/* Барахолка — рынок 90-х */
:root {
  --ink: #1A1714; --paper: #F2ECDD; --paper2: #E6DCC5; --card: #FFFDF6;
  --kraft: #C9A26B; --kraft-dark: #8B6A3E; --red: #B3261E; --blue: #1F4FA3; --yellow: #FFD43B;
  --green: #2F6B3A; --board: #23302A; --muted: #5A4E3F; --line: #5C544A;
  --display: 'Rubik Mono One', 'Rubik', system-ui, sans-serif;
  --body: 'Rubik', system-ui, sans-serif;
  --hand: 'Caveat', cursive;
  --mono: 'PT Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.45; }
a { color: var(--ink); }
a:hover { color: var(--red); }
img { max-width: 100%; display: block; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { max-width: 1280px; margin: 0 auto; padding: 0 24px; }
.kraft { background-color: var(--kraft); background-image: repeating-linear-gradient(90deg, rgba(26,23,20,.06) 0 2px, transparent 2px 7px); }
.plaid { height: 44px; border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); background-color: var(--paper);
  background-image: repeating-linear-gradient(90deg, rgba(179,38,30,.9) 0 18px, transparent 18px 36px, rgba(31,79,163,.9) 36px 44px, transparent 44px 72px),
                    repeating-linear-gradient(0deg, rgba(179,38,30,.55) 0 18px, transparent 18px 36px, rgba(31,79,163,.55) 36px 44px, transparent 44px 72px); }
.mono { font-family: var(--mono); }
.hand { font-family: var(--hand); }
.display { font-family: var(--display); font-weight: 400; }
h1, h2, h3 { margin: 0; }
.h2 { font-family: var(--display); font-weight: 400; font-size: clamp(26px, 3.4vw, 36px); }

/* Шапка */
.strip { background: var(--blue); color: #fff; font-family: var(--mono); font-size: 13px; padding: 8px 24px; display: flex; flex-wrap: wrap; gap: 6px 28px; justify-content: center; }
.top { background: var(--ink); color: var(--paper); }
.top-row { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; padding-top: 18px; padding-bottom: 18px; }
.logo { text-decoration: none; color: var(--paper); display: flex; align-items: baseline; gap: 4px; }
.logo b { font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--yellow); letter-spacing: .02em; }
.logo span { font-family: var(--mono); font-size: 14px; }
.logo:hover { color: var(--paper); }
.search { flex: 1 1 320px; display: flex; min-width: 0; }
.search input { flex: 1; min-width: 0; height: 50px; padding: 0 16px; border: 2px solid var(--paper); border-right: 0; background: var(--paper); color: var(--ink); font-family: var(--mono); font-size: 15px; border-radius: 0; }
.search button { height: 50px; padding: 0 20px; background: var(--yellow); color: var(--ink); border: 2px solid var(--paper); font-family: var(--body); font-weight: 700; font-size: 15px; cursor: pointer; }
.langs { display: flex; gap: 4px; }
.langs a { min-width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 2px solid var(--line); color: var(--paper); text-decoration: none; font-family: var(--mono); font-size: 14px; }
.langs a[aria-current="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--ink); font-weight: 700; }
.cartlink { display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 16px; border: 2px solid var(--paper); color: var(--paper); text-decoration: none; font-weight: 500; }
.cartlink:hover { color: var(--yellow); border-color: var(--yellow); }
.rownav { border-bottom: 3px solid var(--ink); }
.rownav .wrap { display: flex; flex-wrap: wrap; gap: 0 4px; }
.rownav a { padding: 14px; font-weight: 700; text-decoration: none; font-size: 15px; }
.rownav a[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; }

/* Кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; padding: 0 28px; font-family: var(--body); font-weight: 700; font-size: 18px; text-decoration: none; border: 3px solid var(--ink); cursor: pointer; }
.btn-red { background: var(--red); color: #fff; box-shadow: 5px 5px 0 var(--ink); }
.btn-red:hover { color: #fff; transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--ink); }
.btn-ghost { background: var(--paper); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--yellow); border-color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Главная */
.hero { display: flex; flex-wrap: wrap; gap: 48px; align-items: center; padding-top: 64px; padding-bottom: 72px; }
.hero-text { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.badge { align-self: flex-start; font-family: var(--mono); font-size: 13px; letter-spacing: .1em; text-transform: uppercase; border: 2px solid var(--ink); padding: 6px 10px; transform: rotate(-1.5deg); }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(40px, 6vw, 76px); line-height: 1.02; }
.hero p { margin: 0; font-size: 20px; line-height: 1.5; max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 6px; }
.stall { flex: 1 1 440px; min-width: 0; position: relative; min-height: 420px; }
.sign { position: absolute; inset: 20px 30px 40px 10px; border: 3px solid var(--ink); transform: rotate(-2deg); box-shadow: 8px 8px 0 var(--ink); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; padding: 32px; text-align: center; }
.sign b { font-family: var(--hand); font-size: clamp(44px, 6vw, 64px); line-height: .95; }
.sign i { font-family: var(--hand); font-style: normal; font-weight: 600; font-size: 34px; }
.sign span { margin-top: 14px; font-family: var(--mono); font-size: 15px; background: var(--paper); border: 2px dashed var(--ink); padding: 8px 14px; }
.tape { position: absolute; top: 0; left: 46%; width: 120px; height: 34px; background: rgba(255,212,59,.75); transform: rotate(6deg); }
.sticker { position: absolute; border: 3px solid var(--ink); font-family: var(--hand); font-weight: 700; padding: 6px 16px; }
.sticker.price { right: 0; top: 70px; transform: rotate(8deg); background: var(--yellow); font-size: 40px; }
.sticker.note { left: 0; bottom: 0; transform: rotate(-6deg); background: #fff; font-size: 28px; color: var(--red); }
.section { padding-top: 72px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 32px; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 12px; }
.section-head .hand { font-size: 28px; font-weight: 600; }
.band { background: var(--paper2); border-top: 3px solid var(--ink); border-bottom: 3px solid var(--ink); }
.rows-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 22px; }
.rowcard { display: flex; gap: 18px; align-items: flex-start; padding: 22px; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); text-decoration: none; color: var(--ink); transition: transform .12s; }
.rowcard:hover { transform: translate(-2px,-2px); color: var(--ink); }
.rowcard .num { flex: none; width: 58px; height: 58px; border-radius: 50%; border: 3px solid var(--ink); background: var(--paper); display: flex; align-items: center; justify-content: center; font-family: var(--display); font-size: 20px; transform: rotate(-8deg); }
.rowcard b { display: block; font-size: 22px; }
.rowcard span span { font-size: 15px; }
.steps { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; }
.step { background: var(--card); border: 2px solid var(--ink); padding: 26px; display: flex; flex-direction: column; gap: 10px; font-family: var(--mono); }
.step .n { font-family: var(--display); font-size: 44px; color: var(--red); }
.step b { font-family: var(--body); font-size: 21px; }
.step span { font-size: 15px; line-height: 1.55; }
.board { background: var(--board); color: var(--paper); border: 10px solid var(--kraft-dark); padding: 40px clamp(20px, 4vw, 56px); display: flex; flex-wrap: wrap; gap: 28px 64px; }
.board h2 { flex: 1 1 260px; font-family: var(--hand); font-weight: 700; font-size: 56px; line-height: 1; }
.board ol { flex: 2 1 420px; margin: 0; padding-left: 28px; font-family: var(--hand); font-size: 30px; line-height: 1.35; }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 26px; }
.card { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; background: var(--card); border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); transition: transform .12s; }
.card:hover { transform: translate(-2px,-2px); color: var(--ink); }
.card .pic { aspect-ratio: 4 / 3; position: relative; border-bottom: 3px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .pic img { width: 100%; height: 100%; object-fit: cover; }
.nopic { font-family: var(--mono); font-size: 13px; background: var(--paper); padding: 4px 8px; border: 1px dashed var(--ink); }
.tag { position: absolute; top: 12px; right: 12px; transform: rotate(5deg); background: var(--yellow); font-family: var(--hand); font-weight: 700; font-size: 32px; line-height: 1; padding: 6px 12px; border: 2px solid var(--ink); }
.cond { position: absolute; left: 10px; bottom: 10px; font-family: var(--mono); font-size: 12px; background: var(--ink); color: var(--paper); padding: 3px 8px; }
.held { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(26,23,20,.55); }
.held span { background: var(--paper); border: 2px solid var(--ink); font-family: var(--mono); font-size: 14px; padding: 6px 10px; transform: rotate(-4deg); }
.card .info { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; }
.card .row { font-family: var(--mono); font-size: 12px; letter-spacing: .06em; text-transform: uppercase; }
.card .name { font-weight: 700; font-size: 18px; line-height: 1.25; }
.card .note { font-family: var(--hand); font-size: 23px; line-height: 1.1; color: var(--red); }
.empty { font-family: var(--hand); font-size: 30px; padding: 40px 0; }

/* Каталог */
.crumbs { font-family: var(--mono); font-size: 14px; display: flex; gap: 8px; flex-wrap: wrap; padding-top: 28px; }
.cat-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; padding-top: 14px; }
.cat-head h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 4vw, 46px); }
.sortbox { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 14px; }
select, input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], textarea {
  height: 46px; padding: 0 12px; border: 2px solid var(--ink); background: #fff; color: var(--ink); font-family: var(--mono); font-size: 15px; border-radius: 0; width: 100%; }
textarea { height: auto; min-height: 110px; padding: 10px 12px; line-height: 1.5; }
.sortbox select { width: auto; }
.cat { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; padding-top: 28px; padding-bottom: 80px; }
.filters { flex: 1 1 250px; max-width: 100%; border: 3px solid var(--ink); box-shadow: 5px 5px 0 var(--ink); padding: 22px; display: flex; flex-direction: column; gap: 22px; }
.filters .title { font-family: var(--hand); font-weight: 700; font-size: 34px; line-height: 1; }
fieldset { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
legend { font-weight: 700; font-size: 16px; margin-bottom: 8px; }
.check { display: flex; gap: 10px; align-items: center; min-height: 32px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--red); }
.range { display: flex; gap: 8px; align-items: center; }
.range input { height: 42px; }
.lockerbox { font-weight: 700; background: var(--paper); border: 2px dashed var(--ink); padding: 12px; }
.results { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.more { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }

/* Товар */
.product { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; padding-top: 28px; padding-bottom: 64px; }
.gallery { flex: 1 1 520px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.mainpic { aspect-ratio: 1 / 1; border: 3px solid var(--ink); box-shadow: 6px 6px 0 var(--ink); display: flex; align-items: center; justify-content: center; position: relative; overflow: hidden; }
.mainpic img { width: 100%; height: 100%; object-fit: contain; background: var(--paper); }
.one { position: absolute; top: 18px; left: 18px; transform: rotate(-4deg); background: var(--ink); color: var(--yellow); font-family: var(--mono); font-size: 13px; padding: 6px 10px; letter-spacing: .06em; }
.thumbs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.thumbs button { aspect-ratio: 1 / 1; border: 2px solid var(--ink); padding: 0; cursor: pointer; overflow: hidden; background: var(--paper); }
.thumbs button[aria-current="true"] { border: 3px solid var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.pinfo { flex: 1 1 460px; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.pinfo h1 { font-size: clamp(30px, 3.4vw, 42px); line-height: 1.1; }
.pricerow { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 24px; }
.bigtag { transform: rotate(-3deg); background: var(--yellow); border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); font-family: var(--hand); font-weight: 700; font-size: 56px; line-height: 1; padding: 8px 22px; }
.pricerow .hand { font-size: 28px; color: var(--red); line-height: 1.1; }
.box { background: var(--card); border: 2px solid var(--ink); padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.box > b { font-size: 18px; }
.checkline { display: flex; gap: 12px; align-items: flex-start; font-family: var(--mono); font-size: 15px; line-height: 1.45; }
.checkline svg { flex: none; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; }
.actions form { flex: 1 1 240px; display: flex; }
.actions form .btn { flex: 1; }
.notice { font-family: var(--mono); font-size: 15px; background: var(--paper2); border: 2px dashed var(--ink); padding: 14px 16px; }
.shiprow { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--ink); padding: 6px 0; }
.shiprow:last-child { border-bottom: 0; }
.desc { display: flex; flex-wrap: wrap; gap: 32px; padding-bottom: 72px; }
.desc > div { flex: 2 1 480px; display: flex; flex-direction: column; gap: 14px; font-size: 17px; line-height: 1.6; white-space: pre-line; }

/* Корзина и оформление */
.page { padding-top: 36px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.cartlist { display: flex; flex-direction: column; gap: 14px; }
.cartitem { display: flex; gap: 16px; align-items: center; background: var(--card); border: 2px solid var(--ink); padding: 12px; }
.cartitem .thumb { width: 88px; height: 88px; flex: none; border: 2px solid var(--ink); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.cartitem .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cartitem .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cartitem .price { font-family: var(--hand); font-weight: 700; font-size: 30px; }
.linkbtn { background: none; border: 0; padding: 10px; min-height: 44px; font-family: var(--mono); font-size: 14px; text-decoration: underline; cursor: pointer; color: var(--ink); }
.cartfoot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; }
.cartfoot .sum { font-family: var(--mono); font-size: 20px; font-weight: 700; }
.error { background: var(--red); color: #fff; padding: 14px 18px; border: 3px solid var(--ink); font-weight: 500; }
.ok { background: var(--yellow); padding: 14px 18px; border: 3px solid var(--ink); font-weight: 500; }
.co { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-top: 36px; padding-bottom: 80px; }
.co form.main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 32px; }
.co h1 { font-family: var(--display); font-weight: 400; font-size: clamp(28px, 3.6vw, 40px); }
.panel { border: 3px solid var(--ink); background: var(--card); margin: 0; padding: 22px 24px 26px; display: flex; flex-direction: column; gap: 16px; }
.panel legend { font-size: 18px; padding: 0 8px; background: var(--paper); }
.fields { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.carriers { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.carrier { position: relative; display: flex; flex-direction: column; gap: 6px; min-height: 92px; padding: 14px 16px; border: 2px solid var(--ink); background: #fff; cursor: pointer; }
.carrier input { position: absolute; opacity: 0; pointer-events: none; }
.carrier:has(input:checked) { background: var(--yellow); border-width: 3px; box-shadow: 4px 4px 0 var(--ink); }
.carrier:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.carrier .top2 { display: flex; justify-content: space-between; gap: 8px; }
.carrier b { font-size: 17px; }
.carrier small { font-size: 14px; }
.receipt-wrap { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; position: sticky; top: 16px; }
.receipt { background: var(--card); border: 2px solid var(--ink); border-bottom: 0; padding: 26px 24px 18px; font-family: var(--mono); font-size: 15px; display: flex; flex-direction: column; gap: 12px; }
.receipt .c { text-align: center; }
.receipt hr { border: 0; border-top: 2px dashed var(--ink); margin: 0; width: 100%; }
.receipt .l { display: flex; justify-content: space-between; gap: 12px; }
.receipt .tot { font-weight: 700; font-size: 20px; border-top: 2px solid var(--ink); padding-top: 10px; }
.zig { height: 14px; background: linear-gradient(-45deg, transparent 7px, var(--card) 0) 0 0 / 14px 14px repeat-x, linear-gradient(45deg, transparent 7px, var(--card) 0) 0 0 / 14px 14px repeat-x; }
.paybtn { margin-top: 22px; min-height: 64px; font-size: 19px; width: 100%; }
.heldnote { margin-top: 16px; font-family: var(--hand); font-size: 26px; text-align: center; transform: rotate(-2deg); }
.hide { display: none !important; }

/* Подвал */
.foot { background: var(--ink); color: var(--paper); font-family: var(--mono); font-size: 14px; }
.foot .wrap { padding-top: 48px; padding-bottom: 48px; display: flex; flex-wrap: wrap; gap: 32px 64px; justify-content: space-between; }
.foot .col { display: flex; flex-direction: column; gap: 10px; max-width: 360px; }
.foot b { color: var(--yellow); }
.foot a { color: var(--paper); }
.foot a:hover { color: var(--yellow); }
.foot .logo2 { font-family: var(--display); font-size: 22px; color: var(--yellow); }

/* Админка */
.admin { font-family: var(--body); }
.admin-bar { background: var(--ink); color: var(--paper); }
.admin-bar .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 22px; padding-top: 12px; padding-bottom: 12px; }
.admin-bar a, .admin-bar button { color: var(--paper); font-family: var(--mono); font-size: 14px; }
.admin-bar button { background: none; border: 0; text-decoration: underline; cursor: pointer; }
.atable { width: 100%; border-collapse: collapse; background: var(--card); border: 2px solid var(--ink); font-size: 15px; }
.atable th, .atable td { padding: 10px 12px; border-bottom: 1px solid #cfc4ad; text-align: left; vertical-align: middle; }
.atable th { font-family: var(--mono); font-size: 13px; text-transform: uppercase; background: var(--paper2); }
.atable img { width: 56px; height: 56px; object-fit: cover; border: 1px solid var(--ink); }
.scroll { overflow-x: auto; }
.pill { display: inline-block; font-family: var(--mono); font-size: 12px; padding: 2px 8px; border: 1px solid var(--ink); }
.pill.active, .pill.paid { background: var(--yellow); }
.pill.reserved, .pill.pending { background: var(--paper2); }
.pill.sold, .pill.shipped { background: var(--ink); color: var(--paper); }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a { font-family: var(--mono); font-size: 14px; padding: 8px 12px; border: 2px solid var(--ink); text-decoration: none; }
.tabs a[aria-current="true"] { background: var(--ink); color: var(--yellow); }
.aform { display: flex; flex-direction: column; gap: 22px; }
.langcols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.hint { font-family: var(--mono); font-size: 13px; color: var(--muted); font-weight: 400; }
.photos { display: flex; flex-wrap: wrap; gap: 12px; }
.photos figure { margin: 0; width: 130px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.photos img { width: 130px; height: 130px; object-fit: cover; border: 2px solid var(--ink); }

@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding-top: 36px; gap: 32px; }
  .stall { min-height: 340px; }
  .sticker.price { font-size: 32px; }
  .board h2 { font-size: 44px; }
  .board ol { font-size: 26px; }
  .receipt-wrap { position: static; }
}
