/* ==========================================================================
   Stili Dedicati per la Prenotazione Google Calendar (Versione Premium)
   Studio di Osteopatia Anita Salvalaio
   ========================================================================== */

/* 1. Reset di Sezione e Layout di Base */
.booking-page-header {
    padding: 140px 0 60px;
    background: linear-gradient(180deg, #F9F6F2 0%, rgba(249, 246, 242, 0.6) 100%);
    border-bottom: 1px solid rgba(234, 223, 215, 0.5);
    position: relative;
    overflow: hidden;
}

.booking-page-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(234, 223, 215, 0.45) 0%, rgba(255, 255, 255, 0) 70%);
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}

.booking-page-header .container {
    position: relative;
    z-index: 1;
}

.booking-app-section {
    padding: 60px 0 120px;
    background: #F9F6F2;
    position: relative;
}

/* 2. Grid Layout (2 Colonne su Desktop) */
.booking-container-grid {
    display: grid;
    grid-template-columns: 420px 1fr;
    gap: 48px;
    align-items: start;
}

/* Sidebar Sticky */
.booking-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 120px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    z-index: 10;
}

/* 3. Stile Premium delle Schede (Cards) */
.premium-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 36px;
    border: 1px solid rgba(234, 223, 215, 0.7);
    box-shadow: 
        0 10px 40px -10px rgba(119, 16, 22, 0.04),
        0 2px 10px rgba(0, 0, 0, 0.01);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.premium-card:hover {
    transform: translateY(-2px);
    box-shadow: 
        0 15px 45px -10px rgba(119, 16, 22, 0.06),
        0 4px 15px rgba(0, 0, 0, 0.02);
}

/* Titoli delle Schede */
.card-title {
    font-family: var(--font-serif);
    font-size: 1.45rem;
    color: var(--primary);
    margin-bottom: 24px;
    font-weight: 600;
    position: relative;
    padding-bottom: 12px;
}

.card-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary);
    border-radius: 2px;
}

/* 4. Modulo di Contatto (WhatsApp & Telefono) */
.contact-intro-text {
    font-family: var(--font-alt);
    font-size: 0.95rem;
    line-height: 1.6;
    color: rgba(119, 16, 22, 0.8);
    margin-bottom: 24px;
}

.contact-buttons-stack {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Pulsanti di Contatto Premium */
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 16px 24px;
    border-radius: 999px;
    font-family: var(--font-sans);
    font-weight: 700;
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
    border: none;
}

/* Pulsante WhatsApp */
.btn-contact-wa {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px -6px rgba(37, 211, 102, 0.4);
}

.btn-contact-wa:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -4px rgba(37, 211, 102, 0.6);
}

.btn-contact-wa:active {
    transform: translateY(-1px);
}

.btn-contact-wa svg {
    fill: none;
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* Pulsante Telefono */
.btn-contact-phone {
    background: linear-gradient(135deg, #a31d25 0%, #771016 100%);
    color: #ffffff;
    box-shadow: 0 8px 24px -6px rgba(119, 16, 22, 0.3);
}

.btn-contact-phone:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -4px rgba(119, 16, 22, 0.5);
}

.btn-contact-phone:active {
    transform: translateY(-1px);
}

.btn-contact-phone svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

/* 5. Guida Step di Prenotazione */
.step-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.step-item {
    display: flex;
    gap: 16px;
    align-items: flex-start;
}

.step-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--primary);
    color: #ffffff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
    font-family: var(--font-sans);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 10px rgba(119, 16, 22, 0.15);
}

.step-body h4 {
    font-family: var(--font-sans);
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 6px;
}

.step-body p {
    font-family: var(--font-alt);
    font-size: 0.88rem;
    line-height: 1.5;
    color: rgba(119, 16, 22, 0.75);
}

/* 6. Colonna Calendario (Google Calendar Embed) */
.calendar-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(234, 223, 215, 0.7);
    box-shadow: 
        0 15px 45px -15px rgba(119, 16, 22, 0.06),
        0 2px 10px rgba(0, 0, 0, 0.01);
    position: relative;
    min-height: 500px;
    overflow: hidden;
}

/* Loader di caricamento dietro l'iframe */
.calendar-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    z-index: 1;
    color: var(--primary);
    font-family: var(--font-sans);
    font-size: 0.9rem;
    font-weight: 500;
    pointer-events: none;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid rgba(234, 223, 215, 0.6);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.calendar-embed-iframe {
    width: 100%;
    height: 950px;
    border: 0;
    border-radius: 16px;
    background: #ffffff;
    position: relative;
    z-index: 2; /* Sopra lo spinner */
    opacity: 0;
    transition: opacity 0.5s ease;
}

.calendar-embed-iframe.loaded {
    opacity: 1;
}

/* 7. Divisore Interno Sidebar */
.sidebar-divider {
    height: 1px;
    background: rgba(234, 223, 215, 0.8);
    margin: 32px 0;
}

.sidebar-subtitle {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--primary);
    margin-bottom: 16px;
    font-weight: 600;
}

/* 8. Dock di Contatto Fluttuante Mobile */
.mobile-floating-dock {
    display: none; /* Nascosto su desktop */
}

/* 9. Responsiveness (Media Queries) */

@media (max-width: 1024px) {
    body {
        padding-bottom: 90px; /* Lascia spazio a fondo pagina per la barra mobile fluttuante */
    }

    .booking-container-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .booking-sidebar {
        position: static;
        order: 2; /* La sidebar va dopo il calendario su mobile */
    }

    .calendar-card {
        order: 1; /* Il calendario viene visualizzato subito su mobile */
        min-height: auto;
    }

    .calendar-embed-iframe {
        height: 850px;
    }

    .booking-app-section {
        padding: 40px 0 80px;
    }

    /* Barra Mobile Fluttuante */
    .mobile-floating-dock {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        background: rgba(249, 246, 242, 0.95);
        backdrop-filter: blur(20px) saturate(180%);
        -webkit-backdrop-filter: blur(20px) saturate(180%);
        border-top: 1px solid rgba(234, 223, 215, 0.8);
        padding: 14px 24px;
        gap: 16px;
        z-index: 2000; /* Sopra la navbar e altri elementi */
        box-shadow: 0 -8px 30px rgba(119, 16, 22, 0.08);
        align-items: center;
        justify-content: space-between;
    }

    .mobile-floating-label {
        font-family: var(--font-sans);
        font-size: 0.82rem;
        font-weight: 700;
        color: var(--primary);
        text-transform: uppercase;
        letter-spacing: 0.08em;
        line-height: 1.2;
    }

    .mobile-floating-buttons {
        display: flex;
        gap: 10px;
        flex-grow: 1;
        max-width: 320px;
    }

    .mobile-floating-buttons .btn-contact {
        padding: 12px 18px;
        font-size: 0.8rem;
        width: 100%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        text-transform: none; /* Meno aggressivo sui bottoni piccoli */
        letter-spacing: 0.02em;
    }
}

@media (max-width: 768px) {
    .booking-page-header {
        padding: 100px 0 40px;
    }

    .booking-page-header .hero-title {
        font-size: 2.2rem;
    }

    .calendar-card {
        padding: 12px;
        border-radius: 16px;
    }

    .calendar-embed-iframe {
        height: 750px;
        border-radius: 8px;
    }

    .premium-card {
        padding: 28px 20px;
        border-radius: 18px;
    }

    /* Su schermi molto piccoli adattiamo il dock */
    .mobile-floating-dock {
        padding: 12px 16px;
        gap: 10px;
    }
    
    .mobile-floating-label {
        display: none; /* Nascondiamo l'etichetta per lasciare spazio intero ai due bottoni */
    }

    .mobile-floating-buttons {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .booking-app-section > .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .calendar-card {
        padding: 4px !important;
        border-radius: 12px !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .calendar-embed-iframe {
        height: 700px !important;
        border-radius: 8px !important;
    }
}

@media (max-width: 400px) {
    .booking-app-section > .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
    .calendar-card {
        padding: 0 !important;
        border-radius: 0 !important;
        border: none !important;
        box-shadow: none !important;
        background: transparent !important;
    }
    .calendar-embed-iframe {
        height: 660px !important;
        border-radius: 0 !important;
    }
}
