@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap");

:root {
  color-scheme: light;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-soft: #eef2f6;
  --text: #111827;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #0f766e;
  --brand-strong: #0f172a;
  --accent: #f59e0b;
  --danger: #e11d48;
  --ok: #059669;
  --shadow: 0 16px 40px rgba(15, 23, 42, .08);
  --radius: 8px;
  --bottom-nav: 78px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0c111d;
  --surface: #111827;
  --surface-soft: #1f2937;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: #263244;
  --brand: #2dd4bf;
  --brand-strong: #f8fafc;
  --accent: #fbbf24;
  --shadow: 0 18px 44px rgba(0, 0, 0, .35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
img { max-width: 100%; display: block; }

.app-shell {
  width: min(100%, 1220px);
  margin: 0 auto;
}

.app-main { padding-bottom: 24px; }

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 80%, transparent);
  backdrop-filter: blur(18px);
}

.app-header-row {
  min-height: 62px;
  padding: 10px 16px;
  display: grid;
  grid-template-columns: 42px 1fr 42px 42px;
  gap: 8px;
  align-items: center;
}

.brand-lockup { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #0f172a, #0f766e);
  box-shadow: var(--shadow);
}
.brand-text { font-size: 18px; font-weight: 900; letter-spacing: 0; color: var(--text); white-space: nowrap; }

.icon-btn {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
  cursor: pointer;
}

.badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.app-search-wrap {
  position: sticky;
  top: calc(62px + env(safe-area-inset-top));
  z-index: 35;
  padding: 0 16px 10px;
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(18px);
}

.app-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--muted);
}

.app-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-weight: 700;
  min-width: 0;
}

.desktop-nav { display: none; }

.desktop-actions {
  display: none;
  align-items: center;
  gap: 8px;
}

.mega-menu {
  position: absolute;
  left: 50%;
  top: calc(100% - 8px);
  width: min(760px, calc(100vw - 32px));
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}

.mega-trigger:hover .mega-menu, .mega-trigger:focus-within .mega-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.surface {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-pad { padding: 14px 16px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.eyebrow { margin: 0 0 3px; color: var(--brand); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.title { margin: 0; font-size: 20px; line-height: 1.15; font-weight: 900; color: var(--text); }
.muted { color: var(--muted); }
.link-strong { color: var(--brand); font-weight: 900; font-size: 12px; }

.hero-strip {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
}

.hero-card {
  min-height: 168px;
  scroll-snap-align: start;
  overflow: hidden;
  position: relative;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, #0f172a, #0f766e 58%, #f59e0b);
  color: #fff;
}

.hero-card.alt { background: linear-gradient(135deg, #312e81, #0f766e 62%, #14b8a6); }
.hero-card.warm { background: linear-gradient(135deg, #7c2d12, #be123c 58%, #f59e0b); }

.hero-card h1, .hero-card h2 { margin: 0; font-size: 24px; line-height: 1.1; font-weight: 900; max-width: 12ch; }
.hero-card p { margin: 8px 0 0; max-width: 26ch; color: rgba(255,255,255,.82); font-weight: 600; font-size: 13px; }

.pill-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.pill {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  padding: 8px 12px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 13px;
  font-weight: 800;
}

.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }

.product-card {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 112px 1fr;
  min-height: 132px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
  
}

.product-media { background: var(--surface-soft); overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s ease; }
.product-card:hover .product-media img { transform: scale(1.04); }
.product-info { padding: 12px; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.product-name { margin: 0; color: var(--text); font-size: 14px; font-weight: 900; line-height: 1.25;overflow-wrap: break-word; }
.product-price { color: var(--brand); font-weight: 900; font-size: 15px; }
.product-meta { color: var(--muted); font-size: 11px; font-weight: 700; }
.product-actions { margin-top: auto; display: flex; gap: 8px; align-items: center; }

.btn {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-weight: 900;
  cursor: pointer;
}
.btn-primary { background: var(--brand-strong); color: var(--surface); }
.btn-soft { background: var(--surface-soft); color: var(--text); border: 1px solid var(--line); }
.btn-danger { background: #fff1f2; color: var(--danger); border: 1px solid #fecdd3; }

.flash-band {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 14px;
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  overflow: hidden;
}

.countdown { display: inline-flex; gap: 5px; font-weight: 900; }
.countdown span { background: rgba(255,255,255,.14); border-radius: 6px; padding: 6px 7px; }

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(18px);
  box-shadow: 0 -16px 34px rgba(15, 23, 42, .1);
}

.bottom-nav-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 8px 10px; }
.bottom-nav a {
  min-height: 56px;
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  position: relative;
}
.bottom-nav a.active { color: var(--brand); background: color-mix(in srgb, var(--brand) 11%, transparent); }
.bottom-nav i { font-size: 17px; }

.drawer-backdrop, .modal-backdrop, .sidebar-backdrop {
  position: fixed;
  inset: 0;
  z-index: 55;
  background: rgba(15, 23, 42, .48);
  backdrop-filter: blur(8px);
}
.hidden { display: none !important; }

.cart-drawer, .app-sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  z-index: 60;
  width: min(420px, 92vw);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
  transition: transform .24s ease;
}
.cart-drawer { right: 0; transform: translateX(100%); }
.app-sidebar { left: 0; transform: translateX(-100%); }
.cart-drawer.open, .app-sidebar.open { transform: translateX(0); }

.drawer-head { min-height: 64px; padding: 14px 16px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.drawer-body { padding: 16px; overflow-y: auto; height: calc(100% - 64px); }

.quick-modal {
  position: fixed;
  inset: auto 12px calc(var(--bottom-nav) + 12px) 12px;
  z-index: 70;
  max-width: 720px;
  margin: 0 auto;
}

.quick-body { display: grid; grid-template-columns: 104px 1fr; gap: 12px; padding: 12px; }
.quick-body img { width: 104px; height: 104px; object-fit: cover; border-radius: var(--radius); background: var(--surface-soft); }

.install-banner {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(var(--bottom-nav) + env(safe-area-inset-bottom) + 10px);
  z-index: 50;
  padding: 12px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.form-field {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  outline: 0;
  padding: 12px;
}

.tabs { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; padding: 6px; background: var(--surface-soft); border-radius: var(--radius); }
.tabs button.active { background: var(--surface); color: var(--brand); box-shadow: 0 8px 18px rgba(15, 23, 42, .07); }

.line-clamp-1, .truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line-clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hide-scrollbar { scrollbar-width: none; }
.hide-scrollbar::-webkit-scrollbar { display: none; }
.safe-top { padding-top: env(safe-area-inset-top); }
.safe-bottom { padding-bottom: env(safe-area-inset-bottom); }

@media (min-width: 768px) {
  body { padding-bottom: 0; }
  .app-header-row { grid-template-columns: auto 1fr auto; min-height: 72px; }
  .mobile-only { display: none !important; }
  .desktop-nav { display: flex; align-items: center; justify-content: center; gap: 6px; }
  .desktop-nav a, .desktop-nav button { padding: 10px 12px; border-radius: var(--radius); color: var(--muted); font-weight: 900; font-size: 13px; background: transparent; border: 0; cursor: pointer; }
  .desktop-nav a:hover, .desktop-nav button:hover { color: var(--text); background: var(--surface-soft); }
  .desktop-actions { display: flex; }
  .app-search-wrap { top: 72px; padding: 0 24px 12px; }
  .section-pad { padding: 18px 24px; }
  .hero-strip { grid-auto-columns: minmax(340px, 1fr); grid-template-columns: repeat(3, 1fr); overflow: visible; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .product-card { grid-template-columns: 1fr; min-height: 0; }
  .product-media { aspect-ratio: 1 / 1; }
  .bottom-nav { display: none; }
  .quick-modal { inset: 50% auto auto 50%; transform: translate(-50%, -50%); width: min(680px, calc(100vw - 40px)); }
}

@media (min-width: 1080px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .catalog-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
  .filters-panel { position: sticky; top: 136px; }
}


