/**
 * ═══════════════════════════════════════════════════════════════
 * RIAD DAR MAMOUNI — Date Picker (style luxe sombre + or)
 * ═══════════════════════════════════════════════════════════════
 * S'attache automatiquement à tout <input type="date"> de la page.
 * Aucune dépendance, vanilla CSS, cohérent avec le thème du riad.
 */

/* Wrapper créé par le JS autour de chaque input date */
.riad-dp-wrap {
    position: relative;
    display: block;
    width: 100%;
}

/* L'input devient text readonly — on garde son style hérité (taille,
   font, couleur) mais on force le curseur main pour signaler le clic */
.riad-dp-input {
    cursor: pointer !important;
    caret-color: transparent;
}
.riad-dp-input::-webkit-calendar-picker-indicator { display: none !important; }

/* ─── Panel principal ───
   Position calculée par le JS (le panel est attaché à document.body
   pour échapper aux stacking contexts/overflow:hidden des conteneurs
   parents comme les barres de recherche). */
.riad-dp-panel {
    position: absolute;
    z-index: 999999;
    width: 320px;
    background: linear-gradient(165deg, #1F1410 0%, #2A1A14 100%);
    border: 1px solid rgba(229, 199, 122, 0.28);
    border-radius: 14px;
    padding: 18px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 4px 14px rgba(229, 199, 122, 0.08);
    color: #F5EDE0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 13px;
    user-select: none;
    -webkit-user-select: none;
    animation: riad-dp-fade 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes riad-dp-fade {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Filet doré décoratif en haut */
.riad-dp-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(229, 199, 122, 0) 0%,
        rgba(229, 199, 122, 0.8) 30%,
        #E5C77A 50%,
        rgba(229, 199, 122, 0.8) 70%,
        rgba(229, 199, 122, 0) 100%);
    border-radius: 14px 14px 0 0;
}

/* Mobile : un peu plus compact, le JS gère le repositionnement horizontal */
@media (max-width: 480px) {
    .riad-dp-panel {
        width: calc(100vw - 32px);
        max-width: 320px;
    }
}

/* ─── Tête : navigation mois ─── */
.riad-dp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.riad-dp-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    color: #E5C77A;
    font-weight: 500;
    text-transform: capitalize;
    letter-spacing: 0.02em;
}
.riad-dp-nav {
    width: 30px;
    height: 30px;
    border: 1px solid rgba(229, 199, 122, 0.28);
    background: transparent;
    border-radius: 8px;
    color: #F5EDE0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.18s ease;
    padding: 0;
    flex-shrink: 0;
}
.riad-dp-nav:hover {
    background: rgba(229, 199, 122, 0.14);
    border-color: #E5C77A;
    color: #E5C77A;
}
.riad-dp-nav:active { transform: scale(0.95); }

/* ─── Lignes des jours de la semaine ─── */
.riad-dp-dows {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(229, 199, 122, 0.14);
}
.riad-dp-dow {
    text-align: center;
    font-size: 10px;
    color: #B8935A;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    padding: 4px 0;
}

/* ─── Grille des jours ─── */
.riad-dp-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}
.riad-dp-day {
    aspect-ratio: 1;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    color: #F5EDE0;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
    line-height: 1;
}
.riad-dp-day:hover:not(:disabled):not(.is-out) {
    background: rgba(229, 199, 122, 0.14);
    border-color: rgba(229, 199, 122, 0.45);
    color: #E5C77A;
}
.riad-dp-day.is-out {
    visibility: hidden;
    pointer-events: none;
}
.riad-dp-day.is-today:not(.is-selected) {
    border-color: rgba(229, 199, 122, 0.55);
    color: #E5C77A;
    font-weight: 700;
}
.riad-dp-day.is-selected {
    background: linear-gradient(135deg, #E5C77A 0%, #C9A34E 100%);
    color: #1A0F08 !important;
    border-color: #E5C77A;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(229, 199, 122, 0.35);
}
.riad-dp-day:disabled {
    color: rgba(245, 237, 224, 0.18);
    cursor: not-allowed;
    background: transparent;
}
.riad-dp-day:disabled:hover {
    background: transparent;
    border-color: transparent;
    color: rgba(245, 237, 224, 0.18);
}

/* ─── Pied : aujourd'hui + effacer (optionnel) ─── */
.riad-dp-foot {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(229, 199, 122, 0.14);
    display: flex;
    justify-content: space-between;
    gap: 8px;
}
.riad-dp-foot button {
    background: transparent;
    border: 1px solid rgba(229, 199, 122, 0.28);
    color: #F5EDE0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
    letter-spacing: 0.03em;
}
.riad-dp-foot button:hover {
    background: rgba(229, 199, 122, 0.12);
    border-color: #E5C77A;
    color: #E5C77A;
}

/* Accessibilité : focus visible */
.riad-dp-nav:focus-visible,
.riad-dp-day:focus-visible,
.riad-dp-foot button:focus-visible {
    outline: 2px solid #E5C77A;
    outline-offset: 2px;
}

/* ═══════════════════════════════════════════════════════════════
   SELECT CUSTOM (luxe sombre + or) — pour le menu Guests
═══════════════════════════════════════════════════════════════ */
.riad-cs-wrap {
    position: relative;
    display: inline-block;
    width: 100%;
}
.riad-cs-trigger {
    cursor: pointer;
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    text-align: left;
    width: 100%;
    padding: 0;
    margin: 0;
    outline: none;
    font-weight: 500;
}
.riad-cs-trigger:focus-visible {
    outline: 2px solid #E5C77A;
    outline-offset: 4px;
    border-radius: 2px;
}

/* Panel (attaché à document.body) */
.riad-cs-panel {
    background: linear-gradient(165deg, #1F1410 0%, #2A1A14 100%);
    border: 1px solid rgba(229, 199, 122, 0.28);
    border-radius: 12px;
    padding: 8px;
    box-shadow:
        0 24px 60px rgba(0, 0, 0, 0.55),
        0 4px 14px rgba(229, 199, 122, 0.08);
    color: #F5EDE0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    user-select: none;
    -webkit-user-select: none;
    animation: riad-dp-fade 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}
.riad-cs-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg,
        rgba(229, 199, 122, 0) 0%,
        rgba(229, 199, 122, 0.8) 30%,
        #E5C77A 50%,
        rgba(229, 199, 122, 0.8) 70%,
        rgba(229, 199, 122, 0) 100%);
    border-radius: 12px 12px 0 0;
}
.riad-cs-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.riad-cs-option {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #F5EDE0;
    transition: all 0.15s ease;
    line-height: 1.3;
}
.riad-cs-option:hover:not(.is-disabled) {
    background: rgba(229, 199, 122, 0.14);
    color: #E5C77A;
}
.riad-cs-option.is-selected {
    background: linear-gradient(135deg, rgba(229, 199, 122, 0.18) 0%, rgba(201, 163, 78, 0.12) 100%);
    color: #E5C77A;
    font-weight: 600;
}
.riad-cs-option.is-disabled {
    color: rgba(245, 237, 224, 0.3);
    cursor: not-allowed;
}
