/**
 * SdelalSam.shop - Main Stylesheet
 * «Создавай. Показывай. Продавай.»
 */

:root {
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Colors */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --border: #e2e8f0;
  --border-focus: #ea580c;

  --text-main: #0f172a;
  --text-muted: #64748b;
  --text-light: #94a3b8;

  /* Brand Accents (Craft & Handmade theme) */
  --primary: #ea580c;        /* Warm terracotta / craft orange */
  --primary-hover: #c2410c;
  --primary-subtle: #fff7ed;
  --primary-border: #fed7aa;

  --dark-header: #0f172a;

  /* Ozon Delivery Brand Colors */
  --ozon-blue: #005bff;
  --ozon-bg: #eff6ff;
  --ozon-border: #bfdbfe;
  --ozon-text: #1d4ed8;

  /* Badges */
  --ready-bg: #ecfdf5;
  --ready-text: #059669;
  --ready-border: #a7f3d0;

  --custom-bg: #f5f3ff;
  --custom-text: #7c3aed;
  --custom-border: #ddd6fe;

  --service-bg: #fffbeb;
  --service-text: #d97706;
  --service-border: #fde68a;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  --shadow-card-hover: 0 12px 24px -4px rgba(15, 23, 42, 0.12);

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --container: 1240px;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

/* Icons */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-weight: 600;
  font-size: 15px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--border);
  color: var(--text-main);
}
.btn-outline:hover {
  border-color: var(--text-main);
  background-color: var(--bg-subtle);
}

.btn-outline-primary {
  background-color: transparent;
  border-color: var(--primary);
  color: var(--primary);
}
.btn-outline-primary:hover {
  background-color: var(--primary-subtle);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-sm);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 16px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* Header */
.site-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 22px;
  color: var(--text-main);
  letter-spacing: -0.5px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ea580c 0%, #f97316 100%);
  color: #ffffff;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 20px;
  box-shadow: 0 4px 10px rgba(234, 88, 12, 0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
}

.brand-title {
  line-height: 1.1;
}

.brand-title span {
  color: var(--primary);
}

.brand-slogan {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.2px;
}

/* Search bar in header */
.header-search {
  flex: 1;
  max-width: 460px;
  position: relative;
}

.search-form {
  display: flex;
  width: 100%;
  position: relative;
}

.search-input {
  width: 100%;
  height: 44px;
  padding: 0 44px 0 16px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  font-size: 14px;
  transition: all 0.2s;
}

.search-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

.search-btn {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s;
}

.search-btn:hover {
  background: var(--primary-hover);
}

/* Navigation */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
}

.nav-link {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-user {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  background: var(--bg-subtle);
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.nav-user:hover {
  background: #e2e8f0;
}

.user-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.mobile-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 40px;
  height: 40px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}
.mobile-toggle:active {
  transform: scale(0.95);
  background: #e2e8f0;
}
.burger-bar {
  width: 20px;
  height: 2px;
  background-color: var(--text-main);
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}

/* Off-canvas Mobile Drawer */
.mobile-drawer-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  transition: opacity 0.25s ease;
}
.mobile-drawer-backdrop.open {
  display: block;
  opacity: 1;
}

body.drawer-open, body.filters-open {
  overflow: hidden !important;
  touch-action: none;
}

.mobile-nav-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 86vw;
  background: #ffffff;
  z-index: 999;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  transform: translateX(100%);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 20px 18px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px));
}
.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}
.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}
.drawer-close-btn:hover {
  background: #e2e8f0;
  color: var(--text-main);
}

.drawer-search {
  margin-bottom: 16px;
}
.drawer-search .search-form {
  position: relative;
  display: flex;
  width: 100%;
}
.drawer-search .search-input {
  width: 100%;
  height: 42px;
  padding: 0 40px 0 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
}
.drawer-search .search-btn {
  position: absolute;
  right: 5px;
  top: 5px;
  width: 32px;
  height: 32px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.drawer-user-section {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 18px;
}
.drawer-user-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-user-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.drawer-user-name {
  font-weight: 700;
  font-size: 15px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-user-email {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.drawer-user-actions {
  display: flex;
  gap: 8px;
}
.drawer-auth-buttons {
  display: flex;
  gap: 10px;
}
.drawer-post-btn {
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(234, 88, 12, 0.25);
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: auto;
}
.drawer-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-main);
  transition: all 0.15s;
}
.drawer-nav-item:hover, .drawer-nav-item.active {
  background: var(--primary-subtle);
  color: var(--primary);
}

.drawer-footer {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
.drawer-slogan {
  font-weight: 600;
  color: #475569;
  margin-bottom: 4px;
}

/* Flash alerts */
.flash-container {
  margin-top: 16px;
}

.alert {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.alert-success {
  background-color: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-error {
  background-color: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  color: #ffffff;
  padding: 64px 0 72px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(234, 88, 12, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 2;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(234, 88, 12, 0.15);
  border: 1px solid rgba(234, 88, 12, 0.3);
  border-radius: var(--radius-full);
  color: #fdba74;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -1px;
  margin-bottom: 16px;
}

.hero-title span {
  background: linear-gradient(135deg, #fb923c 0%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 18px;
  color: #cbd5e1;
  line-height: 1.6;
  margin-bottom: 32px;
  max-width: 580px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.hero-stat-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 24px;
  border-radius: var(--radius-lg);
  backdrop-filter: blur(10px);
}

.hero-stat-num {
  font-size: 32px;
  font-weight: 800;
  color: #fb923c;
  line-height: 1;
  margin-bottom: 6px;
}

.hero-stat-label {
  font-size: 13px;
  color: #94a3b8;
}

/* Categories Grid */
.section {
  padding: 48px 0;
}

.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-link {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 4px;
}
.section-link:hover {
  text-decoration: underline;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.category-card:hover {
  transform: translateY(-2px);
  border-color: var(--primary);
  box-shadow: var(--shadow-md);
}

.category-icon-box {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.category-content {
  flex: 1;
  min-width: 0;
}

.category-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 4px;
  line-height: 1.25;
}

.category-count {
  font-size: 13px;
  color: var(--text-muted);
}

/* Listings Grid */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.listing-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  position: relative;
}

.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card-hover);
  border-color: #cbd5e1;
}

.listing-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background-color: var(--bg-subtle);
  overflow: hidden;
}

.listing-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.listing-card:hover .listing-img {
  transform: scale(1.03);
}

.listing-no-img {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  color: #94a3b8;
  font-size: 13px;
}

.listing-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 2;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  line-height: 1.2;
}

.badge-ready {
  background: var(--ready-bg);
  color: var(--ready-text);
  border: 1px solid var(--ready-border);
}

.badge-custom {
  background: var(--custom-bg);
  color: var(--custom-text);
  border: 1px solid var(--custom-border);
}

.badge-service {
  background: var(--service-bg);
  color: var(--service-text);
  border: 1px solid var(--service-border);
}

/* Signature Ozon Delivery Badge */
.badge-ozon {
  background: var(--ozon-bg);
  color: var(--ozon-text);
  border: 1px solid var(--ozon-border);
  font-size: 11px;
  font-weight: 700;
}

.badge-ozon svg {
  color: var(--ozon-blue);
}

.listing-body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.listing-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 8px;
}

.listing-price {
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.3px;
}

.listing-price.negotiable {
  font-size: 15px;
  font-weight: 700;
  color: #d97706;
}

.listing-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.listing-title:hover {
  color: var(--primary);
}

.listing-meta {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  color: var(--text-muted);
}

.listing-location {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-ozon-footer {
  margin-top: 10px;
}

.ozon-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1d4ed8;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
}

.ozon-pill-icon {
  width: 14px;
  height: 14px;
  color: #005bff;
}

/* Mobile filter bar controls */
.filters-mobile-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  margin-bottom: 20px;
}

.filters-mobile-toggle {
  flex: 1;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  border-radius: var(--radius-md);
  background: #ffffff;
}

.active-filters-dot {
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  display: inline-block;
}

.filters-close-btn {
  display: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Catalog Layout with Filters Sidebar */
.catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  margin: 32px 0 64px;
}

.filters-sidebar {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  height: fit-content;
  position: sticky;
  top: 90px;
}

.filters-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.filter-group {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.filter-group:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.filter-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 12px;
  display: block;
}

.filter-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 14px;
  transition: all 0.2s;
}

.filter-input:focus {
  outline: none;
  background: #ffffff;
  border-color: var(--primary);
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-input {
  width: 50%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  background: var(--bg-subtle);
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: 8px;
  user-select: none;
}

.checkbox-label input[type="checkbox"], .checkbox-label input[type="radio"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}

/* Ozon Filter Highlight */
.ozon-filter-label {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-weight: 600;
  color: #1d4ed8;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.ozon-filter-label:hover {
  background: #dbeafe;
}
.ozon-filter-label input {
  accent-color: #005bff;
  width: 18px;
  height: 18px;
}

/* Catalog Content */
.catalog-content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 16px;
}

.catalog-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #ffffff;
  font-size: 14px;
  cursor: pointer;
}

/* Single Ad View - Modern Avito/Marketplace Style */
.ad-page {
  max-width: 1200px;
  margin: 20px auto 64px;
  padding: 0 20px;
}

.ad-breadcrumbs {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.ad-breadcrumbs a {
  color: var(--text-muted);
  transition: color 0.2s;
}
.ad-breadcrumbs a:hover {
  color: var(--primary);
}
.bc-sep {
  color: #cbd5e1;
}
.bc-current {
  color: var(--text-main);
  font-weight: 600;
}

/* Page Header: Title + Meta Bar */
.ad-header-block {
  margin-bottom: 24px;
}

.ad-main-title {
  font-size: 30px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.ad-meta-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}

.ad-meta-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ad-meta-dot {
  color: #cbd5e1;
}

.ad-meta-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.btn-meta-action {
  background: none;
  border: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.btn-meta-action:hover {
  color: var(--primary);
  background: var(--primary-subtle);
}
.btn-meta-action.favorited {
  color: var(--primary);
}
.btn-meta-action.favorited svg {
  fill: var(--primary);
  stroke: var(--primary);
}
.btn-meta-report:hover {
  color: #ef4444;
  background: #fef2f2;
}

/* Product Page Layout */
.ad-content-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  grid-template-areas: 
    "gallery sidebar"
    "details sidebar";
  gap: 32px;
  align-items: start;
}

.ad-grid-gallery {
  grid-area: gallery;
  min-width: 0;
}

.ad-grid-sidebar {
  grid-area: sidebar;
  min-width: 0;
}

.ad-grid-details {
  grid-area: details;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-mobile-bottom-bar {
  display: none;
}

/* Gallery Card */
.ad-gallery-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.main-image-viewport {
  width: 100%;
  aspect-ratio: 16 / 10;
  background: #f8fafc;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid #f1f5f9;
}

.main-image {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
}

.ad-no-photo-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.no-photo-icon-circle {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #f1f5f9;
  color: #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
}

.no-photo-title {
  font-size: 16px;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.no-photo-sub {
  font-size: 13px;
  color: #94a3b8;
}

.thumbs-carousel {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.thumb-box {
  width: 76px;
  height: 76px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  opacity: 0.7;
  transition: all 0.2s;
  background: #f8fafc;
}

.thumb-box.active, .thumb-box:hover {
  opacity: 1;
  border-color: var(--primary);
}

.thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ozon Feature Box */
.ad-ozon-feature-box {
  background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  display: flex;
  align-items: flex-start;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.ozon-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #005bff;
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 91, 255, 0.25);
}

.ozon-feature-text h4 {
  font-size: 16px;
  font-weight: 800;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.ozon-feature-text p {
  font-size: 13px;
  color: #2563eb;
  line-height: 1.5;
}

/* Block Cards */
.ad-block-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-sm);
}

.ad-block-heading {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* Parameters List */
.ad-params-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-param-row {
  display: grid;
  grid-template-columns: 180px 1fr;
  align-items: baseline;
  font-size: 14px;
  gap: 12px;
}

.param-key {
  color: var(--text-muted);
  font-weight: 500;
}

.param-val {
  color: var(--text-main);
  font-weight: 600;
}

.param-link {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}
.param-link:hover {
  text-decoration: underline;
}

.ad-description-body {
  font-size: 15px;
  line-height: 1.7;
  color: #334155;
  white-space: pre-wrap;
}

.ad-address-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  color: var(--text-main);
}

.address-icon {
  color: var(--primary);
  margin-top: 2px;
}

/* Right Column (Sticky Sidebar) */
.ad-sticky-sidebar {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ad-sidebar-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}

.ad-price-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.ad-hero-price {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.5px;
  line-height: 1;
}

.ad-hero-price.negotiable {
  font-size: 22px;
  color: #d97706;
}

.ad-cta-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-btn-primary {
  height: 52px;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius-md);
}

.ad-quick-messengers {
  display: flex;
  gap: 8px;
  flex-direction: column;
  margin-top: 4px;
}

.btn-quick-tg {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-quick-tg:hover {
  background: #e0f2fe;
}

.btn-quick-wa {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px;
  background: #f0fdf4;
  color: #16a34a;
  border: 1px solid #bbf7d0;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s;
}
.btn-quick-wa:hover {
  background: #dcfce7;
}

/* Seller Card */
.seller-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.seller-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.seller-avatar-initial {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary-subtle);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 800;
  flex-shrink: 0;
}

.seller-name {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-main);
  text-decoration: none;
  line-height: 1.25;
}
.seller-name:hover {
  color: var(--primary);
}

.seller-spec {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  margin-top: 3px;
}

.seller-details-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--text-muted);
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.seller-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Safety Card */
.ad-safety-card {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
}

.safety-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 6px;
  font-size: 13px;
}

/* Related Listings Section */
.ad-related-section {
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* Revealed Contacts Box */
.revealed-contacts {
  display: none;
  background: #f8fafc;
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.revealed-contacts.show {
  display: block;
}
.revealed-contacts-title {
  font-weight: 700;
  margin-bottom: 8px;
  color: #0f172a;
}
.contact-line {
  margin-bottom: 6px;
}
.contact-lbl {
  color: var(--text-muted);
  font-size: 13px;
  margin-right: 6px;
}
.contact-val-phone {
  font-weight: 700;
  color: var(--primary);
}
.contact-val-tg {
  font-weight: 700;
  color: #0284c7;
}
.contact-val-wa {
  font-weight: 700;
  color: #16a34a;
}
.contact-note {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed #cbd5e1;
  font-size: 13px;
  color: #475569;
}

/* Forms (Create / Edit Ad) */
.form-card {
  max-width: 760px;
  margin: 32px auto 64px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
}

.form-header {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.form-title {
  font-size: 24px;
  font-weight: 800;
}

.form-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: 4px;
}

.form-row {
  margin-bottom: 22px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-main);
}

.form-label span.req {
  color: #ef4444;
}

.form-control {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 15px;
  background: #ffffff;
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(234, 88, 12, 0.15);
}

textarea.form-control {
  min-height: 140px;
  resize: vertical;
}

.radio-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.radio-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
}

.radio-card input {
  position: absolute;
  top: 14px;
  right: 14px;
  accent-color: var(--primary);
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.radio-title {
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 4px;
}

.radio-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Ozon Checkbox Box in Form */
.form-ozon-box {
  background: #eff6ff;
  border: 2px solid #bfdbfe;
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s;
}

.form-ozon-box:hover {
  background: #dbeafe;
}

.form-ozon-box input[type="checkbox"] {
  width: 22px;
  height: 22px;
  accent-color: #005bff;
  margin-top: 2px;
  cursor: pointer;
}

.form-ozon-text h4 {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-bottom: 4px;
}

.form-ozon-text p {
  font-size: 13px;
  color: #3b82f6;
  line-height: 1.4;
}

/* File Upload Drop Area */
.upload-dropzone {
  border: 2px dashed #cbd5e1;
  border-radius: var(--radius-md);
  padding: 32px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all 0.2s;
}

.upload-dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-subtle);
}

.upload-icon {
  font-size: 32px;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.upload-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.upload-subtext {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Modals */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open {
  display: flex;
}

.modal-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  box-shadow: var(--shadow-lg);
  position: relative;
  animation: modalIn 0.2s ease-out;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #94a3b8;
  margin-top: auto;
  padding: 56px 0 24px;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-brand-title {
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
}
.footer-brand-title span { color: var(--primary); }

.footer-desc {
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
}

.footer-col h4 {
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-link {
  font-size: 14px;
  transition: color 0.2s;
}
.footer-link:hover {
  color: #ffffff;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid #1e293b;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
}

/* Helper Component Classes */
.form-grid-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.masters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.auth-card {
  max-width: 460px;
  margin: 40px auto 80px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-md);
}

.custom-hero-banner {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 20px;
  padding: 40px;
  color: #ffffff;
  margin-bottom: 36px;
  box-shadow: var(--shadow-md);
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  gap: 24px;
  margin-bottom: 32px;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.profile-tabs::-webkit-scrollbar {
  display: none;
}

.master-header-card {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

/* ============================================================
   RESPONSIVE MEDIA QUERIES (Mobile-First Polish & Cross-Browser)
   ============================================================ */

/* Tablets & Small Laptops (max-width: 992px) */
@media (max-width: 992px) {
  .hero-inner {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .hero-actions {
    justify-content: center;
  }
  .hero-stats {
    max-width: 480px;
    margin: 0 auto;
  }

  /* Catalog Layout on Tablets */
  .catalog-layout {
    grid-template-columns: 1fr;
    gap: 0;
    margin-top: 16px;
  }
  .filters-mobile-bar {
    display: flex;
  }
  .filters-sidebar {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1001;
    background: #ffffff;
    padding: 24px 20px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }
  .filters-sidebar.open {
    display: block;
    animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  }
  .filters-close-btn {
    display: flex;
  }

  /* Product Page Grid on Tablets & Mobile */
  .ad-content-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .ad-grid-gallery {
    order: 1;
    width: 100%;
  }
  .ad-grid-sidebar {
    order: 2;
    width: 100%;
  }
  .ad-grid-details {
    order: 3;
    width: 100%;
  }
  .ad-sticky-sidebar {
    position: static;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* Smartphones & Small Tablets (max-width: 768px) */
@media (max-width: 768px) {
  /* Prevent iOS zoom on inputs & enforce cross-browser touch */
  input, select, textarea, .form-control, .search-input, .filter-input, .price-input {
    font-size: 16px !important;
  }

  .container {
    padding-left: 16px;
    padding-right: 16px;
  }

  body.has-bottom-bar {
    padding-bottom: 76px;
  }

  /* Site Header Mobile */
  .header-top {
    height: 60px;
    gap: 8px;
    padding-left: 14px;
    padding-right: 14px;
  }
  .brand {
    gap: 8px;
    min-width: 0;
  }
  .brand-icon {
    width: 34px;
    height: 34px;
    font-size: 16px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .brand-title {
    font-size: 18px;
    line-height: 1.1;
    white-space: nowrap;
  }
  .brand-slogan {
    display: none !important;
  }
  .header-search {
    display: none !important;
  }
  .nav-links {
    display: none !important;
  }
  .header-admin-btn {
    display: none !important;
  }
  .mobile-toggle {
    display: flex;
  }
  .header-actions {
    gap: 8px;
    flex-shrink: 0;
  }

  /* Listings Grid: 2 columns on smartphones */
  .listings-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .listing-card {
    border-radius: var(--radius-md);
  }
  .listing-img-wrap {
    aspect-ratio: 4 / 3;
  }
  .listing-body {
    padding: 10px 10px 12px;
    gap: 6px;
  }
  .listing-price {
    font-size: 16px;
  }
  .listing-title {
    font-size: 13px;
    line-height: 1.35;
    height: 2.7em;
    -webkit-line-clamp: 2;
  }
  .listing-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    font-size: 11px;
  }
  .listing-ozon-footer {
    display: none;
  }

  /* Product Page Detail */
  .ad-breadcrumbs {
    display: none;
  }
  .ad-page {
    padding-top: 14px;
  }
  .ad-header-block {
    margin-bottom: 14px;
  }
  .ad-main-title {
    font-size: 20px;
    line-height: 1.3;
    margin-bottom: 8px;
    word-break: break-word;
  }
  .ad-meta-line {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .ad-meta-info {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 6px;
  }
  .ad-meta-actions {
    width: 100%;
    display: flex;
    gap: 8px;
  }
  .btn-meta-action {
    flex: 1;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
  .ad-gallery-card {
    padding: 10px;
    border-radius: var(--radius-md);
  }
  .main-image-viewport {
    max-height: 300px;
    aspect-ratio: 4 / 3;
  }
  .thumbs-carousel {
    gap: 8px;
    padding-bottom: 4px;
  }
  .thumb-box {
    width: 58px;
    height: 58px;
    border-radius: 6px;
  }
  .ad-sidebar-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }
  .ad-hero-price {
    font-size: 24px;
  }
  .ad-hero-price.negotiable {
    font-size: 20px;
  }
  .ad-btn-primary {
    height: 48px;
    font-size: 15px;
  }
  .ad-block-card {
    padding: 18px 16px;
    border-radius: var(--radius-md);
  }
  .ad-block-heading {
    font-size: 16px;
    margin-bottom: 14px;
  }
  .ad-description-body {
    font-size: 14px;
    line-height: 1.6;
  }
  .ad-ozon-feature-box {
    padding: 14px 16px;
    gap: 12px;
  }
  .ozon-icon-circle {
    width: 36px;
    height: 36px;
  }
  .ozon-feature-text h4 {
    font-size: 15px;
  }
  .ozon-feature-text p {
    font-size: 12px;
  }

  /* Fixed Mobile Bottom Bar */
  .ad-mobile-bottom-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 997;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-top: 1px solid var(--border);
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.08);
  }
  .mobile-bar-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
  }
  .mobile-bar-btn {
    flex: 1;
    max-width: 200px;
    height: 42px;
    font-size: 14px;
  }

  /* Forms & Modals on Mobile */
  .form-card {
    padding: 20px 16px;
    margin: 16px auto 36px;
    border-radius: var(--radius-md);
  }
  .form-title {
    font-size: 20px;
  }
  .form-subtitle {
    font-size: 13px;
  }
  .form-grid-2col {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .radio-group {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .auth-card {
    padding: 24px 16px;
    margin: 24px auto 48px;
    border-radius: var(--radius-md);
  }
  .custom-hero-banner {
    padding: 24px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
  }
  .custom-hero-banner h1 {
    font-size: 22px !important;
  }
  .custom-hero-banner p {
    font-size: 14px !important;
    margin-bottom: 16px !important;
  }
  .masters-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .master-header-card {
    padding: 20px 16px;
    border-radius: var(--radius-md);
    margin-bottom: 24px;
  }

  /* Home Hero on Mobile */
  .hero {
    padding: 36px 0 44px;
  }
  .hero-title {
    font-size: 26px;
    line-height: 1.15;
  }
  .hero-desc {
    font-size: 13px;
    margin-bottom: 20px;
  }
  .hero-actions {
    flex-direction: column;
    width: 100%;
    gap: 10px;
  }
  .hero-actions .btn {
    width: 100%;
  }
  .hero-stats {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-top: 24px;
  }
  .hero-stat-card {
    padding: 12px 10px;
    border-radius: var(--radius-md);
  }
  .hero-stat-num {
    font-size: 20px;
  }
  .hero-stat-label {
    font-size: 11px;
  }
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .category-card {
    padding: 12px 10px;
    gap: 10px;
    border-radius: var(--radius-md);
  }
  .category-icon-box {
    width: 36px;
    height: 36px;
  }
  .category-name {
    font-size: 13px;
  }
  .category-count {
    font-size: 11px;
  }
  .section-title {
    font-size: 19px;
  }
  .section-subtitle {
    font-size: 12px;
  }

  /* Footer on Mobile */
  .site-footer {
    padding: 32px 0 20px;
  }
  .footer-inner {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 24px;
  }
  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
}

/* Extra Small Phones (max-width: 480px) */
@media (max-width: 480px) {
  .header-top {
    padding-left: 12px;
    padding-right: 12px;
    gap: 6px;
  }
  .brand {
    gap: 6px;
  }
  .brand-title {
    font-size: 17px;
  }
  .brand-icon {
    width: 32px;
    height: 32px;
    font-size: 15px;
    border-radius: 7px;
  }
  .header-actions {
    gap: 6px;
  }
  .header-login-btn {
    display: none !important;
  }
  .user-name-text {
    display: none !important;
  }
  .nav-user {
    padding: 0;
    background: transparent;
  }
  .user-avatar {
    width: 34px;
    height: 34px;
  }
  .header-post-text {
    display: none !important;
  }
  .header-post-btn {
    width: 36px;
    height: 36px;
    padding: 0;
    border-radius: 50%;
    min-width: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Parameters Table: stack key above value so nothing overlaps */
  .ad-param-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border);
  }
  .param-key {
    font-size: 12px;
    color: var(--text-muted);
  }
  .param-val {
    font-size: 14px;
  }

  .seller-header {
    gap: 12px;
  }
  .seller-avatar, .seller-avatar-initial {
    width: 44px;
    height: 44px;
    font-size: 18px;
  }

  .container {
    padding-left: 12px;
    padding-right: 12px;
  }
}

/* Ultra Narrow Devices (max-width: 340px) */
@media (max-width: 340px) {
  .listings-grid {
    grid-template-columns: 1fr;
  }
  .brand-title {
    font-size: 15px;
  }
}
