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

:root {
  /* Brand — ported from the ShopVibe Claude Design System (fuchsia/cyan/amber) */
  --brand: #D946EF;
  --brand-hover: #C026D3;
  --brand-active: #A21CAF;
  --brand-tint: #FDF4FF;
  --brand-dark: #A21CAF;
  --secondary: #22D3EE;
  --secondary-tint: #ECFEFF;
  --tertiary: #FACC15;
  --tertiary-tint: #FEFCE8;
  --accent: #22D3EE;
  --text: #171717;
  --muted: #525252;
  --text-tertiary: #A3A3A3;
  --border: #E5E5E5;
  --border-strong: #D4D4D4;
  --bg: #FAFAFA;
  --surface: #FFFFFF;
  --surface-sunken: #F5F5F5;
  --danger: #EF4444;
  --danger-hover: #DC2626;
  --success: #22C55E;
  --warning: #F59E0B;
  --chip-success-bg: #DCFCE7; --chip-success-text: #166534;
  --chip-warning-bg: #FEF9C3; --chip-warning-text: #854D0E;
  --chip-error-bg: #FEE2E2;   --chip-error-text: #991B1B;

  /* Type */
  --font-headline: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: "Space Mono", monospace;

  /* Radius (sm=badges, md=inputs/cards, lg=product cards, xl=hero, full=pills) */
  --radius-sm: 4px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Elevation */
  --shadow-subtle: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-medium: 0 4px 6px rgba(0,0,0,0.07), 0 2px 4px rgba(0,0,0,0.05);
  --shadow-large: 0 10px 25px rgba(0,0,0,0.10), 0 6px 10px rgba(0,0,0,0.06);
  --shadow-overlay: 0 25px 50px rgba(0,0,0,0.15), 0 12px 24px rgba(0,0,0,0.08);
  --shadow-product-hover: 0 14px 32px rgba(217,70,239,0.12), 0 6px 12px rgba(0,0,0,0.06);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
h1, h2, h3, .brand-font { font-family: var(--font-headline); }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-active); text-decoration: underline; }
img { max-width: 100%; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; }

/* announcement bar */
.announcement-bar { background: var(--secondary); color: #164E63; text-align: center; padding: 8px 16px; font: 700 12px/1.3 var(--font-body); letter-spacing: .03em; }

/* header */
.site-header { background: rgba(255,255,255,0.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.header-inner { display: flex; align-items: center; gap: 20px; padding: 14px 16px; flex-wrap: wrap; }
.logo { font-family: var(--font-headline); font-size: 1.35rem; font-weight: 800; color: var(--text); display: flex; align-items: center; }
.logo img { height: 36px; width: auto; display: block; }
.search { flex: 1; display: flex; min-width: 200px; }
.search input { flex: 1; padding: 9px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-full) 0 0 var(--radius-full); font: inherit; }
.search button { padding: 9px 18px; border: none; background: var(--brand); color: #fff; border-radius: 0 var(--radius-full) var(--radius-full) 0; cursor: pointer; font-weight: 700; }
.search button:hover { background: var(--brand-hover); }
.header-nav { display: flex; gap: 6px; align-items: center; }
.header-nav a { padding: 8px 14px; border-radius: var(--radius-full); font-weight: 600; color: var(--muted); }
.header-nav a:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.cat-nav { display: flex; gap: 6px; padding: 10px 16px; border-top: 1px solid var(--border); overflow-x: auto; white-space: nowrap; }
.cat-nav a { padding: 7px 14px; border-radius: var(--radius-full); font-weight: 600; font-size: .9rem; color: var(--muted); }
.cat-nav a:hover { background: var(--surface-sunken); color: var(--text); text-decoration: none; }
.inline-form { display: inline; }
.linklike { background: none; border: none; color: var(--brand); cursor: pointer; font: inherit; padding: 0; }
.linklike:hover { text-decoration: underline; }

/* layout bits */
main.container { padding-top: 24px; padding-bottom: 48px; min-height: 60vh; }
.flash { padding: 10px 14px; border-radius: var(--radius-md); margin-bottom: 16px; }
.flash-success { background: var(--chip-success-bg); color: var(--chip-success-text); }
.flash-error { background: var(--chip-error-bg); color: var(--chip-error-text); }
.site-footer { background: var(--surface); border-top: 1px solid var(--border); padding: 40px 0 24px; color: var(--muted); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 24px; }
.footer-grid h4 { margin: 0 0 4px; font: 700 11px/1.2 var(--font-body); letter-spacing: .1em; text-transform: uppercase; color: var(--text-tertiary); }
.footer-grid nav { display: flex; flex-direction: column; gap: 8px; }
.footer-grid nav a { color: var(--muted); font-size: .9rem; }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 16px; font-size: .85rem; }
@media (max-width: 720px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 26px; background: var(--brand); color: #fff !important; border: none; border-radius: var(--radius-full); cursor: pointer; font-weight: 700; font-size: 1rem; text-decoration: none !important; transition: background .15s, border-color .15s, opacity .15s; }
.btn:hover { background: var(--brand-hover); }
.btn:active { background: var(--brand-active); }
.btn-secondary { background: transparent; color: var(--brand) !important; border: 2px solid var(--brand); padding: 10px 24px; }
.btn-secondary:hover { background: var(--brand-tint); border-color: var(--brand-hover); }
.btn-ghost { background: transparent; color: var(--muted) !important; border: none; }
.btn-ghost:hover { background: var(--surface-sunken); }
.btn-danger { background: var(--danger); }
.btn-danger:hover { background: var(--danger-hover); }
.btn-sm { padding: 7px 16px; font-size: .85rem; }
.btn[disabled] { opacity: .4; cursor: not-allowed; }
form.stacked label { display: block; margin: 12px 0 4px; font-weight: 600; }
form.stacked input, form.stacked select, form.stacked textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-md); font: inherit; }
form.stacked input:focus, form.stacked select:focus, form.stacked textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(217,70,239,0.15); }
.form-narrow { max-width: 460px; margin: 0 auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px 28px 28px; }
.form-help { color: var(--muted); font-size: .875rem; }

/* product grids */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow-product-hover); transform: translateY(-3px); }
.card a.card-link { color: inherit; text-decoration: none; }
.card .card-body a.card-link { display: flex; flex-direction: column; gap: 4px; }
.card .thumb { position: relative; aspect-ratio: 3/4; background: var(--surface-sunken) center/cover no-repeat; }
.card .card-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .name { font-weight: 700; font-family: var(--font-headline); font-size: .95rem; }
.card .price { color: var(--text); font-weight: 700; }
.card .compare { color: var(--text-tertiary); text-decoration: line-through; font-weight: 400; font-size: .875rem; margin-left: 6px; }
.card .vendor { color: var(--muted); font-size: .8rem; margin-top: auto; }
.card .stars { display: inline-flex; align-items: center; gap: 4px; font-size: .8rem; color: var(--muted); }
.card .stars .star-glyphs { color: var(--tertiary); letter-spacing: -1px; }
.card-badge { position: absolute; top: 10px; left: 10px; z-index: 2; }
.wishlist-btn { position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border-radius: var(--radius-full); border: none; background: rgba(255,255,255,0.92); color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-subtle); font-size: 16px; line-height: 1; padding: 0; }
.wishlist-btn.is-saved { color: var(--brand); }
.wishlist-btn:hover { color: var(--brand); }

.badge { display: inline-block; padding: 3px 9px; border-radius: var(--radius-sm); font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.badge-featured { background: var(--tertiary-tint); color: #854D0E; }
.badge-sale { background: var(--secondary); color: #164E63; }
.badge-new { background: var(--brand); color: #fff; }
.badge-pending { background: var(--chip-warning-bg); color: var(--chip-warning-text); }
.badge-approved, .badge-active, .badge-paid, .badge-delivered, .badge-shipped { background: var(--chip-success-bg); color: var(--chip-success-text); }
.badge-suspended, .badge-cancelled, .badge-refunded { background: var(--chip-error-bg); color: var(--chip-error-text); }
.badge-draft, .badge-unfulfilled { background: var(--surface-sunken); color: #374151; text-transform: none; letter-spacing: normal; }
.badge-processing, .badge-submitted, .badge-payable { background: #DBEAFE; color: #1E3A8A; }
.badge-warning { background: var(--chip-warning-bg); color: var(--chip-warning-text); }
.badge-error { background: var(--chip-error-bg); color: var(--chip-error-text); }

/* filter chips */
.chip-filter { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--surface); color: var(--text); font-weight: 600; font-size: .85rem; cursor: pointer; text-decoration: none !important; transition: background .12s, border-color .12s, color .12s; }
.chip-filter:hover { background: var(--surface-sunken); }
.chip-filter.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 24px; }

/* quantity stepper */
.qty-stepper { display: inline-flex; align-items: center; gap: 10px; }
.qty-stepper button { width: 28px; height: 28px; border-radius: var(--radius-full); border: 1.5px solid var(--border-strong); background: var(--surface); cursor: pointer; color: var(--muted); font-weight: 700; padding: 0; line-height: 1; }
.qty-stepper button:hover { background: var(--surface-sunken); color: var(--text); }
.qty-stepper .qty-input { text-align: center; }

/* hero / featured */
.hero { position: relative; overflow: hidden; background: linear-gradient(120deg, var(--brand-tint) 0%, #FAE8FF 45%, var(--secondary-tint) 100%); color: var(--text); border-radius: var(--radius-xl); padding: 48px 40px; margin-bottom: 32px; }
.hero .eyebrow { display: inline-flex; padding: 5px 12px; border-radius: var(--radius-sm); background: var(--brand); color: #fff; font: 700 11px/1.2 var(--font-body); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 16px; }
.hero h1 { margin: 0 0 10px; font-family: var(--font-headline); font-weight: 800; font-size: 2.5rem; line-height: 1.1; max-width: 22ch; }
.hero h1 .hl { color: var(--brand); }
.hero p { margin: 0 0 22px; color: var(--muted); font-size: 1.1rem; max-width: 40ch; }
.hero .actions { gap: 12px; }
@media (max-width: 720px) { .hero { padding: 32px 24px; } .hero h1 { font-size: 1.9rem; } }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 40px 0 16px; }
.section-title h2 { margin: 0; font-family: var(--font-headline); font-weight: 700; }

/* tables */
table.data { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
table.data th { background: var(--surface-sunken); font-size: .85rem; text-transform: uppercase; letter-spacing: .03em; }
table.data tr:last-child td { border-bottom: none; }

/* product page */
.product-page { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; overflow-wrap: anywhere; }
/* Grid items default to min-width:auto, which lets an unbreakable run of text (e.g. supplier
   copy pasted with &nbsp; instead of real spaces) blow past its 1fr share and collapse the
   other column — min-width:0 lets the overflow-wrap rule above actually take effect instead of
   being overridden by the grid track's content-based minimum size. */
.product-page > div { min-width: 0; }
@media (max-width: 720px) { .product-page { grid-template-columns: 1fr; } }
.product-page .main-img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-md); background: var(--surface-sunken); }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.price-lg { font-size: 1.6rem; font-weight: 700; color: var(--text); }

/* dashboard-ish */
.stat-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 14px; margin-bottom: 24px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; }
.stat .num { font-size: 1.6rem; font-weight: 700; }
.stat .label { color: var(--muted); font-size: .85rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 20px; }
.panel h2, .panel h3 { margin-top: 0; }
.side-layout { display: grid; grid-template-columns: 210px 1fr; gap: 24px; }
@media (max-width: 720px) { .side-layout { grid-template-columns: 1fr; } }
.side-nav { display: flex; flex-direction: column; gap: 4px; }
.side-nav a { padding: 8px 12px; border-radius: var(--radius-md); color: var(--text); }
.side-nav a.active, .side-nav a:hover { background: var(--brand-tint); color: var(--brand-active); text-decoration: none; }

/* admin top nav bar with dropdown menus (native <details> + a few lines of JS for closing) */
.admin-topnav { background: var(--surface, #fff); border-bottom: 1px solid var(--border); }
.admin-topnav-inner { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.admin-topnav .topnav-link { display: flex; align-items: center; gap: 6px; padding: 10px 14px; color: var(--text); font-weight: 500; cursor: pointer; list-style: none; user-select: none; white-space: nowrap; border-bottom: 2px solid transparent; }
.admin-topnav .topnav-link:hover { background: var(--brand-tint); color: var(--brand-active); text-decoration: none; }
.admin-topnav .topnav-link.active { color: var(--brand-active); border-bottom-color: var(--brand-active); }
.admin-topnav summary::-webkit-details-marker { display: none; }
.admin-topnav .caret { font-size: .65rem; color: var(--muted); transition: transform .15s; }
.topnav-menu { position: relative; }
.topnav-menu[open] .caret { transform: rotate(180deg); }
.topnav-menu[open] > summary { background: var(--brand-tint); color: var(--brand-active); }
.topnav-dropdown { position: absolute; top: 100%; left: 0; z-index: 60; min-width: 190px; background: var(--surface, #fff); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 6px; display: flex; flex-direction: column; gap: 2px; }
.topnav-dropdown a { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: var(--radius-md); color: var(--text); white-space: nowrap; }
.topnav-dropdown a:hover, .topnav-dropdown a.active { background: var(--brand-tint); color: var(--brand-active); text-decoration: none; }
@media (max-width: 720px) { .admin-topnav-inner { overflow-x: auto; flex-wrap: nowrap; } }

/* order timeline */
.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { padding: 8px 0 8px 22px; border-left: 2px solid var(--border); position: relative; margin-left: 8px; }
.timeline li::before { content: ""; width: 10px; height: 10px; background: var(--brand); border-radius: 50%; position: absolute; left: -6px; top: 14px; }
.timeline .when { color: var(--muted); font-size: .8rem; }

.error-page { text-align: center; padding-top: 60px; }
.error-page h1 { font-size: 4rem; margin: 0; color: var(--brand-active); font-family: var(--font-headline); }
.muted { color: var(--muted); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.pagination { display: flex; gap: 6px; margin-top: 20px; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
.pagination .current { background: var(--brand); color: #fff; border-color: var(--brand); }
.qty-input { width: 70px !important; }
