/* ============================================================
   ФРЕШ МАРКЕТ — Premium Mobile UI
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  --primary:        #2E7D32;     /* Тёмно-зелёный — премиум */
  --primary-mid:    #4CAF50;     /* Средний зелёный */
  --primary-light:  #81C784;     /* Светло-зелёный */
  --primary-bg:     #E8F5E9;     /* Пастельный фон */
  --accent:         #FF9800;     /* Оранжевый акцент */
  --accent-light:   #FFB74D;
  --accent-bg:      #FFF3E0;
  --red:            #E53935;
  --sale-red:       #D32F2F;
  --bg:             #F7F9F7;     /* Мягкий фон */
  --bg-card:        #FFFFFF;
  --white:          #FFFFFF;
  --text:           #1A1A1A;
  --text-2:         #424242;
  --text-muted:     #757575;
  --text-light:     #BDBDBD;
  --border:         #E5E8EB;
  --shadow-sm:      0 1px 3px rgba(0,0,0,0.06);
  --shadow:         0 2px 12px rgba(46,125,50,0.08);
  --shadow-lg:      0 8px 24px rgba(0,0,0,0.12);
  --radius-sm:      8px;
  --radius:         14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --bottom-nav-h:   72px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  letter-spacing: -0.01em;
}

#shopApp {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; display: block; }

/* ============================================================
   HEADER (sticky)
   ============================================================ */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(76,175,80,0.3);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-weight: 800;
  font-size: 17px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 500;
}

.header-action {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  position: relative;
}

.header-action svg { width: 20px; height: 20px; }

/* ============================================================
   SEARCH BAR
   ============================================================ */

.search-bar {
  margin: 12px 16px;
  position: relative;
}

.search-bar input {
  width: 100%;
  height: 44px;
  padding: 0 16px 0 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  font-family: inherit;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: all .2s;
}

.search-bar input:focus {
  border-color: var(--primary-mid);
  box-shadow: 0 0 0 3px rgba(76,175,80,0.12);
}

.search-bar input::placeholder { color: var(--text-muted); }

.search-bar svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}

/* ============================================================
   PAGES
   ============================================================ */

.page {
  display: none;
  padding-bottom: calc(var(--bottom-nav-h) + 32px);
  min-height: 100vh;
}

.page.active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   PROMO BANNER
   ============================================================ */

.promo-banner {
  margin: 8px 16px 20px;
  height: 140px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #2E7D32 0%, #4CAF50 50%, #66BB6A 100%);
  padding: 20px 22px;
  color: white;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.promo-banner::before {
  content: '';
  position: absolute;
  right: -30px;
  top: -30px;
  width: 140px;
  height: 140px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

.promo-banner::after {
  content: '🥬';
  position: absolute;
  right: 16px;
  bottom: -10px;
  font-size: 100px;
  opacity: 0.4;
  transform: rotate(-15deg);
}

.promo-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

.promo-sub {
  font-size: 13px;
  opacity: 0.92;
  font-weight: 500;
  position: relative;
  z-index: 2;
  max-width: 70%;
}

.promo-cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  padding: 8px 14px;
  background: white;
  color: var(--primary);
  font-weight: 700;
  font-size: 12px;
  border-radius: 999px;
  position: relative;
  z-index: 2;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.promo-cta::after { content: '→'; }

/* ============================================================
   CATEGORIES (chips)
   ============================================================ */

.cat-row {
  display: flex;
  gap: 8px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 18px;
}

.cat-row::-webkit-scrollbar { display: none; }

.cat-chip {
  flex-shrink: 0;
  padding: 8px 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
  transition: all .2s;
}

.cat-chip.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============================================================
   SECTION HEADER
   ============================================================ */

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 16px 12px;
}

.section-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.section-link {
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
}

/* ============================================================
   PRODUCT GRID (2 columns)
   ============================================================ */

.product-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}

.product-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all .2s;
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:active { transform: scale(0.98); }

.product-card:hover { box-shadow: var(--shadow); }

.product-image {
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--primary-bg);
  position: relative;
  overflow: hidden;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: var(--accent);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.product-badge.new {
  background: var(--primary);
}

.product-badge.sale {
  background: var(--sale-red);
}

.product-fav {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.product-fav svg { width: 14px; height: 14px; }

.product-info {
  padding: 10px 12px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.product-brand {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: none; /* Скрыто — бренд и так один, не нужен на каждой карточке */
}

.product-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
}

.product-rating {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}

.product-rating .star { color: var(--accent); }

.product-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
}

.product-price {
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}

.product-price-old {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 4px;
  font-weight: 500;
}

.product-add {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.product-add:active { transform: scale(0.92); }

.product-add svg { width: 16px; height: 16px; }

/* ============================================================
   BOTTOM NAVIGATION (pill style)
   ============================================================ */

.bottom-nav {
  position: fixed;
  bottom: 12px;
  left: 12px;
  right: 12px;
  height: var(--bottom-nav-h);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-radius: var(--radius-xl);
  box-shadow: 0 8px 32px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.06);
  display: flex;
  align-items: center;
  z-index: 100;
  border: 1px solid rgba(255,255,255,0.7);
  padding: 0 8px;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 4px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  transition: all .2s;
  position: relative;
}

.nav-item.active { color: var(--primary); }

.nav-item svg {
  width: 22px;
  height: 22px;
  transition: transform .25s;
}

.nav-item.active svg {
  transform: translateY(-2px);
}

.cart-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  display: none;
  align-items: center;
  justify-content: center;
}

.cart-badge.visible { display: flex; }

/* ============================================================
   AUTH SCREEN
   ============================================================ */

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: linear-gradient(160deg, #2E7D32 0%, #4CAF50 100%);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 28px;
  text-align: center;
}

.auth-screen.visible { display: flex; }

.auth-logo {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  margin-bottom: 24px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.auth-title {
  font-size: 28px;
  font-weight: 800;
  color: white;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}

.auth-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.9);
  margin-bottom: 32px;
  max-width: 280px;
  line-height: 1.5;
}

.auth-btn {
  width: 100%;
  max-width: 320px;
  height: 52px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 10px;
  transition: all .2s;
}

.auth-btn.primary {
  background: white;
  color: var(--primary);
  box-shadow: 0 8px 24px rgba(0,0,0,0.18);
}

.auth-btn.secondary {
  background: rgba(255,255,255,0.15);
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}

.auth-btn:active { transform: scale(0.98); }

/* ============================================================
   USER BAR (top, after auth)
   ============================================================ */

.user-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: none;
  align-items: center;
  gap: 10px;
}

.user-bar.visible { display: flex; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  overflow: hidden;
}

.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.user-logout {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg);
}

/* ============================================================
   MODALS
   ============================================================ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 300;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  position: relative;
  animation: modalUp .25s ease;
}

@keyframes modalUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: var(--text-2);
  z-index: 2;
}

/* ============================================================
   EMPTY STATE
   ============================================================ */

.empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.6;
}

.empty-state-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.empty-state-sub {
  font-size: 13px;
}

/* ============================================================
   UTILITIES
   ============================================================ */

.btn-primary {
  width: 100%;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.btn-primary:active { transform: scale(0.98); }

.btn-primary:disabled {
  background: var(--text-light);
  cursor: not-allowed;
}

.btn-secondary {
  width: 100%;
  height: 44px;
  background: var(--bg);
  color: var(--text-2);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
}

.toast {
  position: fixed;
  bottom: calc(var(--bottom-nav-h) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--text);
  color: white;
  padding: 10px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  z-index: 500;
  opacity: 0;
  transition: all .3s;
  white-space: nowrap;
}

.toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   PRODUCT DETAIL (Bottom Sheet)
   ============================================================ */

.pd-overlay {
  align-items: flex-end;
  padding: 0;
  background: rgba(0,0,0,0.6);
}

.pd-sheet {
  background: var(--white);
  border-radius: 24px 24px 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 92vh;
  overflow: hidden;
  position: relative;
  animation: pdSlideUp .35s cubic-bezier(.2,.9,.3,1);
  display: flex;
  flex-direction: column;
}

@keyframes pdSlideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.pd-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  color: var(--text);
}

.pd-close svg { width: 18px; height: 18px; }

.pd-hero {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: linear-gradient(135deg, var(--primary-bg), #fafafa);
  position: relative;
  flex-shrink: 0;
  overflow: hidden;
}

.pd-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pd-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 120px;
  background: var(--primary-bg);
}

.pd-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.pd-badges .pd-badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 700;
  color: white;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pd-badges .pd-badge.new { background: var(--primary); }
.pd-badges .pd-badge.sale { background: var(--sale-red); }
.pd-badges .pd-badge.hit { background: var(--accent); }

.pd-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 20px 100px;
  -webkit-overflow-scrolling: touch;
}

.pd-head {
  margin-bottom: 8px;
}

.pd-name {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.pd-rating-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pd-rating {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
}

.pd-stars {
  color: var(--accent);
  font-weight: 700;
  font-size: 14px;
}

.pd-fav-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .2s;
}

.pd-fav-btn.active {
  background: #FFE8E5;
  color: var(--sale-red);
}

.pd-fav-btn.active svg { fill: var(--sale-red); }

.pd-fav-btn svg { width: 18px; height: 18px; }

.pd-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 16px 0 6px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.pd-price {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.pd-old-price {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-left: 10px;
  font-weight: 500;
}

.pd-discount {
  padding: 5px 10px;
  background: var(--sale-red);
  color: white;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  display: none;
}

.pd-discount.visible { display: block; }

.pd-stock-row {
  font-size: 13px;
  font-weight: 600;
  padding: 4px 0 16px;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.pd-stock-row::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 11px;
  font-weight: 700;
}

.pd-stock-row.out {
  color: var(--sale-red);
}

.pd-stock-row.out::before {
  content: '✗';
  background: var(--sale-red);
}

.pd-section {
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.pd-section:last-child { border-bottom: none; }

.pd-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pd-desc {
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-2);
}

.pd-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
}

.pd-spec-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pd-spec-label {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.pd-spec-value {
  font-size: 14px;
  color: var(--text);
  font-weight: 600;
}

.pd-delivery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-delivery-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pd-delivery-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.pd-delivery-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.pd-delivery-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.pd-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 12px 20px;
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

.pd-qty {
  display: flex;
  align-items: center;
  background: var(--bg);
  border-radius: 14px;
  overflow: hidden;
}

.pd-qty-btn {
  width: 38px;
  height: 44px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pd-qty-btn:active { background: rgba(0,0,0,0.05); }

.pd-qty-val {
  min-width: 32px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.pd-add-btn {
  flex: 1;
  height: 48px;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(76,175,80,0.35);
  transition: all .2s;
}

.pd-add-btn:active { transform: scale(0.98); }

.pd-add-btn svg { width: 18px; height: 18px; }

/* ============================================================
   CART PAGE
   ============================================================ */

.cart-empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--text-muted);
}

.cart-empty svg {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  color: var(--text-light);
}

.cart-empty p {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0 16px;
  width: 100%;
  box-sizing: border-box;
}

.cart-item {
  display: flex;
  gap: 14px;
  background: var(--white);
  padding: 12px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  align-items: center;
  width: 100%;
  box-sizing: border-box;
}

.cart-item-img {
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}

.cart-item-brand {
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.cart-item-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--text);
  margin-top: 2px;
}

.qty-control {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.qty-btn {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.qty-btn:active { background: rgba(0,0,0,0.05); }

.qty-val {
  min-width: 22px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.cart-remove {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
  font-weight: 500;
}

.cart-remove:active { color: var(--sale-red); }

.cart-total-bar {
  position: sticky;
  bottom: calc(var(--bottom-nav-h) + 12px);
  margin: 20px 16px 0;
  padding: 16px 18px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 18px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.cart-total-row span:last-child {
  color: var(--primary);
  font-size: 22px;
}

.checkout-btn {
  width: 100%;
  height: 52px;
  background: var(--primary);
  color: white;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(76,175,80,0.35);
}

.checkout-btn:active { transform: scale(0.98); }

/* Cart item "В корзине" badge on product cards (main + catalog) */
.in-cart-badge {
  position: absolute;
  top: 8px;
  right: 44px;
  padding: 3px 8px;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 3px;
  box-shadow: 0 2px 8px rgba(76,175,80,0.4);
}

.in-cart-badge::before {
  content: '✓';
  font-size: 11px;
}

/* Detail card "В корзине" indicator */
.pd-in-cart {
  display: none;
  padding: 8px 14px;
  background: var(--primary-bg);
  color: var(--primary);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 12px;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}

.pd-in-cart::before {
  content: '✓';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  font-size: 10px;
  font-weight: 700;
}

.pd-in-cart.visible { display: inline-flex; }