@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&display=swap');

:root {
  --orange: #f0622a;
  --orange-dark: #d94f1c;
  --ink: #222222;
  --ink-soft: #757575;
  --bg: #f5f5f5;
  --card: #ffffff;
  --border: #ececec;
  --good: #1a9c6b;
  --bad: #d0342c;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  font-size: 14.5px; line-height: 1.5;
}
* { scrollbar-width: thin; scrollbar-color: rgba(240,98,42,.35) transparent; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: rgba(240,98,42,.3); border-radius: 8px; }
a { color: var(--orange); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

.utility-bar { background: #fff; border-bottom: 1px solid var(--border); font-size: 12.5px; position: sticky; top: 0; z-index: 21; }
.utility-inner { max-width: 1440px; margin: 0 auto; padding: 6px 28px; display: flex; justify-content: space-between; align-items: center; gap: 14px; }
.utility-tag { color: var(--ink-soft); }
.utility-tag i { color: var(--orange); margin-right: 5px; }
.utility-bar nav { display: flex; align-items: center; gap: 14px; }
.utility-bar nav a { color: var(--ink-soft); }
.utility-bar nav a:hover { color: var(--orange); text-decoration: none; }
.utility-hi { font-weight: 600; color: var(--ink); }
@media (max-width: 700px) { .utility-tag { display: none; } }

.account-menu { position: relative; }
.account-trigger { display: flex; align-items: center; gap: 7px; background: none; border: none; font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; padding: 2px 0; }
.account-avatar { width: 20px; height: 20px; border-radius: 50%; background: var(--orange); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 10px; flex-shrink: 0; }
.account-dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 10px;
  background: #fff; border: 1px solid var(--border); border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0,0,0,.1); min-width: 180px; padding: 6px 0;
  display: none; z-index: 30;
}
.account-dropdown.open { display: block; }
.account-dropdown a { display: flex; align-items: center; gap: 9px; padding: 9px 14px; color: var(--ink); font-size: 13px; }
.account-dropdown a:hover { background: var(--bg); text-decoration: none; color: var(--ink); }
.account-dropdown a i { width: 14px; color: var(--ink-soft); }

.topbar {
  display: flex; align-items: center; gap: 32px;
  padding: 18px 28px; background: var(--orange); color: #fff;
  position: sticky; top: 30px; z-index: 20;
}
.topbar .brand { font-size: 27px; font-weight: 800; color: #fff; flex-shrink: 0; display: flex; align-items: center; gap: 9px; }
.topbar .brand-mark { font-size: 22px; }
.topbar-search { flex: 1; max-width: 760px; display: flex; background: #fff; border-radius: 4px; overflow: hidden; }
.topbar-search input { flex: 1; border: none; padding: 12px 18px; font-family: inherit; font-size: 14.5px; outline: none; }
.topbar-search button { background: var(--orange-dark); color: #fff; border: none; padding: 0 22px; cursor: pointer; }
.topbar .cart-link { position: relative; color: #fff; display: flex; align-items: center; font-size: 21px; flex-shrink: 0; margin-left: auto; }
.topbar .cart-badge {
  position: absolute; top: -8px; right: -10px;
  background: #fff; color: var(--orange); font-size: 10.5px; font-weight: 700;
  border-radius: 20px; min-width: 17px; height: 17px; line-height: 17px; text-align: center; padding: 0 3px;
}
@media (max-width: 700px) { .topbar { flex-wrap: wrap; gap: 12px; position: static; } .topbar-search { order: 3; max-width: none; flex-basis: 100%; } }

.wrap { max-width: 1100px; margin: 0 auto; padding: 24px 20px; }
.narrow { max-width: 420px; }

.hero-section { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; margin-bottom: 20px; }
.hero-main { border-radius: 8px; overflow: hidden; display: block; background: var(--card); border: 1px solid var(--border); aspect-ratio: 2.4; }
.hero-main img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-side-col { display: flex; flex-direction: column; gap: 14px; }
.hero-side { border-radius: 8px; overflow: hidden; display: block; background: var(--card); border: 1px solid var(--border); flex: 1; }
.hero-side img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 700px) { .hero-section { grid-template-columns: 1fr; } .hero-main { aspect-ratio: 1.9; } .hero-side-col { flex-direction: row; } .hero-side { aspect-ratio: 1.6; } }

.perks-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 22px; }
.perk { background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 14px 10px; text-align: center; }
.perk i { color: var(--orange); font-size: 20px; margin-bottom: 6px; display: block; }
.perk .perk-label { font-size: 12px; font-weight: 600; }
@media (max-width: 700px) { .perks-row { grid-template-columns: repeat(2, 1fr); } }

.home-layout { max-width: 1440px; margin: 0 auto; display: flex; align-items: flex-start; gap: 16px; }
.home-layout .wrap { flex: 1; min-width: 0; margin: 0; }
.ad-rail { width: 160px; flex-shrink: 0; display: flex; flex-direction: column; gap: 12px; padding-top: 24px; }
.ad-banner { display: block; border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.ad-banner img { width: 100%; display: block; }
@media (max-width: 1150px) { .ad-rail { display: none; } }

.category-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 20px; }
.category-pill { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 7px 16px; font-size: 13px; color: var(--ink); }
.category-pill.active { background: var(--orange); color: #fff; border-color: var(--orange); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px; }
.product-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; display: block; color: inherit; }
.product-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.08); text-decoration: none; }
.product-card.featured { border-color: var(--orange); box-shadow: 0 0 0 2px rgba(240,98,42,.18); }
.product-card .featured-badge {
  position: absolute; top: 8px; left: 8px; z-index: 1;
  background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
  padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: .03em;
}
.product-card .thumb { width: 100%; aspect-ratio: 1; background: #f0f0f0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .placeholder { color: #bbb; font-size: 12px; }
.product-card .info { padding: 10px 12px 14px; }
.product-card .name { font-size: 13px; color: var(--ink); margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 34px; }
.product-card .price { color: var(--orange); font-weight: 700; font-size: 15px; }
.product-card .stock-note { font-size: 11px; color: var(--ink-soft); margin-top: 3px; }

.card {
  background: var(--card); border: 1px solid var(--border); border-radius: 8px;
  padding: 22px; margin-bottom: 18px;
}
h1 { font-size: 22px; margin: 0 0 6px; }
h2 { font-size: 17px; margin: 0 0 14px; color: var(--ink); }

.product-detail { display: grid; grid-template-columns: 340px 1fr; gap: 28px; }
.product-detail .thumb-lg { width: 100%; aspect-ratio: 1; background: #f0f0f0; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.product-detail .thumb-lg img { width: 100%; height: 100%; object-fit: cover; }
.product-detail .price-lg { font-size: 26px; color: var(--orange); font-weight: 800; margin: 10px 0; }
.product-detail .desc { color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; white-space: pre-line; }
.desc { color: var(--ink-soft); font-size: 13.5px; line-height: 1.7; white-space: pre-line; }
.specs-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.specs-table tr { border-bottom: 1px solid var(--border); }
.specs-table tr:last-child { border-bottom: none; }
.specs-table th { text-align: left; color: var(--ink-soft); font-weight: 500; padding: 9px 16px 9px 0; width: 220px; vertical-align: top; }
.specs-table td { padding: 9px 0; color: var(--ink); }
@media (max-width: 500px) { .specs-table th { width: 120px; } }
@media (max-width: 700px) { .product-detail { grid-template-columns: 1fr; } }

.qty-input { width: 70px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 4px; font-family: inherit; font-size: 14px; }

.shipping-box { display: flex; gap: 12px; align-items: flex-start; background: #fff7f2; border: 1px solid #fbe0d0; border-radius: 6px; padding: 12px 14px; margin: 14px 0; font-size: 13px; }
.shipping-box i { color: var(--orange); margin-top: 2px; }
.stock-pill { color: var(--good); font-weight: 600; }
.stock-pill i { margin-right: 3px; }
.qty-stepper { display: flex; align-items: center; gap: 0; width: fit-content; }
.qty-step-btn { background: var(--card); color: var(--ink); border: 1px solid var(--border); width: 34px; height: 34px; padding: 0; cursor: pointer; }
.qty-stepper .qty-step-btn:first-child { border-radius: 4px 0 0 4px; }
.qty-stepper .qty-step-btn:last-child { border-radius: 0 4px 4px 0; }
.qty-stepper .qty-input { border-radius: 0; border-left: none; border-right: none; text-align: center; width: 56px; }
.qty-step-btn:hover { background: var(--bg); }
.product-actions { display: flex; gap: 10px; margin-top: 16px; }
.product-actions button { flex: 1; }
.product-actions .btn.secondary { background: transparent; }
.product-actions button:disabled { opacity: .5; cursor: not-allowed; }

.variant-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.variant-pill { background: var(--card); border: 1.5px solid var(--border); border-radius: 4px; padding: 7px 16px; font-size: 13px; font-family: inherit; color: var(--ink); cursor: pointer; }
.variant-pill:hover { border-color: var(--orange); }
.variant-pill.active { border-color: var(--orange); background: #fff3ee; color: var(--orange); font-weight: 600; }
.variant-pill.has-swatch { display: inline-flex; align-items: center; gap: 8px; padding-left: 6px; }
.variant-pill .swatch-img { width: 22px; height: 22px; object-fit: cover; border-radius: 3px; flex-shrink: 0; }

.variant-row { display: grid; grid-template-columns: 1fr 1fr 90px 34px; gap: 8px; align-items: center; margin-bottom: 8px; }
.variant-row input { margin: 0; }
.variant-remove-btn { padding: 8px !important; height: 38px; display: flex; align-items: center; justify-content: center; color: var(--bad); border-color: var(--bad); }
@media (max-width: 500px) { .variant-row { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; } }

form label { display: block; font-size: 12.5px; color: var(--ink-soft); margin: 12px 0 4px; }
form input, form select, form textarea { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 4px; font-size: 14px; font-family: inherit; }
form input:focus, form select:focus, form textarea:focus { outline: none; border-color: var(--orange); }

button, .btn {
  background: var(--orange); color: #fff; border: none; border-radius: 4px;
  padding: 11px 22px; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-block; font-family: inherit;
}
button:hover, .btn:hover { background: var(--orange-dark); text-decoration: none; }
.btn.secondary { background: transparent; color: var(--orange); border: 1.5px solid var(--orange); }
.btn.secondary:hover { background: #fff3ee; }
.btn.block { width: 100%; text-align: center; }
.error { color: var(--bad); font-size: 13px; margin: -4px 0 12px; }
.hint { color: var(--ink-soft); font-size: 12.5px; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); font-size: 13.5px; }
th { color: var(--ink-soft); font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; }

.cart-row { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.cart-row .thumb-sm { width: 64px; height: 64px; border-radius: 6px; background: #f0f0f0; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.cart-row .thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.cart-row .name { flex: 1; font-size: 13.5px; }
.cart-row .line-price { color: var(--orange); font-weight: 700; width: 90px; text-align: right; }

.summary-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14px; }
.summary-row.total { font-weight: 700; font-size: 17px; border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; }
.summary-row.total .amt { color: var(--orange); }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; color: #fff; text-transform: uppercase; letter-spacing: .02em; }
.pill.status-pending_payment { background: #e0b65c; }
.pill.status-paid { background: #3b82f6; }
.pill.status-processing { background: #8b5cf6; }
.pill.status-shipped { background: #0ea5e9; }
.pill.status-completed { background: var(--good); }
.pill.status-cancelled { background: var(--bad); }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.stat { background: var(--bg); border-radius: 8px; padding: 16px; text-align: center; }
.stat .num { font-size: 24px; font-weight: 800; color: var(--orange); }
.stat .label { font-size: 11.5px; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .03em; margin-top: 2px; }

.footer { text-align: center; color: var(--ink-soft); font-size: 12px; padding: 30px 20px; }

/* ---- Signed-in app shell (customer account + admin) ------------------ */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px; flex-shrink: 0; background: #1c1c1c; color: #fff;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.sidebar .brand-row { padding: 20px; font-size: 19px; font-weight: 800; }
.sidebar nav { flex: 1; padding: 6px 12px; }
.sidebar nav a {
  display: flex; align-items: center; gap: 12px; color: #d5d5d5; padding: 11px 14px;
  border-radius: 6px; font-size: 13.5px; font-weight: 500; margin-bottom: 2px;
}
.sidebar nav a i { width: 18px; text-align: center; }
.sidebar nav a:hover { background: rgba(255,255,255,.08); text-decoration: none; color: #fff; }
.sidebar nav a.active { background: var(--orange); color: #fff; }
.sidebar .sidebar-foot { padding: 14px 20px 20px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; color: #aaa; }
.app-main { flex: 1; min-width: 0; }
@media (max-width: 720px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; }
  .sidebar nav { display: flex; flex-wrap: wrap; padding: 0 8px 10px; }
  .sidebar .sidebar-foot { display: none; }
}
