/* Private Bars (privatebarsoap.com). The original single-page design, adapted to the shared
   server-side basket (_variant_row / _cart / _cart_count fragments) and checkout. */
:root {
    --bg: #121513;
    --surface: #1a1f1b;
    --surface-border: #2c352d;
    --accent-od: #4d5945;
    --accent-od-hover: #5d6c54;
    --accent-steel: #82a89d;
    --text: #e6e9e6;
    --text-muted: #8d988e;
    --danger: #d98a7e;
    --font-mono: 'Courier New', Courier, monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
body { background-color: var(--bg); color: var(--text); font-family: var(--font-sans); line-height: 1.5; overflow-x: hidden; }
a { color: var(--accent-steel); }
button { cursor: pointer; font: inherit; }
img { max-width: 100%; height: auto; display: block; }

.stencil { font-family: var(--font-mono); font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.muted { color: var(--text-muted); }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Header */
.site-header {
    background-color: #0c0f0d; border-bottom: 2px solid var(--surface-border);
    position: sticky; top: 0; z-index: 100; padding: 0.75rem 1.25rem;
}
.nav-container { max-width: 1100px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.brand-group { display: flex; align-items: center; gap: 0.75rem; text-decoration: none; color: var(--text); }
.brand-logo-mini { width: 38px; height: 38px; flex-shrink: 0; display: block; }
.brand-name { font-size: 1.2rem; letter-spacing: 2px; display: flex; align-items: center; gap: 0.35rem; }
.brand-rank { color: var(--accent-steel); }

.btn-cart-toggle {
    background: var(--surface); border: 1px solid var(--surface-border); color: var(--text);
    padding: 0.5rem 0.85rem; border-radius: 4px; display: flex; align-items: center; gap: 0.6rem;
    font-size: 0.85rem; transition: border-color 0.2s;
}
.btn-cart-toggle:hover { border-color: var(--accent-steel); }
.cart-count {
    background: var(--accent-steel); color: #0c0f0d; font-weight: bold; border-radius: 999px;
    padding: 0.1rem 0.5rem; font-size: 0.75rem; font-family: var(--font-mono);
}
.btn-cart-toggle.bump { animation: bump 0.35s ease; }
@keyframes bump { 50% { transform: scale(1.1); } }

/* Hero */
.hero { max-width: 900px; margin: 0 auto; padding: 3rem 1.25rem 2rem; text-align: center; }
.hero-mascot-wrapper {
    width: 220px; max-width: 60vw; margin: 0 auto 1.5rem;
    filter: drop-shadow(0 12px 24px rgba(0,0,0,0.7)); animation: floatSubtle 4s ease-in-out infinite;
}
@keyframes floatSubtle { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.hero-serial { font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-steel); letter-spacing: 2.5px; margin-bottom: 0.5rem; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.75rem); line-height: 1.15; margin-bottom: 1rem; color: #fff; }
.hero p { font-size: 1.05rem; color: var(--text-muted); max-width: 620px; margin: 0 auto 1.5rem; }

.intel-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin: 2.5rem 0; }
.intel-box { background: var(--surface); border: 1px dashed var(--surface-border); padding: 1.25rem; border-radius: 4px; text-align: left; font-size: 0.85rem; }
.intel-box span { font-family: var(--font-mono); color: var(--accent-steel); display: block; margin-bottom: 0.25rem; font-weight: bold; }

/* Product */
.container { max-width: 700px; margin: 0 auto; padding: 0 1.25rem 5rem; }
.product-grid { display: grid; grid-template-columns: 1fr; gap: 2rem; }
.bar-card {
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 4px;
    padding: 1.75rem; position: relative;
}
.bar-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--accent-od); }
.bar-photo { margin: 0 0 1.25rem; border-radius: 2px; aspect-ratio: 1 / 1; object-fit: cover; width: 100%; }
.card-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-muted); margin-bottom: 0.35rem; }
.bar-title { font-size: 1.6rem; margin-bottom: 0.5rem; color: #fff; }
.bar-price { font-family: var(--font-mono); font-size: 1.5rem; color: var(--accent-steel); font-weight: bold; margin-bottom: 0.5rem; }
.bar-unit { font-size: 0.9rem; font-weight: normal; color: var(--text-muted); }
.wholesale-notice {
    display: inline-block; background: #2a332b; color: #a8c4bb; padding: 0.25rem 0.5rem; font-size: 0.75rem;
    font-family: var(--font-mono); border-radius: 2px; margin-bottom: 1.25rem; font-weight: bold;
}
.bar-desc { color: var(--text-muted); font-size: 1rem; white-space: pre-line; }
.spec-details {
    background: #111412; border: 1px solid var(--surface-border); padding: 0.85rem; font-size: 0.85rem;
    font-family: var(--font-mono); margin: 1.25rem 0; border-radius: 2px;
}

/* −/+ steppers (shared _variant_row fragment) */
.variant-list { list-style: none; }
.variant-row { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; }
.variant-name { font-family: var(--font-mono); font-weight: bold; text-transform: uppercase; letter-spacing: 1px; }
.variant-price, .variant-detail { color: var(--text-muted); font-size: 0.8rem; margin-left: 0.35rem; }
.stock-note { display: block; font-size: 0.75rem; color: var(--danger); font-family: var(--font-mono); }
.variant-row.sold-out .variant-name { color: var(--text-muted); text-decoration: line-through; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--surface-border); border-radius: 4px; background: var(--bg); }
.step-btn { background: transparent; border: none; color: var(--text); font-size: 1.1rem; width: 44px; height: 44px; }
.step-btn:hover:not(:disabled), .step-btn:focus-visible { background: var(--accent-od); }
.step-btn:disabled { opacity: 0.3; cursor: default; }
.step-qty { min-width: 2rem; text-align: center; font-family: var(--font-mono); font-weight: bold; }
.stepper-sm .step-btn { width: 30px; height: 30px; font-size: 0.95rem; }
form.htmx-request .step-btn { opacity: 0.6; }

/* Dispatch info */
.dispatch { margin-top: 2.5rem; padding: 1.25rem; border: 1px dashed var(--surface-border); border-radius: 4px; font-size: 0.9rem; color: var(--text-muted); }
.dispatch h2 { font-size: 1rem; color: var(--accent-steel); margin-bottom: 0.75rem; }
.dispatch ul { list-style: none; margin-bottom: 0.75rem; }
.dispatch li { padding: 0.25rem 0; }
.dispatch strong { color: var(--text); font-family: var(--font-mono); }

/* Drawer */
.drawer-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.75); z-index: 1000; }
.drawer {
    position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100vw); z-index: 1001;
    background: #151916; border-left: 2px solid var(--surface-border); box-shadow: -8px 0 24px rgba(0, 0, 0, 0.8);
    display: flex; flex-direction: column; transform: translateX(100%); transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.drawer.open { transform: translateX(0); }
.drawer-header {
    padding: 1.25rem; border-bottom: 1px solid var(--surface-border); display: flex;
    justify-content: space-between; align-items: center; background: #0f1210;
}
.drawer-close { background: transparent; border: none; color: var(--text-muted); font-size: 1.5rem; }
.drawer-content { flex: 1; overflow-y: auto; padding: 1.25rem; }
.drawer .cart-title { display: none; }

/* Basket (shared _cart fragment) */
.cart-title { font-family: var(--font-mono); font-size: 1rem; color: var(--accent-steel); margin-bottom: 0.75rem; text-transform: uppercase; letter-spacing: 1.5px; }
.cart-empty { text-align: center; color: var(--text-muted); padding: 2rem 0; font-family: var(--font-mono); }
.cart-lines { list-style: none; margin-bottom: 1rem; }
.cart-line {
    display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 0.6rem;
    padding: 0.9rem 0; border-bottom: 1px dashed var(--surface-border); font-family: var(--font-mono); font-size: 0.9rem;
}
.cart-desc { color: #fff; font-weight: bold; }
.deal-note { display: block; color: var(--accent-steel); font-weight: normal; font-size: 0.75rem; text-transform: uppercase; }
.cart-amount { color: var(--accent-steel); font-weight: bold; }
.order-total { display: flex; justify-content: space-between; flex-wrap: wrap; font-family: var(--font-mono); font-size: 1.05rem; font-weight: bold; margin-bottom: 1rem; }
.order-total small { width: 100%; color: var(--text-muted); font-weight: normal; font-size: 0.75rem; }
.checkout-link, .submit-btn {
    display: block; width: 100%; background: var(--accent-steel); color: #0c0f0d; text-align: center;
    font-family: var(--font-mono); font-weight: bold; text-decoration: none; padding: 0.9rem; border-radius: 4px;
    letter-spacing: 1.5px; font-size: 0.95rem; border: none; text-transform: uppercase; transition: background 0.2s;
}
.checkout-link:hover, .submit-btn:hover { background: #9abeb4; }
.checkout-page .checkout-link { display: none; }
.clear-btn { background: none; border: none; color: var(--text-muted); text-decoration: underline; font-size: 0.8rem; margin-top: 0.75rem; }

/* Checkout */
.page-title { font-size: 1.4rem; color: #fff; margin: 2.5rem 0 0.75rem; }
.checkout-page .cart { background: var(--surface); border: 1px solid var(--surface-border); border-radius: 4px; padding: 1.25rem; margin: 1rem 0; }
.back-link { margin-bottom: 1.5rem; font-family: var(--font-mono); font-size: 0.85rem; }
.fulfillment-choices { border: none; margin-bottom: 1rem; }
.fulfillment-choices legend { color: var(--accent-steel); margin-bottom: 0.75rem; font-size: 0.9rem; }
.choice {
    display: flex; align-items: center; gap: 0.75rem; padding: 0.9rem 1rem; margin-bottom: 0.6rem;
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 4px; cursor: pointer;
}
.choice:has(input:checked) { border-color: var(--accent-steel); }
.choice input { accent-color: var(--accent-steel); width: 18px; height: 18px; }
.choice-label { flex: 1; }
.choice-fee { color: var(--text-muted); font-size: 0.85rem; font-family: var(--font-mono); text-align: right; }
.secure-note { margin-top: 0.75rem; font-size: 0.85rem; text-align: center; }

/* Fallback order-request form */
#order label { display: block; font-family: var(--font-mono); font-size: 0.8rem; color: var(--accent-steel); margin: 1rem 0 0.3rem; }
.form-control {
    width: 100%; background: var(--bg); border: 1px solid var(--surface-border); color: var(--text);
    padding: 0.75rem; border-radius: 4px; font: inherit;
}
.form-control:focus { outline: none; border-color: var(--accent-steel); }
.honeypot { position: absolute; left: -9999px; height: 0; width: 0; overflow: hidden; }
.cf-turnstile { display: flex; justify-content: center; min-height: 65px; margin: 1rem 0; }
.form-error { background: #2d1c1a; border-left: 4px solid var(--danger); color: #f0c9c2; padding: 0.75rem 1rem; border-radius: 4px; margin: 1rem 0; }
#order .submit-btn { margin-top: 1rem; }

/* Thank you */
.thanks { text-align: center; padding-top: 1rem; }
.thanks p { color: var(--text-muted); margin-bottom: 1rem; }
.thanks strong { color: #fff; }
.game-download {
    margin: 2rem auto; padding: 1.5rem 1.25rem; max-width: 560px;
    background: var(--surface); border: 1px solid var(--surface-border); border-radius: 6px;
}
.game-download h2 { font-size: 1rem; color: var(--accent-steel); margin-bottom: 0.75rem; }
.game-download .checkout-link { display: inline-block; width: auto; margin: 0.25rem; padding-inline: 1.25rem; }
.game-download .small { font-size: 0.85rem; margin-bottom: 0; }

/* Toast */
#toast-container { position: fixed; bottom: 20px; right: 20px; left: 20px; z-index: 1100; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; pointer-events: none; }
.toast {
    background: var(--surface); border: 1px solid var(--accent-steel); color: var(--text); font-family: var(--font-mono);
    padding: 0.75rem 1rem; border-radius: 4px; display: flex; gap: 0.5rem; transform: translateX(120%); transition: transform 0.3s;
}
.toast.show { transform: translateX(0); }

/* Footer */
.studio-ad {
    max-width: 640px; margin: 0 auto 2.5rem; padding: 1rem 1.25rem; text-align: center;
    border: 1px dashed var(--accent-od); border-radius: 6px; font-size: 0.9rem; color: var(--text-muted);
}
.studio-ad-tag { font-size: 0.75rem; color: var(--accent-steel); margin-bottom: 0.4rem; }
.studio-ad strong { color: var(--text); }
.studio-ad-link { display: inline-block; margin-top: 0.6rem; font-size: 0.8rem; text-decoration: none; }
.studio-ad-link:hover { text-decoration: underline; }
.site-footer { border-top: 1px solid var(--surface-border); padding: 3rem 1.25rem; text-align: center; font-size: 0.85rem; color: var(--text-muted); background: #0c0f0d; }
.site-footer p { margin-bottom: 0.5rem; }
.footer-location { font-family: var(--font-mono); color: var(--accent-steel); margin: 1rem 0; letter-spacing: 1px; }
.legal-notice { font-family: var(--font-mono); font-size: 0.75rem; color: #657066; margin: 1rem auto 0; max-width: 600px; }

@media (prefers-reduced-motion: reduce) {
    .hero-mascot-wrapper { animation: none; }
    .drawer, .toast { transition: none; }
    .btn-cart-toggle.bump { animation: none; }
}
@media (max-width: 420px) {
    .brand-name { font-size: 1rem; letter-spacing: 1px; }
    .bar-card { padding: 1.25rem; }
}
