/* WineGrapeTrader shop — matches the WordPress front page: cream header, burgundy + gold, clean white body. */
:root {
  --cream: #F8F5F0;
  --white: #ffffff;
  --ink: #2a2326;
  --muted: #6f6669;
  --line: #e9e3db;
  --burgundy: #4A121F;
  --wine: #6b1f2a;
  --gold: #B08D57;
  --ok: #2f6b3a;
  --warn: #9a6a12;
  --err: #a12a2a;
  --radius: 6px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --accent: var(--wine);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--white); color: var(--ink); font: 15px/1.6 var(--sans); }
img { max-width: 100%; display: block; }
a { color: var(--wine); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; color: var(--burgundy); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 2.3rem; } h2 { font-size: 1.7rem; } h3 { font-size: 1.25rem; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hide { display: none !important; }

/* Header — mirrors the WP header */
.site-header { background: var(--cream); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 96px; }
.logo img { height: 48px; width: auto; }
.logo .logo-text { font-family: var(--serif); font-size: 1.5rem; color: var(--burgundy); font-weight: 700; letter-spacing: .04em; }
.main-nav { display: flex; gap: 34px; }
.main-nav a { font-family: var(--serif); text-transform: uppercase; letter-spacing: .22em; font-size: .92rem; color: var(--burgundy); font-weight: 600; }
.main-nav a.active, .main-nav a:hover { color: var(--gold); text-decoration: none; }
.header-icons { display: flex; align-items: center; gap: 18px; }
.header-icons a { color: var(--burgundy); position: relative; display: inline-flex; }
.header-icons svg { width: 22px; height: 22px; }
.badge { position: absolute; top: -8px; right: -10px; background: var(--wine); color: #fff; font-size: .7rem; border-radius: 10px; padding: 0 6px; line-height: 18px; }
.nav-toggle { display: none; background: none; border: 0; color: var(--burgundy); cursor: pointer; }
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 96px; background: var(--cream); flex-direction: column; gap: 0; border-bottom: 1px solid var(--line); z-index: 20; }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 14px 16px; border-top: 1px solid var(--line); }
  .site-header { position: relative; }
}

/* Footer */
.site-footer { margin-top: 64px; background: var(--burgundy); color: #eadfd2; padding: 36px 0; font-size: .9rem; }
.site-footer a { color: #f1e6d6; }
.site-footer .cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; }

/* Messages */
.messages { list-style: none; padding: 0; margin: 16px 0; }
.messages li { padding: 10px 14px; border-radius: var(--radius); margin-bottom: 8px; background: #f3efe9; border-left: 3px solid var(--gold); }
.messages .success { border-color: var(--ok); background: #eef6ef; }
.messages .error { border-color: var(--err); background: #fbeeee; }
.messages .warning { border-color: var(--warn); background: #fbf5e8; }

/* Buttons */
.btn { display: inline-block; background: var(--wine); color: #fff; border: 1px solid var(--wine); border-radius: 30px; padding: 10px 22px; font: 600 .9rem var(--sans); cursor: pointer; letter-spacing: .02em; }
.btn:hover { background: var(--burgundy); text-decoration: none; }
.btn.ghost { background: transparent; color: var(--wine); }
.btn.ghost:hover { background: var(--cream); }
.btn.small { padding: 6px 14px; font-size: .8rem; }
.btn.danger { background: #fff; color: var(--err); border-color: #e3c0c0; }
.btn.wblock { display: block; width: 100%; text-align: center; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* Section heading */
.section { padding: 48px 0 8px; }
.section-head { text-align: center; margin-bottom: 28px; }
.section-head .rule { width: 80px; height: 1px; background: var(--gold); margin: 10px auto 0; }
.eyebrow { font-family: var(--serif); text-transform: uppercase; letter-spacing: .25em; color: var(--gold); font-size: .85rem; }

/* Four wine blocks */
.blocks { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.wblock { display: block; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; text-align: center; padding: 26px 16px 22px; transition: border-color .2s, box-shadow .2s; color: var(--ink); }
.wblock:hover { border-color: var(--gold); box-shadow: 0 6px 24px rgba(74,18,31,.07); text-decoration: none; }
.wblock img { height: 190px; margin: 0 auto 14px; }
.wblock h3 { margin: 0; font-size: 1.4rem; }
.wblock p { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }
@media (max-width: 900px) { .blocks { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .wblock img { height: 140px; } .blocks { gap: 12px; } }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 22px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.card:hover { border-color: var(--gold); }
.card .img { aspect-ratio: 7 / 9; background: #fff; display: block; }
.card .img img { width: 100%; height: 100%; object-fit: contain; }
.card .noimg { aspect-ratio: 7/9; display: flex; align-items: center; justify-content: center; color: var(--muted); background: var(--cream); font-size: .85rem; }
.card .body { padding: 12px 14px 16px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card .seller { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--gold); }
.card .name { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--burgundy); line-height: 1.2; }
.card .meta { font-size: .8rem; color: var(--muted); }
.card .price { margin-top: auto; padding-top: 8px; font-weight: 600; }

/* Filters */
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin: 0 0 22px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.filters select, .filters input { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
.tabs a { padding: 6px 16px; border: 1px solid var(--line); border-radius: 20px; color: var(--ink); font-size: .9rem; }
.tabs a.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Product detail */
.pd { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; padding-top: 32px; }
.pd .gallery .main { border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 7/9; background: #fff; }
.pd .gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.pd .thumbs { display: flex; gap: 10px; margin-top: 10px; }
.pd .thumbs button { border: 1px solid var(--line); border-radius: 4px; padding: 0; width: 70px; background: #fff; cursor: pointer; }
.pd .thumbs button.on { border-color: var(--gold); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; font-size: .92rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.price-big { font-size: 1.8rem; font-family: var(--serif); color: var(--burgundy); font-weight: 700; }
.sawis { display: inline-flex; gap: 6px; align-items: center; font-size: .8rem; color: var(--ok); border: 1px solid #cfe2d2; background: #f2f8f3; border-radius: 20px; padding: 3px 10px; }
.qty-row { display: flex; gap: 10px; align-items: center; margin: 16px 0; }
.qty-row input { width: 80px; padding: 9px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; }
@media (max-width: 800px) { .pd { grid-template-columns: 1fr; gap: 20px; } }

/* Storefront (vendor's own site feel) */
.store-hero { position: relative; background: var(--cream); }
.store-hero .banner { width: 100%; aspect-ratio: 16/5; object-fit: cover; }
.store-hero .banner-blank { height: 120px; background: linear-gradient(180deg, var(--cream), #fff); }
.store-id { display: flex; gap: 20px; align-items: flex-end; margin-top: -52px; position: relative; }
.store-id .slogo { width: 112px; height: 112px; border-radius: 8px; border: 4px solid #fff; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.08); object-fit: contain; }
.store-id .slogo.blank { display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 2.4rem; color: var(--accent); }
.store-id h1 { margin: 0; color: var(--accent); }
.store-nav { border-bottom: 1px solid var(--line); margin: 20px 0 28px; display: flex; gap: 24px; overflow-x: auto; }
.store-nav a { padding: 10px 0; color: var(--ink); white-space: nowrap; border-bottom: 2px solid transparent; }
.store-nav a.on { border-color: var(--accent); color: var(--accent); }
.store-cols { display: grid; grid-template-columns: 1fr 300px; gap: 36px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: #fff; margin-bottom: 18px; }
.panel h3 { font-size: 1.1rem; }
@media (max-width: 860px) { .store-cols { grid-template-columns: 1fr; } .store-id { margin-top: -36px; } .store-id .slogo { width: 84px; height: 84px; } }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.table td.num, .table th.num { text-align: right; white-space: nowrap; }
.table tfoot td { font-weight: 700; border-bottom: 0; }
.table-wrap { overflow-x: auto; }

/* Forms */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.form-grid .full { grid-column: 1 / -1; }
@media (max-width: 700px) { .form-grid { grid-template-columns: 1fr; } }
.field label, .field > .lbl { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 4px; }
.field .req { color: var(--err); }
.field input[type=text], .field input[type=email], .field input[type=number], .field input[type=password], .field input[type=url], .field input[type=tel],
.field select, .field textarea { width: 100%; padding: 10px 12px; border: 1px solid #d9d1c6; border-radius: var(--radius); font: inherit; background: #fff; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid rgba(176,141,87,.35); border-color: var(--gold); }
.field .help { font-size: .78rem; color: var(--muted); margin-top: 3px; }
.field .errorlist, .errorlist { list-style: none; padding: 0; margin: 4px 0 0; color: var(--err); font-size: .82rem; }
.field ul:not(.errorlist) { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; }
.field ul:not(.errorlist) label { font-weight: 400; display: inline-flex; gap: 6px; align-items: center; }
.check { display: flex; gap: 8px; align-items: flex-start; }
.check input { margin-top: 4px; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 18px; margin: 0 0 20px; }
legend { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; color: var(--burgundy); padding: 0 6px; }
.callout { padding: 12px 14px; border-radius: var(--radius); background: var(--cream); border: 1px solid var(--line); font-size: .9rem; }
.callout.reg { background: #f2f8f3; border-color: #cfe2d2; }

/* Cart / checkout */
.cart-group { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 24px; }
.cart-group .head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 16px; background: var(--cream); border-bottom: 1px solid var(--line); border-radius: var(--radius) var(--radius) 0 0; }
.cart-group .foot { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; }
.cart-thumb { width: 48px; }
.qty { width: 64px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; }
.checkout { display: grid; grid-template-columns: 1fr 360px; gap: 32px; }
@media (max-width: 900px) { .checkout { grid-template-columns: 1fr; } }
.opt { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; cursor: pointer; }
.opt.on { border-color: var(--gold); background: #fffdf9; }
.opt.na { opacity: .45; cursor: not-allowed; }
.opt .fee { margin-left: auto; font-weight: 600; white-space: nowrap; }
.sum-row { display: flex; justify-content: space-between; padding: 4px 0; }
.sum-row.total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 1.1rem; }

/* Status pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: .75rem; font-weight: 600; background: #eee; color: #444; white-space: nowrap; }
.pill.pending { background: #fbf2de; color: #8a5d00; }
.pill.paid, .pill.processing { background: #e6f0fb; color: #1d4f8a; }
.pill.shipped, .pill.ready { background: #efe7f7; color: #5b2a86; }
.pill.delivered { background: #e7f4ea; color: #2f6b3a; }
.pill.cancelled, .pill.refunded { background: #f6e6e6; color: #8a2b2b; }
.pill.approved { background: #e7f4ea; color: #2f6b3a; }
.pill.suspended { background: #f6e6e6; color: #8a2b2b; }

/* Age gate */
.gate { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--cream); padding: 16px; }
.gate .box { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 40px 32px; max-width: 440px; text-align: center; }
.gate .box img { height: 64px; margin: 0 auto 16px; }
.gate .row { display: flex; gap: 12px; justify-content: center; margin-top: 22px; }

/* ===== Vendor dashboard ===== */
.dash { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; background: #faf8f5; }
.dash-side { background: #fff; border-right: 1px solid var(--line); padding: 20px 0; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.dash-side .brand { display: flex; gap: 10px; align-items: center; padding: 0 20px 18px; border-bottom: 1px solid var(--line); margin-bottom: 10px; }
.dash-side .brand img { width: 40px; height: 40px; object-fit: contain; border-radius: 6px; border: 1px solid var(--line); }
.dash-side .brand .ini { width: 40px; height: 40px; border-radius: 6px; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 1.3rem; }
.dash-side .brand b { display: block; line-height: 1.2; font-size: .95rem; }
.dash-side nav a { display: flex; gap: 10px; align-items: center; padding: 10px 20px; color: var(--ink); font-size: .92rem; border-left: 3px solid transparent; }
.dash-side nav a:hover { background: var(--cream); text-decoration: none; }
.dash-side nav a.on { border-color: var(--accent); background: var(--cream); color: var(--accent); font-weight: 600; }
.dash-side nav svg { width: 18px; height: 18px; flex: none; }
.dash-side .sep { height: 1px; background: var(--line); margin: 10px 20px; }
.dash-main { padding: 28px 32px 60px; min-width: 0; }
.dash-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.dash-top h1 { margin: 0; font-size: 1.9rem; }
.dash-burger { display: none; }
@media (max-width: 900px) {
  .dash { grid-template-columns: 1fr; }
  .dash-side { position: fixed; z-index: 40; width: 260px; transform: translateX(-100%); transition: transform .2s; box-shadow: 0 0 30px rgba(0,0,0,.1); }
  .dash-side.open { transform: none; }
  .dash-main { padding: 16px 16px 48px; }
  .dash-burger { display: inline-flex; }
}
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 1000px) { .kpis { grid-template-columns: repeat(2, 1fr); } }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .l { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.kpi .v { font-family: var(--serif); font-size: 1.9rem; font-weight: 700; color: var(--burgundy); line-height: 1.2; margin-top: 4px; }
.kpi .s { font-size: .8rem; color: var(--muted); }
.card-d { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 18px; }
.card-d > h2, .card-d > h3 { font-size: 1.25rem; }
.two { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }
@media (max-width: 1000px) { .two { grid-template-columns: 1fr; } }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 140px; padding-top: 10px; }
.bars span { flex: 1; background: var(--accent); opacity: .85; border-radius: 2px 2px 0 0; min-height: 2px; }
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { padding: 6px 0; display: flex; gap: 8px; align-items: center; }
.checklist .y { color: var(--ok); } .checklist .n { color: #c9bfb3; }
.calc { background: var(--cream); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.calc .sum-row b { font-variant-numeric: tabular-nums; }
.calc .commission { color: var(--wine); }
.img-strip { display: flex; flex-wrap: wrap; gap: 12px; }
.img-strip .it { width: 120px; text-align: center; font-size: .75rem; }
.img-strip .it img { border: 1px solid var(--line); border-radius: 4px; background: #fff; }
.img-strip form { display: inline; }
.linkbtn { background: none; border: 0; color: var(--wine); cursor: pointer; font: inherit; font-size: .75rem; padding: 2px 4px; }
.rules { font-size: .82rem; color: var(--muted); margin: 6px 0 12px; padding-left: 18px; }
.swatches ul { gap: 10px !important; }
.swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; vertical-align: middle; }

@media print {
  .site-header, .site-footer, .dash-side, .no-print { display: none !important; }
  .dash { display: block; background: #fff; }
}

/* Grape tick boxes */
.grapes-box > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 4px 14px; }
.grapes-box > div > div label { font-weight: 400; display: flex; gap: 8px; align-items: center; padding: 4px 0; cursor: pointer; }
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .name { font-size: 1.05rem; }
  .card .body { padding: 10px; }
}
