/* ==========================================================================
   CAR — purchase-popup.css
   Modal de compra: lista de serviços, slider de minutos, resumo
   Estética Oráculo: Luxo minimalista · Escuro quente · Dourado champagne
   ========================================================================== */

/* ── Overlay ─────────────────────────────────────────────────────────────── */
.car-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: car-fade-in 0.25s ease;
}

@keyframes car-fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

body.car-popup-open {
    overflow: hidden;
}

/* ── Popup box ───────────────────────────────────────────────────────────── */
.car-popup {
    background: rgba(14, 13, 11, 0.96);
    backdrop-filter: blur(32px) saturate(1.5);
    -webkit-backdrop-filter: blur(32px) saturate(1.5);
    border: 1px solid rgba(201, 169, 110, 0.12);
    border-radius: var(--radius-lg, 12px);
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow:
        0 24px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(201, 169, 110, 0.05),
        0 0 80px rgba(201, 169, 110, 0.03),
        inset 0 1px 0 rgba(242, 237, 231, 0.04);
    position: relative;
    animation: car-slide-up 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

@keyframes car-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* Filete dourado no topo */
.car-popup::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 5%, #C9A96E 30%, #D4BA82 50%, #C9A96E 70%, transparent 95%);
    z-index: 1;
}

/* ── Header ──────────────────────────────────────────────────────────────── */
.car-popup__header {
    padding: 22px 24px 16px;
    border-bottom: 1px solid var(--color-border, #2A2622);
    flex-shrink: 0;
}

.car-popup__title {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.15rem;
    font-weight: 500;
    font-style: italic;
    color: var(--color-text-primary, #F2EDE7);
    margin: 0;
    letter-spacing: 0.01em;
}

/* ── Fechar ──────────────────────────────────────────────────────────────── */
.car-popup__close {
    position: absolute;
    top: 18px;
    right: 18px;
    background: transparent;
    border: 1px solid rgba(242, 237, 231, 0.06);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 13px;
    color: var(--color-text-muted, #5C5549);
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background var(--transition-base, 0.25s ease),
        color var(--transition-base, 0.25s ease),
        border-color var(--transition-base, 0.25s ease);
    z-index: 2;
    padding: 0;
}

.car-popup__close:hover {
    background: rgba(242, 237, 231, 0.06);
    color: var(--color-text-secondary, #A09889);
    border-color: rgba(242, 237, 231, 0.12);
}

/* ── Body com scroll ─────────────────────────────────────────────────────── */
.car-popup__body {
    flex: 1;
    overflow-y: auto;
    padding: 22px 24px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border, #2A2622) transparent;
}

.car-popup__body::-webkit-scrollbar { width: 4px; }
.car-popup__body::-webkit-scrollbar-track { background: transparent; }
.car-popup__body::-webkit-scrollbar-thumb { background: var(--color-border, #2A2622); border-radius: 2px; }

/* ── Estado: loading ─────────────────────────────────────────────────────── */
.car-popup__loading {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 36px 0;
    color: var(--color-text-muted, #5C5549);
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
}

.car-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid var(--color-border, #2A2622);
    border-top-color: var(--color-cta, #C9A96E);
    border-radius: 50%;
    animation: car-spin 0.7s linear infinite;
    flex-shrink: 0;
}

@keyframes car-spin {
    to { transform: rotate(360deg); }
}

/* ── Estado: lista de serviços ───────────────────────────────────────────── */
.car-popup__instruction {
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 13px;
    color: var(--color-text-muted, #5C5549);
    margin: 0 0 16px;
    letter-spacing: 0.02em;
}

.car-service-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.car-service-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    border: 1px solid var(--color-border, #2A2622);
    border-radius: var(--radius-base, 8px);
    background: rgba(23, 21, 19, 0.5);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition:
        border-color var(--transition-base, 0.25s ease),
        background var(--transition-base, 0.25s ease),
        box-shadow var(--transition-base, 0.25s ease);
}

/* Barra lateral ao hover */
.car-service-item::before {
    content: '';
    position: absolute;
    top: 8px;
    bottom: 8px;
    left: 0;
    width: 2px;
    border-radius: 0 2px 2px 0;
    background: transparent;
    transition: background var(--transition-base, 0.25s ease);
}

.car-service-item:hover {
    border-color: rgba(201, 169, 110, 0.3);
    background: rgba(201, 169, 110, 0.04);
    box-shadow: 0 4px 20px rgba(201, 169, 110, 0.06);
}

.car-service-item:hover::before {
    background: linear-gradient(to bottom, var(--color-accent, #D4BA82), var(--color-cta, #C9A96E));
}

.car-service-item__info {
    flex: 1;
    min-width: 0;
}

.car-service-item__name {
    display: block;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-primary, #F2EDE7);
}

.car-service-item__desc {
    margin: 3px 0 0;
    font-size: 12px;
    color: var(--color-text-muted, #5C5549);
}

.car-service-item__price {
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 13px;
    font-weight: 600;
    color: var(--color-cta, #C9A96E);
    white-space: nowrap;
    margin-right: 4px;
}

/* ── Estado: slider de minutos ───────────────────────────────────────────── */
.car-popup__back {
    background: none;
    border: none;
    color: var(--color-accent, #D4BA82);
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 13px;
    cursor: pointer;
    padding: 0 0 18px;
    display: block;
    font-weight: 500;
    letter-spacing: 0.02em;
    transition: color var(--transition-fast, 0.15s ease);
}

.car-popup__back:hover {
    color: var(--color-cta, #C9A96E);
}

.car-selected-service {
    padding: 14px 18px;
    background: var(--color-surface, #171513);
    border: 1px solid var(--color-border, #2A2622);
    border-radius: var(--radius-base, 8px);
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
    color: var(--color-text-secondary, #A09889);
    margin-bottom: 24px;
}

/* Slider */
.car-slider-wrap {
    margin-bottom: 24px;
}

.car-slider-label {
    display: block;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
    color: var(--color-text-secondary, #A09889);
    margin-bottom: 14px;
    font-weight: 500;
}

.car-slider-label strong {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    color: var(--color-cta, #C9A96E);
    font-size: 1.4rem;
    font-weight: 600;
    margin-left: 6px;
}

.car-slider {
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
    height: 4px;
    border-radius: 2px;
    background: var(--color-border-strong, #3D3830);
    outline: none;
    cursor: pointer;
}

.car-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-cta, #C9A96E);
    cursor: pointer;
    box-shadow:
        0 2px 8px rgba(201, 169, 110, 0.35),
        0 0 0 4px rgba(201, 169, 110, 0.10);
    transition: transform var(--transition-fast, 0.15s ease), box-shadow var(--transition-fast, 0.15s ease);
}

.car-slider::-webkit-slider-thumb:hover {
    transform: scale(1.12);
    box-shadow:
        0 2px 12px rgba(201, 169, 110, 0.45),
        0 0 0 6px rgba(201, 169, 110, 0.12);
}

.car-slider::-moz-range-thumb {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--color-cta, #C9A96E);
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(201, 169, 110, 0.35);
}

.car-slider-range-labels {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 11px;
    color: var(--color-text-muted, #5C5549);
    margin-top: 8px;
}

/* Preview de preço */
.car-price-preview {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    background: var(--color-surface, #171513);
    border: 1px solid var(--color-border, #2A2622);
    border-radius: var(--radius-base, 8px);
    margin-bottom: 20px;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 15px;
    color: var(--color-text-secondary, #A09889);
}

.car-price-total {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--color-cta, #C9A96E);
}

/* ── Estado: resumo ──────────────────────────────────────────────────────── */
.car-summary-box {
    margin-bottom: 20px;
}

.car-summary-list {
    list-style: none;
    padding: 0;
    margin: 0 0 20px;
    border: 1px solid var(--color-border, #2A2622);
    border-radius: var(--radius-base, 8px);
    overflow: hidden;
}

.car-summary-list li {
    display: flex;
    justify-content: space-between;
    padding: 13px 18px;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
    color: var(--color-text-secondary, #A09889);
    border-bottom: 1px solid var(--color-border, #2A2622);
}

.car-summary-list li:last-child {
    border-bottom: none;
}

.car-summary-total {
    background: var(--color-surface, #171513);
    font-weight: 600;
    color: var(--color-text-primary, #F2EDE7);
}

.car-summary-price {
    font-family: var(--font-display, 'Cormorant Garamond', Georgia, serif);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-cta, #C9A96E);
}

.car-popup__secure {
    text-align: center;
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 12px;
    color: var(--color-text-muted, #5C5549);
    margin: 14px 0 0;
    letter-spacing: 0.02em;
}

/* ── Estado: erro ────────────────────────────────────────────────────────── */
.car-popup__error {
    padding: 28px 0;
    text-align: center;
    color: var(--color-danger, #C45B5B);
    font-family: var(--font-primary, 'Outfit', sans-serif);
    font-size: 14px;
}

/* ── Responsivo ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .car-popup {
        border-radius: var(--radius-lg, 12px) var(--radius-lg, 12px) 0 0;
        max-height: 95vh;
    }

    .car-popup-overlay {
        align-items: flex-end;
        padding: 0;
    }
}