/* VDH Grading — configurator sidebar (conversion surface) styles. */

.vdhg-cfg {
    position: sticky;
    top: 90px;
    padding: 24px;
    background: linear-gradient(180deg, var(--vdhg-surface) 0%, var(--vdhg-bg-2) 100%);
    border: 1px solid var(--vdhg-border);
    border-radius: var(--vdhg-radius);
    box-shadow:
        0 0 0 1px rgba(168, 85, 247, 0.08),
        0 20px 60px -20px rgba(168, 85, 247, 0.45),
        inset 0 1px 0 rgba(255, 255, 255, 0.04);
    color: var(--vdhg-fg);
    font-family: var(--vdhg-font);
}

.vdhg-cfg--empty {
    padding: 28px;
    color: var(--vdhg-muted);
    font-size: 14px;
    text-align: center;
}
.vdhg-cfg--empty a { color: var(--vdhg-green); }

.vdhg-cfg__title {
    margin: 0 0 20px;
    font-family: var(--vdhg-font-display);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.vdhg-cfg__section {
    border: 0;
    padding: 0;
    margin: 0 0 22px;
}

.vdhg-cfg__legend {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    margin-bottom: 12px;
    font-family: var(--vdhg-font-display);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--vdhg-fg);
}

.vdhg-cfg__step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 7px;
    background: var(--vdhg-green);
    color: #000;
    font-size: 12px;
    font-weight: 800;
}

/* Radio / checkbox rows share core layout. */
.vdhg-cfg__radio,
.vdhg-cfg__check {
    position: relative;
    display: grid;
    grid-template-columns: 20px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    margin-bottom: 8px;
    background: var(--vdhg-surface-hi);
    border: 1px solid var(--vdhg-border);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.vdhg-cfg__radio:hover,
.vdhg-cfg__check:hover {
    transform: translateY(-1px);
    border-color: var(--vdhg-green);
}

.vdhg-cfg__radio input[type="radio"],
.vdhg-cfg__check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    border: 1.5px solid var(--vdhg-border);
    background: var(--vdhg-bg);
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.vdhg-cfg__radio input[type="radio"] { border-radius: 50%; }
.vdhg-cfg__check input[type="checkbox"] { border-radius: 5px; }

.vdhg-cfg__radio input[type="radio"]:checked {
    border-color: var(--vdhg-green);
    background:
        radial-gradient(circle, var(--vdhg-green) 0 5px, transparent 6px),
        var(--vdhg-bg);
    box-shadow: 0 0 10px -2px var(--vdhg-green-soft);
}

.vdhg-cfg__check input[type="checkbox"]:checked {
    border-color: var(--vdhg-purple);
    background: var(--vdhg-purple);
    box-shadow: 0 0 10px -2px var(--vdhg-purple-soft);
}

.vdhg-cfg__check input[type="checkbox"]:checked::after {
    content: "✓";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #000;
    font-size: 13px;
    font-weight: 900;
    line-height: 1;
}

.vdhg-cfg__radio input:focus-visible,
.vdhg-cfg__check input:focus-visible,
.vdhg-cfg__game input:focus-visible + img,
.vdhg-cfg__game input:focus-visible ~ .vdhg-cfg__game-text,
.vdhg-cfg__qty-input:focus-visible {
    outline: 2px solid var(--vdhg-green);
    outline-offset: 2px;
}

/* Selected row state — color + weight + brighter border. */
.vdhg-cfg__radio:has(input:checked),
.vdhg-cfg__check:has(input:checked) {
    border-color: var(--vdhg-border-green);
    background: linear-gradient(180deg, var(--vdhg-surface-hi), rgba(57, 255, 20, 0.04));
}

.vdhg-cfg__radio:has(input:checked) .vdhg-cfg__radio-label,
.vdhg-cfg__check:has(input:checked) .vdhg-cfg__check-label {
    font-weight: 700;
    color: var(--vdhg-fg);
}

.vdhg-cfg__radio-label,
.vdhg-cfg__check-label {
    font-size: 15px;
    color: var(--vdhg-fg);
}

.vdhg-cfg__radio-price,
.vdhg-cfg__check-price {
    font-family: var(--vdhg-font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--vdhg-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.vdhg-cfg__radio:has(input:checked) .vdhg-cfg__radio-price {
    color: var(--vdhg-green);
}

/* "Most Popular" magenta pill. */
.vdhg-cfg__badge {
    position: absolute;
    top: -9px;
    right: 12px;
    padding: 3px 10px;
    background: #e22ce3;
    color: #fff;
    font-family: var(--vdhg-font-display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    box-shadow: 0 4px 14px -4px rgba(226, 44, 227, 0.7);
}

/* Quantity numeric input. */
.vdhg-cfg__quantity {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 14px;
    margin-top: 10px;
    background: var(--vdhg-surface-hi);
    border: 1px solid var(--vdhg-border);
    border-radius: 10px;
}
.vdhg-cfg__qty-label {
    font-size: 14px;
    color: var(--vdhg-muted);
}
.vdhg-cfg__qty-input {
    width: 80px;
    padding: 8px 10px;
    background: var(--vdhg-bg);
    border: 1px solid var(--vdhg-border);
    border-radius: 8px;
    color: var(--vdhg-fg);
    font-family: var(--vdhg-font-display);
    font-size: 15px;
    font-weight: 700;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.vdhg-cfg__qty-input:focus { border-color: var(--vdhg-green); outline: none; }

/* Game selector — 4-up grid of logo buttons. */
.vdhg-cfg__games {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}
.vdhg-cfg__game {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1;
    padding: 10px;
    background: var(--vdhg-surface-hi);
    border: 1px solid var(--vdhg-border);
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.vdhg-cfg__game input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.vdhg-cfg__game img { max-width: 100%; max-height: 100%; object-fit: contain; filter: grayscale(0.3); transition: filter 0.15s ease; }
.vdhg-cfg__game-text { font-family: var(--vdhg-font-display); font-size: 12px; text-align: center; color: var(--vdhg-fg); }
.vdhg-cfg__game:hover { transform: translateY(-1px); border-color: var(--vdhg-green); }
.vdhg-cfg__game:has(input:checked) {
    border-color: var(--vdhg-green);
    box-shadow: 0 0 0 1px var(--vdhg-green), 0 0 20px -4px var(--vdhg-green-soft);
}
.vdhg-cfg__game:has(input:checked) img { filter: grayscale(0); }
.vdhg-cfg__game:has(input:checked)::after {
    content: "✓";
    position: absolute;
    top: 4px;
    right: 6px;
    font-size: 11px;
    font-weight: 900;
    color: var(--vdhg-green);
}

/* Summary block. */
.vdhg-cfg__summary {
    margin: 20px 0 16px;
    padding: 16px;
    background: var(--vdhg-bg);
    border: 1px solid var(--vdhg-border);
    border-radius: 10px;
}
.vdhg-cfg__summary-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 14px;
    color: var(--vdhg-muted);
}
.vdhg-cfg__subtotal {
    font-family: var(--vdhg-font-display);
    font-size: 24px;
    font-weight: 800;
    color: var(--vdhg-fg);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.01em;
}
.vdhg-cfg__turnaround {
    margin: 8px 0 0;
    font-size: 13px;
    color: var(--vdhg-muted);
}

/* Submit button — extends .btn.btn-primary. */
.vdhg-cfg__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 22px;
    font-size: 16px;
}
.vdhg-cfg__submit-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
}
.vdhg-cfg__submit:hover .vdhg-cfg__submit-arrow { transform: translateX(4px); }

.vdhg-cfg__error {
    margin: 10px 0 0;
    padding: 10px 12px;
    background: rgba(255, 60, 90, 0.08);
    border: 1px solid rgba(255, 60, 90, 0.35);
    border-radius: 8px;
    color: #ff8da3;
    font-size: 13px;
}

/* ─── Close button (drawer only) ─── */
.vdhg-cfg__close {
    display: none;
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--vdhg-border);
    border-radius: 10px;
    color: var(--vdhg-fg);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.vdhg-cfg__close:hover,
.vdhg-cfg__close:focus-visible {
    border-color: var(--vdhg-green);
    color: var(--vdhg-green);
    outline: none;
}

/* ─── Desktop → sidebar, Mobile → drawer ─── */
@media (max-width: 980px) {
    /* Hide the inline configurator completely on mobile — it's accessed via the dock. */
    .home-shell__sidebar { display: none; }

    /* When opened, re-attach the configurator as a fixed slide-up drawer. */
    body.vdhg-cfg-open .home-shell__sidebar {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 1000;
        pointer-events: none;
    }
    body.vdhg-cfg-open .vdhg-cfg {
        pointer-events: auto;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: 10vh;
        max-height: 90vh;
        overflow-y: auto;
        margin: 0;
        border-radius: var(--vdhg-radius) var(--vdhg-radius) 0 0;
        transform: translateY(0);
        animation: vdhg-drawer-slide-up 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
    }
    body.vdhg-cfg-open { overflow: hidden; touch-action: none; }

    .vdhg-cfg__close { display: block; }
    .vdhg-cfg__title { padding-right: 48px; }
    .vdhg-cfg__games { grid-template-columns: repeat(4, 1fr); }
}

@keyframes vdhg-drawer-slide-up {
    from { transform: translateY(100%); opacity: 0.7; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ─── Dock bar (mobile only) ─── */
.vdhg-dock { display: none; }

@media (max-width: 980px) {
    .vdhg-dock {
        display: block;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
        background: linear-gradient(180deg,
            rgba(7, 7, 12, 0.82) 0%,
            rgba(7, 7, 12, 0.96) 60%);
        backdrop-filter: blur(14px);
        border-top: 1px solid var(--vdhg-border);
        box-shadow: 0 -10px 30px -10px rgba(0, 0, 0, 0.6);
    }
    .vdhg-dock__inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        max-width: var(--vdhg-max);
        margin: 0 auto;
    }
    .vdhg-dock__summary {
        display: flex;
        flex-direction: column;
        min-width: 0;
    }
    .vdhg-dock__label {
        font-size: 11px;
        color: var(--vdhg-muted);
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
    .vdhg-dock__total {
        font-family: var(--vdhg-font-display);
        font-size: 22px;
        font-weight: 800;
        color: var(--vdhg-fg);
        font-variant-numeric: tabular-nums;
    }
    .vdhg-dock__cta {
        flex-shrink: 0;
        padding: 12px 18px;
    }
    .vdhg-dock__arrow {
        display: inline-block;
        margin-left: 6px;
        transition: transform 0.15s ease;
    }
    .vdhg-dock__cta:hover .vdhg-dock__arrow { transform: translateX(3px); }

    /* When the drawer is open the dock hides behind it. */
    body.vdhg-cfg-open .vdhg-dock { visibility: hidden; }
}

/* ─── Drawer backdrop (mobile only) ─── */
.vdhg-drawer-backdrop { display: none; }
@media (max-width: 980px) {
    body.vdhg-cfg-open .vdhg-drawer-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        z-index: 950;
        background: rgba(0, 0, 0, 0.6);
        backdrop-filter: blur(4px);
        animation: vdhg-drawer-fade-in 0.2s ease;
    }
}
@keyframes vdhg-drawer-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@media (max-width: 480px) {
    .vdhg-cfg { padding: 18px; }
    .vdhg-cfg__games { grid-template-columns: repeat(2, 1fr); }
    body.vdhg-cfg-open .vdhg-cfg { top: 6vh; max-height: 94vh; }
}

@media (prefers-reduced-motion: reduce) {
    .vdhg-cfg,
    .vdhg-cfg *,
    .vdhg-cfg *::before,
    .vdhg-cfg *::after {
        transition: none !important;
        animation: none !important;
    }
}
