/* ==========================================================
   Buildrova — marketplace styles
   ========================================================== */
:root {
  --nav: #12302b;
  --nav-2: #1b3f38;
  --nav-3: #2d5a50;
  --accent: #d9622b;
  --accent-dark: #a9481b;
  --accent-soft: #fbeee6;
  --brand: #1e7a5c;
  --brand-hover: #17644b;
  --brand-soft: #e4f2ec;
  --bg: #f3f1ec;
  --surface: #ffffff;
  --surface-2: #f7f6f2;
  --border: #e2ded5;
  --border-strong: #c3beb2;
  --ink: #0f1720;
  --ink-2: #334155;
  --muted: #5b6675;
  --link: #17644b;
  --green: #067647;
  --green-soft: #e3f5ec;
  --red: #b42318;
  --red-soft: #fdecea;
  --amber: #93590b;
  --amber-soft: #fff4dc;
  --blue: #1d4ed8;
  --blue-soft: #e6eefe;
  --violet: #6d28d9;
  --violet-soft: #f0e9fe;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(15, 23, 32, .06), 0 2px 8px rgba(15, 23, 32, .05);
  --shadow-lg: 0 10px 30px rgba(15, 23, 32, .14);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--link); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
h1 { font-size: 1.75rem; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.icon { flex: none; vertical-align: middle; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.text-green { color: var(--green); }
.text-red { color: var(--red); }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 1rem; }
.flex { display: flex; gap: .75rem; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.stack > * + * { margin-top: 1rem; }

/* ---------- Top bar ---------- */
.topbar { background: var(--nav); color: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.2); }
.topbar-inner { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 1.25rem; max-width: 1440px; margin: 0 auto; }
.logo { display: flex; align-items: center; gap: .55rem; color: #fff; text-decoration: none; flex: none; }
.logo:hover { color: #fff; text-decoration: none; opacity: .92; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px 10px 10px 2px; background: var(--accent); color: #fff; }
.logo-text { font-weight: 800; font-size: 1.4rem; letter-spacing: -.04em; }

.searchbar { flex: 1; max-width: 720px; display: flex; align-items: center; min-width: 0; height: 44px; border-radius: 999px; background: #fff; padding: 0 4px 0 14px; gap: .5rem; }
.searchbar:focus-within { box-shadow: 0 0 0 3px rgba(217, 98, 43, .55); }
.searchbar-icon { color: var(--muted); }
.searchbar input, .searchbar input[type=search] { flex: 1; min-width: 0; border: 0; padding: 0; font: inherit; font-size: .98rem; outline: none; color: var(--ink); background: transparent; box-shadow: none; }
.searchbar input:focus, .searchbar input[type=search]:focus { box-shadow: none; border: 0; }
.searchbar button { border: 0; background: var(--accent); color: #fff; height: 36px; padding: 0 1.1rem; border-radius: 999px; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; }
.searchbar button:hover { background: var(--accent-dark); }

.topnav { display: flex; align-items: center; gap: .4rem; margin-left: auto; }
.topnav-btn, .cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: .45rem; color: #e8efec; padding: .5rem .8rem; border-radius: 999px;
  background: transparent; border: 0; font: inherit; font-size: .9rem; font-weight: 500; cursor: pointer; white-space: nowrap;
}
.topnav-btn:hover, .cart-btn:hover { background: rgba(255,255,255,.1); color: #fff; text-decoration: none; }
.topnav-signin { border: 1px solid rgba(255,255,255,.35); }
.topnav-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: .8rem; }
.cart-btn { background: rgba(255,255,255,.1); }
.cart-btn:hover { background: rgba(255,255,255,.18); }
.cart-badge { position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--nav); }

.menu { position: relative; }
.menu-panel {
  display: none; position: absolute; right: 0; top: calc(100% + 8px); background: #fff; color: var(--ink);
  min-width: 250px; border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .5rem; z-index: 60; border: 1px solid var(--border);
}
.menu.open .menu-panel, .menu:focus-within .menu-panel { display: block; }
.menu-panel-head { padding: .5rem .7rem .7rem; border-bottom: 1px solid var(--border); margin-bottom: .35rem; display: flex; flex-direction: column; }
.menu-panel-head span { font-size: .8rem; color: var(--muted); }
.menu-panel a { display: flex; align-items: center; gap: .6rem; padding: .55rem .7rem; color: var(--ink); border-radius: 8px; font-size: .92rem; }
.menu-panel a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.menu-panel hr { margin: .35rem 0; }

.subnav { background: var(--surface); border-bottom: 1px solid var(--border); }
.subnav-inner { display: flex; gap: .3rem; overflow-x: auto; padding: .5rem 1.25rem; max-width: 1440px; margin: 0 auto; scrollbar-width: none; }
.subnav-inner::-webkit-scrollbar { display: none; }
.subnav a { color: var(--ink-2); font-size: .86rem; font-weight: 500; white-space: nowrap; padding: .35rem .75rem; border-radius: 999px; display: flex; align-items: center; gap: .35rem; }
.subnav a:hover, .subnav a.active { background: var(--brand-soft); color: var(--brand-hover); text-decoration: none; }
.subnav-all { font-weight: 700 !important; color: var(--ink) !important; border: 1px solid var(--border); }
.subnav-deal { color: var(--accent-dark) !important; font-weight: 600 !important; }
.subnav-sell { margin-left: auto; font-weight: 600 !important; color: var(--brand) !important; }

/* ---------- Layout ---------- */
.shop-main { max-width: 1500px; margin: 0 auto; padding: 1rem; min-height: 60vh; }
.container-narrow { max-width: 1100px; margin: 0 auto; }
.panel { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.panel-head h2, .panel-head h3 { margin: 0; }
.section { margin-top: 1.25rem; }

/* ---------- Flash ---------- */
.flash { padding: .8rem 1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--green-soft); border-color: #a6dcc0; color: var(--green); }
.flash-error { background: var(--red-soft); border-color: #f3b8b2; color: var(--red); }
.flash-info { background: var(--blue-soft); border-color: #b9ccf8; color: var(--blue); }

/* ---------- Buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font: inherit; font-weight: 600; font-size: .92rem;
  padding: .6rem 1.05rem; border-radius: 10px; border: 1px solid var(--border-strong); background: #fff; color: var(--ink);
  cursor: pointer; text-decoration: none; line-height: 1.2; transition: background .15s, box-shadow .15s;
}
.btn:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.btn:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid rgba(30, 122, 92, .45); outline-offset: 1px; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: #fff; }
.btn-accent { background: var(--accent); border-color: var(--accent-dark); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-dark { background: var(--nav-2); border-color: var(--nav-2); color: #fff; }
.btn-dark:hover { background: var(--nav-3); color: #fff; }
.btn-danger { color: var(--red); border-color: #f0b4ae; }
.btn-danger:hover { background: var(--red-soft); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.btn-link { background: none; border: 0; padding: 0; color: var(--link); font: inherit; cursor: pointer; }
.btn-link:hover { text-decoration: underline; color: var(--accent-dark); }

label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: .3rem; color: var(--ink-2); }
.field { margin-bottom: 1rem; }
.field-hint { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=tel], input[type=date], input[type=search], select, textarea {
  width: 100%; font: inherit; font-size: .95rem; color: var(--ink); background: #fff;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .55rem .7rem;
  box-shadow: inset 0 1px 2px rgba(15, 23, 32, .06);
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px rgba(30, 122, 92, .2); }
textarea { min-height: 110px; resize: vertical; }
.checkbox { display: flex; align-items: center; gap: .5rem; font-weight: 500; cursor: pointer; }
.checkbox input { width: 17px; height: 17px; accent-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 1rem; }
.input-prefix { position: relative; }
.input-prefix span { position: absolute; left: .7rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.input-prefix input { padding-left: 1.5rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem .25rem; margin: 0 0 1rem; }
legend { font-weight: 700; padding: 0 .4rem; }

/* ---------- Badges ---------- */
.badge { display: inline-flex; align-items: center; gap: .3rem; padding: .18rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-blue { background: var(--blue-soft); color: var(--blue); }
.badge-violet { background: var(--violet-soft); color: var(--violet); }
.badge-green { background: var(--green-soft); color: var(--green); }
.badge-gray { background: #eceff2; color: #4b5563; }
.badge-red { background: var(--red-soft); color: var(--red); }
.chip { display: inline-block; background: var(--surface-2); border: 1px solid var(--border); padding: .12rem .5rem; border-radius: 999px; font-size: .75rem; color: var(--ink-2); }

.stars { color: #d2d7dd; letter-spacing: -1px; font-size: .95rem; }
.stars .on { color: #e3a008; }

/* ---------- Home ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background:
    radial-gradient(900px 380px at 90% 10%, rgba(217, 98, 43, .32), transparent 60%),
    linear-gradient(125deg, #0f2824 0%, #16382f 55%, #1f4a3f 100%);
  color: #fff; padding: 3rem 2.5rem; display: grid; grid-template-columns: 1.25fr 1fr; gap: 2rem; align-items: center;
}
.hero::after {
  content: ''; position: absolute; inset: 0; opacity: .08; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.5) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.5) 1px, transparent 1px); background-size: 32px 32px;
}
.hero > * { position: relative; z-index: 1; }
.hero-kicker { display: inline-block; background: rgba(217, 98, 43, .2); color: #ffc6a6; border: 1px solid rgba(217, 98, 43, .5); padding: .2rem .7rem; border-radius: 999px; font-size: .8rem; font-weight: 600; margin-bottom: 1rem; }
.hero h1 { font-size: clamp(2rem, 4vw, 3.1rem); font-weight: 800; letter-spacing: -.035em; margin-bottom: .75rem; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p { color: #d3dae2; font-size: 1.1rem; max-width: 34rem; }
.hero-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero-actions .btn { padding: .8rem 1.4rem; font-size: 1rem; }
.hero-card { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); padding: 1.25rem; backdrop-filter: blur(4px); }
.hero-stat { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; }
.hero-stat + .hero-stat { border-top: 1px solid rgba(255, 255, 255, .1); }
.hero-stat .icon-wrap { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: rgba(217, 98, 43, .2); color: #ffb48c; }
.hero-stat strong { display: block; }
.hero-stat span { color: #b9c3ce; font-size: .87rem; }

.cat-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; }
.cat-tile {
  background: var(--surface); border-radius: var(--radius); padding: 1rem .75rem; text-align: center; box-shadow: var(--shadow);
  color: var(--ink); display: flex; flex-direction: column; align-items: center; gap: .55rem; font-weight: 600; font-size: .88rem;
  border: 1px solid transparent; transition: transform .15s, border-color .15s;
}
.cat-tile:hover { transform: translateY(-2px); border-color: var(--accent); text-decoration: none; color: var(--ink); }
.cat-tile .cat-icon { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-dark); }

.value-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .75rem; }
.value { display: flex; gap: .8rem; align-items: flex-start; background: var(--surface); border-radius: var(--radius); padding: 1rem; box-shadow: var(--shadow); }
.value .icon { color: var(--accent-dark); margin-top: 2px; }
.value strong { display: block; font-size: .95rem; }
.value span { font-size: .85rem; color: var(--muted); }

.row-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: .9rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; }
.row-scroll > * { scroll-snap-align: start; }

.sell-cta {
  display: grid; grid-template-columns: 1fr auto; gap: 1.5rem; align-items: center; border-radius: var(--radius);
  background: var(--brand-soft); border: 1px solid #c7e3d7; color: var(--ink); padding: 2rem 2.25rem;
}
.sell-cta h2 { font-size: 1.6rem; font-weight: 800; margin-bottom: .35rem; }
.sell-cta p { margin: 0; font-weight: 500; }

/* ---------- Product card ---------- */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: .9rem; }
.pcard { background: var(--surface); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); border: 1px solid transparent; transition: box-shadow .15s, border-color .15s; }
.pcard:hover { box-shadow: var(--shadow-lg); border-color: var(--border); }
.pcard-img { position: relative; aspect-ratio: 4 / 3; background: var(--surface-2); display: block; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.pcard-deal { position: absolute; left: .6rem; top: .6rem; background: var(--accent); color: #fff; font-weight: 700; font-size: .74rem; padding: .2rem .6rem; border-radius: 999px; letter-spacing: .01em; }
.pcard-body { padding: .8rem .9rem 1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.pcard-title { color: var(--ink); font-weight: 500; font-size: .93rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pcard-title:hover { color: var(--accent-dark); }
.pcard-price .price { font-size: 1.3rem; font-weight: 700; }
.pcard-price .unit { color: var(--muted); font-size: .82rem; margin-right: .35rem; }
.pcard-bulk { font-size: .8rem; color: var(--green); font-weight: 600; }
.pcard-meta { font-size: .8rem; color: var(--muted); margin-top: auto; padding-top: .25rem; }

/* ---------- Search ---------- */
.search-layout { display: grid; grid-template-columns: 250px 1fr; gap: 1rem; align-items: start; }
.filters { background: var(--surface); border-radius: var(--radius); padding: 1rem 1.1rem; box-shadow: var(--shadow); position: sticky; top: 80px; }
.filters h4 { font-size: .9rem; margin: 1rem 0 .45rem; }
.filters h4:first-child { margin-top: 0; }
.filters a.filter-link { display: block; padding: .18rem 0; color: var(--ink-2); font-size: .9rem; }
.filters a.filter-link.active { font-weight: 700; color: var(--accent-dark); }
.price-range { display: flex; gap: .4rem; align-items: center; }
.price-range input { padding: .4rem .5rem; }
.results-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; background: var(--surface); border-radius: var(--radius); padding: .7rem 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; flex-wrap: wrap; }
.results-bar select { width: auto; }
.pagination { display: flex; gap: .35rem; justify-content: center; margin: 1.5rem 0 .5rem; flex-wrap: wrap; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; padding: 0 .6rem; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); color: var(--ink); }
.pagination a.active { background: var(--nav-2); color: #fff; border-color: var(--nav-2); }
.pagination a:hover { text-decoration: none; border-color: var(--accent); }
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.empty .icon { color: var(--border-strong); margin: 0 auto .75rem; }
.empty h3 { color: var(--ink); }

/* ---------- Product page ---------- */
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: .75rem; }
.crumbs a { color: var(--muted); }
.product-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) 320px; gap: 1.5rem; align-items: start; }
.product-gallery { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); position: sticky; top: 80px; }
.product-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.product-info h1 { font-size: 1.55rem; font-weight: 600; }
.product-info .by { font-size: .9rem; margin-bottom: .4rem; }
.price-block { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: .9rem 0; margin: .8rem 0; }
.price-big { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.price-big sup { font-size: 1rem; top: -.8em; }
.save { color: var(--accent-dark); font-size: 1.3rem; font-weight: 400; margin-right: .5rem; }
.bulk-callout { display: flex; gap: .6rem; align-items: center; background: var(--green-soft); color: var(--green); padding: .6rem .8rem; border-radius: var(--radius-sm); font-weight: 600; font-size: .9rem; margin-top: .6rem; }
.spec-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.spec-table th, .spec-table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.spec-table th { width: 40%; background: var(--surface-2); font-weight: 600; color: var(--ink-2); }
.buybox { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; position: sticky; top: 80px; }
.buybox .price-big { font-size: 1.7rem; }
.buybox-row { display: flex; gap: .6rem; align-items: flex-start; font-size: .88rem; margin: .6rem 0; }
.buybox-row .icon { color: var(--muted); margin-top: 1px; }
.qty-row { display: flex; align-items: center; gap: .5rem; margin: .9rem 0; }
.qty-row input { width: 90px; }
.buybox .btn { margin-top: .45rem; }
.reviews-layout { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
.review { padding: 1rem 0; border-bottom: 1px solid var(--border); }
.review:last-child { border-bottom: 0; }
.review-head { display: flex; align-items: center; gap: .6rem; font-weight: 600; font-size: .9rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--nav-3); color: #fff; display: grid; place-items: center; font-size: .8rem; font-weight: 700; flex: none; }
.rating-bar { display: flex; align-items: center; gap: .5rem; font-size: .85rem; margin: .3rem 0; }
.rating-bar .track { flex: 1; height: 14px; background: #eceff2; border-radius: 4px; overflow: hidden; border: 1px solid var(--border); }
.rating-bar .fill { height: 100%; background: #e3a008; }
.star-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .15rem; }
.star-input input { position: absolute; opacity: 0; width: 0; }
.star-input label { font-size: 1.8rem; color: #d2d7dd; cursor: pointer; margin: 0; line-height: 1; }
.star-input input:checked ~ label, .star-input label:hover, .star-input label:hover ~ label { color: #e3a008; }

/* ---------- Store page ---------- */
.store-hero { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 1rem; }
.store-banner { height: 110px; background: linear-gradient(120deg, var(--nav-2), var(--nav-3)); position: relative; }
.store-banner::after { content: ''; position: absolute; inset: 0; opacity: .1; background-image: repeating-linear-gradient(45deg, #fff 0 2px, transparent 2px 20px); }
.store-hero-body { display: flex; gap: 1.25rem; padding: 0 1.5rem 1.25rem; align-items: flex-end; flex-wrap: wrap; }
.store-logo { width: 96px; height: 96px; border-radius: 16px; border: 4px solid #fff; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 2rem; font-weight: 800; margin-top: -48px; position: relative; overflow: hidden; box-shadow: var(--shadow); }
.store-logo img { width: 100%; height: 100%; object-fit: cover; }
.store-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.store-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem; display: flex; gap: 1rem; color: var(--ink); border: 1px solid transparent; }
.store-card:hover { border-color: var(--accent); text-decoration: none; color: var(--ink); }
.store-card .store-logo { width: 60px; height: 60px; margin: 0; border-width: 0; font-size: 1.3rem; border-radius: 12px; flex: none; }

/* ---------- Cart & checkout ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1rem; align-items: start; }
.cart-group + .cart-group { margin-top: 1rem; }
.cart-group-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-bottom: .75rem; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.cart-item { display: grid; grid-template-columns: 110px 1fr auto; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-item img { width: 110px; height: 82px; object-fit: cover; border-radius: var(--radius-sm); background: var(--surface-2); }
.cart-item-title { font-weight: 600; color: var(--ink); }
.cart-item-actions { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; flex-wrap: wrap; }
.cart-item-actions input { width: 76px; padding: .35rem .5rem; }
.summary { position: sticky; top: 80px; }
.summary-row { display: flex; justify-content: space-between; padding: .3rem 0; font-size: .93rem; }
.summary-total { border-top: 1px solid var(--border); margin-top: .5rem; padding-top: .7rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.progress-free { font-size: .85rem; background: var(--green-soft); color: var(--green); padding: .45rem .7rem; border-radius: var(--radius-sm); }
.progress-free.pending { background: var(--amber-soft); color: var(--amber); }
.option-cards { display: grid; gap: .6rem; }
.option-card { display: flex; gap: .75rem; align-items: flex-start; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: .75rem .9rem; cursor: pointer; font-weight: 400; margin: 0; background: #fff; }
.option-card:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 1px var(--accent); }
.option-card input { margin-top: 3px; accent-color: var(--accent); }
.option-card strong { display: block; color: var(--ink); }
.option-card span { font-size: .85rem; color: var(--muted); }
.steps { display: flex; gap: .5rem; margin-bottom: 1rem; flex-wrap: wrap; }
.steps span { font-size: .82rem; font-weight: 600; color: var(--muted); }
.steps span.on { color: var(--accent-dark); }

/* ---------- Auth ---------- */
.auth-wrap { max-width: 440px; margin: 1.5rem auto; }
.auth-wrap .panel { padding: 1.75rem; }
.auth-wrap h1 { font-size: 1.6rem; }
.auth-alt { text-align: center; margin-top: 1rem; font-size: .9rem; }
.demo-box { background: var(--surface-2); border: 1px dashed var(--border-strong); border-radius: var(--radius-sm); padding: .75rem .9rem; font-size: .83rem; margin-top: 1rem; }
.demo-box code { background: #fff; padding: 0 .3rem; border-radius: 4px; border: 1px solid var(--border); }

/* ---------- Dashboards ---------- */
.dash { display: grid; grid-template-columns: 250px 1fr; min-height: calc(100vh - 64px); background: linear-gradient(to right, var(--surface) 249px, var(--border) 249px, var(--border) 250px, transparent 250px); }
.dash-side { background: var(--surface); border-right: 1px solid var(--border); padding: 1.25rem .9rem; position: sticky; top: 64px; height: calc(100vh - 64px); overflow-y: auto; display: flex; flex-direction: column; }
.dash-side-head { padding: 0 .6rem 1rem; border-bottom: 1px solid var(--border); margin-bottom: .75rem; display: flex; flex-direction: column; gap: .1rem; }
.dash-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-dark); font-weight: 700; }
.dash-nav a { display: flex; align-items: center; gap: .7rem; padding: .6rem .7rem; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .93rem; margin-bottom: 2px; }
.dash-nav a:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.dash-nav a.active { background: var(--accent-soft); color: var(--accent-dark); font-weight: 600; }
.dash-switch { margin-top: auto; font-size: .85rem; font-weight: 600; padding: .75rem .7rem 0; border-top: 1px solid var(--border); }
.dash-main { padding: 1.5rem 2rem 3rem; min-width: 0; max-width: 1300px; }
.dash-title { display: flex; justify-content: space-between; align-items: center; gap: 1rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.dash-title h1 { margin: 0; font-size: 1.6rem; }
.dash-title p { margin: .2rem 0 0; color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.1rem 1.2rem; display: flex; flex-direction: column; gap: .15rem; }
.stat-label { font-size: .82rem; color: var(--muted); font-weight: 500; display: flex; align-items: center; gap: .4rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; color: var(--ink); }
.stat-sub { font-size: .8rem; color: var(--muted); }
.stat.attention { box-shadow: inset 4px 0 0 var(--accent), var(--shadow); }
.dash-cols { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--border); margin-bottom: 1rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 600; font-size: .9rem; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a.active { color: var(--accent-dark); border-color: var(--accent); }
.tabs .count { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 0 .45rem; font-size: .75rem; margin-left: .25rem; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: .6rem .75rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .75rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .thumb { width: 52px; height: 40px; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; }

.list-item { display: flex; align-items: center; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item img { width: 48px; height: 38px; object-fit: cover; border-radius: 6px; }

/* Sales chart */
.chart { position: relative; }
.chart-plot { display: flex; align-items: flex-end; gap: 2px; height: 180px; border-bottom: 1px solid var(--border-strong); padding-top: 12px; position: relative; }
.chart-grid { position: absolute; inset: 12px 0 0 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.chart-grid span { border-top: 1px dashed #e3e7eb; position: relative; }
.chart-grid span em { position: absolute; left: 0; top: -.65rem; font-size: .68rem; color: var(--muted); font-style: normal; background: var(--surface); padding-right: .25rem; }
.chart-col { flex: 1; height: 100%; display: flex; align-items: flex-end; justify-content: center; position: relative; cursor: default; }
.chart-bar { width: min(70%, 26px); background: var(--accent); border-radius: 4px 4px 0 0; min-height: 0; transition: background .15s; }
.chart-col:hover .chart-bar, .chart-col:focus .chart-bar { background: var(--accent-dark); }
.chart-tip { display: none; position: absolute; bottom: calc(100% - 4px); left: 50%; transform: translateX(-50%); background: var(--nav); color: #fff; font-size: .75rem; padding: .35rem .55rem; border-radius: 6px; white-space: nowrap; z-index: 2; pointer-events: none; }
.chart-col:hover .chart-tip, .chart-col:focus .chart-tip { display: block; }
.chart-x { display: flex; gap: 2px; margin-top: .35rem; }
.chart-x span { flex: 1; text-align: center; font-size: .68rem; color: var(--muted); }
.chart-x span:nth-child(even) { visibility: hidden; }

/* Order timeline */
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; padding: 0 0 1rem 1.6rem; font-size: .88rem; }
.timeline li::before { content: ''; position: absolute; left: 5px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); }
.timeline li::after { content: ''; position: absolute; left: 9px; top: 18px; bottom: -2px; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.current::before { background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.progress-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: .75rem 0 .35rem; }
.progress-steps span { height: 6px; border-radius: 3px; background: #e3e7eb; }
.progress-steps span.done { background: var(--accent); }
.progress-labels { display: grid; grid-template-columns: repeat(4, 1fr); font-size: .74rem; color: var(--muted); }
.progress-labels span:not(:first-child) { text-align: center; }
.progress-labels span:last-child { text-align: right; }

.shipment { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.shipment + .shipment { margin-top: 1rem; }
.shipment-head { background: var(--surface-2); padding: .8rem 1rem; display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: center; border-bottom: 1px solid var(--border); }
.shipment-body { padding: 1rem; }
.address-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.address-card { border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; background: var(--surface); font-size: .9rem; display: flex; flex-direction: column; gap: .15rem; }
.address-card.is-default { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.address-card .actions { margin-top: auto; padding-top: .75rem; display: flex; gap: .75rem; flex-wrap: wrap; }
.address-add { border: 2px dashed var(--border-strong); display: grid; place-items: center; min-height: 170px; color: var(--muted); font-weight: 600; text-align: center; }
.address-add:hover { border-color: var(--accent); color: var(--accent-dark); text-decoration: none; }
.img-preview { width: 100%; max-width: 280px; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); margin-bottom: .6rem; }

/* ---------- Footer ---------- */
.footer { background: var(--nav); color: #cfdcd7; margin-top: 3rem; }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 2.75rem 1.25rem 2rem; display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 2rem; }
.footer-brand p { color: #a9bdb6; font-size: .9rem; margin-top: .8rem; max-width: 280px; }
.footer h4 { color: #fff; font-size: .95rem; margin-bottom: .7rem; }
.footer a { display: block; color: #cfdcd7; font-size: .88rem; padding: .18rem 0; }
.footer a:hover { color: #fff; }
.footer .logo { display: inline-flex; }
.muted-light { color: #9fb3ac; font-size: .85rem; }
.footer-base { border-top: 1px solid rgba(255,255,255,.08); text-align: center; padding: 1.1rem; font-size: .8rem; color: #8fa59d; }

/* ---------- Responsive ---------- */
@media (max-width: 1200px) {
  .product-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .buybox-col { grid-column: 1 / -1; }
  .buybox, .product-gallery { position: static; }
  .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; padding: 2rem 1.5rem; }
  .search-layout, .cart-layout, .dash-cols, .reviews-layout { grid-template-columns: 1fr; }
  .filters, .summary { position: static; }
  .value-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash { grid-template-columns: 1fr; background: none; }
  .dash-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: .75rem; }
  .dash-side-head { display: none; }
  .dash-nav { display: flex; overflow-x: auto; gap: .25rem; }
  .dash-nav a { white-space: nowrap; margin: 0; }
  .dash-switch { display: none; }
  .dash-main { padding: 1.25rem 1rem 2.5rem; }
  .footer-inner { grid-template-columns: repeat(2, 1fr); }
  .footer-brand { grid-column: 1 / -1; }
  .sell-cta { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .topbar-inner { flex-wrap: wrap; gap: .5rem; padding: .5rem .75rem; }
  .searchbar { order: 3; flex-basis: 100%; max-width: none; }
  .searchbar button { padding: 0 .9rem; }
  .topnav { margin-left: auto; }
  .hide-sm { display: none !important; }
  .product-layout { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
  .pcard-price .price { font-size: 1.1rem; }
  .cart-item { grid-template-columns: 80px 1fr; }
  .cart-item img { width: 80px; height: 60px; }
  .cart-item > .right { grid-column: 2; text-align: left; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: .6rem; }
  .stat-value { font-size: 1.35rem; }
  .shop-main { padding: .75rem; }
  .dash-title h1 { font-size: 1.35rem; }
  .table-stack thead { display: none; }
  .table-stack tr { display: block; border-bottom: 1px solid var(--border); padding: .5rem 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .3rem .5rem; }
  .table-stack td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: .8rem; font-weight: 600; }
}

/* ---------- Admin ---------- */
.menu-details { position: relative; display: inline-block; }
.menu-details > summary { list-style: none; }
.menu-details > summary::-webkit-details-marker { display: none; }
.menu-details-panel {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: .75rem; min-width: 250px; white-space: normal; text-align: left;
}
.menu-details-panel form + form { margin-top: .5rem; }
.menu-details-panel .btn-link { display: block; padding: .25rem 0; font-size: .9rem; }
.chart-x-sparse span { visibility: visible !important; white-space: nowrap; overflow: visible; text-align: left; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }

.btn-ghost-light { background: transparent; border-color: rgba(255,255,255,.4); color: #fff; }
.btn-ghost-light:hover { background: rgba(255,255,255,.1); color: #fff; }
.order-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.2rem; display: grid; grid-template-columns: 1fr auto; gap: 1rem; align-items: center; }
.order-card + .order-card { margin-top: .75rem; }
.order-card-top { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; margin-bottom: .35rem; }
.order-card-meta { font-size: .85rem; color: var(--muted); display: flex; gap: .4rem 1rem; flex-wrap: wrap; margin-bottom: .7rem; }
.order-card-meta strong { color: var(--ink); font-weight: 600; }
.order-card-actions { display: flex; flex-direction: column; gap: .4rem; min-width: 150px; }
@media (max-width: 720px) { .order-card { grid-template-columns: 1fr; } .order-card-actions { flex-direction: row; } }

/* ---------- Brand logo images ---------- */
.logo img { display: block; height: 42px; width: auto; }
.footer .logo img { height: 60px; }
@media (max-width: 720px) { .logo img { height: 30px; } }
