:root {
  --bg: #faf9f6;
  --card: #ffffff;
  --ink: #161514;
  --ink-2: #5d5a55;
  --ink-3: #98948d;
  --line: #e7e3dc;
  --soft: #f1eee8;
  --accent: #c8553d;
  --accent-soft: #fbeee9;
  --wa: #1fae57;
  --wa-dark: #178a45;
  --ok: #3f7d4e;
  --radius: 14px;
  --shadow: 0 8px 28px rgba(22, 21, 20, 0.1);
  --display: 'Instrument Serif', Georgia, serif;
  --body: 'Inter', system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.55 var(--body); }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; letter-spacing: 0.01em; margin: 0; line-height: 1.15; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid var(--ink); background: var(--ink); color: #fff; font-weight: 500; text-decoration: none; transition: transform .15s, background .15s, opacity .15s; white-space: nowrap; }
.btn:hover { background: #000; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.wa { background: var(--wa); border-color: var(--wa); }
.btn.wa:hover { background: var(--wa-dark); }
.btn.danger { background: transparent; color: var(--accent); border-color: var(--line); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }

.field { display: flex; flex-direction: column; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 500; color: var(--ink-2); }
.field em { color: var(--accent); font-style: normal; }
.input, .field input, .field select, .field textarea { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; }
.field textarea { min-height: 88px; resize: vertical; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,21,20,.08); }
.hint { font-size: 12.5px; color: var(--ink-3); }

.check { display: flex; align-items: center; gap: 10px; min-height: 34px; cursor: pointer; font-size: 14px; }
.check input { appearance: none; flex: none; width: 20px; height: 20px; margin: 0; border: 1.5px solid #c9c4bb; border-radius: 6px; background: #fff; display: grid; place-items: center; transition: .12s; }
.check input:checked { background: var(--ink); border-color: var(--ink); }
.check input:checked::after { content: ''; width: 10px; height: 6px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.check .n { margin-left: auto; color: var(--ink-3); font-size: 12px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; }
.chip span { display: inline-flex; align-items: center; min-height: 38px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: #fff; font-size: 14px; cursor: pointer; transition: .12s; }
.chip input:checked + span { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip input:focus-visible + span { box-shadow: 0 0 0 3px rgba(22,21,20,.15); }

/* ---------- header ---------- */
.top { position: sticky; top: 0; z-index: 30; background: rgba(250,249,246,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-in { max-width: 1360px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; gap: 14px; }
.brand { font-family: var(--display); font-size: 24px; text-decoration: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search { flex: 1; max-width: 460px; margin-left: auto; position: relative; }
.search input { width: 100%; min-height: 42px; border-radius: 999px; border: 1px solid var(--line); padding: 0 16px 0 40px; background: #fff; outline: none; }
.search input:focus { border-color: var(--ink); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--ink-3); }
.cart-btn { position: relative; }
.badge { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 12px; font-weight: 600; display: inline-grid; place-items: center; }

/* ---------- catalogue layout ---------- */
.hero { max-width: 1360px; margin: 0 auto; padding: 28px 20px 8px; }
.hero h1 { font-size: clamp(30px, 4.5vw, 46px); }
.hero p { margin: 8px 0 0; color: var(--ink-2); max-width: 640px; }
.banner { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: var(--accent-soft); color: #7c3222; font-size: 14px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.banner a { font-weight: 500; }

.shell { max-width: 1360px; margin: 0 auto; padding: 16px 20px 120px; display: grid; grid-template-columns: 250px 1fr; gap: 32px; align-items: start; }
.filters { position: sticky; top: 78px; max-height: calc(100vh - 96px); overflow-y: auto; padding-right: 6px; }
.fgroup { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fgroup:first-of-type { padding-top: 0; }
.fgroup h3 { font: 600 12px/1 var(--body); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.range { display: flex; align-items: center; gap: 8px; }
.range input { min-height: 38px; width: 100%; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.filters-head { display: none; }

.toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.count { color: var(--ink-2); font-size: 14px; margin-right: auto; }
.toolbar select { min-height: 38px; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; background: #fff; }
.active { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--soft); font-size: 13px; border: 0; }
.tag:hover { background: var(--line); }
.open-filters { display: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.card { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, transform .2s, border-color .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card.sel { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ph { position: relative; aspect-ratio: 3 / 4; background: var(--soft); cursor: zoom-in; overflow: hidden; }
.ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .3s; }
.ph img.alt { opacity: 0; }
.card:hover .ph img.alt { opacity: 1; }
.pill { position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: rgba(255,255,255,.92); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.vid { position: absolute; left: 10px; bottom: 10px; display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; background: rgba(22,21,20,.72); color: #fff; font-size: 11.5px; }
.pick { position: absolute; right: 10px; top: 10px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.95); display: grid; place-items: center; box-shadow: 0 2px 8px rgba(0,0,0,.15); transition: .15s; }
.pick:hover { transform: scale(1.06); }
.card.sel .pick { background: var(--ink); color: #fff; }
.meta { padding: 12px 14px 14px; }
.meta .nm { display: flex; align-items: baseline; gap: 8px; }
.meta h2 { font-size: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta .code { margin-left: auto; font: 500 11.5px/1 ui-monospace, Menlo, monospace; color: var(--ink-3); }
.facts { margin-top: 4px; color: var(--ink-2); font-size: 13.5px; }
.langs { margin-top: 2px; color: var(--ink-3); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta .btn { margin-top: 10px; }

.empty { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--ink-2); }
.empty h2 { font-size: 28px; margin-bottom: 6px; color: var(--ink); }
.skel { aspect-ratio: 3 / 5; border-radius: var(--radius); background: linear-gradient(100deg, var(--soft) 30%, #f8f6f1 50%, var(--soft) 70%); background-size: 300% 100%; animation: sh 1.4s infinite linear; }
@keyframes sh { to { background-position: -150% 0; } }

/* ---------- overlays ---------- */
.scrim { position: fixed; inset: 0; z-index: 40; background: rgba(22,21,20,.5); opacity: 0; pointer-events: none; transition: opacity .25s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100vw); background: var(--bg); display: flex; flex-direction: column; transform: translateX(102%); transition: transform .3s cubic-bezier(.25,.1,.25,1); box-shadow: var(--shadow); }
.drawer.on { transform: none; }
.d-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.d-head h2 { font-size: 26px; margin-right: auto; }
.x { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; font-size: 22px; line-height: 1; }
.x:hover { background: var(--soft); }
.d-body { flex: 1; overflow-y: auto; padding: 16px 20px; }
.d-foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: #fff; display: grid; gap: 8px; }
.line { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line img { width: 56px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--soft); }
.line b { font-weight: 600; }
.line small { display: block; color: var(--ink-2); }
.line input { margin-top: 6px; width: 100%; min-height: 34px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; background: #fff; }
.form-grid { display: grid; gap: 12px; margin-top: 18px; }
.form-grid h3 { font-size: 22px; }

.modal { position: fixed; z-index: 60; inset: 0; display: grid; place-items: center; padding: 20px; pointer-events: none; opacity: 0; transition: opacity .2s; }
.modal.on { opacity: 1; pointer-events: auto; }
.sheet { position: relative; width: min(980px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--bg); border-radius: 18px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.sheet > .x { position: absolute; right: 10px; top: 10px; z-index: 2; background: rgba(255,255,255,.9); }
.gal { background: #111; position: relative; }
.gal .big { aspect-ratio: 3 / 4; width: 100%; object-fit: contain; background: #111; }
.gal video.big { object-fit: contain; }
.thumbs { display: flex; gap: 6px; padding: 8px; overflow-x: auto; background: #111; }
.thumbs button { flex: none; width: 58px; height: 74px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; background: #222; color: #fff; font-size: 11px; }
.thumbs button.on { border-color: #fff; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.nav { position: absolute; top: 40%; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.85); font-size: 18px; }
.nav.l { left: 10px; } .nav.r { right: 10px; }
.info { padding: 28px 26px; }
.info h2 { font-size: 38px; }
.info .code { font: 500 12px/1 ui-monospace, Menlo, monospace; color: var(--ink-3); }
.dl { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; margin: 18px 0; font-size: 14.5px; }
.dl dt { color: var(--ink-3); } .dl dd { margin: 0; }
.bio { color: var(--ink-2); white-space: pre-line; margin-bottom: 20px; }

.bar { position: fixed; z-index: 35; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translate(-50%, 140%); transition: transform .3s cubic-bezier(.25,.1,.25,1); display: flex; align-items: center; gap: 14px; padding: 8px 8px 8px 18px; border-radius: 999px; background: var(--ink); color: #fff; box-shadow: var(--shadow); width: max-content; max-width: calc(100vw - 24px); }
.bar.on { transform: translate(-50%, 0); }
.bar .faces { display: flex; }
.bar .faces img { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--ink); margin-left: -8px; }
.bar .faces img:first-child { margin-left: 0; }
.bar .btn { background: #fff; color: var(--ink); border-color: #fff; min-height: 40px; }

.toast { position: fixed; z-index: 80; top: 16px; right: 16px; padding: 12px 16px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 14px; box-shadow: var(--shadow); transform: translateY(-160%); transition: transform .3s; max-width: calc(100vw - 32px); }
.toast.on { transform: none; }

/* ---------- apply page ---------- */
.narrow { max-width: 760px; margin: 0 auto; padding: 28px 20px 80px; }
.narrow h1 { font-size: clamp(32px, 6vw, 46px); }
.lead { color: var(--ink-2); margin: 10px 0 0; }
.tips { margin: 18px 0 0; padding: 14px 16px 14px 34px; border-radius: 12px; background: var(--accent-soft); color: #6d2c1e; font-size: 14px; }
.tips li { margin: 2px 0; }
.panel { margin-top: 22px; padding: 22px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.panel h2 { font-size: 26px; margin-bottom: 14px; }
.panel h2 small { font: 400 13px var(--body); color: var(--ink-3); margin-left: 6px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.stack { display: grid; gap: 14px; }
.drop { display: grid; place-items: center; text-align: center; gap: 4px; padding: 26px 16px; border: 1.5px dashed #cfc9be; border-radius: 12px; background: var(--bg); cursor: pointer; transition: .15s; }
.drop:hover, .drop.over { border-color: var(--ink); background: var(--soft); }
.drop b { font-weight: 600; }
.previews { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 10px; margin-top: 12px; }
.pv { position: relative; aspect-ratio: 3 / 4; border-radius: 10px; overflow: hidden; background: var(--soft); }
.pv img { width: 100%; height: 100%; object-fit: cover; }
.pv button { position: absolute; right: 5px; top: 5px; width: 26px; height: 26px; border-radius: 50%; border: 0; background: rgba(22,21,20,.75); color: #fff; line-height: 1; }
.pv .main { position: absolute; left: 5px; bottom: 5px; padding: 2px 7px; border-radius: 999px; background: #fff; font-size: 10.5px; font-weight: 600; }
.progress { height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; margin-top: 12px; }
.progress i { display: block; height: 100%; width: 0; background: var(--ink); transition: width .2s; }
.err { margin-top: 14px; padding: 10px 14px; border-radius: 10px; background: #fdecea; color: #8c2a1c; font-size: 14px; }
.done { text-align: center; padding: 60px 20px; }
.done .tick { width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 18px; background: var(--ok); color: #fff; display: grid; place-items: center; font-size: 34px; }

/* ---------- admin ---------- */
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 18px 0; }
.tabs button { border: 0; background: none; padding: 10px 14px; border-bottom: 2px solid transparent; color: var(--ink-2); white-space: nowrap; }
.tabs button.on { color: var(--ink); border-color: var(--ink); font-weight: 500; }
.wide { max-width: 1200px; margin: 0 auto; padding: 24px 20px 120px; }
.row { display: grid; grid-template-columns: 24px 64px 1fr auto; gap: 14px; align-items: center; padding: 12px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; }
.row img { width: 64px; height: 82px; object-fit: cover; border-radius: 8px; background: var(--soft); cursor: pointer; }
.row .acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.row small { color: var(--ink-2); display: block; }
.st { display: inline-block; padding: 1px 8px; border-radius: 99px; font-size: 11.5px; font-weight: 600; background: var(--soft); }
.st.pending { background: #fdf1d8; color: #7a5a10; } .st.approved { background: #e2f1e5; color: #285c35; }
.stripe { display: flex; gap: 6px; overflow-x: auto; margin: 10px 0; }
.stripe img { height: 150px; border-radius: 8px; }
.mini { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 8px; }
.mini code { font-size: 13px; background: var(--soft); padding: 2px 6px; border-radius: 6px; word-break: break-all; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; padding-top: 10px; }
  .filters { position: fixed; z-index: 50; left: 0; right: 0; bottom: 0; top: auto; max-height: 86vh; padding: 0 20px 90px; background: var(--bg); border-radius: 20px 20px 0 0; transform: translateY(102%); transition: transform .3s cubic-bezier(.25,.1,.25,1); box-shadow: var(--shadow); }
  .filters.on { transform: none; }
  .filters-head { display: flex; align-items: center; position: sticky; top: 0; background: var(--bg); padding: 14px 0 10px; z-index: 1; }
  .filters-head h2 { font-size: 26px; margin-right: auto; }
  .btn.block.filters-apply { position: fixed; width: auto; left: 20px; right: 20px; bottom: calc(14px + env(safe-area-inset-bottom)); }
  .open-filters { display: inline-flex; }
  .sheet { grid-template-columns: 1fr; }
  .info { padding: 20px; }
  .info h2 { font-size: 32px; }
}
@media (min-width: 901px) { .filters-apply { display: none; } }
@media (max-width: 600px) {
  .top-in { flex-wrap: wrap; padding: 10px 16px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .brand { flex: 1; font-size: 21px; }
  .hero, .shell { padding-left: 16px; padding-right: 16px; }
  .grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .meta { padding: 10px; }
  .meta h2 { font-size: 19px; }
  .two { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .modal { padding: 0; align-items: end; }
  .sheet { max-height: 94vh; border-radius: 18px 18px 0 0; }
  .row { grid-template-columns: 24px 56px 1fr; }
  .row .acts { grid-column: 1 / -1; justify-content: flex-start; }
}
