/* Ziaja concept: shared hi-fi components. Uses only tokens from ../04-system/build/tokens.css. */
@import url("tokens.css");
@import url("components.css");

* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body { font: 400 16px/1.55 var(--font-sans); color: var(--color-text); background: var(--color-bg); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: var(--border-strong) solid var(--color-focus); outline-offset: 3px; border-radius: var(--radius-sm); }
[hidden] { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: var(--grid-max); margin: 0 auto; padding: 0 var(--grid-margin); }
.ico { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.muted { color: var(--color-muted); }
.t-hand { color: var(--color-accent); }

/* sections */
.sec { padding: var(--space-16) 0; }
.sec.tint { background: var(--color-surface); }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: var(--space-6); margin-bottom: var(--space-8); }
.sec-head .t-hand { display: block; margin-bottom: var(--space-2); }
.more { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 700; white-space: nowrap; }
.more:hover { color: var(--color-accent); }

/* promo + header */
.promo { background: var(--color-accent); color: var(--color-accent-text); font-size: 12px; font-weight: 500; text-align: center; padding: var(--space-2) var(--grid-margin); }
.hdr { position: sticky; top: 0; z-index: 30; background: color-mix(in srgb, var(--color-bg) 94%, transparent); backdrop-filter: blur(10px); border-bottom: var(--border-hair) solid var(--color-line); }
.hdr .wrap { display: flex; align-items: center; gap: var(--space-8); min-height: 72px; }
.logo { display: inline-flex; align-items: center; min-height: 44px; }
.logo img { height: 34px; width: auto; }
.nav { display: flex; gap: var(--space-6); font-weight: 600; font-size: 16px; }
.nav a { position: relative; padding: var(--space-3) 6px; margin: 0 -4px; }
.nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 4px; height: 2px; background: var(--color-accent); border-radius: var(--radius-pill);
  transform: scaleX(0); transform-origin: left; transition: transform var(--motion-duration-base) var(--motion-ease-out); }
.nav a:hover::after, .nav a[aria-current]::after { transform: scaleX(1); }
.search { flex: 1; max-width: 420px; margin-left: auto; position: relative; }
.search input { width: 100%; height: 44px; border: var(--border-hair) solid var(--color-line); border-radius: var(--radius-pill); padding: 0 var(--space-4) 0 44px; background: var(--color-surface); font-size: 14px; }
.search input::placeholder { color: var(--color-muted); }
.search .ico { position: absolute; left: 14px; top: 10px; color: var(--color-muted); }
.hicons { display: flex; gap: 2px; }
.hicons a { width: 44px; height: 44px; display: grid; place-items: center; position: relative; }
.hicons a:hover { background: var(--color-surface); }
.hicons .show-m { display: none; }
.count { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: var(--radius-round); background: var(--color-accent); color: var(--color-accent-text); font: 700 12px/18px var(--font-sans); text-align: center; }

/* buttons, chips */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); min-height: 52px; padding: 0 var(--space-6); border-radius: var(--radius-pill);
  font-weight: 700; font-size: 16px; border: var(--border-strong) solid transparent; background: none;
  transition: transform var(--motion-duration-fast) var(--motion-ease-out), background var(--motion-duration-fast), color var(--motion-duration-fast); }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--color-accent); color: var(--color-accent-text); }
.btn-primary:hover { background: var(--color-accent-hover); }
.btn-ghost { border-color: var(--color-line-strong); }
.btn-ghost:hover { background: var(--color-text); color: var(--color-bg); }
.btn-sm { min-height: 44px; padding: 0 var(--space-4); font-size: 14px; }
.round { width: 48px; height: 48px; min-height: 48px; padding: 0; }
.chips { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: 0 var(--space-4); border-radius: var(--radius-pill);
  border: var(--border-hair) solid var(--color-line); background: var(--color-bg); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: border-color var(--motion-duration-fast), background var(--motion-duration-fast); }
.chip:hover { border-color: var(--color-line-strong); }
.chip[aria-pressed="true"] { background: var(--color-text); border-color: var(--color-text); color: var(--color-bg); }
.label-pill { display: inline-flex; align-items: center; min-height: 26px; padding: 0 var(--space-3); border-radius: var(--radius-pill); font: 700 12px/1 var(--font-sans); letter-spacing: .04em; }
.label-pill.best { background: var(--color-text); color: var(--color-bg); }
.label-pill.sale { background: var(--color-sale); color: var(--color-sale-text); }

/* product card */
.card { position: relative; display: flex; flex-direction: column; min-width: 0; }
.card .tile { position: relative; display: block; aspect-ratio: var(--ratio-square); background: var(--color-bg); box-shadow: var(--shadow-photo); padding: 10% 16% 5%; overflow: hidden;
  transition: box-shadow var(--motion-duration-base) var(--motion-ease-out); }
.card:hover .tile { box-shadow: var(--shadow-photo-hover); }
.card .tile img, .packimg { width: 100%; height: 100%; object-fit: contain; object-position: bottom; mix-blend-mode: multiply;
  transform: translateY(var(--lift, 0)) scale(var(--z, 1)); transform-origin: 50% 100%; transition: transform var(--motion-duration-base) var(--motion-ease-out); }
.card:hover .tile img { --lift: -6px; }
.card .tags { position: absolute; top: var(--space-3); left: var(--space-3); display: flex; gap: var(--space-1); z-index: 1; }
.card .series { margin-top: var(--space-3); font: 700 12px/1.3 var(--font-sans); letter-spacing: .06em; text-transform: uppercase; color: var(--color-accent); }
.card h3 { font-size: 16px; font-weight: 600; line-height: 1.35; margin-top: var(--space-1); }
.card .stars { display: flex; gap: var(--space-2); align-items: center; font-size: 12px; color: var(--color-muted); margin-top: var(--space-2); }
.card .stars b { color: var(--color-text); letter-spacing: 1px; font-weight: 400; }
.card .buy { display: flex; justify-content: space-between; align-items: end; gap: var(--space-3); margin-top: auto; padding-top: var(--space-3); }
.price { font-weight: 800; font-size: 18px; line-height: 1.2; }
.price s { font-weight: 500; font-size: 14px; color: var(--color-muted); margin-left: var(--space-1); }
.price.sale { color: var(--color-sale); }
.unit { font-size: 12px; color: var(--color-muted); line-height: 1.35; }
.add { width: 48px; height: 48px; flex: none; border: 0; background: var(--color-accent); color: var(--color-accent-text); display: grid; place-items: center;
  transition: transform var(--motion-duration-fast) var(--motion-ease-out), background var(--motion-duration-fast); }
.add:hover { background: var(--color-accent-hover); } .add:active { transform: scale(.9); }
.add .ico { width: 22px; height: 22px; stroke-width: 2.4; }

/* rows / carousels */
.grid4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-8) var(--space-6); }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * var(--space-6)) / 4); gap: var(--space-6); overflow-x: auto; padding: var(--space-2) var(--space-2) var(--space-6); margin: calc(var(--space-2) * -1) calc(var(--space-2) * -1) calc(var(--space-6) * -1);
  scroll-snap-type: x mandatory; scrollbar-width: none; scroll-behavior: smooth; }
.rail > * { scroll-snap-align: start; }
.rail-ctrl { display: flex; gap: var(--space-2); }
.rail-ctrl button { width: 48px; height: 48px; border: var(--border-hair) solid var(--color-line); background: var(--color-bg); display: grid; place-items: center; }
.rail-ctrl button:hover { border-color: var(--color-line-strong); }
.rail-ctrl button:disabled { opacity: .35; cursor: default; }

/* series tiles */
.series-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: var(--space-6) var(--space-4); }
.sr-tile { display: block; text-align: center; }
.sr-tile .blob { position: relative; aspect-ratio: var(--ratio-square); background: var(--color-bg); box-shadow: var(--shadow-photo); padding: 12% 22% 4%;
  transition: box-shadow var(--motion-duration-base) var(--motion-ease-out); }
.sr-tile:hover .blob { box-shadow: var(--shadow-photo-hover); }
.sr-tile:hover .packimg { --lift: -6px; }
.sr-tile h3 { font-size: 16px; font-weight: 700; margin-top: var(--space-3); }
.sr-tile p { font-size: 12px; color: var(--color-muted); }

/* sticker + hand notes (the light hand-drawn layer) */
.sticker { display: inline-grid; place-items: center; text-align: center; width: 76px; height: 76px; background: var(--color-bg); border: var(--border-strong) solid var(--color-line-strong);
  transform: rotate(-4deg); box-shadow: var(--shadow-photo); font: 800 16px/1 var(--font-sans); }
.sticker small { display: block; font: 700 16px/1 var(--font-hand); color: var(--color-muted); margin-bottom: 2px; }
.u { position: relative; white-space: nowrap; }
.u svg { position: absolute; left: -2%; bottom: -.12em; width: 104%; height: .3em; overflow: visible; fill: none; stroke: var(--color-accent); stroke-width: 5; stroke-linecap: round; }
.draw { stroke-dasharray: 1; stroke-dashoffset: 1; animation: draw var(--motion-duration-draw) var(--motion-ease-out) forwards; animation-delay: var(--dl, 200ms); }
@keyframes draw { to { stroke-dashoffset: 0; } }
@media (prefers-reduced-motion: reduce) { .draw { animation: none; stroke-dashoffset: 0; } }

/* footer + tabbar */
footer { border-top: var(--border-hair) solid var(--color-line); padding: var(--space-12) 0 var(--space-8); font-size: 14px; color: var(--color-muted); }
footer .cols { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--space-8); }
footer h4 { font-size: 16px; font-weight: 700; color: var(--color-text); margin-bottom: var(--space-3); }
footer ul { padding: 0; list-style: none; } footer li a { display: inline-flex; align-items: center; min-height: 44px; }
footer a:hover { color: var(--color-accent); }
.news { display: flex; gap: var(--space-2); margin-top: var(--space-4); max-width: 420px; }
.news input { flex: 1; min-width: 0; height: 52px; border-radius: var(--radius-pill); border: var(--border-hair) solid var(--color-line-strong); padding: 0 var(--space-4); background: var(--color-bg); }
.disclaimer { margin-top: var(--space-8); padding-top: var(--space-4); border-top: var(--border-hair) solid var(--color-line); font-size: 12px; }
.tabbar { display: none; }

@media (max-width: 1024px) {
  .nav { display: none; }
  .grid4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .rail { grid-auto-columns: calc((100% - var(--space-4)) / 2.3); gap: var(--space-4); }
  .series-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
  body { padding-bottom: 68px; }
  .hdr .wrap { min-height: 60px; gap: var(--space-3); }
  .logo img { height: 28px; }
  .search { display: none; }
  .hicons { margin-left: auto; }
  .hicons .hide-m { display: none; }
  .hicons .show-m { display: grid; }
  .sec { padding: var(--space-12) 0; }
  .sec-head { margin-bottom: var(--space-6); flex-direction: column; align-items: flex-start; gap: var(--space-2); }
  .rail-ctrl { display: none; }
  .rail { grid-auto-columns: 46%; margin-right: calc(var(--grid-margin) * -1); padding-right: var(--grid-margin); }
  .series-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 38%; overflow-x: auto; scrollbar-width: none;
                 margin-right: calc(var(--grid-margin) * -1); padding-right: var(--grid-margin); scroll-snap-type: x mandatory; }
  .series-grid > * { scroll-snap-align: start; }
  .series-grid { padding-top: var(--space-2); padding-bottom: var(--space-6); padding-left: var(--space-2); margin-left: calc(var(--space-2) * -1); }
  .card h3 { font-size: 16px; }
  .add { width: 44px; height: 44px; }
  .price { font-size: 18px; }
  footer .cols { grid-template-columns: 1fr 1fr; }
  footer .cols > :first-child { grid-column: 1 / -1; }
  .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; height: 64px; padding-bottom: env(safe-area-inset-bottom);
            background: var(--color-bg); border-top: var(--border-hair) solid var(--color-line); justify-content: space-around; align-items: center; }
  .tabbar a { display: grid; justify-items: center; gap: 2px; min-width: 60px; min-height: 48px; align-content: center; font-size: 12px; font-weight: 600; color: var(--color-muted); position: relative; }
  .tabbar a[aria-current] { color: var(--color-accent); }
  .tabbar .count { top: 0; right: 10px; }
}
