/* =========================================================
   LVE Calendar — Admin + Front Styles
   Loire Valley Expériences — Plein Écran
   ========================================================= */

/* -------------------------------------------------------
   ADMIN — Calendrier de gestion des disponibilités
   ------------------------------------------------------- */

.lve-calendar-layout {
    display: grid;
    grid-template-columns: 380px 1fr;
    gap: 28px;
    align-items: start;
}

@media (max-width: 900px) {
    .lve-calendar-layout { grid-template-columns: 1fr; }
}

/* Calendrier admin */
.lve-admin-cal-wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
}

.lve-admin-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    font-weight: 700;
    font-size: 16px;
}

.lve-admin-cal-grid {
    user-select: none;
}

.lve-cal-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
    margin-bottom: 4px;
}

.lve-cal-dh {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: #888;
    padding: 4px 0;
}

.lve-cal-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.lve-cal-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background 0.15s, color 0.15s;
    border: 2px solid transparent;
    position: relative;
}

.lve-cal-day:hover:not(.lve-cal-empty):not(.lve-cal-past) {
    background: #FFF8E1;
    border-color: #F4C430;
}

.lve-cal-empty {
    cursor: default;
}

.lve-cal-past {
    background: #fff0f0;
    color: #fca5a5;
    cursor: not-allowed;
    border-color: #fecaca;
    font-weight: 500;
}

.lve-cal-available {
    background: #d1fae5;
    color: #065f46;
    border-color: #2F8F6B;
    font-weight: 700;
}

.lve-cal-available:hover {
    background: #fde68a !important;
    border-color: #f59e0b !important;
    color: #92400e !important;
}

.lve-cal-selected {
    background: #F4C430 !important;
    color: #fff !important;
    border-color: #F4C430 !important;
}

/* Admin — stock indicators sur les cellules de calendrier */
.lve-cal-day.lve-cal-full {
    background: #fee2e2 !important;
    color: #ef4444 !important;
    border-color: #fecaca !important;
    opacity: .8;
}

.lve-cal-day.lve-cal-full:hover {
    background: #fecaca !important;
    border-color: #ef4444 !important;
    color: #ef4444 !important;
}

.lve-cal-day.lve-cal-low {
    background: #fffbeb !important;
    color: #92400e !important;
    border-color: #F4C430 !important;
    font-weight: 700;
}

.lve-cal-day.lve-cal-ok {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border-color: #2F8F6B !important;
}

.lve-cal-legend {
    margin-top: 12px;
    font-size: 12px;
    color: #666;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.lve-cal-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.lve-cal-dot-available { background: #2F8F6B; }
.lve-cal-dot-unavail   { background: #fca5a5; border: 1px solid #fecaca; }
.lve-cal-dot-full      { background: #ef4444; }
.lve-cal-dot-low       { background: #F4C430; }

.lve-cal-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Liste des dates disponibles */
.lve-dates-list-wrap h3 {
    font-size: 15px;
    font-weight: 700;
    margin: 0 0 12px;
    color: #8C2F39;
}

.lve-dates-list {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 8px;
    background: #fafafa;
}

.lve-dates-section-title {
    font-size: 11px;
    font-weight: 700;
    color: #888;
    text-transform: uppercase;
    letter-spacing: .05em;
    padding: 4px 6px;
}

.lve-date-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fff;
    margin-bottom: 4px;
    border: 1px solid #e5e7eb;
    font-size: 14px;
}

.lve-date-row:hover {
    background: #f0f9ff;
    border-color: #bae6fd;
}

.lve-date-past {
    opacity: 0.55;
}

/* Badge rouge manquant */
.lve-badge-red {
    background: #fee2e2;
    color: #991b1b;
}
.lve-badge-blue {
    background: #dbeafe;
    color: #1e40af;
}

/* -------------------------------------------------------
   FRONT — Calendrier shortcode
   ------------------------------------------------------- */

.lve-front-calendar {
    font-family: inherit;
    max-width: 440px;
    margin: 0 auto 24px;
}

.lve-front-cal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #8C2F39;
    color: #fff;
    border-radius: 12px 12px 0 0;
    padding: 12px 16px;
}

.lve-front-month-label {
    font-weight: 700;
    font-size: 16px;
    letter-spacing: .02em;
}

.lve-front-prev,
.lve-front-next {
    background: none;
    border: 2px solid rgba(255,255,255,.4);
    color: #fff;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
    line-height: 1;
}

.lve-front-prev:hover,
.lve-front-next:hover {
    background: rgba(255,255,255,.15);
}

.lve-front-cal-grid {
    border: 1px solid #e5e7eb;
    border-top: none;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
    background: #fff;
    padding: 8px;
}

.lve-front-day-headers {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    margin-bottom: 4px;
}

.lve-front-dh {
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #94a3b8;
    padding: 4px 0;
    text-transform: uppercase;
}

.lve-front-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.lve-front-day {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: default;
    /* Non disponible = rouge par défaut */
    color: #fca5a5;
    background: #fff5f5;
    border: 1px solid #fee2e2;
    transition: all 0.15s;
}

.lve-front-day.is-available {
    background: #ecfdf5;
    color: #2F8F6B;
    border-color: #a7f3d0;
    cursor: pointer;
    font-weight: 700;
}

.lve-front-day.is-available:hover {
    background: #d1fae5;
    border-color: #2F8F6B;
    transform: scale(1.05);
}

.lve-front-day.is-chosen {
    background: #8C2F39 !important;
    color: #fff !important;
    border-color: #8C2F39 !important;
    transform: scale(1.08);
    box-shadow: 0 2px 8px rgba(140,47,57,.3);
}

/* Front — peu de places restantes */
.lve-front-day.is-low-stock {
    background: #fffbeb;
    border-color: #F4C430;
    color: #92400e;
}

.lve-front-day.is-low-stock:hover {
    background: #fde68a;
    border-color: #F4C430;
}

/* Badge places restantes sur la cellule calendrier */
.lve-front-day {
    position: relative;
}

.lve-day-count {
    position: absolute;
    bottom: 2px;
    right: 3px;
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    color: #92400e;
    pointer-events: none;
}

/* Badge places restantes dans le panneau de sélection */
.lve-sel-remaining {
    display: block;
    margin-top: 4px;
    font-size: 0.72rem;
    font-weight: 700;
    color: #F4C430;
    letter-spacing: .01em;
}

.lve-front-cal-legend {
    margin-top: 16px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    align-items: center;
}

.lve-leg-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    vertical-align: middle;
    margin-right: 4px;
}

.lve-leg-available { background: #2F8F6B; }
.lve-leg-unavail   { background: #fca5a5; border: 1px solid #fecaca; }
.lve-leg-chosen    { background: #8C2F39; }

.lve-front-selected-info {
    margin-top: 20px;
    padding: 13px 18px;
    background: #8C2F39;
    border-radius: 12px;
    font-size: 14px;
    color: #fff;
    gap: 12px;
    align-items: center;
    box-shadow: 0 4px 16px rgba(140,47,57,.25);
    animation: lve-sel-in .2s ease;
}

@keyframes lve-sel-in {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.lve-sel-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,.12);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lve-sel-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.lve-sel-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: rgba(255,255,255,.55);
}

.lve-sel-date {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: .01em;
}

.lve-no-dates {
    padding: 20px;
    background: #fafafa;
    border: 1px dashed #d1d5db;
    border-radius: 10px;
    color: #94a3b8;
    text-align: center;
    font-size: 14px;
}

/* Validation notice si date requise */
.lve-date-required-notice {
    display: none; /* géré par JS : flex */
    align-items: center;
    gap: 8px;
    margin: 0 22px 14px;
    padding: 12px 16px;
    background: #fff1f2;
    border: 1.5px solid #fca5a5;
    border-radius: 10px;
    color: #b91c1c;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    animation: lve-shake 0.35s ease;
}
.lve-date-required-notice svg { flex-shrink: 0; stroke: #ef4444; }

@keyframes lve-shake {
    0%,100% { transform: translateX(0); }
    20%      { transform: translateX(-5px); }
    40%      { transform: translateX(5px); }
    60%      { transform: translateX(-4px); }
    80%      { transform: translateX(4px); }
}

/* -------------------------------------------------------
   MODALE "Ajouté au panier"
   ------------------------------------------------------- */

#lve-cart-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(140, 47, 57, 0.55);
    backdrop-filter: blur(3px);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

#lve-cart-modal-overlay.is-open {
    display: flex;
    animation: lve-overlay-in 0.2s ease;
}

@keyframes lve-overlay-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lve-cart-modal {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    box-shadow: 0 20px 60px rgba(140,47,57,.25);
    position: relative;
    overflow: hidden;
    animation: lve-modal-in 0.25s cubic-bezier(.34,1.56,.64,1);
}

@keyframes lve-modal-in {
    from { opacity: 0; transform: scale(0.92) translateY(12px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Bouton fermeture */
.lve-cm-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255,255,255,.9);
    border: 1px solid #e2e8f0;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #64748b;
    transition: background 0.15s, color 0.15s;
    z-index: 2;
}

.lve-cm-close:hover {
    background: #f1f5f9;
    color: #8C2F39;
}

/* Header succès */
.lve-cm-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    background: #ecfdf5;
    border-bottom: 1px solid #a7f3d0;
    font-weight: 700;
    font-size: 15px;
    color: #2F8F6B;
}

/* Corps : image + infos */
.lve-cm-body {
    display: flex;
    gap: 14px;
    padding: 16px 20px;
    align-items: flex-start;
}

.lve-cm-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.lve-cm-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.lve-cm-name {
    font-weight: 700;
    font-size: 14px;
    color: #8C2F39;
    line-height: 1.35;
}

.lve-cm-date,
.lve-cm-dur {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #475569;
}
.lve-cm-private {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 5px;
    padding: 3px 8px;
    margin-top: 2px;
}

.lve-cm-pricing {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
    font-size: 13px;
    color: #64748b;
}

.lve-cm-pricing strong {
    font-size: 14px;
    font-weight: 700;
    color: #8C2F39;
}

/* Ligne total panier */
.lve-cm-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
    font-size: 14px;
    color: #475569;
}

.lve-cm-total strong {
    font-size: 18px;
    font-weight: 800;
    color: #8C2F39;
}

/* Boutons d'action */
.lve-cm-actions {
    display: flex;
    gap: 10px;
    padding: 14px 20px 18px;
}

.lve-cm-btn-outline,
.lve-cm-btn-primary {
    flex: 1;
    padding: 11px 10px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.lve-cm-btn-outline {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    color: #475569;
}

.lve-cm-btn-outline:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #8C2F39;
}

.lve-cm-btn-primary {
    background: #8C2F39;
    border: 1.5px solid #8C2F39;
    color: #fff;
}

.lve-cm-btn-primary:hover {
    background: #7a2933;
    border-color: #7a2933;
    color: #fff;
}

/* Spinner bouton ajout */
@keyframes lve-spin {
    to { transform: rotate(360deg); }
}

.lve-spin {
    animation: lve-spin 0.7s linear infinite;
    display: inline-block;
    vertical-align: middle;
}

@media (max-width: 480px) {
    .lve-cart-modal { border-radius: 12px; }
    .lve-cm-actions { flex-direction: column; }
    .lve-cm-img     { width: 64px; height: 64px; }
}
