@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Manrope';
  font-style: normal;
  font-display: swap;
  font-weight: 200 800;
  src: url(/fonts/manrope-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --orange: #ff6b1a;
  --orange-600: #f05a0a;
  --orange-700: #c94a06;
  --orange-50: #fff5ee;
  --orange-100: #ffe7d6;
  --orange-200: #ffd0b0;

  --bg: #f7f7f8;
  --surface: #ffffff;
  --text: #17171c;
  --text-2: #4b4b57;
  --muted: #868694;
  --line: #ebebef;
  --line-2: #dedee4;

  --tg: #229ed9;
  --wa: #1fae55;
  --vk: #0077ff;
  --danger: #e03131;

  --r-sm: 10px;
  --r: 16px;
  --r-lg: 24px;
  --sh-1: 0 1px 2px rgba(23, 23, 28, .04), 0 1px 3px rgba(23, 23, 28, .06);
  --sh-2: 0 8px 24px rgba(23, 23, 28, .08);
  --sh-o: 0 8px 24px rgba(255, 107, 26, .28);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.55 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
h1, h2 { letter-spacing: -.02em; }
h1 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 8px; font-weight: 800; }
h2 { font-size: 1.25rem; line-height: 1.3; margin: 0; font-weight: 800; }
.ic { flex: none; display: block; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 20px; }
.main { padding-top: 24px; padding-bottom: 56px; min-height: 70vh; }
.muted { color: var(--muted); }
.center { text-align: center; }
code { background: var(--orange-50); color: var(--orange-700); padding: 2px 6px; border-radius: 6px; font-size: .9em; }

/* ---------- header ---------- */
.topbar { position: sticky; top: 0; z-index: 30; background: rgba(255, 255, 255, .92); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.topbar::before { content: ''; display: block; height: 3px; background: linear-gradient(90deg, #ff8a3d, var(--orange), #ff4d00); }
.topbar-inner { display: flex; align-items: center; gap: 24px; height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 10px; flex: none; box-shadow: var(--sh-o); }
.logo-word { font-weight: 800; font-size: 1.4rem; letter-spacing: -.03em; color: var(--text); white-space: nowrap; }
.logo-word b { font-weight: 800; color: var(--orange); }
.search { flex: 1; min-width: 0; max-width: 640px; display: flex; align-items: center; position: relative; background: var(--bg); border: 2px solid var(--orange); border-radius: 14px; padding: 3px; transition: box-shadow .15s; }
.search:focus-within { box-shadow: 0 0 0 4px var(--orange-100); background: #fff; }
.search-ic { position: absolute; left: 14px; color: var(--muted); }
.search input { flex: 1; min-width: 0; height: 40px; border: 0; background: transparent; padding: 0 12px 0 40px; font: inherit; color: var(--text); outline: none; }
.search input::-webkit-search-cancel-button { display: none; }
.search-btn { height: 40px; padding: 0 22px; border: 0; border-radius: 11px; background: var(--orange); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.search-btn:hover { background: var(--orange-600); }
.nav { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.nav-item { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--text-2); white-space: nowrap; }
.nav-item:hover { background: var(--bg); color: var(--text); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .1s, box-shadow .15s;
}
.btn:active { transform: translateY(1px); }
.btn-sm { height: 36px; padding: 0 12px; font-size: .9rem; border-radius: 10px; }
.btn-lg { height: 52px; padding: 0 26px; font-size: 1.02rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-primary { background: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(255, 107, 26, .3); }
.btn-primary:hover { background: var(--orange-600); }
.btn-outline { background: #fff; border-color: var(--line-2); color: var(--text); }
.btn-outline:hover { border-color: var(--orange); color: var(--orange-700); }
.btn-white { background: #fff; color: var(--orange-700); }
.btn-white:hover { background: var(--orange-50); }
.btn-ghost-white { background: rgba(255, 255, 255, .14); color: #fff; border-color: rgba(255, 255, 255, .5); }
.btn-ghost-white:hover { background: rgba(255, 255, 255, .24); }
.btn-text { background: none; color: var(--muted); padding: 0 10px; }
.btn-text:hover { color: var(--danger); }
.icon-btn { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text-2); cursor: pointer; text-decoration: none; }
.icon-btn:hover { border-color: var(--orange); color: var(--orange-700); background: var(--orange-50); }
.icon-danger:hover { border-color: var(--danger); color: var(--danger); background: #fff0f0; }

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden; display: flex; justify-content: space-between; align-items: flex-end; gap: 32px;
  padding: 48px; margin-bottom: 36px; border-radius: var(--r-lg); color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(255, 255, 255, .22) 0, transparent 40%),
    radial-gradient(circle at 10% 110%, rgba(255, 200, 150, .35) 0, transparent 45%),
    linear-gradient(120deg, #ff8a3d 0%, #ff6b1a 45%, #f04f00 100%);
}
.hero::after { content: ''; position: absolute; right: -60px; top: -60px; width: 260px; height: 260px; border-radius: 50%; border: 40px solid rgba(255, 255, 255, .1); }
.hero-text { max-width: 620px; position: relative; z-index: 1; }
.hero h1 { font-size: clamp(1.8rem, 3.6vw, 2.75rem); line-height: 1.1; margin-bottom: 14px; }
.hero p { margin: 0 0 26px; font-size: 1.08rem; opacity: .94; max-width: 540px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 12px; margin: 0; position: relative; z-index: 1; }
.hero-stats div { background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .25); border-radius: var(--r); padding: 14px 20px; min-width: 104px; backdrop-filter: blur(4px); }
.hero-stats dt { font-size: 1.7rem; font-weight: 800; line-height: 1.1; }
.hero-stats dd { margin: 2px 0 0; font-size: .85rem; opacity: .9; }

/* ---------- sections ---------- */
.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.chips-cat { margin-bottom: 10px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 18px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 16px; border-radius: 999px; background: #fff; border: 1px solid var(--line-2); text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--text-2); }
.chip small { font-size: .78rem; color: var(--muted); font-weight: 700; }
.chip:hover { border-color: var(--orange); color: var(--orange-700); }
.chip.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.chip.active small { color: rgba(255, 255, 255, .8); }

/* shop tiles */
.shops { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 300px); gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.shops::-webkit-scrollbar { display: none; }
.shop-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); text-decoration: none; box-shadow: var(--sh-1); transition: border-color .15s, box-shadow .15s; }
.shop-tile:hover { border-color: var(--orange-200); box-shadow: var(--sh-2); }
.shop-tile-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.shop-tile-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shop-tile-text small { color: var(--muted); }
.shop-tile .ic { color: var(--muted); }

/* ---------- product cards (photo first, marketplace style) ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 24px 16px; }
.card { display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }
.card-img { position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: 18px; display: grid; place-items: center; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s; }
.card:hover .card-img img { transform: scale(1.04); }
.noimg { color: var(--line-2); }
.card-badges { position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; pointer-events: none; }
.badge { display: inline-flex; align-items: center; gap: 4px; max-width: 100%; padding: 3px 9px; border-radius: 999px; font-size: .74rem; font-weight: 800; line-height: 1.3; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .01em; }
.badge-stall { background: var(--orange); }
.badge-opt { background: #16a34a; }
.badge-dark { background: rgba(23, 23, 28, .85); }
.card-body { padding: 10px 2px 0; display: flex; flex-direction: column; gap: 2px; }
.card-price { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; color: var(--orange-700); }
.card-price.is-request, .product-price.is-request { color: var(--orange-700); font-size: 1rem; }
.card-title { color: var(--text-2); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-city { display: inline-flex; align-items: center; gap: 4px; }
.card-city .ic { color: var(--orange); }

/* ---------- avatars ---------- */
.avatar { width: 40px; height: 40px; border-radius: 12px; object-fit: cover; flex: none; }
.avatar-xs { width: 28px; height: 28px; border-radius: 8px; font-size: .85rem; }
.avatar-md { width: 48px; height: 48px; border-radius: 14px; }
.avatar-lg { width: 80px; height: 80px; border-radius: 20px; font-size: 2rem; }
.avatar-xl { width: 112px; height: 112px; border-radius: 28px; font-size: 2.8rem; border: 5px solid #fff; box-shadow: var(--sh-2); }
.avatar-letter { display: grid; place-items: center; background: linear-gradient(135deg, var(--orange-100), var(--orange-200)); color: var(--orange-700); font-weight: 800; }
.avatar-md.avatar-letter { font-size: 1.2rem; }

/* ---------- breadcrumbs ---------- */
.crumbs { display: flex; align-items: center; gap: 6px; font-size: .88rem; color: var(--muted); margin-bottom: 16px; overflow: hidden; white-space: nowrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--orange-700); }
.crumbs span { overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }

/* ---------- product page ---------- */
.product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 1fr); gap: 32px; align-items: start; margin-bottom: 48px; }
/* Photos: thumbnails in a column on the left, the big photo 3:4 next to them. */
.gallery-media { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 12px; align-items: start; }
.gallery-main { grid-column: 2; grid-row: 1; }
.gallery-media:not(:has(.thumbs)) { grid-template-columns: minmax(0, 1fr); }
.gallery-media:not(:has(.thumbs)) .gallery-main { grid-column: 1; }
.gallery-main { position: relative; aspect-ratio: 3 / 4; background: #fff; border-radius: var(--r-lg); overflow: hidden; display: grid; place-items: center; box-shadow: var(--sh-1); }
.slides { position: absolute; inset: 0; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; }
.slides::-webkit-scrollbar { display: none; }
.slides { cursor: grab; user-select: none; -webkit-user-select: none; }
.slides.dragging { cursor: grabbing; }
.slides:has(.slide:only-child) { cursor: default; }
.slide { position: relative; flex: 0 0 100%; height: 100%; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; }
.slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.gnav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: var(--sh-2); cursor: pointer; opacity: 0; transition: opacity .15s; }
.gallery-main:hover .gnav { opacity: 1; }
.gnav:hover { color: var(--orange-700); }
.gnav-prev { left: 14px; }
.gnav-next { right: 14px; }
.dots { position: absolute; left: 0; right: 0; bottom: 14px; display: none; justify-content: center; gap: 6px; pointer-events: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: rgba(23, 23, 28, .25); transition: width .2s, background .2s; }
.dot.active { width: 20px; border-radius: 4px; background: var(--orange); }
.gallery-count { position: absolute; right: 14px; bottom: 14px; background: rgba(23, 23, 28, .7); color: #fff; font-size: .8rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.thumbs { grid-column: 1; grid-row: 1; display: flex; flex-direction: column; gap: 10px; align-self: stretch; height: 0; min-height: 100%; overflow-y: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: none; width: 76px; height: 101px; padding: 0; border: 2px solid transparent; border-radius: 12px; overflow: hidden; cursor: pointer; background: #fff; opacity: .7; transition: opacity .15s, border-color .15s; }
.thumb:hover { opacity: 1; }
.thumb.active { border-color: var(--orange); opacity: 1; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.desc-card { background: #fff; border-radius: var(--r-lg); padding: 24px; margin-top: 20px; box-shadow: var(--sh-1); }
.desc-card h2 { font-size: 1.1rem; margin-bottom: 10px; }
.desc { white-space: pre-line; color: var(--text-2); }
.product-side { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 14px; }
.side-card { background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 14px; }
.side-card h1 { font-size: 1.45rem; margin: 0; }
.product-price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.product-date { display: flex; align-items: center; gap: 6px; font-size: .85rem; color: var(--muted); }

/* contacts */
.contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.contact { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; text-decoration: none; transition: border-color .15s, background .15s; min-width: 0; }
.contact:hover { border-color: currentColor; }
.contact-ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex: none; color: #fff; }
.contact-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; color: var(--text); }
.contact-text small { color: var(--muted); font-size: .78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.c-phone { grid-column: 1 / -1; background: var(--orange); border-color: var(--orange); color: #fff; box-shadow: 0 4px 14px rgba(255, 107, 26, .3); }
.c-phone:hover { background: var(--orange-600); border-color: var(--orange-600); }
.c-phone .contact-ic { background: rgba(255, 255, 255, .2); }
.c-phone .contact-text, .c-phone .contact-text small { color: #fff; }
.c-tg { color: var(--tg); } .c-tg .contact-ic { background: var(--tg); }
.c-wa { color: var(--wa); } .c-wa .contact-ic { background: var(--wa); }
.c-vk { color: var(--vk); } .c-vk .contact-ic { background: var(--vk); }
.c-max { color: #5533ee; } .c-max .contact-ic { background: none; }
.c-max .contact-ic .ic-brand { width: 36px; height: 36px; border-radius: 10px; }
.buybar .ic-brand { border-radius: 5px; }

/* place */
.place { display: flex; flex-direction: column; gap: 12px; background: #fff; border-radius: var(--r); padding: 14px 16px; box-shadow: var(--sh-1); }
.place-row { display: flex; align-items: center; gap: 12px; }
.stalls { display: flex; gap: 10px; }
.stall { flex: 1; display: flex; flex-direction: column; padding: 10px 14px; border-radius: 12px; background: var(--orange-50); border: 1.5px dashed var(--orange-200); }
.stall small { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--orange-700); }
.stall strong { font-size: 1.5rem; font-weight: 800; letter-spacing: -.01em; line-height: 1.15; }
.card-photos { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; background: rgba(23, 23, 28, .65); color: #fff; font-weight: 700; font-size: .75rem; padding: 3px 8px; border-radius: 8px; }
.fact-stall { color: var(--orange-700); font-weight: 700; }
.mini-stall { font-weight: 800; color: var(--orange-700); background: var(--orange-50); padding: 1px 8px; border-radius: 6px; }
.place-ic { width: 42px; height: 42px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--orange-50); color: var(--orange); }
.place-body { flex: 1; min-width: 0; }
.place-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.place-text { font-weight: 700; line-height: 1.35; }
.place-map { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 8px 12px; border-radius: 10px; background: var(--orange-50); color: var(--orange-700); font-weight: 700; font-size: .88rem; text-decoration: none; }
.place-map:hover { background: var(--orange-100); }

/* seller card */
.seller-card { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: #fff; border-radius: var(--r); text-decoration: none; box-shadow: var(--sh-1); }
.seller-card:hover .seller-go { color: var(--orange-700); }
.seller-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.seller-text small { color: var(--muted); font-size: .78rem; }
.seller-go { display: inline-flex; align-items: center; gap: 2px; font-size: .88rem; font-weight: 700; color: var(--muted); }

/* sticky buy bar (mobile only) */
.buybar { display: none; }

/* ---------- shop page ---------- */
.shop-hero { background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-1); margin-bottom: 36px; }
.shop-cover { height: 150px; background:
    radial-gradient(circle at 80% 20%, rgba(255, 255, 255, .25) 0, transparent 40%),
    linear-gradient(120deg, #ff8a3d, #ff6b1a 50%, #f04f00); }
.shop-hero-body { display: flex; align-items: flex-start; gap: 20px; padding: 0 28px; margin-top: -48px; }
.shop-hero-info { flex: 1; min-width: 0; padding-top: 60px; }
.shop-hero-info h1 { margin: 0 0 6px; }
.shop-facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .9rem; }
.shop-facts span { display: inline-flex; align-items: center; gap: 6px; }
.shop-facts .ic { color: var(--orange); }
.shop-edit { margin-top: 60px; }
.bio { white-space: pre-line; color: var(--text-2); margin: 10px 0 0; max-width: 720px; }
.shop-hero-foot { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 16px; padding: 22px 28px 28px; align-items: start; }
.shop-hero-foot .place { box-shadow: none; border: 1px solid var(--line); }
.shop-hero-foot .contacts { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.shop-hero-foot .c-phone { grid-column: auto; }

/* ---------- alerts / empty ---------- */
.alert { padding: 14px 16px; border-radius: 14px; margin-bottom: 18px; font-weight: 600; }
.alert-error { background: #fff0f0; color: #b42318; border: 1px solid #ffd5d5; }
.alert-ok { background: var(--orange-50); color: var(--orange-700); border: 1px solid var(--orange-100); }
.alert-info { background: #fff8e6; color: #8a5a00; border: 1px solid #ffe8b0; }
.empty { text-align: center; padding: 56px 20px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); color: var(--text-2); }
.empty-ic { width: 64px; height: 64px; margin: 0 auto 14px; display: grid; place-items: center; border-radius: 20px; background: var(--orange-50); color: var(--orange); }
.empty p { margin: 0 0 18px; font-weight: 600; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; grid-template-columns: 1fr 1fr; max-width: 960px; margin: 8px auto; background: #fff; border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--sh-2); }
.auth-aside { padding: 44px; color: #fff; background:
    radial-gradient(circle at 90% 10%, rgba(255, 255, 255, .22) 0, transparent 40%),
    linear-gradient(150deg, #ff8a3d, #ff6b1a 50%, #e84a00); }
.auth-aside h2 { font-size: 1.7rem; margin-bottom: 24px; }
.auth-aside ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 16px; }
.auth-aside li { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.auth-aside li .ic { width: 36px; height: 36px; padding: 8px; border-radius: 10px; background: rgba(255, 255, 255, .18); }
.auth { padding: 40px 44px; }
.auth h1 { margin-bottom: 4px; }

/* ---------- forms ---------- */
.formpage { max-width: 760px; margin: 0 auto; }
.back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 12px; color: var(--muted); text-decoration: none; font-weight: 600; }
.back:hover { color: var(--orange-700); }
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 18px; }
.form-card { background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); display: flex; flex-direction: column; gap: 16px; }
.form-card h2 { font-size: 1.1rem; margin-bottom: -8px; }
.hint { margin: 0; color: var(--muted); font-size: .88rem; }
.form label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .92rem; }
.form label > .lbl .muted { font-weight: 500; }
/* Two fields side by side: inputs line up even if one label is longer. */
.form-row > label { justify-content: flex-end; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form input:not([type=checkbox]):not([type=file]), .form textarea {
  font: inherit; font-weight: 500; color: var(--text); background: var(--bg);
  border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; transition: border-color .15s, background .15s, box-shadow .15s;
}
.form input:hover, .form textarea:hover { border-color: var(--line-2); }
.form input:focus, .form textarea:focus { outline: none; background: #fff; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-100); }
.form textarea { resize: vertical; }
.input-suffix { position: relative; display: block; }
.input-suffix input { padding-right: 44px !important; font-size: 1.1rem !important; font-weight: 700 !important; }
.input-suffix span { position: absolute; right: 16px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 700; }
.drop { position: relative; display: flex !important; flex-direction: column; align-items: center; gap: 4px !important; border: 2px dashed var(--orange-200); background: var(--orange-50); border-radius: var(--r); padding: 28px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover { border-color: var(--orange); background: var(--orange-100); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-ic { color: var(--orange); }
.drop strong { color: var(--orange-700); }
.drop small { color: var(--muted); font-weight: 500; }
.drop-sm { flex-direction: row !important; padding: 14px 18px; flex: 1; justify-content: center; gap: 10px !important; }
.avatar-row { display: flex; align-items: center; gap: 16px; }
.edit-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.edit-imgs:empty { display: none; }
.edit-img { position: relative; display: flex; flex-direction: column; font-weight: 500; font-size: .85rem; }
.edit-img img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; display: block; }
.edit-img-cover { display: none; position: absolute; left: 6px; bottom: 6px; background: var(--orange); color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
#photoGrid .edit-img:first-child:not(.is-removed) .edit-img-cover { display: inline-block; }
.edit-img-new { position: absolute; right: 6px; top: 6px; background: #16a34a; color: #fff; font-size: .7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.add-tile { position: relative; aspect-ratio: 3 / 4; display: flex !important; flex-direction: column; align-items: center; justify-content: center; gap: 4px !important; padding: 10px; text-align: center; border: 2px dashed var(--orange-200); background: var(--orange-50); border-radius: 12px; cursor: pointer; transition: border-color .15s, background .15s; }
.add-tile:hover { border-color: var(--orange); background: var(--orange-100); }
.add-tile input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.add-tile-ic { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--orange); color: #fff; }
.add-tile strong { color: var(--orange-700); font-size: .85rem; }
.add-tile small { color: var(--muted); font-weight: 500; font-size: .72rem; line-height: 1.3; }
.img-menu-btn { position: absolute; right: 6px; top: 6px; width: 30px; height: 30px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--text); box-shadow: var(--sh-1); cursor: pointer; }
.img-menu-btn:hover { color: var(--orange-700); }
.img-menu { position: absolute; right: 6px; top: 40px; z-index: 5; min-width: 190px; display: flex; flex-direction: column; padding: 6px; background: #fff; border-radius: 12px; box-shadow: var(--sh-2); border: 1px solid var(--line); }
.img-menu[hidden] { display: none; }
.img-menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 10px; border: 0; border-radius: 8px; background: none; font: inherit; font-weight: 600; font-size: .88rem; color: var(--text); text-align: left; cursor: pointer; }
.img-menu button:hover { background: var(--bg); }
.img-menu .danger { color: var(--danger); }
.img-removed { display: none; position: absolute; inset: 0; border-radius: 12px; background: rgba(23, 23, 28, .7); color: #fff; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; font-weight: 700; padding: 8px; }
.img-removed button { border: 0; border-radius: 999px; background: #fff; color: var(--text); font: inherit; font-weight: 700; font-size: .8rem; padding: 5px 12px; cursor: pointer; }
.edit-img.is-removed .img-removed { display: flex; }
.edit-img.is-removed .img-menu-btn { display: none; }
.form-actions { display: flex; justify-content: flex-end; gap: 12px; position: sticky; bottom: 0; padding: 16px 0; background: linear-gradient(transparent, var(--bg) 30%); }
input[type=checkbox] { accent-color: var(--orange); width: 18px; height: 18px; margin: 0; }

/* toggle switch */
.switch { flex-direction: row !important; align-items: center; gap: 12px !important; background: #fff; padding: 16px 20px; border-radius: var(--r); box-shadow: var(--sh-1); cursor: pointer; position: relative; }
.switch input { position: absolute; opacity: 0; }
.switch-ui { width: 44px; height: 26px; flex: none; border-radius: 999px; background: var(--line-2); position: relative; transition: background .2s; }
.switch-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .2); transition: transform .2s; }
.switch input:checked + .switch-ui { background: var(--orange); }
.switch input:checked + .switch-ui::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-ui { box-shadow: 0 0 0 4px var(--orange-100); }
.switch small { font-weight: 500; }

/* ---------- dashboard ---------- */
.dash-head { display: flex; align-items: center; gap: 20px; background: #fff; border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-1); margin-bottom: 16px; }
.dash-info { flex: 1; min-width: 0; }
.eyebrow { font-size: .75rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--orange); }
.dash-info h1 { margin: 2px 0 10px; }
.share { display: flex; gap: 8px; max-width: 460px; }
.share input { flex: 1; min-width: 0; font: inherit; font-size: .88rem; padding: 7px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--text-2); }
.dash-actions { display: flex; flex-direction: column; gap: 8px; align-items: stretch; }
.dash-actions form { margin: 0; display: flex; }
.dash-actions .btn-text { width: 100%; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 32px; }
.stat { background: #fff; border-radius: var(--r); padding: 18px 20px; box-shadow: var(--sh-1); display: flex; flex-direction: column; }
.stat:first-child { background: linear-gradient(120deg, #ff8a3d, var(--orange-600)); color: #fff; }
.stat:first-child .stat-label { color: rgba(255, 255, 255, .85); }
.stat-num { font-size: 1.9rem; font-weight: 800; line-height: 1.1; }
.stat-label { color: var(--muted); font-weight: 600; font-size: .88rem; }
.dlist { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.drow { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drow:last-child { border-bottom: 0; }
.drow:hover { background: #fcfcfd; }
.drow.is-hidden .drow-img, .drow.is-hidden .drow-title { opacity: .5; }
.drow-img { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; background: var(--bg); flex: none; }
.drow-img img { width: 100%; height: 100%; object-fit: cover; }
.drow-main { flex: 1; min-width: 0; }
.drow-title { font-weight: 700; text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.drow-title:hover { color: var(--orange-700); }
.drow-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.drow-meta span { display: inline-flex; align-items: center; gap: 4px; }
.drow-meta .ic { color: var(--orange); }
.drow-price { color: var(--text); font-weight: 800; font-size: .95rem; }
.drow-actions { display: flex; gap: 6px; }
.drow-actions form { margin: 0; }
.badge { font-size: .74rem; padding: 3px 10px; border-radius: 999px; font-weight: 700; }
.badge-on { background: #e8f8ee; color: #137a3b; }
.badge-off { background: var(--bg); color: var(--muted); }
.pager { display: flex; justify-content: space-between; margin-top: 28px; }

/* ---------- footer ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); padding-top: 36px; }
.footer-inner { display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.footer-inner p { color: var(--muted); max-width: 380px; margin: 12px 0 0; font-size: .9rem; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a { text-decoration: none; color: var(--text-2); font-weight: 600; }
.footer-links a:hover { color: var(--orange-700); }
.footer-copy { color: var(--muted); font-size: .82rem; padding-top: 24px; padding-bottom: 28px; margin-top: 24px; border-top: 1px solid var(--line); }

/* ---------- responsive ---------- */
@media (max-width: 1000px) {
  /* Tablets / narrow windows: keep photo and info side by side, just tighter. */
  .product { grid-template-columns: minmax(0, 1fr) minmax(280px, 1fr); gap: 20px; }
  .product-side { top: 84px; }
  .topbar-inner { gap: 14px; }
  .nav { gap: 2px; }
  .side-card { padding: 20px; }
  .product-price { font-size: 1.8rem; }
  .hero { flex-direction: column; align-items: flex-start; padding: 36px; }
  .shop-hero-foot { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  /* Phones: render everything at ~85% so text, buttons and images feel less oversized. */
  html { zoom: .85; }
  body { font-size: 14.5px; }
  .wrap { padding: 0 16px; }
  .main { padding-top: 16px; }
  .topbar-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 12px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .search-btn { padding: 0 16px; }
  .nav { gap: 4px; }
  .nav-item > span:not(.avatar), .nav .btn span { display: none; }
  .nav .btn { width: 44px; padding: 0; }
  .nav-item { padding: 8px; }
  .hero { padding: 28px 22px; border-radius: var(--r); margin-bottom: 28px; }
  .hero-stats { width: 100%; }
  .hero-stats div { flex: 1; min-width: 0; padding: 12px; }
  .hero-stats dt { font-size: 1.35rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .card-body { padding: 8px 2px 0; }
  .card-price { font-size: 1.12rem; }
  .card-img { border-radius: 14px; }
  .badge { font-size: .68rem; padding: 2px 7px; }
  .shops { grid-auto-columns: 78%; }
  /* Phones: photos → title, price, contacts → description. */
  .product { display: flex; flex-direction: column; align-items: stretch; gap: 16px; }
  .product > .gallery { display: contents; }
  .product > .gallery > * { order: 1; }
  .product-side { position: static; order: 2; }
  .product > .gallery > .desc-card { order: 3; margin-top: 0; }
  /* Narrow phones: big photo edge to edge, thumbnails in a row underneath. */
  .gallery-media { display: flex; flex-direction: column; gap: 12px; }
  .gallery-main { aspect-ratio: 3 / 4; width: calc(100% + 32px); align-self: center; margin: 0; border-radius: 0; }
  .gnav { display: none; }
  .dots { display: flex; }
  .gallery-count { top: 14px; bottom: auto; }
  .thumbs { flex-direction: row; gap: 8px; height: auto; min-height: 0; overflow-x: auto; }
  .thumb { width: 60px; height: 80px; opacity: .8; }
  .side-card, .desc-card { padding: 20px; border-radius: var(--r); }
  .product-price { font-size: 1.8rem; }
  .shop-cover { height: 110px; }
  .shop-hero-body { flex-direction: column; align-items: flex-start; padding: 0 20px; margin-top: -44px; gap: 12px; }
  .avatar-xl { width: 92px; height: 92px; font-size: 2.2rem; border-radius: 24px; }
  .shop-hero-foot { padding: 18px 20px 22px; }
  .shop-hero-info { padding-top: 0; }
  .shop-edit { align-self: stretch; margin-top: 0; }
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-aside { padding: 28px 24px; }
  .auth-aside h2 { font-size: 1.35rem; margin-bottom: 16px; }
  .auth-aside ul { gap: 10px; }
  .auth { padding: 28px 24px; }
  .form-row { grid-template-columns: 1fr; }
  .form-card { padding: 20px; border-radius: var(--r); }
  .form-actions .btn { flex: 1; }
  .dash-head { flex-wrap: wrap; padding: 20px; gap: 14px; }
  .dash-head > .avatar-lg { width: 56px; height: 56px; border-radius: 16px; font-size: 1.5rem; }
  .dash-info h1 { font-size: 1.4rem; }
  .share { flex-wrap: wrap; max-width: none; }
  .share input { flex-basis: 100%; }
  .share .btn { width: 100%; }
  .dash-actions { flex-direction: row; flex-wrap: wrap; width: 100%; }
  .dash-actions .btn { flex: 1; padding: 0 10px; }
  .dash-actions .btn span { font-size: .85rem; }
  .stats { gap: 10px; }
  .stat { padding: 14px; }
  .stat-num { font-size: 1.5rem; }
  .drow { flex-wrap: wrap; padding: 12px 14px; }
  .drow-actions { width: 100%; justify-content: flex-end; }

  /* mobile buy bar */
  .has-buybar { padding-bottom: 84px; }
  .buybar { display: flex; align-items: center; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(23, 23, 28, .06); }
  .buybar-price { flex: 1; min-width: 0; font-weight: 800; font-size: 1.1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buybar .btn { height: 46px; padding: 0 14px; }
}
@media (max-width: 380px) {
  .contacts { grid-template-columns: 1fr; }
}

/* ---------- seller product cards ---------- */
.mgrid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.mcard { display: flex; flex-direction: column; background: #fff; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-1); transition: box-shadow .2s; }
.mcard:hover { box-shadow: var(--sh-2); }
.mcard-img { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; background: var(--bg); overflow: hidden; }
.mcard-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .35s, filter .2s; }
.mcard:hover .mcard-img img { transform: scale(1.04); }
.mcard-status { position: absolute; right: 10px; top: 10px; display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 800; padding: 3px 9px; border-radius: 8px; }
.mcard-img .card-photos { top: auto; bottom: 10px; }
.mcard-img .card-badges { right: 60px; }
.mcard-status.is-on { background: #e8f8ee; color: #137a3b; }
.mcard-status.is-off { background: rgba(23, 23, 28, .75); color: #fff; }
.mcard.is-hidden .mcard-img img { filter: grayscale(.85) opacity(.55); }
.mcard.is-hidden .mcard-title, .mcard.is-hidden .card-price { color: var(--muted); }
.mcard-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px 10px; flex: 1; }
.mcard-title { color: var(--text-2); text-decoration: none; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mcard-title:hover { color: var(--orange-700); }
.mcard-body .card-city { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: 4px; }
.mcard-actions { display: flex; gap: 6px; padding: 0 10px 12px; }
.mcard-actions form { margin: 0; display: flex; }
.mact { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-width: 38px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--text-2); font: inherit; font-size: .85rem; font-weight: 700; text-decoration: none; cursor: pointer; }
.mcard-actions > .mact { flex: 1; }
.mact:hover { border-color: var(--orange); color: var(--orange-700); background: var(--orange-50); }
.mact-danger:hover { border-color: var(--danger); color: var(--danger); background: #fff0f0; }
@media (max-width: 760px) {
  .mgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .mcard-body { padding: 10px 12px 8px; }
  .mcard-actions { padding: 0 8px 10px; gap: 4px; }
  .mact { height: 34px; min-width: 34px; padding: 0 8px; }
}

/* market picker */
.markets { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.markets legend { font-weight: 700; font-size: .92rem; padding: 0; margin-bottom: 6px; }
.market-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.market-opt { display: block !important; position: relative; cursor: pointer; }
.market-opt input { position: absolute; opacity: 0; pointer-events: none; }
.market-card { display: flex; align-items: center; gap: 10px; height: 100%; padding: 12px; border-radius: 14px; border: 1.5px solid var(--line-2); background: #fff; font-weight: 500; transition: border-color .15s, background .15s, box-shadow .15s; }
.market-card strong { display: block; font-weight: 800; line-height: 1.25; }
.market-card small { display: block; color: var(--muted); font-size: .78rem; line-height: 1.3; }
.market-ic { width: 38px; height: 38px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--bg); color: var(--muted); }
.market-opt:hover .market-card { border-color: var(--orange-200); }
.market-opt input:checked + .market-card { border-color: var(--orange); background: var(--orange-50); box-shadow: 0 0 0 3px var(--orange-100); }
.market-opt input:checked + .market-card .market-ic { background: var(--orange); color: #fff; }
.market-opt input:focus-visible + .market-card { box-shadow: 0 0 0 4px var(--orange-100); }
@media (max-width: 760px) { .market-options { grid-template-columns: 1fr; } }

/* catalog */
.catalog-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.catalog-head h1 { margin: 0 0 2px; }
.catalog-head p { margin: 0; }
.sortbar { display: inline-flex; padding: 4px; background: #fff; border-radius: 12px; box-shadow: var(--sh-1); }
.sort { padding: 8px 14px; border-radius: 9px; text-decoration: none; font-weight: 700; font-size: .9rem; color: var(--text-2); white-space: nowrap; }
.sort:hover { color: var(--orange-700); }
.sort.active { background: var(--orange); color: #fff; }
.chip .ic { color: var(--orange); }
.chip.active .ic { color: #fff; }
@media (max-width: 760px) {
  .sortbar { width: 100%; }
  .sort { flex: 1; text-align: center; padding: 8px 6px; }
}
.see-all { display: inline-flex; align-items: center; gap: 2px; color: var(--orange-700); font-weight: 700; text-decoration: none; white-space: nowrap; }
.see-all:hover { text-decoration: underline; }

/* ---------- admin ---------- */
.nav-admin { color: var(--orange-700); }
.formpage.narrow { max-width: 560px; }
.admin-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.admin-head h1 { margin: 2px 0 0; }
.admin-tabs { display: inline-flex; padding: 4px; background: #fff; border-radius: 12px; box-shadow: var(--sh-1); }
.admin-tabs a { padding: 8px 18px; border-radius: 9px; text-decoration: none; font-weight: 700; color: var(--text-2); }
.admin-tabs a.active { background: var(--orange); color: #fff; }
.stats-4 { grid-template-columns: repeat(4, 1fr); margin-bottom: 20px; }
.admin-search { display: flex; gap: 8px; margin-bottom: 16px; }
.admin-search input { flex: 1; min-width: 0; font: inherit; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line-2); background: #fff; }
.admin-search input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-100); }
.alist { list-style: none; margin: 0; padding: 0; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden; }
.arow { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.arow:last-child { border-bottom: 0; }
.arow.is-blocked { background: #fff7f7; }
.arow.is-blocked .arow-title a, .arow.is-blocked img { opacity: .6; }
.arow-main { flex: 1; min-width: 0; }
.arow-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; }
.arow-title a { text-decoration: none; }
.arow-title a:hover { color: var(--orange-700); }
.arow-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: center; margin-top: 4px; font-size: .85rem; color: var(--muted); }
.arow-meta span, .arow-meta a { display: inline-flex; align-items: center; gap: 4px; }
.arow-meta a { color: var(--text-2); }
.arow-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.arow-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.arow-actions form { margin: 0; display: flex; }
.badge-block { background: #ffe3e3; color: #b42318; }
.badge-admin { background: var(--orange-50); color: var(--orange-700); }
@media (max-width: 760px) {
  .stats-4 { grid-template-columns: repeat(2, 1fr); }
  .arow { flex-wrap: wrap; padding: 12px 14px; }
  .arow-actions { width: 100%; }
  .admin-tabs { width: 100%; }
  .admin-tabs a { flex: 1; text-align: center; }
}
.small { font-size: .85rem; }

/* ---------- cards: wholesale, sold out ---------- */
.card-wrap { position: relative; display: flex; }
.card-wrap { min-width: 0; }
.card-wrap > .card { flex: 1; min-width: 0; }
.card.is-soldout .card-img img { filter: grayscale(.7); opacity: .75; }
.card.is-soldout .card-price { color: var(--muted); }

/* ---------- product page extras ---------- */
.side-title { display: flex; align-items: flex-start; gap: 10px; }
.side-title h1 { flex: 1; }
.prices { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.opt-box { display: flex; flex-direction: column; padding: 8px 14px; border-radius: 12px; background: #e8f8ee; color: #137a3b; line-height: 1.2; }
.opt-box strong { font-size: 1.3rem; font-weight: 800; }
.opt-box small { font-weight: 700; font-size: .8rem; }
.attr { display: flex; flex-direction: column; gap: 6px; }
.attr-label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.attr-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attr-chip { padding: 5px 12px; border-radius: 9px; border: 1.5px solid var(--line-2); font-weight: 700; font-size: .88rem; background: #fff; }
.soldout-banner { background: #17171c; color: #fff; font-weight: 700; border-radius: 12px; padding: 10px 14px; font-size: .9rem; }
.report-link { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .85rem; text-decoration: none; padding: 4px 2px; }
.report-link:hover { color: var(--danger); }

/* ---------- product form extras ---------- */
.form select { font: inherit; font-weight: 500; color: var(--text); background: var(--bg); border: 1.5px solid transparent; border-radius: 12px; padding: 12px 14px; width: 100%; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23868694' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; }
.form select:focus { outline: none; background-color: #fff; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-100); }
.form-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: -8px; }
.form-card-head h2 { margin: 0; }
.form-card-head .muted { font-size: .85rem; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-weight: 700; font-size: .92rem; }
.field .hint { margin: 0; }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 50px; padding: 7px 8px; background: var(--bg); border: 1.5px solid transparent; border-radius: 12px; cursor: text; }
.tags:focus-within { background: #fff; border-color: var(--orange); box-shadow: 0 0 0 4px var(--orange-100); }
.tag { display: inline-flex; align-items: center; gap: 2px; height: 34px; padding: 0 4px 0 12px; border-radius: 9px; background: #fff; border: 1px solid var(--line-2); font-weight: 700; font-size: .9rem; }
.tag button { width: 26px; height: 26px; border: 0; border-radius: 7px; background: none; color: var(--muted); font-size: 1.15rem; line-height: 1; cursor: pointer; }
.tag button:hover { background: var(--bg); color: var(--danger); }
.form .tags-input { flex: 1; min-width: 160px; border: 0 !important; background: transparent !important; box-shadow: none !important; padding: 6px 6px !important; }
.reasons { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.reasons legend { font-weight: 700; margin-bottom: 8px; }

/* ---------- categories ---------- */
.chip-opt { border-color: #b7e4c7; color: #137a3b; }
.chip-opt.active { background: #137a3b; border-color: #137a3b; color: #fff; }


/* ---------- seller dashboard extras ---------- */
.mcard-stats { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: auto; padding-top: 6px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.mcard-stats span { display: inline-flex; align-items: center; gap: 4px; }
.mini-soldout { color: #fff !important; background: #17171c; padding: 1px 7px; border-radius: 6px; }
.mact-on { background: #17171c; color: #fff; border-color: #17171c; }
.tab-badge { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e5484d; color: #fff; font-size: .7rem; margin-left: 4px; }
.arow.is-done { opacity: .6; }

/* ---------- QR page ---------- */
.qr-card { margin: 18px auto; max-width: 420px; background: #fff; border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 28px 28px 24px; text-align: center; border-top: 8px solid var(--orange); }
.qr-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.qr-shop { font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.qr-stall { display: inline-flex; align-items: baseline; gap: 8px; margin-top: 8px; padding: 4px 14px; border-radius: 10px; background: var(--orange); color: #fff; font-size: 1.5rem; font-weight: 800; }
.qr-stall small { font-size: .9rem; font-weight: 700; opacity: .9; }
.qr-img { width: 100%; max-width: 300px; margin: 18px auto 10px; image-rendering: pixelated; }
.qr-call { font-weight: 800; font-size: 1.05rem; }
.qr-url { color: var(--text); font-weight: 800; font-size: 1.15rem; letter-spacing: .01em; margin-top: 4px; word-break: break-all; }
.qr-settings { flex-direction: row; align-items: center; gap: 22px; margin-bottom: 16px; }
.qr-settings-img { width: 168px; height: 168px; flex: none; border: 1px solid var(--line); border-radius: 14px; padding: 6px; background: #fff; image-rendering: pixelated; }
.qr-settings-info { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.qr-settings-info h2 { margin: 0; }
.qr-settings-link { font-weight: 800; font-size: 1.2rem; color: var(--orange-700); word-break: break-all; }
.qr-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width: 760px) {
  .qr-settings { flex-direction: column; align-items: stretch; text-align: center; }
  .qr-settings-img { margin: 0 auto; width: 200px; height: 200px; }
  .qr-settings-actions { justify-content: center; }
}
.qr-note { text-align: center; font-size: .88rem; margin: 14px auto 0; max-width: 460px; }
.qr-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
@media print {
  .topbar, .footer, .no-print { display: none !important; }
  body, .main { background: #fff; padding: 0; margin: 0; zoom: 1 !important; }
  .qr-card { box-shadow: none; border: 2px solid #17171c; border-top: 10px solid var(--orange); margin: 10mm auto; max-width: 120mm; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .qr-stall, .logo-mark { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media (max-width: 760px) {
  }
@media (max-width: 760px) {
  /* four action buttons on a half-width card: edit becomes icon-only too */
  .mcard-actions .mact span { display: none; }
  .mcard-actions > .mact { flex: 1; }
}

/* Wider phone-style windows: photo no taller than ~3/4 of the screen, thumbnails in a column on its left. */
@media (min-width: 521px) and (max-width: 760px) {
  .gallery-media { display: grid; grid-template-columns: 64px min(calc(100% - 76px), calc(72vh * 3 / 4)); justify-content: center; gap: 12px; }
  .gallery-media:not(:has(.thumbs)) { grid-template-columns: min(100%, calc(72vh * 3 / 4)); }
  .gallery-main { width: auto; border-radius: var(--r); }
  .thumbs { flex-direction: column; height: 0; min-height: 100%; overflow-x: hidden; overflow-y: auto; }
  .thumb { width: 64px; height: 85px; }
}

/* Instant hover hints on icon buttons: <button data-tip="…"> */
[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip); position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translate(-50%, 4px);
  background: #17171c; color: #fff; font-size: .78rem; font-weight: 600; line-height: 1.3; white-space: nowrap;
  padding: 6px 10px; border-radius: 8px; box-shadow: var(--sh-2); pointer-events: none; opacity: 0; z-index: 30;
  transition: opacity .12s, transform .12s;
}
[data-tip]:hover::after, [data-tip]:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.mcard-actions > :last-child [data-tip]::after { left: auto; right: 0; transform: translateY(4px); }
.mcard-actions > :last-child [data-tip]:hover::after { transform: none; }
@media (hover: none) { [data-tip]::after { display: none; } }
