:root {
  --ink: #151514;
  --muted: #77736e;
  --paper: #f5f2ec;
  --card: #fffdf8;
  --accent: #f15a24;
  --accent-soft: #ffdfd1;
  --line: #ded9d0;
  --nav-height: 82px;
  --radius: 22px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 16% 8%, rgba(241, 90, 36, .12), transparent 22rem),
    linear-gradient(135deg, #e8e3da, #f6f3ed 48%, #ddd7cd);
  font-family: "DM Sans", sans-serif;
}

button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.app-shell {
  width: min(100%, 1180px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
  box-shadow: 0 0 80px rgba(36, 31, 24, .13);
  padding-bottom: calc(var(--nav-height) + 28px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  padding: 0 22px;
  background: rgba(245, 242, 236, .88);
  border-bottom: 1px solid rgba(21, 21, 20, .08);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-family: "Syne", sans-serif;
  font-size: 14px;
  letter-spacing: .12em;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: white;
  background: var(--ink);
  border-radius: 11px;
  font-weight: 800;
}

.locale-wrap { position: relative; }

.locale {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 78px;
  min-height: 44px;
  padding: 9px 11px;
  border: 0;
  border-radius: 12px;
  background: white;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  box-shadow: 0 1px 0 rgba(21,21,20,.06);
}

.locale-globe { color: var(--accent); font-size: 17px; line-height: 1; }

.locale-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 45;
  width: 190px;
  padding: 7px;
  border: 1px solid rgba(21,21,20,.08);
  border-radius: 16px;
  background: rgba(255,253,248,.98);
  box-shadow: 0 18px 50px rgba(30,25,20,.17);
  backdrop-filter: blur(18px);
  transform-origin: top right;
  animation: locale-in .18s both;
}

.locale-menu button {
  display: grid;
  grid-template-columns: 32px 1fr 16px;
  align-items: center;
  width: 100%;
  padding: 10px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  text-align: left;
  font-size: 13px;
}

.locale-menu button:hover, .locale-menu button.selected { background: var(--paper); }
.locale-menu button span { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.locale-menu button b { display: none; color: var(--accent); }
.locale-menu button.selected b { display: inline; }

.hero {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 36px 22px 32px;
  color: white;
  background: #171715;
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  transform: rotate(-22deg);
}

.hero::before {
  width: 380px;
  height: 120px;
  right: -110px;
  top: 12px;
  background: linear-gradient(90deg, rgba(241,90,36,.92), rgba(241,90,36,.08));
}

.hero::after {
  width: 280px;
  height: 90px;
  right: 20px;
  bottom: -25px;
  border: 1px solid rgba(255,255,255,.22);
}

.hero-copy { position: relative; z-index: 1; max-width: 670px; }

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .18em;
}

.hero h1 {
  margin: 0;
  font-family: "Syne", sans-serif;
  font-size: clamp(36px, 9vw, 72px);
  line-height: .94;
  letter-spacing: -.055em;
}

.hero h1 em { color: var(--accent); font-style: normal; }
.hero-copy > p:last-child { max-width: 520px; margin: 22px 0 0; color: #bbb8b1; line-height: 1.55; }

.hero-badge {
  position: absolute;
  right: 20px;
  bottom: 20px;
  z-index: 1;
  display: none;
  align-items: flex-end;
  gap: 12px;
}

.hero-badge span { font-family: "Syne"; font-size: 64px; font-weight: 700; line-height: .75; }
.hero-badge small { width: 70px; font-size: 9px; font-weight: 700; letter-spacing: .12em; }

.search-zone {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin: -1px 14px 0;
  padding: 14px 0;
  position: sticky;
  top: 68px;
  z-index: 18;
  background: var(--paper);
}

.search-box {
  display: grid;
  grid-template-columns: 22px 1fr 42px;
  align-items: center;
  min-width: 0;
  height: 54px;
  padding-left: 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 17px;
  transition: border-color .2s, box-shadow .2s;
}

.search-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(241,90,36,.12); }
.search-box > svg, .image-search svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; padding: 0 10px; font-size: 14px; }
.image-search { display: grid; width: 44px; height: 44px; place-items: center; border: 0; background: transparent; }
.image-search svg { width: 23px; }

.search-submit {
  height: 54px;
  padding: 0 17px;
  color: white;
  border: 0;
  border-radius: 17px;
  background: var(--accent);
  font-weight: 700;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 14px 0;
}

.category-scroll {
  display: flex;
  gap: 4px;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.category-scroll::-webkit-scrollbar { display: none; }
.category { white-space: nowrap; padding: 10px 13px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); font-weight: 600; }
.category.active { color: white; background: var(--ink); }

.view-actions { display: flex; margin-left: auto; border-left: 1px solid var(--line); }
.view-actions button { display: grid; width: 44px; height: 44px; place-items: center; border: 0; background: transparent; }
.view-actions svg { width: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.brand-directory {
  margin: 12px 14px 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}
.brand-directory-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.brand-directory-head span { color: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.brand-directory-head strong { font-family: "Syne", sans-serif; font-size: 14px; }
.brand-scroll { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.brand-scroll::-webkit-scrollbar { display: none; }
.brand-chip { flex: 0 0 auto; padding: 9px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 11px; font-weight: 700; }
.brand-chip.active { color: white; border-color: var(--accent); background: var(--accent); }

.result-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 12px;
  color: var(--muted);
  font-size: 12px;
}

.result-line p { margin: 0; }
.result-line strong { color: var(--ink); }
.result-line button { border: 0; background: transparent; font-size: 12px; font-weight: 600; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 0 10px;
}

.product-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  background: var(--card);
  border-radius: 18px;
  box-shadow: 0 2px 0 rgba(21,21,20,.04);
  animation: card-in .5s both;
}

.product-card:nth-child(2n) { animation-delay: .06s; }
.product-hit { position: absolute; inset: 0; z-index: 3; width: 100%; border: 0; background: transparent; cursor: pointer; }
.product-visual { position: relative; aspect-ratio: .9; overflow: hidden; }
.product-visual::before { content: ""; position: absolute; inset: 0; background-image: radial-gradient(rgba(255,255,255,.42) .7px, transparent .7px); background-size: 8px 8px; opacity: .35; }
.photo-visual { background: #e9e4dc; }
.photo-visual::before { z-index: 1; background: linear-gradient(180deg, transparent 70%, rgba(18,17,15,.08)); opacity: 1; }
.product-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.product-photo.crop-top { transform: scale(1.18); transform-origin: center bottom; }
.product-visual svg { position: absolute; inset: 4% 3% 1%; width: 94%; height: 95%; overflow: visible; }
.product-visual svg path, .product-visual svg rect, .product-visual svg circle { fill: currentColor; }
.product-visual svg .line { fill: none; stroke: rgba(255,255,255,.56); stroke-width: 8; stroke-linecap: round; }
.product-visual svg text { fill: rgba(255,255,255,.88); font-family: "Syne"; font-size: 54px; font-weight: 800; text-anchor: middle; }
.tag { position: absolute; top: 12px; left: 12px; z-index: 2; padding: 6px 8px; color: white; background: var(--accent); border-radius: 7px; font-size: 8px; font-weight: 800; letter-spacing: .11em; }
.tag-dark { background: var(--ink); }
.save { position: absolute; top: 8px; right: 8px; z-index: 5; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255,255,255,.76); backdrop-filter: blur(8px); font-size: 20px; }
.save.saved { color: white; background: var(--accent); }

.visual-bag { color: #22211f; background: #d9c8b3; }
.visual-bag svg .line { stroke: #f15a24; }
.visual-shoe { color: #f3efe7; background: #e4693e; }
.visual-shoe svg .sole { fill: none; stroke: #181816; stroke-width: 18; }
.visual-shoe svg .accent { fill: #151514; }
.visual-jersey { color: #17233c; background: #a6b6b2; }
.visual-glasses { color: #111; background: #d4aa92; }
.visual-crossbody { color: #5c6244; background: #d9d4bf; }
.visual-crossbody svg .strap { fill: none; stroke: #5c6244; stroke-width: 18; }
.visual-watch { color: #c6c7c4; background: #1d1c1a; }
.visual-watch svg .face { fill: #262624; }
.visual-watch svg .accent { fill: var(--accent); }
.visual-hoodie { color: #77736d; background: #d8d0c7; }
.visual-cap { color: #f15a24; background: #b8c4ca; }

.product-info { padding: 13px 12px 14px; }
.product-code { margin: 0 0 6px; color: var(--accent); font-size: 8px; font-weight: 800; letter-spacing: .08em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-info h2 { margin: 0; font-family: "Syne", sans-serif; font-size: clamp(15px, 4vw, 20px); letter-spacing: -.035em; }
.product-note { min-height: 32px; margin: 7px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.4; }
.card-footer { display: flex; align-items: flex-end; justify-content: space-between; gap: 5px; padding-top: 10px; border-top: 1px solid var(--line); }
.card-footer strong { font-size: 12px; }
.card-footer span { color: var(--muted); font-size: 9px; white-space: nowrap; }

.product-grid.list-view { grid-template-columns: 1fr; }
.product-grid.list-view .product-card { display: grid; grid-template-columns: 145px 1fr; }
.product-grid.list-view .product-visual { aspect-ratio: 1; }
.product-grid.list-view .product-info { display: flex; flex-direction: column; justify-content: center; }

.load-more {
  display: block;
  min-width: 166px;
  margin: 24px auto 34px;
  padding: 13px 18px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 0 2px 0 rgba(21,21,20,.04);
  font-weight: 700;
}

.empty-state { margin: 40px 18px; padding: 54px 24px; text-align: center; border: 1px dashed #c8c1b5; border-radius: var(--radius); }
.empty-state span { font-size: 42px; }
.empty-state h2 { margin: 10px 0 5px; font-family: "Syne"; }
.empty-state p { margin: 0 0 20px; color: var(--muted); font-size: 13px; }
.empty-state button { padding: 12px 18px; border: 0; border-radius: 12px; color: white; background: var(--ink); font-weight: 700; }

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: min(100%, 1180px);
  min-height: var(--nav-height);
  padding: 8px 8px max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  border-top: 1px solid rgba(21,21,20,.09);
  background: rgba(255,253,248,.92);
  backdrop-filter: blur(18px);
}

.bottom-nav a, .bottom-nav button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; border: 0; color: var(--muted); background: transparent; text-decoration: none; font-size: 9px; font-weight: 600; }
.bottom-nav b { font-size: 9px; font-weight: 700; }
.bottom-nav span { font-size: 23px; line-height: 1; }
.bottom-nav .active { color: var(--accent); }
.bottom-nav .camera-nav span { display: grid; width: 49px; height: 49px; margin-top: -28px; place-items: center; color: white; background: var(--accent); border: 5px solid var(--card); border-radius: 17px; box-shadow: 0 8px 22px rgba(241,90,36,.28); }
.bottom-nav .camera-nav b { font-size: 9px; font-weight: 700; }

.sheet-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(20,19,17,.42); backdrop-filter: blur(3px); }
.bottom-sheet { position: fixed; left: 50%; bottom: 0; z-index: 41; width: min(100%, 620px); padding: 10px 20px calc(24px + env(safe-area-inset-bottom)); transform: translate(-50%, 105%); background: var(--card); border-radius: 28px 28px 0 0; box-shadow: 0 -20px 70px rgba(0,0,0,.15); transition: transform .32s cubic-bezier(.22,.8,.25,1); }
.bottom-sheet.open { transform: translate(-50%, 0); }
.sheet-handle { width: 42px; height: 4px; margin: 0 auto 19px; border-radius: 9px; background: #d2cdc5; }
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet-head h2, .detail-content h2 { margin: 0; font-family: "Syne"; font-size: 28px; letter-spacing: -.04em; }
.sheet-close { width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--paper); font-size: 25px; line-height: 1; }
.filter-group { margin-top: 26px; }
.filter-group > p { font-size: 12px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 11px; background: transparent; font-size: 12px; }
.chips button.selected { color: white; border-color: var(--ink); background: var(--ink); }
.apply-filter { width: 100%; margin-top: 28px; padding: 15px; color: white; border: 0; border-radius: 15px; background: var(--accent); font-weight: 800; }
.apply-filter:disabled { cursor: wait; opacity: .7; }

.image-preview { display: grid; min-height: 210px; margin-top: 22px; place-content: center; justify-items: center; overflow: hidden; border: 1px dashed #bfb7ac; border-radius: 18px; background: var(--paper); text-align: center; }
.image-preview svg { width: 42px; fill: none; stroke: var(--accent); stroke-width: 1.5; }
.image-preview p { margin: 13px 0 3px; font-weight: 700; }
.image-preview span { color: var(--muted); font-size: 11px; }
.image-preview img { width: 100%; max-height: 260px; object-fit: contain; }

.detail-sheet {
  display: flex;
  max-height: min(94dvh, 920px);
  min-height: 78dvh;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.detail-gallery { flex: 0 0 auto; }
.detail-stage {
  position: relative;
  display: grid;
  min-height: min(58vh, 540px);
  overflow: hidden;
  place-items: center;
  border-radius: 20px;
  background: #ebe7df;
}
.detail-stage img {
  width: 100%;
  height: min(58vh, 540px);
  object-fit: contain;
}
.detail-counter {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  color: white;
  border-radius: 999px;
  background: rgba(20,19,17,.72);
  backdrop-filter: blur(8px);
  font-size: 11px;
  font-weight: 700;
}
.gallery-arrow {
  position: absolute;
  top: 50%;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  transform: translateY(-50%);
  color: var(--ink);
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(8px);
  box-shadow: 0 5px 18px rgba(0,0,0,.1);
  font-size: 30px;
  line-height: 1;
}
.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }
.detail-thumbnails {
  display: flex;
  gap: 8px;
  margin: 10px 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.detail-thumbnails::-webkit-scrollbar { display: none; }
.detail-thumbnails button {
  flex: 0 0 70px;
  height: 70px;
  padding: 3px;
  overflow: hidden;
  border: 2px solid transparent;
  border-radius: 13px;
  background: #ece7df;
}
.detail-thumbnails button.active { border-color: var(--accent); }
.detail-thumbnails img { width: 100%; height: 100%; border-radius: 9px; object-fit: cover; }
.detail-content { padding-bottom: 6px; }
.detail-content > p:not(.eyebrow) { color: var(--muted); line-height: 1.6; }
.detail-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 24px; }
.detail-actions button { padding: 14px; color: white; border: 0; border-radius: 14px; background: var(--accent); font-weight: 800; }
.detail-actions .secondary { color: var(--ink); background: var(--paper); }
.floating-close { position: absolute; z-index: 4; right: 18px; top: 22px; box-shadow: 0 6px 20px rgba(0,0,0,.12); }

.toast { position: fixed; left: 50%; bottom: 105px; z-index: 60; max-width: calc(100% - 32px); padding: 12px 16px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; color: white; background: var(--ink); border-radius: 12px; font-size: 12px; transition: .25s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes card-in { from { opacity: 0; transform: translateY(14px); } }
@keyframes locale-in { from { opacity: 0; transform: translateY(-5px) scale(.98); } }

@media (min-width: 720px) {
  .topbar { padding-inline: 34px; }
  .hero { min-height: 360px; padding: 65px 46px; }
  .hero-badge { display: flex; }
  .search-zone { margin-inline: 28px; }
  .catalog-toolbar, .result-line { padding-inline: 32px; }
  .brand-directory { margin-inline: 32px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; padding: 0 30px; }
  .product-info { padding: 18px; }
  .product-note { font-size: 13px; }
  .card-footer strong { font-size: 14px; }
  .product-grid.list-view { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-sheet { padding-inline: 28px; }
}

@media (min-width: 1020px) {
  .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .bottom-nav { width: min(760px, calc(100% - 40px)); bottom: 18px; border: 1px solid rgba(21,21,20,.09); border-radius: 23px; box-shadow: 0 15px 45px rgba(0,0,0,.14); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
