/* ==========================
   WIDGET DE RÉSERVATION
========================== */
.booking-widget {
    position: absolute;
    top: 370px; /* Navbar (~70px) + hero-header (340px) + marge (10px) */
    right: 10px; /* Centré à droite du main-container (1100px/2 + 20px marge) */
    width: 328px;
    height: 765px; /* Hauteur disponible sous le header */
    background: white;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    z-index: 100; /* Plus bas que la navbar (9999) mais au-dessus du contenu normal */
    overflow: hidden;
    transition: all 0.3s ease;
}



.booking-widget.collapsed .booking-content {
    max-height: 0;
    display: none;
}

.booking-widget-header {
    background: linear-gradient(135deg, #2c3e50, #34495e);
    color: white;
    padding: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    position: relative;
}

.booking-icon {
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    padding: 0.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.booking-widget-header h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    flex: 1;
}

.booking-toggle {
    background: rgba(255,255,255,0.2);
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
    outline: none;
}

.booking-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.booking-toggle svg {
    transition: transform 0.3s ease;
}

.booking-content {
    padding: 1.5rem;
    transition: max-height 0.3s ease;
    overflow-y: auto;
}

.price-display {
    text-align: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.price-amount {
    font-size: 2rem;
    font-weight: 700;
    color: #2c3e50;
    display: block;
}

.price-period {
    color: #6c757d;
    font-size: 0.9rem;
}

.availability-status {
    margin-bottom: 1.5rem;
}

.availability-indicator {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
}

.availability-indicator.available .availability-dot {
    background: #28a745;
}

.availability-indicator.unavailable {
    background: #f8d7da;
    border-color: #f5c6cb;
}

.availability-indicator.unavailable .availability-dot {
    background: #dc3545;
}

.availability-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: block;
}

.booking-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.guests-input {
    display: flex;
    flex-direction: column;
}

.guests-input label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
    font-size: 0.9rem;
}

.guests-input select {
    padding: 0.8rem;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    background: white;
}

.guests-input select:focus {
    outline: none;
    border-color: #4a90e2;
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.guests-row-gite {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
}

.guests-input-inline {
    margin-bottom: 0;
}

.guests-input-inline select {
    width: 100%;
}

.total-calculation {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1rem;
    border: 2px solid #e9ecef;
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #495057;
}

.calculation-row:last-child {
    margin-bottom: 0;
}

.calculation-row.total {
    border-top: 1px solid #dee2e6;
    padding-top: 0.5rem;
    margin-top: 0.5rem;
    color: #2c3e50;
    font-size: 1.1rem;
}

.booking-button {
    background: linear-gradient(135deg, #4a90e2, #357abd);
    color: white;
    border: none;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
}

.booking-button:hover {
    background: linear-gradient(135deg, #357abd, #2968a3);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.booking-button:active {
    transform: translateY(0);
}

.booking-notice {
    text-align: center;
    font-size: 0.8rem;
    color: #6c757d;
    margin: 0.5rem 0 0 0;
    line-height: 1.4;
}

/* Media query pour écrans > 768px */
@media (min-width: 769px) {
    .booking-widget.collapsed {
        width: 48px;
        height: 48px;
        border-radius: 8px;
        top: 370px;
        background: linear-gradient(135deg, #2c3e50, #34495e);
    }
    
    .booking-widget.collapsed .booking-widget-header {
        padding: 0;
        justify-content: center;
        align-items: center;
        height: 48px;
    }
    
    .booking-widget.collapsed .booking-icon {
        display: none;
    }
    
    .booking-widget.collapsed .booking-widget-header h3 {
        display: none;
    }
    
    .booking-widget.collapsed .booking-toggle {
        position: static;
        transform: none;
        margin: 0;
    }
}

/* Responsive pour le widget */
@media (max-width: 768px) {
    .booking-widget {
        position: fixed;
        bottom: 0;
        right: 0;
        left: 0;
        top: auto;
        transform: none;
        width: 100%;
        max-height: 70vh;
        border-radius: 16px 16px 0 0;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.15);
        z-index: 100;
    }

    .booking-widget.collapsed {
        max-height: 50px;
    }
    
    .booking-widget.collapsed .booking-widget-header {
        padding: 1.5rem;
        height: 50px;
    }
    
    .booking-widget.collapsed .booking-toggle {
        position: static;
        transform: none;
        margin: 0;
    }
    
    .booking-content {
        max-height: calc(70vh - 50px);
    }
}
/* ==========================
   CALENDRIER DU BOOKING WIDGET
========================== */
.bw-dates {
    position: relative;
    margin-bottom: 1rem;
}

.bw-date-btns {
    display: inline-flex;
    border-radius: 6px;
    overflow: hidden;
    background: inherit;
    border: 1px solid #e6e6e6;
    width: 100%;
}

.bw-date-btn {
    padding: 14px 14px;
    background: transparent;
    border: none;
    color: #222;
    cursor: pointer;
    width: 50%;
    height: 60px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
}

.bw-date-btn:first-child {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
}

.bw-date-btn:last-child {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
}

.bw-date-btn + .bw-date-btn {
    border-left: 1px solid #e6e6e6;
}

.bw-date-label {
    font-size: 15px;
    color: #666;
    line-height: 1;
}

.bw-date-value {
    font-size: 17px;
    color: #666;
    line-height: 1;
}

.bw-date-value:empty::before {
    content: "Sélectionner";
    color: #999;
    font-weight: 400;
}

/* Calendar popup styles */
.bw-calendar {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    padding: 18px;
    border-radius: 12px;
    box-shadow: 0 14px 40px rgba(0,0,0,0.16);
    display: none;
    z-index: 2000;
    width: 100%;
    max-width: 350px;
    box-sizing: border-box;
}

.bw-calendar[aria-hidden="false"] {
    display: block;
}

.bw-cal-header {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 8px;
}

.bw-cal-header button {
    padding: 6px 8px;
    background: #adc5d6;
    border: none;
    color: #fff;
    border-radius: 6px;
    cursor: pointer;
}

.bw-cal-header button:hover {
    filter: brightness(0.95);
}

.bw-cal-title {
    font-weight: 600;
    color: rgb(75, 75, 75);
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.bw-cal-month-name {
    display: inline-block;
    width: 100%;
    text-align: center;
}

.bw-cal-weekdays,
.bw-cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
}

.bw-cal-panels {
    display: block;
}

.bw-cal-month {
    width: 100%;
}

.bw-cal-subtitle {
    display: none;
    text-align: center;
    font-weight: 600;
    margin-bottom: 6px;
}

.bw-cal-weekdays div {
    text-align: center;
    font-size: 11px;
    color: #666;
}

.bw-cal-cell {
    border: none;
    background: transparent;
    padding: 8px;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.15s ease;
}

.bw-cal-cell:hover:not(.disabled):not(.empty) {
    background: rgba(120, 150, 170, 0.95);
}

.bw-cal-cell.disabled {
    color: #9aa1a6;
    cursor: default;
    text-decoration: line-through;
    text-decoration-color: currentColor;
    text-decoration-thickness: 1px;
    text-decoration-skip-ink: none;
}

.bw-cal-cell.selected {
    background: rgba(108, 139, 161, 0.55);
}

.bw-cal-cell.inrange {
    background: rgba(173, 197, 214, 0.35);
    border-radius: 0;
}

.bw-cal-cell.inrange-hover {
    background: rgba(173, 197, 214, 0.55);
    border-radius: 0;
}

.bw-cal-cell.inrange-dim {
    opacity: 0.35;
}

.bw-cal-cell.booked {
    color: #2f2f2f;
}

.bw-cal-cell.booked-middle {
    background: rgba(214, 75, 75, 0.22);
}

.bw-cal-cell.booked-checkin {
    background:
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 49.5%,
            rgba(214, 75, 75, 0.28) 50%,
            rgba(214, 75, 75, 0.28) 100%
        );
}

.bw-cal-cell.booked-checkout {
    background:
        linear-gradient(
            135deg,
            rgba(214, 75, 75, 0.28) 0%,
            rgba(214, 75, 75, 0.28) 50%,
            transparent 50.5%,
            transparent 100%
        );
}

.bw-cal-cell.booked-checkin.booked-checkout {
    background:
        linear-gradient(
            135deg,
            rgba(214, 75, 75, 0.28) 0%,
            rgba(214, 75, 75, 0.28) 50%,
            transparent 50%,
            transparent 100%
        ),
        linear-gradient(
            315deg,
            rgba(214, 75, 75, 0.28) 0%,
            rgba(214, 75, 75, 0.28) 50%,
            transparent 50%,
            transparent 100%
        );
}

.bw-cal-cell.checkin {
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    background: 
        linear-gradient(
            135deg,
            transparent 0%,
            transparent 50%,
            rgba(173, 197, 214, 0.6) 50%,
            rgba(173, 197, 214, 0.6) 100%
        );
}

.bw-cal-cell.checkout {
    border-top-right-radius: 6px;
    border-bottom-right-radius: 6px;
    background: 
        linear-gradient(
            135deg,
            rgba(173, 197, 214, 0.6) 0%,
            rgba(173, 197, 214, 0.6) 50%,
            transparent 50%,
            transparent 100%
        );
}

.bw-cal-cell.selected.checkin,
.bw-cal-cell.selected.checkout {
    color: #000;
    position: relative;
}

/* Superposition visuelle selection + date reservee (biseau 45deg bi-couleur) */
.bw-cal-cell.selected.checkout.booked-checkin {
    background:
        linear-gradient(
            135deg,
            rgba(173, 197, 214, 0.68) 0%,
            rgba(173, 197, 214, 0.68) 50%,
            rgba(214, 75, 75, 0.34) 50%,
            rgba(214, 75, 75, 0.34) 100%
        );
}

.bw-cal-cell.selected.checkin.booked-checkout {
    background:
        linear-gradient(
            135deg,
            rgba(214, 75, 75, 0.34) 0%,
            rgba(214, 75, 75, 0.34) 50%,
            rgba(173, 197, 214, 0.68) 50%,
            rgba(173, 197, 214, 0.68) 100%
        );
}

.bw-cal-cell.selected.checkin.booked-checkin,
.bw-cal-cell.selected.checkout.booked-checkout {
    background:
        linear-gradient(
            135deg,
            rgba(173, 197, 214, 0.68) 0%,
            rgba(173, 197, 214, 0.68) 50%,
            rgba(214, 75, 75, 0.34) 50%,
            rgba(214, 75, 75, 0.34) 100%
        );
}

.bw-cal-cell.selected,
.bw-cal-cell.inrange,
.bw-cal-cell.inrange-hover {
    color: #000;
}

.bw-cal-cell.hover-start {
    border-top-left-radius: 6px !important;
    border-bottom-left-radius: 6px !important;
}

.bw-cal-cell.hover-end {
    border-top-right-radius: 6px !important;
    border-bottom-right-radius: 6px !important;
}

.bw-cal-cell.empty {
    background: transparent;
}

/* Responsive pour le calendrier du booking widget */
@media (max-width: 640px) {
    .bw-calendar {
        width: calc(100% - 32px);
        left: 50%;
        transform: translateX(-50%);
        padding: 12px;
        max-width: 100%;
    }
    
    .bw-cal-panels {
        gap: 12px;
        flex-direction: column;
    }
    
    .bw-cal-month {
        min-width: auto;
        width: 100%;
    }
    
    /* hide the second month panel */
    .bw-cal-panels .bw-cal-month:nth-child(2) {
        display: none;
    }
    
    /* header adjustments: hide right month name, make left full width */
    .bw-cal-month-name.right {
        display: none;
    }
    
    .bw-cal-month-name.left {
        width: 100%;
    }
    
    .bw-cal-title {
        justify-content: center;
    }
}