/* =============================================================
   THE CLINIC — Apothecary / Vintage Medical
   Black base, cream parchment foreground, EKG-red signature.
   Logo-aligned: condensed display type, prescription-pad chrome.
   ============================================================= */

/* -- Tokens ---------------------------------------------------- */
:root {
    /* PayNow binds --main-color and --hover-color to schema.json
       config values. We alias them as the clinic red so the
       owner-pickable color still flows through every accent.
       Default: oxblood — deeper than the logo's brighter red so
       the overall mood reads surgical/morgue, not apothecary. */
    --red:        var(--main-color, #8E2A22);
    --red-hi:     var(--hover-color, #B7322B);
    --red-dim:    color-mix(in srgb, var(--red) 22%, transparent);
    --red-line:   color-mix(in srgb, var(--red) 50%, transparent);

    /* Gold — matches the parchment/brass border on the TGC logo.
       Used for titles, frames, brand mark, eyebrow accents. */
    --cream:      #C9A961;  /* primary gold */
    --cream-soft: #DDBE73;  /* brighter gold for headings */
    --cream-dim:  #8A7748;  /* muted gold for labels */
    --cream-line: color-mix(in srgb, var(--cream) 28%, transparent);

    /* Surfaces — deeper, colder undertone */
    --bg:         #050506;
    --surface:    #0C0B0D;
    --surface-2:  #131214;
    --surface-3:  #1A181A;

    /* Lines */
    --line:       #1F1C1B;
    --line-strong: #2C2826;

    /* Text — slightly warm bone so body copy harmonizes with gold
       without competing with it for emphasis */
    --text:       #DDD5C2;
    --text-mute:  #9A917D;
    --text-dim:   #6B6354;
    --text-ink:   #15110D;

    /* Type */
    --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Big Shoulders Display', 'Rajdhani', sans-serif;
    --font-serif:   'DM Serif Display', Georgia, serif;
    --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

    /* Geometry — keep mostly sharp; small radii on capsules/pills */
    --radius: 0;
    --radius-sm: 2px;
    --radius-pill: 999px;

    /* Space scale */
    --s-1: 0.25rem;
    --s-2: 0.5rem;
    --s-3: 0.75rem;
    --s-4: 1rem;
    --s-5: 1.25rem;
    --s-6: 1.5rem;
    --s-8: 2rem;
    --s-10: 2.5rem;
    --s-12: 3rem;

    --t-fast: 120ms ease-out;
    --t: 200ms ease-out;
}

/* -- Reset / Base ---------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    color: var(--text);
    background: var(--bg);
    font-family: var(--font-sans);
    font-weight: 600;
    font-size: 16px;
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

/* Single-lamp atmosphere — feels like one overhead light in an
   otherwise dark room. A faint red wash bleeds in from the lower
   edge so the page never reads as dead-flat black. */
body {
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse 90% 55% at 50% -10%, rgba(201, 169, 97, 0.04), transparent 60%),
        linear-gradient(180deg, rgba(0,0,0,0.55), transparent 30%, transparent 70%, rgba(0,0,0,0.65));
    background-attachment: fixed;
    background-size: 100% 100%;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--red-hi); transition: color var(--t-fast); }

hr {
    border: 0;
    border-top: 1px solid var(--line);
    margin: var(--s-6) 0;
}

::selection { background: var(--red); color: var(--cream-soft); }

/* -- Container ------------------------------------------------- */
.container {
    width: 100%;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 var(--s-6);
    position: relative;
}

@media (max-width: 768px) {
    .container { padding: 0 var(--s-4); }
}

/* -- Header / Nav ---------------------------------------------- */
header {
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    padding: 0;
    margin-bottom: 0;
}

.header-top {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s-6);
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 32px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cream-soft);
    line-height: 1;
    white-space: nowrap;
}

.brand .rx-mark {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 400;
    font-size: 30px;
    letter-spacing: 0;
    text-transform: none;
    color: var(--red);
    line-height: 1;
}

/* Social icons — small cream rings */
.social-media {
    display: flex;
    gap: var(--s-2);
    list-style: none;
    padding: 0;
    margin: 0;
}

.social-media a {
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cream-dim);
    border: 1px solid var(--cream-line);
    border-radius: 50%;
    transition: color var(--t-fast), border-color var(--t-fast), background var(--t-fast);
}
.social-media a:hover {
    color: var(--cream-soft);
    border-color: var(--cream);
    background: color-mix(in srgb, var(--cream) 8%, transparent);
}
.social-media i { font-size: 13px; }

/* Header right-side chrome */
.header-account {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.header-item {
    height: 38px;
    min-width: 38px;
    padding: 0 var(--s-3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    border: 1px solid var(--cream-line);
    background: transparent;
    color: var(--cream-dim);
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: var(--radius-pill);
    position: relative;
    transition: border-color var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.header-item:hover {
    color: var(--cream-soft);
    border-color: var(--cream);
    background: color-mix(in srgb, var(--cream) 6%, transparent);
}
.header-item img {
    width: 32px;
    height: 32px;
    object-fit: cover;
    border-radius: 50%;
}

.cart-number {
    position: absolute;
    top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--red);
    color: var(--cream-soft);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    border-radius: var(--radius-pill);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Primary nav — flush, terminal-like but warmer */
.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    border-top: 1px solid var(--line);
    padding: 0;
    margin: 0 0 var(--s-8) 0;
    border-radius: 0;
    border-left: 0;
    border-right: 0;
}

.topbar .container {
    min-height: 50px;
    display: flex;
    align-items: stretch;
}

.topbar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 0;
    width: 100%;
}

li.nav-item {
    display: flex;
    align-items: stretch;
    min-height: 50px;
}

li.nav-item a {
    height: 100%;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    padding: 0 var(--s-3);
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cream-dim);
    transition: color var(--t-fast), background var(--t-fast);
    position: relative;
}

li.nav-item a:hover { color: var(--cream-soft); }

li.nav-item.active a { color: var(--cream-soft); }

li.nav-item.active a::after {
    content: '';
    position: absolute;
    left: var(--s-3); right: var(--s-3); bottom: -1px;
    height: 2px;
    background: var(--red);
}

li.nav-item a i {
    font-size: 12px;
    opacity: 0.6;
    color: var(--cream-dim);
}
li.nav-item.active a i { opacity: 1; color: var(--red); }

.nav-icon { display: inline-flex; align-items: center; }

/* Dropdowns */
.menu-dropdown {
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    min-width: 220px;
    margin-top: 4px;
    padding: var(--s-2) 0;
}

.menu-dropdown a {
    display: block;
    padding: var(--s-2) var(--s-4);
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream-dim);
    transition: background var(--t-fast), color var(--t-fast);
}
.menu-dropdown a:hover { background: var(--surface-3); color: var(--cream-soft); }

/* -- Eyebrow / Rx labels -------------------------------------- */
.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: var(--s-3);
}
.eyebrow::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 16px;
    letter-spacing: 0;
    color: var(--red);
    transform: translateY(-1px);
}

/* -- Hero (home only) ---------------------------------------- */
.hero {
    border: 1px solid var(--cream-line);
    background:
        radial-gradient(ellipse at 85% 15%, color-mix(in srgb, var(--cream) 8%, transparent), transparent 55%),
        var(--surface);
    padding: var(--s-12) var(--s-8);
    margin-bottom: var(--s-12);
    position: relative;
    overflow: hidden;
}

/* Cream-stamp double border to echo the logo's seal */
.hero::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid color-mix(in srgb, var(--cream) 25%, transparent);
    pointer-events: none;
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: var(--s-4);
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
.hero-eyebrow::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 18px;
    letter-spacing: 0;
    color: var(--red);
    transform: translateY(-1px);
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(48px, 7vw, 96px);
    font-weight: 700;
    line-height: 0.92;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--cream-soft);
    margin: 0 0 var(--s-5) 0;
    position: relative;
}

.hero-title em {
    font-style: normal;
    color: var(--red);
}

.hero-sub {
    font-family: var(--font-sans);
    font-size: 16px;
    color: var(--cream-dim);
    max-width: 60ch;
    margin: 0 0 var(--s-6) 0;
    position: relative;
    line-height: 1.6;
}

.hero-ekg {
    position: relative;
    margin: var(--s-4) 0 var(--s-6);
    color: var(--red);
}

.hero-actions {
    display: flex;
    gap: var(--s-3);
    position: relative;
    flex-wrap: wrap;
}

/* -- Buttons -------------------------------------------------- */
.btn,
button.btn,
a.btn,
button.add-btn,
a.add-btn,
button#purchaseFromGift {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--s-2);
    padding: 0 var(--s-5);
    height: 44px;
    background: var(--cream);
    color: var(--text-ink);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1px solid var(--cream);
    cursor: pointer;
    transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
    text-align: center;
    white-space: nowrap;
    width: auto;
    border-radius: 0;
}
.btn:hover,
button.btn:hover,
a.btn:hover,
button.add-btn:hover,
a.add-btn:hover {
    background: var(--cream-soft);
    border-color: var(--cream-soft);
    color: var(--text-ink);
}
.btn:active { transform: translateY(1px); }

.btn-ghost,
button#giftButton {
    background: transparent;
    color: var(--cream-soft);
    border: 1px solid var(--cream-line);
}
.btn-ghost:hover,
button#giftButton:hover {
    background: color-mix(in srgb, var(--cream) 8%, transparent);
    border-color: var(--cream);
    color: var(--cream-soft);
}

.btn-danger,
.remove-btn,
button#closeGift {
    background: transparent;
    color: var(--red-hi);
    border: 1px solid var(--red-line);
}
.btn-danger:hover,
.remove-btn:hover,
button#closeGift:hover {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--cream-soft);
}

.btn-block { width: 100%; }

/* -- Cards / Modules ---------------------------------------- */
.card,
.module,
.home-content,
.index-section {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    position: relative;
}

.module { padding: 0; }

.module-header {
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

h2.module-title {
    position: static;
    margin: 0;
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-soft);
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
}
h2.module-title::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0;
    color: var(--red);
    transform: translateY(-1px);
}

.module-body { padding: var(--s-4); font-size: 15px; }
.module-empty { color: var(--text-mute); font-size: 14px; font-family: var(--font-mono); }

/* Home text panels — same chrome as modules */
.home-content-sec,
.index-section-body {
    padding: var(--s-8);
}

h1.home-content-tit {
    font-family: var(--font-display);
    font-size: clamp(40px, 5vw, 64px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--cream-soft);
    margin: 0 0 var(--s-4) 0;
}

.index-section > h1 {
    position: static;
    margin: 0;
    padding: var(--s-3) var(--s-4);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    font-family: var(--font-display);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-soft);
    display: flex;
    align-items: center;
    gap: var(--s-2);
}
.index-section > h1::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 15px;
    letter-spacing: 0;
    color: var(--red);
    transform: translateY(-1px);
}

.home-content-text { color: var(--cream-dim); }
.home-content-text p { margin: 0 0 var(--s-4) 0; }
.home-content-text h2 {
    font-family: var(--font-display);
    font-size: 24px;
    color: var(--cream-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--s-6) 0 var(--s-3) 0;
}

/* -- Forms ---------------------------------------------------- */
input,
select,
textarea,
.form-select {
    background: var(--bg);
    border: 1px solid var(--line) !important;
    color: var(--cream-soft);
    font-family: var(--font-mono);
    font-size: 13px;
    padding: 0 var(--s-3);
    height: 42px;
    border-radius: 0 !important;
    transition: border-color var(--t-fast);
}
textarea { padding: var(--s-3); height: auto; }
input:focus,
select:focus,
textarea:focus,
.form-select:focus {
    outline: 0;
    border-color: var(--red) !important;
}
input::placeholder, textarea::placeholder { color: var(--text-dim); }

/* -- Category / Product grid ---------------------------------- */
h2.category-title {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 1.0;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: var(--cream-soft);
    text-align: center;
    margin: 4px 0 var(--s-4) 0;
}

.category-page { text-align: center; margin-bottom: 0; }
.category-description {
    color: var(--cream-dim);
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    max-width: 72ch;
    margin: 0 auto;
    line-height: 1.6;
}
/* Kill stray top/bottom margins from rich-text content authored
   inside the description (the user's "Important info" callout in
   particular) so it doesn't stack with the grid's top margin. */
.category-description > *:first-child { margin-top: 0; }
.category-description > *:last-child  { margin-bottom: 0; }
.category-description:empty { display: none; }

.category-package {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: border-color var(--t), transform var(--t);
}

/* Inner cream frame on hover, echoing the logo's parchment seal */
.category-package::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid transparent;
    pointer-events: none;
    transition: border-color var(--t);
    z-index: 1;
}
.category-package:hover { border-color: var(--cream-line); transform: translateY(-2px); }
.category-package:hover::before { border-color: color-mix(in srgb, var(--cream) 22%, transparent); }

/* Hover corner brackets — medical-viewfinder feel */
.category-package .corner-bracket {
    position: absolute;
    width: 14px;
    height: 14px;
    border: 0 solid var(--cream);
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
    z-index: 2;
}
.category-package:hover .corner-bracket { opacity: 0.85; }
.category-package .cb-tl { top: -1px; left: -1px; border-top-width: 1px; border-left-width: 1px; }
.category-package .cb-tr { top: -1px; right: -1px; border-top-width: 1px; border-right-width: 1px; }
.category-package .cb-bl { bottom: -1px; left: -1px; border-bottom-width: 1px; border-left-width: 1px; }
.category-package .cb-br { bottom: -1px; right: -1px; border-bottom-width: 1px; border-right-width: 1px; }

/* Top strip — Rx / SKU / type — sits above the image */
.card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-2) var(--s-3);
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
    gap: var(--s-2);
    min-height: 28px;
}
.card-top .sku {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-dim);
    display: inline-flex;
    align-items: center;
    gap: var(--s-1);
}
.card-top .sku::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 13px;
    letter-spacing: 0;
    color: var(--red);
    margin-right: 4px;
    transform: translateY(-1px);
}
.card-top .chip,
.category-package-price-list .chip {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-dim);
    padding: 2px 7px;
    border: 1px solid var(--cream-line);
    align-self: flex-start;
    margin-top: 4px;
    white-space: nowrap;
}

/* Angled wax stamp for on-sale products */
.sale-stamp {
    position: absolute;
    top: 14px;
    right: -14px;
    transform: rotate(8deg);
    padding: 4px 14px;
    border: 1.5px solid var(--red);
    color: var(--red);
    font-family: var(--font-display);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    background: rgba(10, 10, 11, 0.88);
    z-index: 3;
    box-shadow: 0 0 0 3px rgba(10, 10, 11, 0.6);
}
.sale-stamp::before {
    content: '';
    position: absolute;
    inset: 2px;
    border: 1px solid color-mix(in srgb, var(--red) 50%, transparent);
    pointer-events: none;
}

/* Mini EKG strip under the product image on category cards */
.card-ekg {
    border-top: 1px solid var(--line);
    color: var(--cream);
    line-height: 0;
    opacity: 0.55;
}

.category-package-details {
    padding: var(--s-6) var(--s-4);
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--s-4);
}

.category-package-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 50%, var(--surface-3), var(--surface-2));
    border: 1px solid var(--line);
    padding: var(--s-4);
}
.category-package-img img { max-width: 100%; max-height: 100%; object-fit: contain; }

span.category-package-name {
    font-family: var(--font-display);
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--cream-soft);
    text-align: center;
    line-height: 1.05;
}

.package-bott {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--line);
    background: var(--surface-2);
}

.category-package-price-list {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.0;
}

.category-package-price {
    font-family: var(--font-mono);
    font-size: 16px;
    font-weight: 700;
    color: var(--cream-soft);
}

span.category-package-price-disc {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-dim);
    text-decoration: line-through;
    margin-bottom: 2px;
}

.category-package-buttons {
    display: flex;
    align-items: center;
    gap: var(--s-2);
}

.category-buy-btn {
    height: 36px;
    padding: 0 var(--s-3);
    font-size: 13px;
}

.btn-svg { display: inline-flex; align-items: center; gap: var(--s-2); }
.btn-svg span {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-ink);
}
.btn-svg svg path { fill: var(--text-ink); }

/* -- Product detail ------------------------------------------ */
.product-page {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 0;
    padding: 0;
    position: relative;
}

/* Cream inner frame on the product card */
.product-page::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 1px solid color-mix(in srgb, var(--cream) 14%, transparent);
    pointer-events: none;
    z-index: 1;
}

.product-page-image {
    padding: var(--s-8);
    background:
        radial-gradient(circle at 50% 35%, color-mix(in srgb, var(--cream) 5%, transparent), transparent 60%),
        radial-gradient(circle at 50% 50%, var(--surface-3), var(--surface-2));
    border-right: 1px solid var(--line);
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* LOT badge in the corner of the image area */
.product-page-image .lot {
    position: absolute;
    top: var(--s-4);
    left: var(--s-4);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-dim);
    z-index: 2;
}
.product-page-image .lot::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0;
    color: var(--red);
    margin-right: 6px;
    transform: translateY(-1px);
}

/* Stock chip in the opposite corner */
.product-page-image .stock-chip {
    position: absolute;
    top: var(--s-4);
    right: var(--s-4);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 4px 8px;
    border: 1px solid var(--cream-line);
    color: var(--cream-soft);
    z-index: 2;
}
.product-page-image .stock-chip.out {
    color: var(--red-hi);
    border-color: var(--red-line);
}

img.product-img { max-height: 320px; width: auto; max-width: 100%; z-index: 1; position: relative; }

/* Prescription-insert chrome on the right panel */
.product-details-top .lot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream-dim);
    padding-bottom: var(--s-3);
    border-bottom: 1px dashed var(--line-strong);
    margin-bottom: var(--s-3);
}
.product-details-top .lot-row .label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.product-details-top .lot-row .label::before {
    content: 'Rx';
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 14px;
    letter-spacing: 0;
    color: var(--red);
    margin-right: 4px;
    transform: translateY(-1px);
}

.product-divider-ekg {
    margin: var(--s-4) 0;
    color: var(--cream);
    line-height: 0;
    opacity: 0.55;
}

/* Dosage-style key/value rows for product variables */
.dosage-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--cream-soft);
    padding: 10px 0;
    border-bottom: 1px solid var(--line);
}
.dosage-row:last-child { border-bottom: 0; }
.dosage-row .v { color: var(--cream-soft); font-weight: 700; }

.product-page-details {
    padding: var(--s-8);
    display: flex;
    flex-direction: column;
    gap: var(--s-4);
    position: relative;
}

.product-details-top { display: flex; flex-direction: column; gap: var(--s-3); }

.product-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: var(--s-4);
    flex-wrap: wrap;
}

.product-name {
    font-family: var(--font-display);
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--cream-soft);
}

.product-name span {
    display: block;
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.16em;
    color: var(--cream-dim);
    text-transform: uppercase;
    margin-top: var(--s-2);
}

.product-price { text-align: right; }
.product-price h3 {
    font-family: var(--font-mono);
    font-size: 36px;
    font-weight: 700;
    color: var(--cream-soft);
    margin: 0;
    line-height: 1.0;
}
.product-price h3.line-through {
    font-size: 14px;
    color: var(--text-dim);
    text-decoration: line-through;
}

.product-details-top span {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--cream-dim);
    text-transform: uppercase;
}

.small-title {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    margin-top: var(--s-5);
    margin-bottom: var(--s-2);
}

.small-title span {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.16em;
    color: var(--cream-soft);
    text-transform: uppercase;
}

.small-title i { color: var(--red); font-size: 12px; }

span.product-det-border {
    flex: 1;
    background: linear-gradient(to right, var(--red-line), transparent);
    height: 1px;
    margin-left: var(--s-2);
}

.product-stock-out {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--red-hi);
}

.product-buttons .btn,
.product-buttons button { min-width: 140px; }

/* :not(.hidden) so Tailwind's `.hidden` (display: none) wins when
   #giftActions is toggled closed — ID selectors otherwise out-rank
   the .hidden class and both rows render at once. */
#mainActions:not(.hidden),
#giftActions:not(.hidden) {
    display: flex;
    gap: var(--s-2);
    flex-wrap: wrap;
    align-items: center;
}

.product-description {
    background: var(--surface);
    border: 1px solid var(--line);
    border-top: 0;
    padding: var(--s-8);
    color: var(--text);
    font-size: 16px;
    font-weight: 500;
    line-height: 1.75;
}
.product-description p { margin: 0 0 var(--s-3) 0; }
.product-description h2,
.product-description h3 {
    font-family: var(--font-display);
    color: var(--cream-soft);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin: var(--s-5) 0 var(--s-3) 0;
}

/* -- Cart ----------------------------------------------------- */
.cart-page-title {
    font-family: var(--font-display);
    font-size: clamp(44px, 6vw, 64px);
    font-weight: 700;
    line-height: 0.95;
    letter-spacing: 0;
    text-transform: uppercase;
    color: var(--cream-soft);
    display: block;
}

.nr-item {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-dim);
}

table { width: 100%; background: transparent; border-collapse: collapse; }

.cart-table {
    border: 1px solid var(--line);
    background: var(--surface);
    margin-top: var(--s-6) !important;
}

.table > thead > tr > th {
    padding: var(--s-3) var(--s-4);
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--cream-dim);
    text-align: left;
    border-bottom: 1px solid var(--line);
    background: var(--surface-2);
}

.table > tbody > tr > td {
    padding: var(--s-4);
    vertical-align: middle;
    border-bottom: 1px solid var(--line);
}

tbody tr { background: transparent; border-top: 0; }
tbody tr:last-child td { border-bottom: 0; }

td.image {
    width: 80px;
    background: var(--surface-2);
    padding: var(--s-2) !important;
}
td.image img { height: 60px; width: auto; }

td.name {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: flex-start;
    margin-left: var(--s-2);
}

span.product-name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--cream-soft);
    text-transform: uppercase;
}

.name-sec {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--cream-dim);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

td.price span,
td.total span {
    font-family: var(--font-mono);
    font-size: 14px;
    font-weight: 700;
    color: var(--cream-soft);
}
td.price span { color: var(--cream-dim); }

td.quantity input {
    width: 48px;
    height: 32px;
    text-align: center;
    background: var(--bg);
}

td.close a {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
    transition: color var(--t-fast);
}
td.close a:hover { color: var(--red-hi); }

.subtotal {
    background: var(--surface);
    border: 1px solid var(--line);
    padding: var(--s-5);
}
.subtotal span {
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.16em;
    color: var(--cream-dim);
    text-transform: uppercase;
}
.subtotal p {
    font-family: var(--font-mono);
    font-size: 20px;
    font-weight: 700;
    color: var(--cream-soft);
    margin: 0;
}

/* -- Account -------------------------------------------------- */
.account-sidebar {
    background: var(--surface);
    border: 1px solid var(--line);
}

.account-tab {
    display: block;
    position: relative;
    padding: var(--s-4) var(--s-5);
    border-bottom: 1px solid var(--line);
    transition: background var(--t-fast);
}
.account-tab:last-child { border-bottom: 0; }
.account-tab:hover { background: var(--surface-2); }
.account-tab.active { background: var(--surface-2); }
.account-tab.active::before {
    content: '';
    position: absolute;
    left: 0; top: 0; bottom: 0;
    width: 3px;
    background: var(--red);
}

.account-tab .label {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--cream-dim);
    margin-bottom: 2px;
    display: block;
}

.account-tab .name {
    font-family: var(--font-display);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--cream-soft);
}

.account-row {
    background: var(--surface);
    border: 1px solid var(--line);
}

/* -- Payment goal -------------------------------------------- */
.payment-goal {
    background: var(--surface-3);
    border: 1px solid var(--line);
    height: 14px;
    overflow: hidden;
}
.payment-goal .progress-bar {
    height: 100%;
    background: var(--cream);
    border-radius: 0;
    transition: width var(--t);
}

.goal-current {
    font-family: var(--font-mono);
    font-size: 24px;
    font-weight: 700;
    color: var(--cream-soft);
    margin-bottom: var(--s-3);
}

.payment-goal-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: var(--s-2);
}
.payment-max,
.payment-percentage,
.goal-complete {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    color: var(--cream-dim);
    text-transform: uppercase;
}
.payment-percentage { color: var(--cream-soft); font-weight: 700; }

/* -- Recent payments / Top customers ------------------------- */
.recent-payments {
    list-style: none;
    padding: 0;
    margin: 0;
}
.recent-payments li {
    padding: var(--s-3) 0;
    border-top: 1px solid var(--line);
}
.recent-payments li:first-child { padding-top: 0; border-top: 0; }
.recent-payments img {
    border: 1px solid var(--cream-line);
    border-radius: 50% !important;
    width: 40px !important;
    height: 40px !important;
}

.customer-amount p {
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
    color: var(--red-hi);
    text-align: right;
    margin: 0;
}

/* -- Banner --------------------------------------------------- */
.banner {
    position: relative;
    height: 192px;
    margin-bottom: var(--s-6);
    border: 1px solid var(--cream-line);
    overflow: hidden;
}
.banner img { object-fit: cover; width: 100%; height: 100%; }
.banner h1 {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-display);
    font-size: 60px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--cream-soft);
    background: linear-gradient(180deg, transparent, rgba(0,0,0,0.6));
    margin: 0;
    letter-spacing: 0.02em;
}

/* -- Messages ------------------------------------------------ */
.error-msg,
.success-msg {
    margin: 0;
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--line);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.04em;
    border-radius: 0;
}
.error-msg { background: var(--red-dim); color: var(--cream-soft); }
.success-msg { background: rgba(217, 200, 160, 0.08); color: var(--cream-soft); border-top-color: var(--cream-line); }

#notification-alert {
    background: var(--surface-2);
    border: 1px solid var(--red);
    color: var(--cream-soft);
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    padding: var(--s-3) var(--s-4);
}

/* -- Footer -------------------------------------------------- */
footer {
    background: transparent;
    border-top: 1px solid var(--line);
    margin-top: var(--s-12) !important;
    padding: var(--s-6) 0;
}

.footer-copyright span,
.footer-links a {
    font-family: var(--font-mono);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--cream-dim);
}

.footer-links { display: flex; gap: var(--s-5); }
.footer-links a:hover { color: var(--red-hi); }

/* -- Container max-width ------------------------------------- */
@media (min-width: 1536px) {
    .container { max-width: 1320px !important; }
}

/* Hide the decorative stripes SVG when it's embedded at the top
   of cards/modules — we render an EKG line elsewhere instead. */
.module > svg:first-child,
.home-content > svg:first-child,
.index-section > svg:first-child,
.category-package > svg:first-child { display: none; }

/* -- Utility ------------------------------------------------- */
.mono { font-family: var(--font-mono); }
.serif-rx { font-family: var(--font-serif); font-style: italic; color: var(--red); }

.divider-ekg {
    margin: var(--s-6) 0;
    color: var(--red);
    line-height: 0;
}

.empty-card {
    padding: var(--s-12);
    text-align: center;
    border: 1px solid var(--line);
    background: var(--surface);
}
