:root {
  --green: #0b6b3a; --green-dark: #07502b; --green-soft: #e7f3ec;
  --brand-red: #c8102e; --brand-red-dark: #a00c24; --orange: var(--brand-red); --bg: #f7f7f4; --card: #fff; --text: #1d2420;
  --muted: #6b746e; --line: #e3e5e1; --red: #c92a2a; --radius: 12px;
}
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text); }
a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: 1.7rem; margin: .4em 0 .6em; }
h2 { margin: 1.6em 0 .7em; }
h3 { margin: 1em 0 .4em; font-size: 1.05rem; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
main.wrap { min-height: 60vh; padding-bottom: 48px; }
.muted, .unit { color: var(--muted); font-size: .9rem; }
.warn { color: var(--red); font-weight: 600; }
.num { text-align: right; white-space: nowrap; }

/* header */
.topbar { background: #fff; position: sticky; top: 0; z-index: 10; border-top: 4px solid var(--green); box-shadow: 0 1px 0 var(--line); }
.topbar-inner { display: flex; align-items: center; gap: 20px; padding-top: 8px; padding-bottom: 8px; }
.logo { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.logo:hover { text-decoration: none; }
.logo-img { height: 54px; width: auto; }
.wordmark { display: flex; flex-direction: column; font-weight: 900; font-size: 1.35rem; line-height: 1.05; letter-spacing: .5px; }
.wm-green { color: var(--green); }
.wm-red { color: var(--brand-red); }
.wordmark small { color: var(--green); font-weight: 600; font-size: .85rem; letter-spacing: 0; }
.search { flex: 1; }
.search input { width: 100%; padding: 10px 16px; border-radius: 999px; border: 2px solid var(--green); font-size: 1rem; }
.account-link { color: var(--green); font-weight: 600; white-space: nowrap; }
.cart-link { background: var(--green); color: #fff; font-weight: 600; white-space: nowrap; padding: 9px 16px; border-radius: 999px; }
.cart-link:hover { background: var(--green-dark); text-decoration: none; }
.badge { background: var(--orange); border-radius: 999px; padding: 1px 8px; font-size: .85rem; }
.catnav { background: var(--green); }
.catnav-inner { display: flex; gap: 20px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.catnav a { color: #fff; white-space: nowrap; font-size: .95rem; font-weight: 500; }
.catnav .offer-link { background: var(--brand-red); padding: 0 10px; border-radius: 999px; font-weight: 700; }

/* flash */
.flash { margin: 16px 0 0; padding: 10px 14px; border-radius: 8px; background: var(--green-soft); }
.flash-error { background: #fdecec; color: var(--red); }
.flash-info { background: #fff4e6; }

/* hero */
.hero-wrap { margin-top: 24px; }
.hero-slider .slider-track { grid-auto-columns: 100%; gap: 0; padding: 0; border-radius: var(--radius); }
.hero-slider .slider-btn.prev { left: 10px; }
.hero-slider .slider-btn.next { right: 10px; }
.hero-wrap .slider-dots { margin-top: 12px; }
.banner-slide { scroll-snap-align: start; position: relative; display: block; aspect-ratio: 8 / 3; border-radius: var(--radius); overflow: hidden; background: var(--green-soft); }
.banner-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: var(--focus, 50%) 50%; }
.hero { scroll-snap-align: start; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: #fff; border: 1px solid var(--line); border-left: 6px solid var(--brand-red); border-radius: var(--radius); padding: 32px 36px; }
.eyebrow { color: var(--brand-red); font-weight: 800; letter-spacing: 2px; text-transform: uppercase; font-size: .8rem; margin: 0 0 8px; }
.hero h1 { color: var(--green); }
.hero-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.hero-logo { width: 340px; max-width: 42%; height: auto; }
.hero h1 { font-size: 2.2rem; margin-top: 0; }
.hero p { max-width: 520px; color: #3b453f; }

/* buttons */
.btn { display: inline-block; border: 1px solid var(--line); background: #fff; color: var(--text); padding: 10px 18px; border-radius: 999px; font: inherit; font-weight: 600; cursor: pointer; text-align: center; }
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn-primary:hover { background: var(--green-dark); }
.btn-red { background: var(--brand-red); border-color: var(--brand-red); color: #fff; }
.btn-red:hover { background: var(--brand-red-dark); }
.btn-add { width: 100%; background: var(--green-soft); color: var(--green-dark); border-color: transparent; }
.btn-add:hover { background: var(--green); color: #fff; }
.btn-disabled { opacity: .5; cursor: not-allowed; width: 100%; }
.full { width: 100%; margin-top: 12px; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; font: inherit; }
.link-btn:hover { color: var(--red); }

/* categories */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; }
.cat-tile { background: var(--card); border-radius: var(--radius); padding: 18px 10px; text-align: center; color: var(--text); font-weight: 600; border: 1px solid var(--line); }
.cat-tile span { display: block; font-size: 2.2rem; }
.cat-tile:hover { border-color: var(--green); text-decoration: none; }

/* product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 16px; }
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; }
.card-img { position: relative; display: flex; align-items: center; justify-content: center; height: 140px; background: #fafaf7; }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; }
.soon { color: var(--muted); font-weight: 600; font-size: .95rem; }
.emoji { font-size: 4rem; }
.emoji.big { font-size: 9rem; }
.card-body { padding: 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-body form { margin-top: auto; padding-top: 8px; }
.card-title { color: var(--text); font-weight: 600; }
.price .now { font-weight: 800; font-size: 1.1rem; }
.price s { color: var(--muted); font-size: .9rem; }
.tag-sale { position: absolute; top: 8px; left: 8px; background: var(--orange); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; }
.tag-sale.inline { position: static; }

/* pages */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.crumbs { margin-top: 20px; font-size: .9rem; color: var(--muted); }
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: var(--card); padding: 24px; border-radius: var(--radius); border: 1px solid var(--line); }
.detail-img { display: flex; align-items: center; justify-content: center; background: #fafaf7; border-radius: var(--radius); min-height: 280px; }
.detail-img { background: #fff; }
.detail-img img { max-width: 100%; max-height: 420px; object-fit: contain; border-radius: var(--radius); }
.big-price .now { font-size: 1.6rem; }
.add-row { display: flex; gap: 12px; align-items: center; }
.add-row input { width: 70px; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-top: 16px; }
.two-col { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
.summary { position: sticky; top: 130px; }
.summary .row { display: flex; justify-content: space-between; padding: 4px 0; }
.summary .row.small { font-size: .9rem; }
.summary .total, .lines .total td { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); }
.hint { background: var(--green-soft); padding: 8px 12px; border-radius: 8px; font-size: .9rem; }
.lines { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.lines td { padding: 10px 6px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.li-emoji { font-size: 1.8rem; width: 44px; }
.lines input[type=number] { width: 64px; }

input, select, textarea { font: inherit; padding: 9px 11px; border: 1px solid #cfd3cd; border-radius: 8px; background: #fff; color: var(--text); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--green); border-color: transparent; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-weight: 600; font-size: .92rem; }
.field input, .field select, .field textarea { font-weight: 400; }
.field-row { display: flex; gap: 12px; flex-wrap: wrap; }
.field-row .field { flex: 1; min-width: 140px; }
.check { display: block; margin: 8px 0; }
.err { color: var(--red); font-weight: 500; }
.choice { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.choice label { border: 1px solid var(--line); padding: 10px 12px; border-radius: 8px; cursor: pointer; }
.choice label:has(input:checked) { border-color: var(--green); background: var(--green-soft); }
.narrow { max-width: 420px; margin: 40px auto; }
.narrow.wide { max-width: 680px; margin-top: 16px; }
.confirm { max-width: 720px; margin: 32px auto; }
.confirm-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* accounts & invoices */
.auth-switch { text-align: center; margin: 16px 0 0; }
.two-col.even { grid-template-columns: 1fr 1fr; }
.invoice-box { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: #fff8f8; border: 1px dashed var(--brand-red); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.admin-who { margin-left: auto; color: #b9d3c3; font-size: .9rem; }
.admin-nav .admin-who + form { margin-left: 0; }

/* status pills */
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: #eef0ec; white-space: nowrap; }
.pill-paid, .pill-completed { background: #d3f9d8; color: #1b5e20; }
.pill-unpaid, .pill-new { background: #fff3bf; color: #7a5a00; }
.pill-confirmed { background: #e3fafc; color: #0b6b7a; }
.pill-role-admin { background: #fdecec; color: var(--brand-red); }
.pill-role-sales { background: #d0ebff; color: #134a7a; }
.pill-role-customer { background: var(--green-soft); color: var(--green-dark); }
.pill-packing, .pill-out_for_delivery { background: #d0ebff; color: #134a7a; }
.pill-cancelled, .pill-refunded { background: #fdecec; color: var(--red); }

/* admin */
.admin-nav { display: flex; gap: 20px; align-items: center; margin-top: 20px; padding: 12px 16px; background: var(--green-dark); border-radius: var(--radius); }
.admin-nav a, .admin-nav .link-btn { color: #fff; }
.admin-nav form { margin-left: auto; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.stat span { color: var(--muted); display: block; font-size: .9rem; }
.stat strong { font-size: 1.6rem; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters a { padding: 4px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-size: .9rem; text-transform: capitalize; }
.filters a.active { background: var(--green); color: #fff; border-color: var(--green); }
.scroll-x { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.admin-table th { text-align: left; color: var(--muted); font-weight: 600; padding: 8px; border-bottom: 2px solid var(--line); }
.admin-table td { padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.admin-table tr.dim { opacity: .5; }
.admin-table td.wrap { white-space: normal; min-width: 160px; }
.admin-thumb { width: 40px; height: 40px; object-fit: contain; background: #fff; border-radius: 6px; vertical-align: middle; }
.bulk-table input.money { width: 80px; text-align: right; padding: 6px 8px; }
.bulk-table input.qty { width: 70px; padding: 6px 8px; }
.bulk-save { position: sticky; bottom: 0; background: #fff; padding: 12px 0 2px; text-align: right; border-top: 1px solid var(--line); }
.admin-filters { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.admin-filters input[type=search] { flex: 1; min-width: 180px; }

.footer { background: var(--green-dark); border-top: 4px solid var(--brand-red); color: #cfd8d2; padding: 32px 0; font-size: .92rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer a { color: #9be3b8; }

/* brands slideshow */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; border-bottom: 1px solid var(--line); margin: 1.6em 0 18px; }
.section-head h2 { margin: 0; padding-bottom: 10px; border-bottom: 4px solid var(--brand-red); margin-bottom: -2px; }
.see-all { color: var(--brand-red); font-weight: 700; font-size: .9rem; letter-spacing: .5px; padding-bottom: 10px; text-decoration: underline; }
.slider { position: relative; }
.slider-track { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * 20px) / 4); gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; padding: 2px; }
.slider-track::-webkit-scrollbar { display: none; }
.brand-tile { scroll-snap-align: start; display: flex; align-items: center; justify-content: center; height: 140px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; transition: border-color .15s, box-shadow .15s; }
.brand-tile:hover { border-color: var(--green); box-shadow: 0 4px 14px rgba(0,0,0,.06); text-decoration: none; }
.brand-tile img { max-height: 100%; max-width: 100%; object-fit: contain; background: transparent; }
.brand-name { font-size: 1.6rem; font-weight: 900; color: var(--green); letter-spacing: .5px; text-align: center; }
.slider-cats .slider-track { grid-auto-columns: calc((100% - 6 * 14px) / 7); gap: 14px; }
.slider-cats .cat-tile { scroll-snap-align: start; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 120px; }
.slider-btn { position: absolute; top: 50%; transform: translateY(-50%); z-index: 2; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: #fff; color: var(--green); font-size: 1.5rem; line-height: 1; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.slider-btn.prev { left: -14px; }
.slider-btn.next { right: -14px; }
.slider-btn[hidden] { display: none; }
.slider-dots { display: flex; justify-content: center; gap: 8px; margin-top: 16px; min-height: 12px; }
.slider-dots button { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--brand-red); background: transparent; padding: 0; cursor: pointer; }
.slider-dots button.active { background: var(--brand-red); }
.brand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; }
.brand-meta { display: flex; justify-content: space-between; padding: 8px 4px; }
.brand-hero { display: flex; align-items: center; gap: 24px; }
.brand-hero img { width: 140px; height: 140px; object-fit: contain; }
.admin-logo { height: 40px; width: 60px; object-fit: contain; vertical-align: middle; }
.admin-logo.big { height: 100px; width: 140px; display: block; margin: 6px 0; }

/* floating cart */
.float-cart { position: fixed; right: 0; top: 50%; transform: translateY(-50%); z-index: 20; display: flex; flex-direction: column; width: 96px; border-radius: 12px 0 0 12px; overflow: hidden; box-shadow: 0 6px 20px rgba(0,0,0,.18); text-align: center; }
.float-cart { cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.float-cart:hover { text-decoration: none; }
.float-cart.moved { border-radius: 12px; }
.float-cart.dragging { cursor: grabbing; box-shadow: 0 12px 30px rgba(0,0,0,.28); opacity: .95; }
.float-cart img, .float-cart svg { pointer-events: none; }
.fc-top { background: var(--green); color: #fff; padding: 12px 6px 8px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: .9rem; font-weight: 600; }
.fc-total { background: #fff; color: var(--brand-red); font-weight: 800; padding: 8px 4px; font-size: 1rem; }

@media (max-width: 760px) {
  .slider-track { grid-auto-columns: calc((100% - 12px) / 2); gap: 12px; }
  .brand-tile { height: 110px; }
  .slider-cats .slider-track { grid-auto-columns: calc((100% - 3 * 10px) / 4); gap: 10px; }
  .slider-cats .cat-tile { min-height: 96px; font-size: .8rem; padding: 10px 4px; }
  .slider-cats .cat-tile span { font-size: 1.8rem; }
  .slider-btn { display: none; }
  .float-cart { top: auto; bottom: 16px; right: 16px; transform: none; width: 84px; border-radius: 12px; }

  .topbar-inner { flex-wrap: wrap; }
  .search { order: 3; flex-basis: 100%; }
  .cart-link { margin-left: auto; }
  .hero { flex-direction: column; padding: 24px; text-align: left; }
  .hero-slider .slider-track { align-items: start; overflow-y: hidden; transition: height .3s ease; }
  .hero-slider .slider-btn { display: none; }
  .hero h1 { font-size: 1.7rem; }
  .hero-logo { max-width: 70%; align-self: center; order: -1; }
  .logo-img { height: 44px; }
  .wordmark { font-size: 1.1rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-img { height: 110px; }
  .emoji { font-size: 3rem; }
  .product-detail, .two-col, .confirm-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  .stats { grid-template-columns: 1fr; }
  .two-col.even { grid-template-columns: 1fr; }
  .account-link span { display: none; }
  .admin-nav { flex-wrap: wrap; gap: 12px; }
}

/* website editor */
.announce { background: var(--brand-red); color: #fff; text-align: center; padding: 7px 16px; font-weight: 600; font-size: .92rem; }
.announce a { color: #fff; text-decoration: underline; }
.catnav .nav-extra { font-weight: 700; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 28px; }
.footer-grid strong { color: #fff; display: block; margin-bottom: 6px; }
.footer-grid .footer-name { display: inline; }
.footer-grid p { margin: 6px 0 10px; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin: 4px 0; }
.footer-account { margin-top: 10px; }
.socials { display: flex; gap: 8px; margin-top: 12px; }
.socials a { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; font-weight: 800; }
.socials a:hover { background: var(--brand-red); text-decoration: none; }
.copyright { margin-top: 22px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.15); font-size: .85rem; color: #a9bfb2; }
.cms-page { max-width: 820px; margin: 24px auto; padding: 28px 36px; line-height: 1.7; }
.cms-page h1 { color: var(--green); margin-top: 0; }
.subnav { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.subnav a { padding: 7px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text); font-weight: 600; font-size: .92rem; }
.subnav a.active { background: var(--green); border-color: var(--green); color: #fff; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -2px; }
.tabs a.active { color: var(--green); border-bottom-color: var(--green); }
.tabs a:hover { text-decoration: none; color: var(--green); }
.settings-form { max-width: 760px; }
.setting { padding: 10px 0; border-bottom: 1px dashed var(--line); }
.setting:last-of-type { border-bottom: 0; }
.setting .field { margin-bottom: 4px; }
.help { color: var(--muted); font-size: .85rem; margin: 2px 0 0; }
.check.small { font-size: .88rem; font-weight: 400; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type=color] { width: 56px; height: 38px; padding: 2px; }
.image-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-weight: 400; }
.setting-img { max-height: 70px; max-width: 160px; border: 1px solid var(--line); border-radius: 8px; background: #fff; padding: 4px; }
.setting-img.square { width: 110px; height: 110px; max-height: none; object-fit: contain; }
input.short { width: 110px; }
.wide-input { min-width: 220px; width: 100%; }
.add-row-form h3 { margin-top: 0; }
.banner-row { display: flex; gap: 16px; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid var(--line); }
.banner-row.dim { opacity: .55; }
.banner-thumb { width: 260px; aspect-ratio: 8 / 3; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); }
.banner-fields { flex: 1; }
.link-btn.danger { color: var(--red); }
.danger-zone { margin-top: 12px; text-align: right; }
.prefix-input { display: flex; align-items: center; font-weight: 400; }
.prefix-input span { padding: 9px 4px 9px 10px; background: #f1f3f0; border: 1px solid #cfd3cd; border-right: 0; border-radius: 8px 0 0 8px; color: var(--muted); }
.prefix-input input { border-radius: 0 8px 8px 0; flex: 1; }
.editor-grid { display: grid; grid-template-columns: 1fr 220px; gap: 16px; }
.editor-grid textarea { font-family: ui-monospace, Menlo, monospace; font-size: .92rem; }
.format-help { display: flex; flex-direction: column; gap: 6px; background: #f7f9f7; border-radius: 10px; padding: 12px; font-size: .88rem; }
.format-help code { background: #fff; border: 1px solid var(--line); border-radius: 6px; padding: 3px 6px; }
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
  .banner-row { flex-direction: column; }
  .banner-thumb { width: 100%; }
  .editor-grid { grid-template-columns: 1fr; }
  .cms-page { padding: 20px; }
}

/* promo codes */
.promo-row { display: flex; gap: 8px; margin-bottom: 4px; }
.promo-row input { flex: 1; text-transform: uppercase; }
.ok { color: var(--green); font-weight: 600; }
.summary .discount { color: var(--green); font-weight: 600; }
