@import url('https://fonts.googleapis.com/css2?family=Metal+Mania&display=swap');

:root {
  --primary: #1e8e3e;
  --primary-hover: #167431;
  --accent-green: #25a244;
  --banner-bg-start: #238636;
  --banner-bg-end: #2ea043;
  --text-primary: #111827;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;
  --bg-main: #ebf3fb;
  --bg-card: #ffffff;
  --border-color: #f1f5f9;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
  --radius-card: 16px;
  --radius-btn: 8px;
  --radius-pill: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-main);
  background-image: radial-gradient(circle at 50% 20%, #f0f7ff 0%, #e2eefe 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow-x: hidden;
  user-select: none;
  -webkit-font-smoothing: antialiased;
}

/* Telegram Native View (Small Screens) */
@media (max-width: 440px) {
  body {
    background: #ffffff;
    align-items: flex-start;
  }
  .device-frame {
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
  }
  .device-speaker, .device-notch, .device-buttons {
    display: none !important;
  }
  .app-viewport {
    height: 100vh !important;
    border-radius: 0 !important;
  }
}

/* iPhone Frame Replica */
.device-frame {
  position: relative;
  width: 390px;
  max-width: 390px;
  height: 844px;
  max-height: 96vh;
  background: #111827;
  border-radius: 48px;
  box-shadow: 0 25px 60px -15px rgba(30, 58, 138, 0.25), 
              0 0 0 8px #1f2937, 
              0 0 0 10px #374151,
              inset 0 0 3px 1px rgba(255, 255, 255, 0.3);
  padding: 8px;
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 10;
}

/* Dynamic Island / Notch on Phone */
.device-notch {
  position: absolute;
  top: 15px;
  left: 50%;
  transform: translateX(-50%);
  width: 105px;
  height: 25px;
  background: #000000;
  border-radius: 18px;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 9px;
  pointer-events: none;
}
.camera-lens {
  width: 9px;
  height: 9px;
  background: #0c1829;
  border-radius: 50%;
  border: 1px solid #1e293b;
}

/* App Viewport inside Phone */
.app-viewport {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  border-radius: 40px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Status Bar */
.status-bar {
  height: 38px;
  padding: 8px 22px 0 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: #111827;
  background: #ffffff;
  z-index: 40;
}
.status-icons {
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Top App Bar (✕ | Extreme Grower | ⋮) */
.app-header {
  height: 44px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  z-index: 40;
}
.header-btn {
  background: none;
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111827;
  border-radius: 50%;
  transition: background-color 0.2s;
}
.header-btn:active {
  background-color: #f1f5f9;
}
.header-title-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.header-logo {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #1e8e3e;
}
.header-title {
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #111827;
}

/* Scrollable Main Area */
.scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 78px; /* space for fixed bottom nav */
}
.scrollable-content::-webkit-scrollbar {
  display: none;
}

/* Hero Banner (Extreme Grower Shop Logo without green background) */
.banner-container {
  padding: 4px 14px 0 14px;
}
.hero-banner {
  background: #08090b;
  border-radius: 18px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.16);
  cursor: pointer;
  transition: transform 0.15s ease;
  min-height: 120px;
}
.hero-banner:active {
  transform: scale(0.98);
}
.banner-full-artwork {
  width: 100%;
  max-width: 360px;
  height: auto;
  max-height: 125px;
  object-fit: contain;
  display: block;
}

/* Inset Search Bar */
.search-container {
  padding: 12px 14px 6px 14px;
}
.search-bar {
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: var(--radius-pill);
  padding: 9px 16px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
  border: 1px solid #f0f2f5;
  transition: border-color 0.2s;
}
.search-bar:focus-within {
  border-color: #299e46;
}
.search-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 13.5px;
  color: #111827;
  font-family: inherit;
}
.search-input::placeholder {
  color: #94a3b8;
  font-weight: 400;
}
.search-icon-btn {
  background: none;
  border: none;
  color: #1e8e3e;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 2px;
}

/* Categories Row (4 Circles: Тыквы, Арбузы, Прочее, Мерч) */
.categories-container {
  padding: 8px 14px 10px 14px;
}
.categories-row {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  gap: 8px;
  width: 100%;
}
.category-item {
  flex: 1;
  max-width: 82px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  gap: 6px;
  transition: transform 0.15s;
}
.category-item:active {
  transform: scale(0.92);
}
.category-circle {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.category-icon-img {
  width: 32px;
  height: 32px;
  max-width: 32px;
  max-height: 32px;
  object-fit: contain;
  filter: drop-shadow(0 2px 3px rgba(0, 0, 0, 0.12));
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  -webkit-user-drag: none;
  display: block;
}
.category-item:active .category-icon-img {
  transform: scale(0.9);
}
.category-item.active .category-icon-img {
  transform: scale(1.1);
}

/* Circle Colors (Soft pastel background with glowing borders when active) */
.circle-pumpkins {
  background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 100%);
  border: 1.5px solid #fed7aa;
}
.circle-watermelons {
  background: linear-gradient(135deg, #fff1f2 0%, #fce7f3 100%);
  border: 1.5px solid #fbcfe8;
}
.circle-other {
  background: linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border: 1.5px solid #fef08a;
}
.circle-merch {
  background: linear-gradient(135deg, #faf5ff 0%, #ede9fe 100%);
  border: 1.5px solid #ddd6fe;
}

.category-item.active .circle-pumpkins {
  background: linear-gradient(135deg, #ffedd5 0%, #fed7aa 100%);
  border-color: #ea580c;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #ea580c, 0 4px 10px rgba(234, 88, 12, 0.22);
}
.category-item.active .circle-watermelons {
  background: linear-gradient(135deg, #fce7f3 0%, #fbcfe8 100%);
  border-color: #db2777;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #db2777, 0 4px 10px rgba(219, 39, 119, 0.22);
}
.category-item.active .circle-other {
  background: linear-gradient(135deg, #fef9c3 0%, #fef08a 100%);
  border-color: #ca8a04;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #ca8a04, 0 4px 10px rgba(202, 138, 4, 0.22);
}
.category-item.active .circle-merch {
  background: linear-gradient(135deg, #ede9fe 0%, #ddd6fe 100%);
  border-color: #7c3aed;
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4.5px #7c3aed, 0 4px 10px rgba(124, 58, 237, 0.22);
}

.category-label {
  font-size: 11.5px;
  font-weight: 500;
  color: #475569;
  text-align: center;
  white-space: nowrap;
}
.category-item.active .category-label {
  font-weight: 700;
  color: #111827;
}

/* Section Header (Популярные товары | Смотреть все) */
.section-header {
  padding: 6px 16px 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-title {
  font-size: 16px;
  font-weight: 700;
  color: #111827;
  letter-spacing: -0.2px;
}
.section-link {
  font-size: 13px;
  font-weight: 600;
  color: #2563eb;
  cursor: pointer;
  text-decoration: none;
}
.section-link:active {
  opacity: 0.7;
}

/* Products Grid (2 Columns) */
.products-grid-container {
  padding: 0 14px;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

/* Product Card */
.product-card {
  background: var(--bg-card);
  border-radius: var(--radius-card);
  padding: 8px;
  display: flex;
  flex-direction: column;
  border: 1px solid #f1f5f9;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.02);
  position: relative;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}
.product-card:active {
  transform: scale(0.98);
}

.product-img-wrapper {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  margin-bottom: 6px;
}
.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}
.product-card:hover .product-img {
  transform: scale(1.04);
}

.product-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  background: rgba(30, 142, 62, 0.92);
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}

.product-info {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.product-title {
  font-size: 13px;
  font-weight: 600;
  color: #1f2937;
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 8px;
}
.product-price {
  font-size: 14.5px;
  font-weight: 700;
  color: #111827;
}

/* Green "В корзину" Button */
.add-to-cart-btn {
  width: 100%;
  background: #1e8e3e;
  color: #ffffff;
  border: none;
  border-radius: var(--radius-btn);
  padding: 7px 0;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: all 0.15s;
}
.add-to-cart-btn:hover {
  background: var(--primary-hover);
}
.add-to-cart-btn:active {
  transform: scale(0.96);
}
.add-to-cart-btn.in-cart {
  background: #25a244;
}

/* ========================================================
   DEDICATED CATEGORIES VIEW (Категории)
   ======================================================== */
.categories-view {
  padding: 10px 14px 20px 14px;
}
.categories-view-header {
  margin-bottom: 14px;
}
.categories-view-title {
  font-size: 20px;
  font-weight: 800;
  color: #111827;
  margin-bottom: 4px;
}
.categories-view-desc {
  font-size: 13px;
  color: #64748b;
}

.categories-large-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.category-card-large {
  background: #ffffff;
  border-radius: 16px;
  border: 1px solid #f1f5f9;
  box-shadow: 0 2px 8px rgba(0,0,0,0.03);
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}
.category-card-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.06);
  border-color: #cbd5e1;
}
.category-card-large:active {
  transform: scale(0.98);
}

.category-large-thumb {
  width: 72px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #f8fafc;
  flex-shrink: 0;
  border: 1px solid #e2e8f0;
}
.category-large-info {
  flex: 1;
}
.category-large-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  margin-bottom: 4px;
}
.badge-pumpkin { background: #e0f2fe; color: #0369a1; }
.badge-watermelon { background: #fce7f3; color: #be185d; }
.badge-tomato { background: #fee2e2; color: #b91c1c; }
.badge-veggie { background: #fef3c7; color: #b45309; }
.badge-sunflower { background: #fef9c3; color: #854d0e; }
.badge-all { background: #dcfce7; color: #15803d; }
.badge-merch { background: #ede9fe; color: #6d28d9; }

.category-large-name {
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  margin-bottom: 3px;
}
.category-large-details {
  font-size: 12px;
  color: #64748b;
  line-height: 1.35;
}
.category-large-arrow {
  color: #94a3b8;
  font-size: 18px;
  font-weight: bold;
  padding-right: 4px;
}

/* Empty State */
.empty-state {
  grid-column: span 2;
  text-align: center;
  padding: 40px 10px;
  color: var(--text-secondary);
}
.empty-icon {
  font-size: 32px;
  margin-bottom: 8px;
}

/* Fixed Bottom Navigation */
.bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 66px;
  background: #ffffff;
  border-top: 1px solid #f1f5f9;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 0 6px 8px 6px;
  z-index: 45;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.02);
}
.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: #94a3b8;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 10px;
  position: relative;
  transition: color 0.15s;
}
.nav-tab.active {
  color: #1e8e3e;
  font-weight: 600;
}
.nav-tab svg {
  width: 21px;
  height: 21px;
}
.nav-badge {
  position: absolute;
  top: 0px;
  right: 12px;
  background: #ef4444;
  color: #ffffff;
  font-size: 9.5px;
  font-weight: 700;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ffffff;
}

/* Drawers & Modals */
.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(3px);
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.bottom-drawer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  border-radius: 22px 22px 0 0;
  padding: 16px 18px 24px 18px;
  z-index: 65;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-height: 85%;
  display: flex;
  flex-direction: column;
}
.bottom-drawer.active {
  transform: translateY(0);
}
.drawer-handle {
  width: 36px;
  height: 4px;
  background: #cbd5e1;
  border-radius: 2px;
  margin: 0 auto 14px auto;
}
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.drawer-title {
  font-size: 17px;
  font-weight: 700;
  color: #111827;
}
.drawer-close {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #64748b;
}

/* Cart Items in Drawer */
.cart-list {
  flex: 1;
  overflow-y: auto;
  margin-bottom: 14px;
  max-height: 320px;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f1f5f9;
}
.cart-item-img {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #f8fafc;
}
.cart-item-details {
  flex: 1;
}
.cart-item-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.25;
}
.cart-item-price {
  font-size: 13px;
  font-weight: 700;
  color: #1e8e3e;
  margin-top: 2px;
}
.cart-qty-controls {
  display: flex;
  align-items: center;
  gap: 7px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  color: #334155;
}
.qty-number {
  font-size: 13.5px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}

.cart-summary {
  background: #f8fafc;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: #64748b;
  margin-bottom: 5px;
}
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  font-size: 15.5px;
  font-weight: 700;
  color: #111827;
  border-top: 1px dashed #e2e8f0;
  padding-top: 7px;
  margin-top: 7px;
}
.checkout-btn {
  background: #1e8e3e;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(30, 142, 62, 0.2);
}
.checkout-btn:active {
  transform: scale(0.98);
}

/* Product Detail Modal */
.product-detail-modal {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: #ffffff;
  z-index: 70;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: hidden; /* Scroll belongs to detail-scrollable-content */
}
.product-detail-modal.active {
  transform: translateY(0);
}
.modal-nav {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  padding: 10px 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  border-bottom: 1px solid #f1f5f9;
}
.modal-back-btn {
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #334155;
  transition: background 0.15s;
}
.modal-back-btn:active {
  background: #e2e8f0;
}

/* Scrollable Container Inside Modal */
.detail-scrollable-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
}
.detail-scrollable-content::-webkit-scrollbar {
  display: none;
}
.detail-img-wrapper {
  width: 100%;
  height: 280px;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.detail-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.detail-body {
  padding: 16px 16px 36px 16px;
  flex: 1;
}
.detail-tag {
  display: inline-block;
  background: #e6f4ea;
  color: #1e8e3e;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 5px;
  margin-bottom: 6px;
}
.detail-title {
  font-size: 18px;
  font-weight: 800;
  color: #111827;
  line-height: 1.25;
  margin-bottom: 8px;
}
.detail-rating-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: #64748b;
}
.stars {
  color: #f59e0b;
}
.detail-price {
  font-size: 21px;
  font-weight: 800;
  color: #1e8e3e;
  margin-bottom: 14px;
}
.detail-desc-title {
  font-size: 14px;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 8px;
}
.detail-desc {
  font-size: 13.5px;
  color: #334155;
  line-height: 1.6;
  margin-bottom: 20px;
  white-space: pre-line;
  word-break: break-word;
}
.detail-brand-note {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px;
  font-size: 13px;
  color: #475569;
  line-height: 1.5;
  margin-bottom: 10px;
}

/* Bottom Bar Docked Cleanly at Bottom of Modal */
.detail-bottom-bar {
  flex-shrink: 0;
  background: #ffffff;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid #f1f5f9;
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
  z-index: 20;
  display: flex;
}
.detail-bottom-bar .checkout-btn {
  width: 100%;
}

/* Floating Desktop Switcher Controls */
.desktop-controls {
  position: fixed;
  bottom: 18px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 100;
}
.control-pill {
  background: #1e293b;
  color: #ffffff;
  border: 1px solid #334155;
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  display: flex;
  align-items: center;
  gap: 5px;
}
@media (max-width: 440px) {
  .desktop-controls {
    display: none;
  }
}

/* Toast */
.toast {
  position: absolute;
  top: 60px;
  left: 50%;
  transform: translateX(-50%) translateY(-15px);
  background: #111827;
  color: #ffffff;
  padding: 8px 16px;
  border-radius: var(--radius-pill);
  font-size: 12.5px;
  font-weight: 600;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}
.toast.active {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* =====================================================================
   PRODUCTION FIXES (2026-10-28)
   1) Убран макет телефона: приложение занимает весь webview Telegram
   2) Высота по --tg-viewport-stable-height вместо 100vh
   3) Тёмная тема Telegram (класс html.theme-dark ставит app.js)
   ===================================================================== */

body {
  display: block;
  min-height: 0;
  height: var(--tg-viewport-stable-height, 100vh);
  height: var(--tg-viewport-stable-height, 100dvh);
  background: #ffffff;
  background-image: none;
  overflow: hidden;
}

.device-frame,
.device-frame[id] {
  width: 100% !important;
  max-width: 560px !important;
  height: 100% !important;
  max-height: none !important;
  margin: 0 auto !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: transparent !important;
}

.app-viewport {
  height: 100% !important;
  border-radius: 0 !important;
}

.device-notch, .device-speaker, .device-buttons,
.status-bar, .app-header, .desktop-controls { display: none !important; }

/* Отступ под «домашнюю полоску» iPhone */
.bottom-nav {
  height: calc(66px + env(safe-area-inset-bottom, 0px));
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px));
}
.scrollable-content { padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px)); }
.bottom-drawer { padding-bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }

/* Тост теперь сверху без фейкового заголовка */
.toast { top: 12px; max-width: calc(100% - 32px); text-align: center; }

/* Единица цены («за 1 семечко») */
.product-price-row { flex-wrap: wrap; row-gap: 0; }
.price-unit { font-size: 11px; font-weight: 500; color: #64748b; }
.detail-price-row { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.detail-price-row .detail-price { margin-bottom: 0; }
.detail-price-row .price-unit { font-size: 13px; }

/* Отступ сверху, раз шапки больше нет */
.banner-container { padding-top: 12px; }

/* Если внутри Telegram используется нативная MainButton — своя кнопка не нужна */
html.tg-main-button #checkoutBtn { display: none; }

/* ---------------- Тёмная тема ---------------- */
html.theme-dark {
  --dk-bg: var(--tg-theme-bg-color, #17212b);
  --dk-surface: var(--tg-theme-secondary-bg-color, #232e3c);
  --dk-text: var(--tg-theme-text-color, #f5f5f5);
  --dk-hint: var(--tg-theme-hint-color, #8a99a8);
  --dk-border: rgba(255, 255, 255, 0.08);
  color-scheme: dark;
}
html.theme-dark body,
html.theme-dark .app-viewport,
html.theme-dark .bottom-nav,
html.theme-dark .bottom-drawer,
html.theme-dark .product-detail-modal,
html.theme-dark .detail-bottom-bar { background: var(--dk-bg) !important; color: var(--dk-text); }
html.theme-dark .modal-nav { background: var(--dk-bg); border-color: var(--dk-border); color: var(--dk-text); }

html.theme-dark .product-card,
html.theme-dark .category-card-large,
html.theme-dark .search-bar,
html.theme-dark .cart-summary,
html.theme-dark .detail-brand-note,
html.theme-dark .detail-img-wrapper,
html.theme-dark .product-img-wrapper,
html.theme-dark .qty-btn,
html.theme-dark .drawer-close,
html.theme-dark .modal-back-btn,
html.theme-dark #profileDrawer a { background: var(--dk-surface) !important; border-color: var(--dk-border) !important; }

html.theme-dark .bottom-nav,
html.theme-dark .cart-item,
html.theme-dark .detail-bottom-bar,
html.theme-dark .cart-summary-total { border-color: var(--dk-border) !important; }

html.theme-dark .section-title,
html.theme-dark .product-title,
html.theme-dark .product-price,
html.theme-dark .categories-view-title,
html.theme-dark .category-large-name,
html.theme-dark .category-item.active .category-label,
html.theme-dark .drawer-title,
html.theme-dark .cart-item-title,
html.theme-dark .cart-summary-total,
html.theme-dark .qty-number,
html.theme-dark .qty-btn,
html.theme-dark .detail-title,
html.theme-dark .detail-desc-title,
html.theme-dark .modal-back-btn,
html.theme-dark .search-input,
html.theme-dark #profileDrawer a,
html.theme-dark #profileDrawer [style*="color: #111827"] { color: var(--dk-text) !important; }

html.theme-dark .category-label,
html.theme-dark .categories-view-desc,
html.theme-dark .category-large-details,
html.theme-dark .cart-summary-row,
html.theme-dark .detail-desc,
html.theme-dark .detail-brand-note,
html.theme-dark .price-unit,
html.theme-dark .nav-tab:not(.active),
html.theme-dark .drawer-close,
html.theme-dark #profileDrawer p,
html.theme-dark #profileDrawer [style*="color: #64748b"] { color: var(--dk-hint) !important; }

html.theme-dark .nav-badge { border-color: var(--dk-bg); }
html.theme-dark .category-item.active .circle-pumpkins { box-shadow: 0 0 0 2px var(--dk-bg), 0 0 0 4.5px #ea580c; }
html.theme-dark .category-item.active .circle-watermelons { box-shadow: 0 0 0 2px var(--dk-bg), 0 0 0 4.5px #db2777; }
html.theme-dark .category-item.active .circle-other { box-shadow: 0 0 0 2px var(--dk-bg), 0 0 0 4.5px #ca8a04; }
html.theme-dark .category-item.active .circle-merch { box-shadow: 0 0 0 2px var(--dk-bg), 0 0 0 4.5px #7c3aed; }
html.theme-dark .toast { background: var(--dk-surface); color: var(--dk-text); }

/* Ссылка на товар в VK / Wildberries */
.detail-ext-link { display: inline-block; margin: -8px 0 18px; font-size: 13.5px; font-weight: 600; color: #2563eb; text-decoration: none; }
html.theme-dark .detail-ext-link { color: var(--tg-theme-link-color, #6ab3f3); }

/* Скрытые панели не должны перехватывать нажатия во время анимации закрытия */
.product-detail-modal:not(.active),
.bottom-drawer:not(.active) { pointer-events: none; }
