/* Shared design system: white with green accents. Used by the store and the admin panel. */
:root {
  --bg: #ffffff;
  --bg-soft: #f5f8f6;
  --bg-tint: #eef6f1;
  --line: #e3e9e5;
  --line-2: #d3ddd6;
  --ink: #0f1c14;
  --ink-2: #3d4c43;
  --muted: #6f7f75;
  --green: #138a42;
  --green-d: #0c6b32;
  --green-dd: #0a4f26;
  --green-soft: #e2f3e8;
  --green-tint: #f1f9f4;
  --amber: #b26b00;
  --amber-soft: #fff4e0;
  --red: #c23a1e;
  --red-soft: #fdeceb;
  --wa: #1fa855;
  --r: 16px;
  --r-sm: 12px;
  --shadow: 0 1px 2px rgba(15, 28, 20, .05), 0 6px 24px -12px rgba(15, 28, 20, .18);
  --shadow-lg: 0 2px 6px rgba(15, 28, 20, .06), 0 24px 60px -24px rgba(15, 28, 20, .35);
  --font: 'Geist', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); font-size: 16px; line-height: 1.45;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
/* Long unbroken names (model codes, pasted links) wrap instead of pushing the page sideways. */
body { overflow-wrap: break-word; }
h1, h2, h3, .pp-title, .card-name, .tile-name, .line-name, .row-name, .oline-name, .size-label, .specs dd, .desc, .ocard-items, .move { overflow-wrap: anywhere; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
.i { width: 20px; height: 20px; flex: none; }
.num, .price { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2.5px solid var(--green); outline-offset: 2px; border-radius: 6px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
  border-radius: 12px; font-weight: 600; font-size: 15.5px; letter-spacing: -.005em; white-space: nowrap;
  transition: background .2s, border-color .2s, color .2s, transform .15s var(--ease), box-shadow .2s;
  border: 1.5px solid transparent; user-select: none; -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .55; pointer-events: none; }
.btn .i, .btn > svg { width: 19px; height: 19px; flex: none; }
.btn-green { background: var(--green); color: #fff; box-shadow: 0 6px 18px -8px rgba(19, 138, 66, .6); }
.btn-green:hover { background: var(--green-d); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 6px 18px -8px rgba(31, 168, 85, .6); }
.btn-wa:hover { background: #17924a; }
.btn-wa svg { width: 20px; height: 20px; }
.btn-line { background: #fff; border-color: var(--line-2); color: var(--ink); }
.btn-line:hover { border-color: var(--green); color: var(--green-d); }
.btn-soft { background: var(--green-soft); color: var(--green-dd); }
.btn-soft:hover { background: #d3ecdc; }
.btn-ghost { color: var(--ink-2); min-height: 40px; padding: 0 12px; }
.btn-ghost:hover { background: var(--bg-soft); }
.btn-danger { background: #fff; border-color: #f1c9c1; color: var(--red); }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { min-height: 38px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 44px; height: 44px; display: inline-grid; place-items: center; border-radius: 12px; color: var(--ink-2);
  transition: background .2s, color .2s; -webkit-tap-highlight-color: transparent; position: relative;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--ink); }

/* ---------- language switch ---------- */
.lang { display: inline-flex; padding: 3px; border-radius: 10px; background: var(--bg-soft); border: 1px solid var(--line); }
.lang button { min-width: 44px; height: 32px; padding: 0 8px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.lang button[aria-pressed="true"] { background: #fff; color: var(--green-d); box-shadow: 0 1px 3px rgba(15, 28, 20, .12); }

/* ---------- form fields ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.field small { color: var(--muted); font-size: 12.5px; }
.input, .select, .textarea {
  width: 100%; min-height: 48px; padding: 11px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff;
  font-size: 16px; transition: border-color .2s, box-shadow .2s; appearance: none; -webkit-appearance: none;
}
.textarea { min-height: 96px; resize: vertical; line-height: 1.45; }
.select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236f7f75' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(19, 138, 66, .12); }
.input::placeholder, .textarea::placeholder { color: #9aa79f; }

/* ---------- status ---------- */
.stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--green-d); }
.stat::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stat.order { color: var(--amber); }
.badge { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border-radius: 99px; font-size: 12.5px; font-weight: 600; background: var(--bg-soft); color: var(--ink-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green-dd); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.ink { background: var(--ink); color: #fff; }

/* ---------- category tile ---------- */
.tiles { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-flow: dense; }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; } }
.tile { display: flex; flex-direction: column; border-radius: var(--r); background: #fff; border: 1px solid var(--line); overflow: hidden;
  transition: border-color .25s, box-shadow .3s var(--ease), transform .3s var(--ease); -webkit-tap-highlight-color: transparent; }
.tile:hover { border-color: #bfd9c8; box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.tile-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--green-tint); display: grid; place-items: center; color: var(--green); }
.tile-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.tile:hover .tile-media img, .tile:hover .tile-media .art { transform: scale(1.05); }
.tile-media .art { width: 46%; height: auto; transition: transform .8s var(--ease); stroke-width: 1.35; }
.tile-media::after { content: ''; position: absolute; inset: 0; background:
  linear-gradient(to right, rgba(19,138,66,.06) 1px, transparent 1px) 0 0 / 22px 22px,
  linear-gradient(to bottom, rgba(19,138,66,.06) 1px, transparent 1px) 0 0 / 22px 22px; pointer-events: none; }
.tile-media.has-photo::after { display: none; }
.tile-body { padding: 12px 14px 14px; display: grid; gap: 3px; }
.tile-name { font-weight: 600; font-size: 15.5px; line-height: 1.25; letter-spacing: -.01em; }
.tile-meta { font-size: 13px; color: var(--muted); }
.tiles.small .tile-media { aspect-ratio: 16 / 10; }
.tiles.small .tile-media .art { width: 34%; }
.tiles.small .tile-name { font-size: 14.5px; }

/* ---------- product card ---------- */
.cards { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { position: relative; display: flex; flex-direction: column; border-radius: var(--r); border: 1px solid var(--line); background: #fff; overflow: hidden;
  transition: border-color .25s, box-shadow .3s var(--ease); }
.card:hover { border-color: #bfd9c8; box-shadow: var(--shadow-lg); }
.card-media { aspect-ratio: 1; background: #fff; display: grid; place-items: center; overflow: hidden; border-bottom: 1px solid var(--line); position: relative; }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 8px; transition: transform .8s var(--ease); }
.card:hover .card-media img { transform: scale(1.05); }
.card-media .art { width: 40%; color: #b9cbbf; stroke-width: 1.3; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-size: 14.5px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { font-size: 12.5px; color: var(--muted); }
.card-foot { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; padding-top: 4px; }
.card-price { font-weight: 700; font-size: 16.5px; letter-spacing: -.01em; line-height: 1.15; }
.card-price small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); letter-spacing: 0; }
.card-price.none { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.card-add { width: 42px; height: 42px; flex: none; border-radius: 12px; display: grid; place-items: center; background: var(--green-soft); color: var(--green-dd); transition: background .2s, color .2s, transform .15s; }
.card-add:hover { background: var(--green); color: #fff; }
.card-add:active { transform: scale(.94); }
.card-add .i { width: 22px; height: 22px; }
.card-flag { position: absolute; top: 8px; left: 8px; z-index: 1; }

/* ---------- product page ---------- */
.pp { display: grid; gap: 22px; grid-template-columns: minmax(0, 1fr); }
.pp > * { min-width: 0; }
@media (min-width: 900px) { .pp { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; align-items: start; } }
.gallery { position: relative; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; border-radius: var(--r); border: 1px solid var(--line); background: #fff; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; aspect-ratio: 1; scroll-snap-align: center; display: grid; place-items: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; padding: 14px; }
.gallery-slide .art { width: 34%; color: #b9cbbf; stroke-width: 1.2; }
@media (max-width: 899px) { .gallery.nophoto .gallery-slide { aspect-ratio: 16 / 9; } .gallery.nophoto .art { width: 22%; } }
.gallery-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.gallery-dots button { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); transition: width .3s var(--ease), background .2s; }
.gallery-dots button[aria-current="true"] { width: 20px; border-radius: 4px; background: var(--green); }
.thumbs { display: none; }
@media (min-width: 900px) {
  .pp-media { position: sticky; top: 96px; }
  .thumbs { display: flex; gap: 8px; margin-top: 10px; }
  .thumbs button { width: 68px; height: 68px; border-radius: 10px; border: 1.5px solid var(--line); overflow: hidden; background: #fff; }
  .thumbs button[aria-current="true"] { border-color: var(--green); }
  .thumbs img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
  .gallery-dots { display: none; }
}
.pp-title { font-size: clamp(1.5rem, 3.2vw, 2.1rem); line-height: 1.15; letter-spacing: -.025em; font-weight: 700; margin: 0; }
.pp-cat { font-size: 14px; color: var(--green-d); font-weight: 500; }
.pp-block { border-top: 1px solid var(--line); padding-top: 18px; }
.pp-block h2 { font-size: 17px; margin: 0 0 12px; letter-spacing: -.01em; }
.sizes { display: grid; gap: 8px; }
.size { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line-2);
  background: #fff; text-align: left; transition: border-color .2s, background .2s; width: 100%; }
.size:hover { border-color: #a9cdb6; }
.size[aria-pressed="true"] { border-color: var(--green); background: var(--green-tint); box-shadow: inset 0 0 0 1px var(--green); }
.size-radio { width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; display: grid; place-items: center; }
.size[aria-pressed="true"] .size-radio { border-color: var(--green); }
.size[aria-pressed="true"] .size-radio::after { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--green); }
.size-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.size-label { font-weight: 600; font-size: 15px; }
.size-price { text-align: right; font-weight: 700; white-space: nowrap; }
.size-price small { display: block; font-size: 12px; font-weight: 500; color: var(--muted); }
.buy { display: grid; gap: 12px; }
.buy-row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.buy-total { font-size: 14px; color: var(--muted); }
.buy-total b { color: var(--ink); font-size: 18px; }
.stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 12px; height: 48px; background: #fff; }
.stepper button { width: 44px; height: 100%; display: grid; place-items: center; color: var(--ink-2); }
.stepper button:hover { color: var(--green-d); }
.stepper input { width: 64px; height: 100%; border: 0; text-align: center; font-weight: 600; font-size: 16px; background: transparent; -moz-appearance: textfield; }
.stepper input:focus { outline: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper .u { padding-right: 10px; font-size: 13px; color: var(--muted); margin-left: -6px; }
.stepper.sm { height: 40px; }
.stepper.sm button { width: 36px; }
.stepper.sm input { width: 52px; font-size: 15px; }
.specs { display: grid; margin: 0; }
.specs div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-2); font-size: 15px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 500; }
.desc { white-space: pre-line; color: var(--ink-2); font-size: 15.5px; line-height: 1.6; }

/* ---------- stars & reviews ---------- */
.stars { position: relative; display: inline-block; font-size: 16px; line-height: 1; letter-spacing: 1px; color: #d9e1db; vertical-align: -1px; }
.stars::before { content: '★★★★★'; }
.stars::after { content: '★★★★★'; position: absolute; left: 0; top: 0; width: calc(var(--r) / 5 * 100%); overflow: hidden; white-space: nowrap; color: #f2a516; }
.stars.lg { font-size: 22px; }
.card-rate { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--muted); }
.card-rate .stars { font-size: 13px; }
.rv-sum { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.rv-sum b { font-size: 24px; letter-spacing: -.02em; }
.rv-sum span { color: var(--muted); font-size: 14px; }
.rv-list { display: grid; gap: 0; }
.rv { padding: 14px 0; border-bottom: 1px dashed var(--line-2); display: grid; gap: 6px; }
.rv-h { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rv-h b { font-size: 15px; }
.rv-h time { color: var(--muted); font-size: 13px; margin-left: auto; }
.rv p { margin: 0; color: var(--ink-2); white-space: pre-line; overflow-wrap: anywhere; }
.rv-form { display: grid; gap: 12px; margin-top: 14px; padding: 16px; border-radius: var(--r); background: var(--bg-soft); border: 1px solid var(--line); }
.star-pick { display: flex; gap: 4px; }
.star-pick button { width: 44px; height: 44px; display: grid; place-items: center; color: #cfd8d2; border-radius: 10px; }
.star-pick button svg { width: 30px; height: 30px; fill: currentColor; stroke: none; }
.star-pick button.on { color: #f2a516; }
.rv-done { padding: 14px 16px; border-radius: 12px; background: var(--green-tint); border: 1px solid #cfe7d8; color: var(--green-dd); font-weight: 500; }

/* ---------- misc ---------- */
.empty { text-align: center; padding: 48px 20px; border: 1.5px dashed var(--line-2); border-radius: var(--r); background: var(--bg-soft); display: grid; gap: 10px; justify-items: center; }
.empty .art { width: 64px; color: var(--green); }
.empty h3 { margin: 4px 0 0; font-size: 18px; }
.empty p { margin: 0; color: var(--muted); max-width: 44ch; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line-2); background: #fff; font-size: 14px; font-weight: 500;
  display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; transition: border-color .2s, background .2s, color .2s; }
.chip:hover { border-color: var(--green); }
.chip[aria-current="true"], .chip[aria-pressed="true"] { background: var(--green); border-color: var(--green); color: #fff; }
.chip .n { font-size: 12px; opacity: .7; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px; background: var(--ink); color: #fff; padding: 13px 16px 13px 18px; border-radius: 14px; font-size: 15px; font-weight: 500;
  box-shadow: var(--shadow-lg); transition: transform .35s var(--ease), opacity .25s; max-width: calc(100vw - 32px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast-a { color: #8ee0ad; font-weight: 600; white-space: nowrap; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13.5px; color: var(--muted); }
.crumbs a:hover { color: var(--green-d); }
.crumbs .i { width: 14px; height: 14px; opacity: .6; }
.skeleton { background: linear-gradient(90deg, var(--bg-soft) 0%, #eaf0ec 50%, var(--bg-soft) 100%); background-size: 200% 100%; animation: sk 1.2s linear infinite; border-radius: var(--r); }
@keyframes sk { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
