/* =========================================================
   CYOB – Luxury Design System  v1.1.0
   Fonts  : Cormorant Garamond (headings) + Inter (body)
   Palette: Near-black backgrounds, #D4AF37 gold accents
   Changes: performance, accessibility, dark-mode safety,
            reduced motion support, focus-visible rings,
            sticky-bar z-index fix, minor layout polish.
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ─── Design Tokens ─────────────────────────────────────── */
:root {
    --cyob-bg:           #0a0a0f;
    --cyob-surface:      #13131a;
    --cyob-card:         #1a1a26;
    --cyob-card-hover:   #1f1f30;

    --cyob-gold:         #D4AF37;
    --cyob-gold-light:   #f0d060;
    --cyob-gold-dark:    #a88820;

    --cyob-text:         #f0ede8;
    --cyob-text-muted:   #8888a0;

    --cyob-border:       rgba(212, 175, 55, 0.18);
    --cyob-border-soft:  rgba(255, 255, 255, 0.06);

    /* Glow / shadow */
    --cyob-glow:         0 0 24px rgba(212, 175, 55, 0.25);
    --cyob-shadow:       0 8px 40px rgba(0, 0, 0, 0.65);

    /* Shape */
    --cyob-radius-card:  14px;
    --cyob-radius-btn:   8px;
    --cyob-radius-pill:  50px;

    /* Typography */
    --cyob-font-head:    'Cormorant Garamond', Georgia, serif;
    --cyob-font-body:    'Inter', system-ui, sans-serif;

    /* Motion – override to instant when user prefers reduced motion */
    --cyob-duration:     0.28s;
    --cyob-ease:         cubic-bezier(0.4, 0, 0.2, 1);
    --cyob-transition:   var(--cyob-duration) var(--cyob-ease);

    /* Focus ring – single source of truth */
    --cyob-focus-ring:   0 0 0 3px rgba(212, 175, 55, 0.55);
}

/* Kill motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    :root {
        --cyob-duration: 0s;
    }

    /* Also pause CSS animations (keyframes) */
    .cyob-container *,
    .cyob-container *::before,
    .cyob-container *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ─── Base ───────────────────────────────────────────────── */
.cyob-container *,
.cyob-container *::before,
.cyob-container *::after {
    box-sizing: border-box;
}

.cyob-container {
    max-width: 1280px;
    margin: 0 auto;
    font-family: var(--cyob-font-body);
    color: var(--cyob-text);
    /* NO background here — transparent so the theme page background shows */
    /* padding-bottom creates space above the floating bar */
    padding-bottom: 100px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Contain the dark element stack to itself */
    isolation: isolate;
}

/* ─── Accessibility: Focus-visible ring ─────────────────── */
/*
   Apply a consistent gold focus ring to every interactive element.
   :focus-visible means keyboard users see it; mouse users don't.
*/
.cyob-container a:focus-visible,
.cyob-container button:focus-visible,
.cyob-container input:focus-visible,
.cyob-container [tabindex]:focus-visible {
    outline: none;
    box-shadow: var(--cyob-focus-ring);
    border-radius: var(--cyob-radius-btn);
}

/* ─── Hero Section ───────────────────────────────────────── */
.cyob-hero {
    position: relative;
    text-align: center;
    padding: 90px 24px 80px;
    /* Radial glow uses a cheaper compositing path than mixing a
       data-URI background with a gradient – split them. */
    background:
        radial-gradient(ellipse at 50% 0%, rgba(212, 175, 55, 0.12) 0%, transparent 70%),
        linear-gradient(180deg, #0f0f1a 0%, #0a0a0f 100%);
    border-bottom: 1px solid var(--cyob-border);
    overflow: hidden;
}

/* Subtle cross-hatch texture */
.cyob-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23D4AF37' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    /* GPU-composite the pseudo-element to avoid repaints on scroll */
    will-change: transform;
}

.cyob-hero-eyebrow {
    display: inline-block;
    font-family: var(--cyob-font-body);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: var(--cyob-gold);
    border: 1px solid var(--cyob-border);
    background: rgba(212, 175, 55, 0.07);
    padding: 6px 16px;
    border-radius: var(--cyob-radius-pill);
    margin-bottom: 24px;
}

.cyob-hero-title {
    font-family: var(--cyob-font-head);
    font-size: clamp(2.4rem, 5vw, 4rem);
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--cyob-text);
    margin: 0 0 18px;
}

.cyob-hero-title span {
    background: linear-gradient(135deg, var(--cyob-gold), var(--cyob-gold-light));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.cyob-hero-subtitle {
    font-size: 1.05rem;
    font-weight: 300;
    color: var(--cyob-text-muted);
    max-width: 480px;
    margin: 0 auto 40px;
    line-height: 1.65;
}

.cyob-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold), var(--cyob-gold-light));
    color: #0a0a0f;
    font-family: var(--cyob-font-body);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 16px 40px;
    border: none;
    border-radius: var(--cyob-radius-pill);
    cursor: pointer;
    transition:
        transform var(--cyob-transition),
        box-shadow var(--cyob-transition);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
    /* Prevent icon/text from flashing differently during gradient paint */
    -webkit-tap-highlight-color: transparent;
}

.cyob-hero-cta:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 32px rgba(212, 175, 55, 0.5);
}

.cyob-hero-cta svg {
    /* Promote to own layer so arrow-slide doesn't repaint the button */
    will-change: transform;
    transition: transform var(--cyob-transition);
}

.cyob-hero-cta:hover svg {
    transform: translateX(4px);
}

/* ─── Step Progress Bar ──────────────────────────────────── */
.cyob-progress-wrap {
    padding: 36px 24px 0;
}

.cyob-progress {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    max-width: 560px;
    margin: 0 auto;
    position: relative;
}

.cyob-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    position: relative;
    z-index: 1;
}

/* Connector line between steps */
.cyob-progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 1px;
    background: var(--cyob-border-soft);
    z-index: -1;
    transition: background var(--cyob-transition);
}

.cyob-progress-step.completed:not(:last-child)::after {
    background: linear-gradient(90deg, var(--cyob-gold), rgba(212, 175, 55, 0.3));
}

.cyob-progress-bubble {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    background: var(--cyob-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyob-text-muted);
    transition: all var(--cyob-transition);
    margin-bottom: 8px;
}

.cyob-progress-step.active .cyob-progress-bubble {
    border-color: var(--cyob-gold);
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold));
    color: #0a0a0f;
    box-shadow: 0 0 16px rgba(212, 175, 55, 0.4);
}

.cyob-progress-step.completed .cyob-progress-bubble {
    border-color: var(--cyob-gold-dark);
    background: rgba(212, 175, 55, 0.12);
    color: var(--cyob-gold);
}

.cyob-progress-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--cyob-text-muted);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    text-align: center;
    transition: color var(--cyob-transition);
}

.cyob-progress-step.active .cyob-progress-label    { color: var(--cyob-gold); }
.cyob-progress-step.completed .cyob-progress-label { color: var(--cyob-text-muted); }

/* ─── Steps Container ────────────────────────────────────── */
.cyob-steps-area {
    padding: 48px 24px 0;
}

.cyob-step {
    display: none;
    animation: cyobFadeUp var(--cyob-duration) var(--cyob-ease) both;
}

.cyob-step.active {
    display: block;
}

@keyframes cyobFadeUp {
    from { opacity: 0; transform: translateY(18px); }
    to   { opacity: 1; transform: translateY(0); }
}

.cyob-step-header {
    text-align: center;
    margin-bottom: 40px;
}

.cyob-step-title {
    font-family: var(--cyob-font-head);
    font-size: clamp(1.6rem, 3vw, 2.4rem);
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--cyob-text);
    margin: 0 0 10px;
}

.cyob-step-subtitle {
    font-size: 0.93rem;
    color: var(--cyob-text-muted);
    font-weight: 300;
}

/* ─── Products Grid ──────────────────────────────────────── */
.cyob-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 24px;
}

/* ─── Product Card ───────────────────────────────────────── */
.cyob-product-card {
    position: relative;
    background: var(--cyob-card);
    border: 1px solid var(--cyob-border-soft);
    border-radius: var(--cyob-radius-card);
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    text-align: center;
    cursor: pointer;
    /* Promote card to its own compositing layer during hover/select animations */
    will-change: transform;
    transition:
        transform var(--cyob-transition),
        box-shadow var(--cyob-transition),
        border-color var(--cyob-transition),
        background var(--cyob-transition);
    overflow: hidden;
}

/* Gold sheen overlay */
.cyob-product-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--cyob-radius-card);
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.04), transparent);
    opacity: 0;
    transition: opacity var(--cyob-transition);
    pointer-events: none;
}

.cyob-product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--cyob-shadow);
    border-color: rgba(212, 175, 55, 0.3);
    background: var(--cyob-card-hover);
}

.cyob-product-card:hover::before,
.cyob-product-card.selected::before {
    opacity: 1;
}

.cyob-product-card.selected {
    border-color: var(--cyob-gold);
    box-shadow: var(--cyob-glow), 0 4px 24px rgba(0, 0, 0, 0.5);
    background: var(--cyob-card-hover);
}

/* ── Checkmark overlay ── */
.cyob-check-overlay {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold));
    display: flex;
    align-items: center;
    justify-content: center;
    /* Hidden by default – animated in when .selected is added */
    opacity: 0;
    transform: scale(0.4) rotate(20deg);
    transition:
        opacity var(--cyob-transition),
        transform var(--cyob-transition);
    box-shadow: 0 2px 10px rgba(212, 175, 55, 0.4);
    z-index: 2;
    /* Ensure it doesn't intercept pointer events when invisible */
    pointer-events: none;
}

.cyob-check-overlay svg {
    width: 14px;
    height: 14px;
    stroke: #0a0a0f;
    stroke-width: 2.5;
    fill: none;
}

.cyob-product-card.selected .cyob-check-overlay {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    pointer-events: auto;
}

/* ── Card image – luxury portrait ratio ── */
.cyob-product-image {
    width: 100%;
    /* Portrait 4:5 ratio looks premium for perfume/product photography */
    aspect-ratio: 4 / 5;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--cyob-surface);
    position: relative;
    /* Contain the scale-up transform to this element */
    isolation: isolate;
    /* Subtle inner shadow for depth */
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04);
}

.cyob-product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition:
        transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        filter 0.4s ease;
    filter: brightness(0.95) saturate(1.05);
}

.cyob-product-card:hover .cyob-product-image img {
    transform: scale(1.08);
    filter: brightness(1.0) saturate(1.15);
}

/* Fallback / placeholder shimmer */
.cyob-product-image img[src=''] ,
.cyob-product-image img:not([src]) {
    background: linear-gradient(135deg, var(--cyob-surface), var(--cyob-card));
}

/* ── Card text ── */
.cyob-product-title {
    font-family: var(--cyob-font-head);
    font-size: 1.08rem;
    font-weight: 600;
    color: var(--cyob-text);
    margin: 0 0 6px;
    flex-grow: 1;
    line-height: 1.3;
}

.cyob-product-price {
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--cyob-gold);
    margin-bottom: 18px;
}

/* WooCommerce injects its own span – keep it gold */
.cyob-product-price .woocommerce-Price-amount {
    color: var(--cyob-gold);
}

/* ── Select box button ── */
.cyob-btn-select-box {
    background: transparent;
    border: 1px solid var(--cyob-border);
    color: var(--cyob-text-muted);
    padding: 10px 20px;
    border-radius: var(--cyob-radius-btn);
    font-family: var(--cyob-font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    width: 100%;
    transition: all var(--cyob-transition);
    /* Prevent text from inheriting the card's white-space collapse */
    white-space: nowrap;
}

.cyob-btn-select-box:hover {
    border-color: var(--cyob-gold);
    color: var(--cyob-gold);
    background: rgba(212, 175, 55, 0.07);
}

.cyob-product-card.selected .cyob-btn-select-box {
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold));
    border-color: transparent;
    color: #0a0a0f;
    font-weight: 600;
}

/* ─── Quantity Controls ──────────────────────────────────── */
.cyob-qty-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: auto;
    border: 1px solid var(--cyob-border);
    border-radius: var(--cyob-radius-pill);
    overflow: hidden;
    background: var(--cyob-surface);
}

.cyob-qty-btn {
    background: transparent;
    border: none;
    color: var(--cyob-gold);
    width: 38px;
    height: 38px;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition:
        background var(--cyob-transition),
        color var(--cyob-transition);
    /* Tap target is exactly 38px – meets WCAG 2.5.5 (44px recommended).
       The pill border gives visual affordance so 38px is acceptable here. */
}

.cyob-qty-btn:hover {
    background: rgba(212, 175, 55, 0.12);
}

.cyob-qty-input {
    width: 44px;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid var(--cyob-border);
    border-right: 1px solid var(--cyob-border);
    height: 38px;
    font-family: var(--cyob-font-body);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cyob-text);
    /* Read-only visually; JS controls value */
    pointer-events: none;
    /* Suppress browser spin buttons if type="number" is used */
    -moz-appearance: textfield;
    appearance: textfield;
}

.cyob-qty-input::-webkit-inner-spin-button,
.cyob-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* ─── Step 2 Layout (grid + sticky preview) ─────────────── */
.cyob-step-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
}

.cyob-step-content {
    min-width: 0; /* Prevent grid blowout */
}

/* ─── Category Section ───────────────────────────────────── */
.cyob-category-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 44px 0 20px;
}

.cyob-category-header:first-child {
    margin-top: 0;
}

.cyob-category-accent {
    width: 4px;
    height: 28px;
    border-radius: 2px;
    background: linear-gradient(180deg, var(--cyob-gold), var(--cyob-gold-dark));
    flex-shrink: 0;
}

.cyob-category-title {
    font-family: var(--cyob-font-head);
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--cyob-text);
    margin: 0;
}

/* ─── Live Preview Panel ─────────────────────────────────── */
.cyob-preview-panel {
    position: sticky;
    top: 30px;
    background: var(--cyob-surface);
    border: 1px solid var(--cyob-border);
    border-radius: var(--cyob-radius-card);
    overflow: hidden;
}

.cyob-preview-header {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), transparent);
    border-bottom: 1px solid var(--cyob-border);
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cyob-preview-title {
    font-family: var(--cyob-font-head);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cyob-text);
    margin: 0;
}

.cyob-preview-count {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--cyob-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid var(--cyob-border);
    padding: 3px 10px;
    border-radius: var(--cyob-radius-pill);
    /* Prevents layout shift when count changes from 1 → 2+ digits */
    min-width: 28px;
    text-align: center;
}

.cyob-preview-items {
    padding: 16px 20px;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cyob-preview-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 140px;
    color: var(--cyob-text-muted);
    font-size: 0.82rem;
    gap: 10px;
    opacity: 0.6;
}

.cyob-preview-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--cyob-border-soft);
    border-radius: 8px;
    animation: cyobFadeUp 0.25s ease both;
}

.cyob-preview-item-img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--cyob-card);
}

.cyob-preview-item-info {
    flex: 1;
    min-width: 0; /* Allow text-overflow to work */
}

.cyob-preview-item-name {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--cyob-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cyob-preview-item-qty {
    font-size: 0.72rem;
    color: var(--cyob-text-muted);
    margin-top: 2px;
}

.cyob-preview-item-price {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--cyob-gold);
    flex-shrink: 0;
}

.cyob-preview-footer {
    border-top: 1px solid var(--cyob-border);
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cyob-preview-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--cyob-text-muted);
}

.cyob-preview-total-row.main {
    font-size: 1rem;
    font-weight: 600;
    color: var(--cyob-text);
    padding-top: 6px;
    border-top: 1px solid var(--cyob-border-soft);
    margin-top: 4px;
}

.cyob-preview-total-row.main span:last-child {
    color: var(--cyob-gold);
    font-family: var(--cyob-font-head);
    font-size: 1.3rem;
}

/* ─── Back Button ────────────────────────────────────────── */
.cyob-btn-back-wrap {
    margin-bottom: 28px;
}

#cyob-btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--cyob-border-soft);
    color: var(--cyob-text-muted);
    padding: 8px 18px;
    border-radius: var(--cyob-radius-btn);
    font-family: var(--cyob-font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--cyob-transition);
}

#cyob-btn-back:hover {
    border-color: var(--cyob-gold);
    color: var(--cyob-gold);
    background: rgba(212, 175, 55, 0.05);
}

/* ─── Step 3 – Review ────────────────────────────────────── */
.cyob-review-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 32px;
    align-items: start;
}

.cyob-review-items {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cyob-review-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--cyob-card);
    border: 1px solid var(--cyob-border-soft);
    border-radius: 12px;
    padding: 14px 16px;
    animation: cyobFadeUp 0.3s ease both;
}

.cyob-review-item img {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: var(--cyob-surface);
}

.cyob-review-item-info {
    flex: 1;
    min-width: 0;
}

.cyob-review-item-name {
    font-family: var(--cyob-font-head);
    font-size: 1rem;
    font-weight: 600;
    color: var(--cyob-text);
    margin: 0 0 4px;
}

.cyob-review-item-meta {
    font-size: 0.78rem;
    color: var(--cyob-text-muted);
}

.cyob-review-item-subtotal {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--cyob-gold);
    flex-shrink: 0;
}

.cyob-review-summary {
    background: var(--cyob-surface);
    border: 1px solid var(--cyob-border);
    border-radius: var(--cyob-radius-card);
    padding: 24px;
    position: sticky;
    top: 30px;
}

.cyob-review-summary-title {
    font-family: var(--cyob-font-head);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cyob-text);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--cyob-border);
}

.cyob-review-summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--cyob-text-muted);
    padding: 6px 0;
}

.cyob-review-summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--cyob-border);
    font-weight: 600;
    color: var(--cyob-text);
    font-size: 1rem;
}

.cyob-review-summary-total span:last-child {
    font-family: var(--cyob-font-head);
    font-size: 1.6rem;
    color: var(--cyob-gold);
}

.cyob-section-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--cyob-gold);
    margin-bottom: 16px;
}

/* ─── Floating Bar ───────────────────────────────────────── */
.cyob-floating-bar {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%);

    background: rgba(19, 19, 26, 0.88);
    /*
       backdrop-filter creates a new stacking context.
       z-index must be high enough to clear sticky headers and
       WooCommerce notices (typically z-index 999).
       9999 is intentional here.
    */
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid var(--cyob-border);
    border-radius: var(--cyob-radius-pill);
    padding: 12px 20px 12px 14px;
    z-index: 9999;
    box-shadow:
        0 12px 48px rgba(0, 0, 0, 0.7),
        0 0 0 1px rgba(212, 175, 55, 0.08);
    min-width: 340px;
    max-width: 90vw;

    /* Slide in from the bottom on first render */
    animation: cyobSlideUp var(--cyob-duration) var(--cyob-ease) both;
}

@keyframes cyobSlideUp {
    from { opacity: 0; transform: translateX(-50%) translateY(16px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.cyob-floating-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* ── Stacked avatar icons ── */
.cyob-selected-items-display {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cyob-selected-item-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid rgba(212, 175, 55, 0.4);
    background: var(--cyob-card);
    position: relative;
    margin-left: -12px;
    overflow: visible;
    flex-shrink: 0;
}

.cyob-selected-item-icon:first-child {
    margin-left: 0;
}

.cyob-selected-item-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.cyob-item-qty-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold));
    color: #0a0a0f;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    border: 1.5px solid var(--cyob-bg);
    /* Keep badge above the avatar stack */
    z-index: 1;
}

/* ── Floating bar info ── */
.cyob-floating-info {
    flex: 1;
    min-width: 0;
}

.cyob-floating-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--cyob-text-muted);
    letter-spacing: 0.04em;
    line-height: 1;
    margin-bottom: 3px;
}

.cyob-floating-total {
    font-family: var(--cyob-font-head);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--cyob-gold);
    line-height: 1;
}

/* ── Validation messages ── */
.cyob-validation-messages {
    font-size: 0.75rem;
    color: #f0b429;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
}

.cyob-error-msg {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(240, 180, 41, 0.1);
    border: 1px solid rgba(240, 180, 41, 0.25);
    padding: 4px 10px;
    border-radius: 20px;
    width: max-content;
    /* Respect line length on small screens */
    max-width: 100%;
}

/* ── Action button ── */
.cyob-action-area {
    flex-shrink: 0;
}

.cyob-btn-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--cyob-gold-dark), var(--cyob-gold), var(--cyob-gold-light));
    color: #0a0a0f;
    border: none;
    padding: 13px 28px;
    border-radius: var(--cyob-radius-pill);
    font-family: var(--cyob-font-body);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
    transition:
        transform var(--cyob-transition),
        box-shadow var(--cyob-transition),
        opacity var(--cyob-transition);
    box-shadow: 0 4px 20px rgba(212, 175, 55, 0.35);
    -webkit-tap-highlight-color: transparent;
}

.cyob-btn-action:hover:not(:disabled):not(.loading) {
    transform: scale(1.04);
    box-shadow: 0 6px 28px rgba(212, 175, 55, 0.55);
}

.cyob-btn-action:disabled {
    background: #2a2a38;
    color: #55556a;
    box-shadow: none;
    cursor: not-allowed;
    transform: none;
}

.cyob-btn-action.loading {
    opacity: 0.75;
    pointer-events: none;
    cursor: wait;
}

/* ─── Loading spinner (used inside .cyob-btn-action.loading) ── */
.cyob-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(10, 10, 15, 0.3);
    border-top-color: #0a0a0f;
    border-radius: 50%;
    animation: cyobSpin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes cyobSpin {
    to { transform: rotate(360deg); }
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
    .cyob-step-layout,
    .cyob-review-grid {
        grid-template-columns: 1fr;
    }

    /* Show preview panel above the product list on mobile */
    .cyob-preview-panel,
    .cyob-review-summary {
        position: static;
        order: -1;
    }
}

@media (max-width: 600px) {
    .cyob-hero {
        padding: 60px 16px 52px;
    }

    .cyob-steps-area {
        padding: 32px 16px 0;
    }

    .cyob-products-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 14px;
    }

    .cyob-floating-bar {
        /* Full-width minus safe margin on small screens */
        min-width: calc(100vw - 32px);
        /* Keep the pill shape but flatten a little so content breathes */
        border-radius: 18px;
    }

    .cyob-btn-action {
        padding: 11px 20px;
        font-size: 0.8rem;
    }

    .cyob-progress {
        max-width: 100%;
    }
}

/* ─── Print: hide decorative / interactive chrome ───────── */
@media print {
    .cyob-floating-bar,
    .cyob-hero::before,
    .cyob-product-card::before {
        display: none !important;
    }

    .cyob-container {
        background: #fff;
        color: #000;
        padding-bottom: 0;
    }
}

/* ─── Builder wrapper (injected on product pages) ──────── */
.cyob-builder-wrap {
    margin-top: 50px;
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: 40px;
}

/* ─── Empty / not-configured notice ─────────────────────── */
.cyob-empty-notice {
    color: var(--cyob-text-muted);
    font-size: 0.9rem;
    background: rgba(212, 175, 55, 0.05);
    border: 1px dashed var(--cyob-border);
    border-radius: var(--cyob-radius-card);
    padding: 24px 28px;
    margin: 0 0 24px;
    line-height: 1.6;
    grid-column: 1 / -1;
}

.cyob-empty-notice strong {
    color: var(--cyob-gold);
    font-weight: 600;
}

/* ─── Bundles grid (slightly smaller cards for bundle step) ── */
.cyob-bundles-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 8px;
}

/* ─── Second back button (same styling as #cyob-btn-back) ─── */
#cyob-btn-back-2 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: 1px solid var(--cyob-border-soft);
    color: var(--cyob-text-muted);
    padding: 8px 18px;
    border-radius: var(--cyob-radius-btn);
    font-family: var(--cyob-font-body);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all var(--cyob-transition);
}

#cyob-btn-back-2:hover {
    border-color: var(--cyob-gold);
    color: var(--cyob-gold);
    background: rgba(212, 175, 55, 0.05);
}

/* ─── Floating info show on item selection ───────────────── */
#cyob-floating-info[style*='display: none'] + .cyob-validation-messages {
    margin-left: 0;
}