/* Shop page. Tokens and buttons come from brand.css. */

body { background: var(--page); }
body.no-scroll { overflow: hidden; }

/* ---------------------------------------------------------------- header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--surface);
  box-shadow: 0 1px 0 var(--line);
}
.site-header { padding-top: env(safe-area-inset-top); }
.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  max-width: 1240px;
  height: 92px;
  margin: 0 auto;
  padding: 0 max(24px, env(safe-area-inset-right)) 0 max(24px, env(safe-area-inset-left));
}
.main-nav { display: flex; gap: 28px; margin-left: auto; font-size: 15px; }
.main-nav a { padding: 6px 0; color: var(--text); border-bottom: 2px solid transparent; }
.main-nav a:hover { color: var(--cyan); }
.main-nav a.active { color: var(--cyan); border-bottom-color: var(--cyan); }
.header-actions { display: flex; align-items: center; gap: 16px; }
.menu-btn { display: none; }

/* ------------------------------------------------------------------ hero */

.hero {
  position: relative;
  overflow: hidden;
  background: var(--navy-900);
  color: #fff;
}
.hero-img {
  position: absolute;
  right: -4%;
  top: 50%;
  width: min(760px, 62%);
  transform: translateY(-50%);
  opacity: 0;
  transition: opacity 0.6s;
}
.hero-img.ready { opacity: 1; }
.hero-inner {
  position: relative;
  max-width: 1240px;
  margin: 0 auto;
  padding: 88px 24px 96px;
}
.hero-title { max-width: 560px; margin: 0 0 16px; font-size: 40px; line-height: 1.2; font-weight: 400; }
.hero-text { max-width: 480px; margin: 0 0 32px; font-size: 17px; color: rgba(255, 255, 255, 0.82); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------------ page */

.page { max-width: 1240px; margin: 0 auto; padding: 40px 24px 64px; }
.box { background: var(--surface); padding: 40px; }
.breadcrumb { font-size: 13px; color: var(--muted); }
.breadcrumb a:hover { color: var(--cyan); }
.page-title { margin: 14px 0 12px; font-size: 30px; font-weight: 400; color: var(--heading); }
.intro { max-width: 720px; margin: 0 0 4px; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.link-btn { color: var(--cyan); font-weight: 700; font-size: 14px; }
.link-btn:hover { text-decoration: underline; }

/* Shop-by-shape tiles */
.tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 36px;
}
.tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 14px 12px 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--tile);
  text-align: center;
  transition: border-color 0.15s;
}
.tile:hover, .tile.active { border-color: var(--cyan); }
.tile img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.tile-name { margin-top: 8px; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--heading); }
.tile-count { font-size: 11px; text-transform: uppercase; color: var(--muted); }

/* --------------------------------------------------------------- toolbar */

.toolbar { margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.chip-group { position: relative; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  color: var(--text);
}
.chip:hover { border-color: var(--cyan); color: var(--cyan); }
.chip.active { border-color: var(--cyan); color: var(--cyan); }
.chip svg { width: 16px; height: 16px; }
.chip .caret { transition: transform 0.15s; }
.chip-group.open .caret { transform: rotate(180deg); }
.chip-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--cyan);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}
.popover {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 15;
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  box-shadow: 0 10px 28px rgba(6, 42, 66, 0.12);
}
.chip-group.open .popover { display: block; }

.option-list { display: grid; gap: 2px; }
.option { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: var(--radius-sm); cursor: pointer; font-size: 14px; }
.option:hover { background: var(--tile); }
.option input { width: 16px; height: 16px; margin: 0; accent-color: var(--cyan); }
.dot { width: 16px; height: 16px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15); }

.active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.active-filters:not(:empty) { padding-top: 14px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 8px 5px 12px;
  border-radius: var(--radius-sm);
  background: #e6f5f8;
  color: var(--navy);
  font-size: 13px;
  font-weight: 700;
}
.pill svg { width: 14px; height: 14px; }
.active-filters .link-btn { margin-left: 4px; }

.result-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 16px; color: var(--muted); font-size: 14px; }
.sort select {
  height: 38px;
  padding: 0 32px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23434343' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 10px center / 14px no-repeat;
  appearance: none;
  font: inherit;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
}

/* ------------------------------------------------------------------ grid */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(260px, 100%), 1fr));
  gap: 36px 24px;
}
.card { display: flex; flex-direction: column; }
.media {
  position: relative;
  aspect-ratio: 16 / 11;
  border-radius: var(--radius-sm);
  background: var(--tile);
  overflow: hidden;
}
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.25s; }
.media .angle { opacity: 0; }
@media (hover: hover) {
  .media.has-angle:hover .angle { opacity: 1; }
  .media.has-angle:hover .front { opacity: 0; }
}
.media.has-angle.show-angle .angle { opacity: 1; }
.media.has-angle.show-angle .front { opacity: 0; }
.media.loading .front { opacity: 0; }
.media.loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}
@keyframes shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 9px;
  border-radius: var(--radius-sm);
  background: var(--cyan);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.fav {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--text);
}
.fav:hover { color: var(--cyan); }
.fav svg { width: 19px; height: 19px; }
.fav.on { color: #d1435b; }
.fav.on svg { fill: currentColor; }

.info { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 14px; }
.name { margin: 0; font-size: 16px; font-weight: 700; color: var(--heading); text-transform: uppercase; letter-spacing: 0.04em; }
.price { font-size: 16px; font-weight: 700; color: var(--navy); white-space: nowrap; }
.shape-label { font-size: 13px; color: var(--muted); }
.meta { display: flex; align-items: center; gap: 12px; margin-top: 8px; min-height: 26px; }
.swatches { display: flex; gap: 9px; }
.color-name { font-size: 13px; color: var(--muted); }
.swatch {
  position: relative;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--c);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}
.swatch::after { content: ""; position: absolute; inset: -6px; }   /* larger tap area */
.swatch.selected { outline: 1.5px solid var(--cyan); outline-offset: 2.5px; }
.swatch.tortoise, .dot.tortoise {
  background:
    radial-gradient(circle at 30% 35%, #c78a3e 0 18%, transparent 32%),
    radial-gradient(circle at 70% 65%, #a2642a 0 16%, transparent 30%),
    radial-gradient(circle at 65% 25%, #140902 0 14%, transparent 24%),
    #3b1f0c;
}
.swatch.clear, .dot.clear { background: linear-gradient(135deg, #fff, var(--c)); }
.swatch.mirror, .dot.mirror { background: linear-gradient(135deg, #b7d2ff, var(--c) 55%, #0b1a3a); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.actions .btn { padding: 10px 12px; min-height: 42px; }

.empty { text-align: center; padding: 48px 0; color: var(--muted); }

/* ------------------------------------------------------------------ band */

.band { background: var(--navy-900); color: #fff; }
.band-inner { max-width: 1240px; margin: 0 auto; padding: 56px 24px; }
.band h2 { margin: 0 0 24px; font-size: 25px; font-weight: 400; }
.band ol { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.band li { counter-increment: step; color: rgba(255, 255, 255, 0.82); }
.band li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border: 1px solid var(--cyan);
  border-radius: var(--radius-sm);
  color: var(--cyan);
  font-weight: 700;
}
.band b { display: block; color: #fff; margin-bottom: 4px; }

/* ---------------------------------------------------------------- footer */

.site-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 48px 24px calc(36px + env(safe-area-inset-bottom));
  background: var(--navy-900);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  text-align: center;
}
.site-footer .logo-dos { height: 72px; }
.site-footer h3 { margin: 24px 0 6px; font-size: 20px; font-weight: 400; }
.footer-links { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; font-size: 14px; }
.footer-links a { display: inline-flex; align-items: center; gap: 10px; }
.footer-links a:hover { color: var(--cyan); }
.footer-links svg { width: 18px; height: 18px; }
.copyright { margin: 28px 0 0; font-size: 13px; color: rgba(255, 255, 255, 0.7); }

/* ---------------------------------------------------------------- drawer */

.drawer {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(6, 42, 66, 0.45);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.drawer.open { opacity: 1; pointer-events: auto; }
.drawer-panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(380px, 100%);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  transform: translateX(-100%);
  transition: transform 0.25s ease;
}
.drawer.open .drawer-panel { transform: none; }
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: calc(18px + env(safe-area-inset-top)) 20px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 20px; font-weight: 400; color: var(--heading); }
.icon-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--cyan); }
.drawer-groups { flex: 1; overflow-y: auto; padding: 8px 12px; }
.drawer-group { padding: 10px 0; border-bottom: 1px solid var(--line); }
.drawer-group h3 { margin: 4px 8px 6px; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.drawer-foot {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 920px) {
  .menu-btn { display: inline-grid; }
  .header-actions { margin-left: auto; }
  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    background: var(--surface);
    box-shadow: 0 10px 20px rgba(6, 42, 66, 0.08);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid var(--line); }
  .main-nav a.active { border-bottom-color: var(--line); }
  .band ol { grid-template-columns: 1fr 1fr; }
  .hero-img { width: 70%; right: -18%; opacity: 0; }
  .hero-img.ready { opacity: 0.45; }
}

/* Modern phones: two products per row, touch-sized controls, no iOS input zoom. */
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; gap: 28px 12px; }
  .media { aspect-ratio: 4 / 3; }
  .info { flex-direction: column; align-items: flex-start; gap: 2px; margin-top: 10px; }
  .name { font-size: 13px; }
  .price { font-size: 14px; }
  .shape-label { font-size: 11px; }
  .meta { margin-top: 6px; }
  .color-name { display: none; }
  .swatches { flex-wrap: wrap; gap: 10px; }
  .actions { grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
  .actions .btn { min-height: 40px; padding: 8px; font-size: 11px; letter-spacing: 0.03em; }
  .badge { top: 8px; left: 8px; padding: 3px 6px; font-size: 10px; }
  .fav { top: 2px; right: 2px; width: 40px; height: 40px; }
  .chips { gap: 6px; }
  .chip { height: 40px; padding: 0 12px; font-size: 13px; }
  .sort select { height: 40px; font-size: 16px; }
  .link-btn { padding: 6px 0; }
  .band-inner { padding: 40px 16px; }
  .page-title { font-size: 26px; }
  .tiles { margin: 24px 0 28px; }
  .tile-name { font-size: 12px; }
}

@media (max-width: 640px) {
  .header-inner { height: 76px; padding: 0 16px; gap: 12px; }
  .header-actions { gap: 8px; }
  .lang-btn { height: 40px; padding: 0 8px; }
  .site-header .logo-dos { height: 40px; }
  .hero-inner { padding: 56px 16px 64px; }
  .hero-title { font-size: 30px; }
  .hero-img { width: 110%; right: -45%; top: 78%; }
  .page { padding: 16px 0 40px; }
  .box { padding: 24px 16px; }
  .tiles { grid-template-columns: 1fr 1fr; gap: 10px; }
  .band ol { grid-template-columns: 1fr; }
  .result-bar { flex-wrap: wrap; }
}
.drawer-foot .btn { padding: 12px 10px; white-space: nowrap; }
