/* ============================================================
   African Reaper Arrows — Arrow Spine Selector
   Dark tactical aesthetic — carbon & amber
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Barlow:wght@400;500;600&family=Barlow+Condensed:wght@400;600;700&display=swap');

/* ── CSS Variables ─────────────────────────────────────────── */
.ar-spine-selector {
    --ar-bg:          #0f0f0f;
    --ar-bg-card:     #181818;
    --ar-bg-input:    #111111;
    --ar-border:      #2a2a2a;
    --ar-border-glow: #C89830;
    --ar-gold:        #C89830;
    --ar-gold-light:  #e8b840;
    --ar-text:        #e8e8e8;
    --ar-text-muted:  #7a7a7a;
    --ar-text-dim:    #444444;
    --ar-radius:      6px;
    --ar-radius-lg:   10px;
    --ar-font-display: 'Bebas Neue', 'Impact', sans-serif;
    --ar-font-body:    'Barlow', 'Helvetica Neue', sans-serif;
    --ar-font-cond:    'Barlow Condensed', 'Barlow', sans-serif;
    --ar-transition:  0.2s ease;
}

/* ── Base ──────────────────────────────────────────────────── */
.ar-spine-selector *,
.ar-spine-selector *::before,
.ar-spine-selector *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.ar-spine-selector {
    background: var(--ar-bg);
    border: 1px solid var(--ar-border);
    border-top: 3px solid var(--ar-gold);
    border-radius: var(--ar-radius-lg);
    padding: 40px;
    max-width: 860px;
    margin: 40px auto;
    font-family: var(--ar-font-body);
    color: var(--ar-text);
    position: relative;
    overflow: hidden;
}

/* carbon-fibre watermark */
.ar-spine-selector::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            45deg,
            rgba(255,255,255,0.015) 0px,
            rgba(255,255,255,0.015) 1px,
            transparent 1px,
            transparent 8px
        ),
        repeating-linear-gradient(
            -45deg,
            rgba(255,255,255,0.015) 0px,
            rgba(255,255,255,0.015) 1px,
            transparent 1px,
            transparent 8px
        );
    pointer-events: none;
    z-index: 0;
}

.ar-spine-selector > * { position: relative; z-index: 1; }

/* ── Header ────────────────────────────────────────────────── */
.ar-spine-selector__header {
    display: flex;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 36px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--ar-border);
}

.ar-spine-selector__logo-mark {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: rgba(200, 152, 48, 0.12);
    border: 1px solid rgba(200, 152, 48, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ar-gold);
    padding: 10px;
}

.ar-spine-selector__heading h2 {
    font-family: var(--ar-font-display);
    font-size: clamp(26px, 4vw, 38px);
    letter-spacing: 0.06em;
    color: var(--ar-gold);
    line-height: 1;
    margin-bottom: 8px;
}

.ar-spine-selector__heading p {
    font-size: 14px;
    color: var(--ar-text-muted);
    line-height: 1.5;
    max-width: 480px;
}

/* ── Form grid ─────────────────────────────────────────────── */
.ar-spine-selector__form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 28px 36px;
}

.ar-field { display: flex; flex-direction: column; gap: 10px; }
.ar-field--full { grid-column: 1 / -1; }
.ar-field--center { align-items: center; }

/* ── Labels ────────────────────────────────────────────────── */
.ar-label {
    font-family: var(--ar-font-cond);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ar-text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ar-value-badge {
    background: rgba(200, 152, 48, 0.15);
    border: 1px solid rgba(200, 152, 48, 0.3);
    color: var(--ar-gold-light);
    font-family: var(--ar-font-display);
    font-size: 14px;
    letter-spacing: 0.05em;
    padding: 2px 9px;
    border-radius: 4px;
    min-width: 64px;
    text-align: center;
}

/* ── Toggle groups ─────────────────────────────────────────── */
.ar-toggle-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ar-toggle {
    font-family: var(--ar-font-cond);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 9px 18px;
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius);
    background: var(--ar-bg-card);
    color: var(--ar-text-muted);
    cursor: pointer;
    transition: all var(--ar-transition);
    line-height: 1;
}

.ar-toggle:hover {
    border-color: var(--ar-text-dim);
    color: var(--ar-text);
}

.ar-toggle.active {
    background: rgba(200, 152, 48, 0.15);
    border-color: var(--ar-gold);
    color: var(--ar-gold-light);
}

/* ── Range sliders ─────────────────────────────────────────── */
.ar-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: var(--ar-border);
    outline: none;
    cursor: pointer;
    /* filled track via JS-updated CSS var isn't supported universally —
       we use a pseudo-gradient approach */
    background: linear-gradient(
        to right,
        var(--ar-gold) 0%,
        var(--ar-gold) var(--pct, 50%),
        var(--ar-border) var(--pct, 50%),
        var(--ar-border) 100%
    );
    transition: background var(--ar-transition);
}

.ar-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ar-gold);
    border: 3px solid var(--ar-bg);
    box-shadow: 0 0 0 1px var(--ar-gold);
    cursor: pointer;
    transition: transform var(--ar-transition), box-shadow var(--ar-transition);
}

.ar-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 1px var(--ar-gold), 0 0 10px rgba(200, 152, 48, 0.4);
}

.ar-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--ar-gold);
    border: 3px solid var(--ar-bg);
    cursor: pointer;
}

.ar-slider-ticks {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: var(--ar-text-dim);
    font-family: var(--ar-font-cond);
    letter-spacing: 0.04em;
    margin-top: 2px;
}

/* ── Hint text ─────────────────────────────────────────────── */
.ar-hint {
    font-size: 12px;
    color: var(--ar-text-dim);
    line-height: 1.4;
    margin-top: -4px;
}

/* ── Calculate button ──────────────────────────────────────── */
.ar-btn-calculate {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--ar-font-display);
    font-size: 18px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    padding: 16px 40px;
    background: var(--ar-gold);
    color: #0f0f0f;
    border: none;
    border-radius: var(--ar-radius);
    cursor: pointer;
    transition: background var(--ar-transition), transform var(--ar-transition), box-shadow var(--ar-transition);
    box-shadow: 0 0 0 rgba(200, 152, 48, 0);
    margin-top: 8px;
}

.ar-btn-calculate:hover {
    background: var(--ar-gold-light);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(200, 152, 48, 0.35);
}

.ar-btn-calculate:active {
    transform: translateY(0);
}

/* ── Results panel ─────────────────────────────────────────── */
.ar-results {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.5s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease;
    margin-top: 0;
}

.ar-results.is-visible {
    max-height: 600px;
    opacity: 1;
    margin-top: 36px;
}

.ar-results__inner {
    border: 1px solid rgba(200, 152, 48, 0.35);
    border-radius: var(--ar-radius-lg);
    background: var(--ar-bg-card);
    padding: 32px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 24px 40px;
    position: relative;
    overflow: hidden;
}

/* corner accent */
.ar-results__inner::after {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 80px; height: 80px;
    background: radial-gradient(circle at 0% 0%, rgba(200,152,48,0.12), transparent 70%);
    pointer-events: none;
}

.ar-results__primary {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-right: 40px;
    border-right: 1px solid var(--ar-border);
    min-width: 140px;
}

.ar-results__label {
    font-family: var(--ar-font-cond);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ar-text-muted);
    margin-bottom: 6px;
}

.ar-results__spine {
    font-family: var(--ar-font-display);
    font-size: clamp(56px, 8vw, 80px);
    letter-spacing: -0.01em;
    color: var(--ar-gold);
    line-height: 1;
}

.ar-results__sub {
    font-family: var(--ar-font-cond);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--ar-text-muted);
    margin-top: 4px;
}

/* details grid */
.ar-results__details {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 12px;
}

.ar-results__detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ar-border);
    gap: 16px;
}

.ar-results__detail-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ar-results__detail-label {
    font-family: var(--ar-font-cond);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--ar-text-muted);
}

.ar-results__detail-val {
    font-family: var(--ar-font-cond);
    font-size: 14px;
    font-weight: 700;
    color: var(--ar-text);
    text-align: right;
}

/* note + CTA — span full width */
.ar-results__note {
    grid-column: 1 / -1;
    font-size: 13px;
    line-height: 1.6;
    color: var(--ar-text-muted);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--ar-border);
    border-radius: var(--ar-radius);
    padding: 12px 16px;
}

.ar-results__note:empty { display: none; }

.ar-btn-shop {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: var(--ar-font-display);
    font-size: 16px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 14px 32px;
    border: 1px solid var(--ar-gold);
    border-radius: var(--ar-radius);
    color: var(--ar-gold);
    background: transparent;
    transition: background var(--ar-transition), color var(--ar-transition), box-shadow var(--ar-transition);
}

.ar-btn-shop:hover {
    background: var(--ar-gold);
    color: #0f0f0f;
    box-shadow: 0 6px 24px rgba(200, 152, 48, 0.3);
}

/* ── Editor preview (Gutenberg) ────────────────────────────── */
.ar-editor-preview {
    background: #0f0f0f;
    border: 1px dashed #444;
    border-top: 3px solid #C89830;
    border-radius: 8px;
    padding: 24px;
}

.ar-editor-preview__inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ar-editor-preview__icon {
    flex-shrink: 0;
    color: #C89830;
}

.ar-editor-preview__text strong {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #C89830;
}

.ar-editor-preview__text span {
    font-size: 14px;
    color: #999;
}

.ar-editor-preview__text p {
    font-size: 12px;
    color: #555;
    margin-top: 6px;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 680px) {
    .ar-spine-selector {
        padding: 24px 20px;
    }

    .ar-spine-selector__form {
        grid-template-columns: 1fr;
    }

    .ar-field--full { grid-column: 1; }

    .ar-results__inner {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ar-results__primary {
        padding-right: 0;
        border-right: none;
        border-bottom: 1px solid var(--ar-border);
        padding-bottom: 20px;
    }
}

/* ── Calculation breakdown panel (v2) ── */
.ar-breakdown-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 7px 0; border-bottom: 1px solid var(--ar-border);
    font-family: var(--ar-font-cond); font-size: 12px;
}
.ar-breakdown-row:last-child { border-bottom: none; }
.ar-breakdown-key { color: var(--ar-text-muted); }
.ar-breakdown-val { font-weight: 700; color: var(--ar-text); text-align: right; }
.ar-breakdown-row--total .ar-breakdown-key { color: var(--ar-gold-light); font-weight: 700; }
.ar-breakdown-row--total .ar-breakdown-val { color: var(--ar-gold-light); font-size: 14px; }
