/* ==========================================================================
   WCR FRONTEND - SKELETON UI (STRUTTURA NEUTRA)
   ========================================================================== */

:root {
    /* Variabili di Ponte: verranno sovrascritte dal tema Click Rental */
    --wcr-primary: #034b95;
    --wcr-accent: #f59e0b;
    --wcr-success: #16a34a;
    --wcr-error: #dc2626;
    --wcr-text-main: #181818;
    --wcr-text-muted: #64748b;
    --wcr-bg-card: #f8fafc;
    --wcr-border-color: #e2e8f0;
    --wcr-radius: 12px;
}

/* 1. BASE & WRAPPERS (Solo struttura, no font-family) */
.wcr-booking-wrapper {
    color: var(--wcr-text-main);
    max-width: 100%;
}

.wcr-premium-booking-ui {
    background: transparent;
    border: 0;
    overflow: hidden;
}

.wcr-section-padding {
    padding: 20px;
}

.wcr-section-padding:last-child {
    border-bottom: none;
}

/* 2. HEADER & STEP NUMBERS */
.wcr-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 10px;
}

.wcr-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--wcr-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.wcr-header.step-completed .wcr-step-number::after {
    content: "\f147";
    font-family: dashicons;
}

.wcr-main-label {
    font-size: 18px;
    font-weight: 700;
}

/* 3. GRID & LAYOUT (Fondamentale per il Responsive) */
.wcr-grid-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 colonne su desktop */
    gap: 15px;
}

/* Responsive Mobile per le griglie */
@media (max-width: 768px) {
    .wcr-grid-layout {
        grid-template-columns: 1fr; /* 1 colonna su mobile */
    }
}

/* --------------------------------------------------------------------------
   4. FORM ELEMENTS (STILE NEUTRO & CROSS-BROWSER)
   -------------------------------------------------------------------------- */

.wcr-main-select, 
.wcr-date-picker-input, 
.wcr-flat-input-select {
    display: block !important;
    width: 100% !important;
    padding: 12px !important;
    border: 1px solid var(--wcr-border-color, #e2e8f0);
    border-radius: var(--wcr-radius, 12px);
    font-size: 14px !important;
    background-color: #fff;
    color: var(--wcr-text-main, #181818);
    box-sizing: border-box !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Gestione stati disabilitati (Orari non selezionabili) */
.wcr-flat-input-select option:disabled {
    color: #999 !important;
    background-color: #f1f1f1 !important;
}

/* Label tecnica */
.wcr-card-label {
    display: block !important;
    font-size: 11px !important;
    font-weight: 800 !important;
    text-transform: uppercase !important;
    color: var(--wcr-text-muted, #64748b);
    margin-bottom: 8px !important;
    line-height: 1.2 !important;
}

/* Fix specifico per Firefox (rimuove il focus tratteggiato) */
select:-moz-focusring {
    color: transparent;
    text-shadow: 0 0 0 #000;
}

/* Fix per IE/Edge vecchi per nascondere la freccia di default */
select::-ms-expand {
    display: none;
}

/* 5. SEZIONE PROTEZIONI (UNIFICATA) */
.wcr-insurances-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcr-insurance-box {
    display: grid;
    grid-template-columns: 30px 40px 1fr auto;
    align-items: center;
    padding: 15px;
    background: var(--wcr-bg-card);
    border: 2px solid transparent;
    border-radius: var(--wcr-radius);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* Stato Selezionato */
.wcr-insurance-real-input:checked + .wcr-insurance-box {
    border-color: var(--wcr-primary);
    background: #fff;
}

/* 6. PRICE PREVIEW (La "Scatola Nera") */
.wcr-price-preview-card {
    padding: 25px;
    border-radius: var(--wcr-radius);
    background: #111; /* Fallback scuro professionale */
    color: #fff;
}

.wcr-price-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    border-bottom: 1px dashed rgba(255,255,255,0.1);
    padding-bottom: 5px;
}

.wcr-total-amount {
    font-size: 32px;
    font-weight: 900;
    color: var(--wcr-accent);
}

/* 7. BOTTONI */
.wcr-add-to-cart-wrapper .single_add_to_cart_button {
    width: 100%;
    padding: 18px;
    background-color: var(--wcr-primary);
    border: none !important;
    border-radius: var(--wcr-radius);
    font-weight: 800;
    text-transform: uppercase;
    cursor: pointer;
}

/* 8. CARICAMENTO & STATUS */
.wcr-loading-skeleton {
    background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
    background-size: 200% 100%;
    animation: wcr-shimmer 1.5s infinite;
    height: 20px;
    border-radius: 4px;
}

@keyframes wcr-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ==========================================================================
   PRICE BOX PREMIUM LOADING & STICKY BAR FIX
   ========================================================================== */

.wcr-price-preview-card { position: relative; overflow: hidden; }

/* Overlay caricamento fluido */
.wcr-loading-overlay {
    position: absolute;
    inset: 0;
    z-index: 30;
    background: rgba(24, 24, 24, 0.8);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    border-radius: 40px;
}

/* Quando carica, sfoca il contenuto e mostra l'overlay */
.wcr-price-preview-card.wcr-is-calculating .wcr-loading-overlay {
    opacity: 1;
    visibility: visible;
}

.spinner-tech {
    width: 35px;
    height: 35px;
    border: 3px solid rgba(255, 215, 0, 0.1);
    border-top-color: var(--yellow);
    border-radius: 50%;
    animation: wcr-spin 0.8s linear infinite;
    margin-bottom: 10px;
}

@keyframes wcr-spin { to { transform: rotate(360deg); } }



/* ==========================================================================
   STICKY BAR UNIVERSALE (PC, TABLET, MOBILE)
   ========================================================================== */
.wcr-sticky-footer-mobile {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: 90px !important;
    background: #111 !important;
    z-index: 9999999 !important; /* Sopra a ogni cosa */
    display: flex !important;
    align-items: center;
    border-top: 3px solid #FFD700;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    transform: translateY(100%); /* Nascondi inizialmente */
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), opacity 0.3s ease;
    opacity: 0;
    visibility: hidden;
}

/* Quando è attiva */
.wcr-sticky-footer-mobile.is-visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Evitiamo che copra l'ultimo pezzo di footer quando arriviamo a fondo pagina */
body.wcr-sticky-active {
    padding-bottom: 90px !important;
}

.wcr-sticky-info {
    display: flex;
    flex-direction: column;
}

.wcr-sticky-car-name {
    color: #888;
    font-size: 11px;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 1px;
}

.wcr-sticky-price {
    color: var(--yellow) !important;
    font-weight: 900;
    font-size: 24px;
    line-height: 1;
}

.wcr-sticky-book-btn {
    background: var(--yellow) !important;
    color: var(--dark) !important;
    padding: 15px 30px;
    border-radius: 12px;
    font-weight: 900;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.wcr-sticky-book-btn:hover {
    transform: scale(1.05);
    background: #fff !important;
}

/* Stili extra per il Modale Universale */
.modal-icon-warning { 
    background: var(--yellow); 
    color: var(--dark); 
    box-shadow: 0 0 40px rgba(255, 215, 0, 0.3); 
}
.modal-type-warning { border-color: var(--yellow) !important; }

/* Bottone di pericolo (per eliminare) */
.wcr-modal-buttons .btn-danger {
    background: #ec1920 !important;
    color: #fff !important;
}
.wcr-modal-buttons .btn-danger:hover {
    background: #bc0f08 !important;
    transform: translateY(-3px);
}

/* Fix specifico per iPhone e input Calendario */
.wcr-date-picker-input, 
.wcr-date-picker-input[readonly] {
    -webkit-appearance: none !important;
    opacity: 1 !important; /* Forza opacità piena su iOS */
    -webkit-text-fill-color: inherit !important; /* Forza colore testo su iOS */
    background-color: #1a1a1a !important; /* Il tuo colore dark */
    font-size: 14px !important; /* Dimensione minima per evitare zoom Safari */
    min-height: 48px !important;
    display: block !important;
    width: 100% !important;
}

/* Assicura che il placeholder sia visibile su iOS */
.wcr-date-picker-input::-webkit-input-placeholder {
    color: rgba(255,255,255,0.5) !important;
    opacity: 1 !important;
}

/* Stile per i giorni pieni nel calendario */
.flatpickr-day.wcr-day-full {
    background: #ff4d4d !important; /* Rosso Click Rental */
    border-color: #ff4d4d !important;
    color: #fff !important;
    cursor: not-allowed !important;
    opacity: 0.6;
    text-decoration: line-through;
}

/* Impedisce l'effetto hover sui giorni pieni */
.flatpickr-day.wcr-day-full:hover {
    background: #ff4d4d !important;
    color: #fff !important;
}

/* Evidenzia il giorno corrente se è pieno */
.flatpickr-day.wcr-day-full.today {
    border-bottom: 2px solid #000 !important;
}

/* Fix per Desktop */
@media (min-width: 1024px) {
    .wcr-sticky-footer-mobile {
        padding: 0 10%;
    }
}

/* Media query per ottimizzazione Mobile Sticky Bar */
@media (max-width: 768px) {
    .wcr-sticky-footer-mobile {
        padding: 10px !important;
        height: auto !important; /* Permette alla barra di adattarsi se il testo va su due righe */
        min-height: 80px;
    }

    .wcr-sticky-footer-mobile .container {
        padding: 0 !important; /* Rimuove padding del container per usare quello della barra */
        gap: 10px;
    }

    .wcr-sticky-price {
        font-size: 18px !important; /* Leggermente più piccolo per evitare l'overflow */
    }

    .wcr-sticky-book-btn {
        padding: 12px 18px !important;
        font-size: 12px !important;
        flex-shrink: 0; /* Impedisce al bottone di rimpicciolirsi troppo */
    }
}