/* =========================================================
   CALENDRIER DES PLANS DE VENTE
   ========================================================= */

/* ---------------------------------------------------------
   CONTENEUR
   --------------------------------------------------------- */

.lpl-calendar-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
}


/* ---------------------------------------------------------
   MOIS
   --------------------------------------------------------- */

.lpl-calendar-month {
    margin-bottom: 45px;
}

.lpl-calendar-month-title {
    margin: 0 0 18px;
    color: #fff;
    font-size: 26px;
    line-height: 1.1;
    font-weight: 700;
}


/* ---------------------------------------------------------
   GRILLE DES SEMAINES
   --------------------------------------------------------- */

.lpl-calendar-weeks {
    display: grid;
    grid-template-columns: repeat(
        var(--calendar-columns),
        minmax(0, 1fr)
    );
    width: 100%;
    gap: 4px;
}


/* ---------------------------------------------------------
   EN-TÊTES DES SEMAINES
   --------------------------------------------------------- */

.lpl-calendar-week-header {
    min-height: 82px;
    padding: 12px 7px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    background: #111;

    text-align: center;
}

.lpl-calendar-week-header strong {
    display: block;
    color: #fff;
    font-size: 25px;
    line-height: 1;
    font-weight: 700;
}

.lpl-calendar-week-header span {
    display: block;
    margin-top: 9px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 14px;
    line-height: 1.2;
    font-weight: 500;
}


/* ---------------------------------------------------------
   COLONNES DES SEMAINES
   --------------------------------------------------------- */

.lpl-calendar-week-grid {
    grid-column: 1 / -1;

    display: grid;
    grid-template-columns: repeat(
        var(--calendar-columns),
        minmax(0, 1fr)
    );
    gap: 4px;
}

.lpl-calendar-week-column {
    position: relative;
    min-height: 120px;
    background: #181818;
    overflow: visible;
}


/* ---------------------------------------------------------
   ÉVÉNEMENTS / BOUTONS
   --------------------------------------------------------- */

.lpl-calendar-event {
    position: absolute;
    left: 6px;
    right: 6px;

    min-height: 88px;
    height: 88px;

    padding: 11px 15px;
    box-sizing: border-box;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 4px;

    border-radius: 3px;

    color: #fff !important;
    text-align: center;
    text-decoration: none !important;

    font-size: 14px;
    line-height: 1.2;
    font-weight: 400;

    white-space: normal !important;
    overflow: hidden !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    transition:
        transform 0.15s ease,
        filter 0.15s ease;
}

.lpl-calendar-event:hover {
    transform: translateY(-1px);
    filter: brightness(1.08);
}


/* ---------------------------------------------------------
   TITRE DU PLAN
   --------------------------------------------------------- */

.lpl-calendar-event-title {
    display: block;
    width: 100%;
    min-width: 0;

    color: inherit !important;

    font-size: 14px;
    line-height: 1.22;
    font-weight: inherit;

    text-align: center;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    /* Sécurité : le titre reste dans le bouton */
    max-height: 34px;
    overflow: hidden;
}


/* ---------------------------------------------------------
   TYPE D'OPÉRATION
   --------------------------------------------------------- */

.lpl-calendar-event-type {
    display: block;
    width: 100%;
    min-width: 0;

    color: inherit !important;
    opacity: 0.78;

    font-size: 11px;
    line-height: 1.2;
    font-weight: inherit;

    text-align: center;

    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;

    max-height: 27px;
    overflow: hidden;
}


/* ---------------------------------------------------------
   PICTOGRAMME
   --------------------------------------------------------- */

.lpl-calendar-event-icon {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: 27px;
    min-height: 27px;

    margin-top: 4px;

    color: inherit;
}

.lpl-calendar-event-icon svg {
    display: block;

    width: 27px;
    height: 27px;

    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}


/* ---------------------------------------------------------
   PRÉCOMMANDE
   Couleur pâle + texte normal
   --------------------------------------------------------- */

.lpl-calendar-event.precommande {
    color: #111 !important;
    font-weight: 400;
}


/* ---------------------------------------------------------
   LIVRAISON
   Couleur pleine + texte gras
   --------------------------------------------------------- */

.lpl-calendar-event.livraison {
    color: #fff !important;
    font-weight: 700;
}


/* ---------------------------------------------------------
   OPÉRATION NATIONALE — JAUNE
   Texte sombre pour rester lisible
   --------------------------------------------------------- */

.lpl-calendar-event-yellow {
    color: #111 !important;
}

.lpl-calendar-event-yellow .lpl-calendar-event-title,
.lpl-calendar-event-yellow .lpl-calendar-event-type,
.lpl-calendar-event-yellow .lpl-calendar-event-icon {
    color: #111 !important;
}

.lpl-calendar-event-yellow .lpl-calendar-event-type {
    opacity: 0.7;
}


/* ---------------------------------------------------------
   LÉGENDE DES TYPES D'OPÉRATION
   --------------------------------------------------------- */

.lpl-calendar-legend {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    flex-wrap: wrap !important;

    gap: 18px 28px !important;

    margin: 0 0 30px !important;

    color: #fff !important;

    font-size: 13px !important;
    font-weight: 600 !important;
}

.lpl-calendar-legend span {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;

    color: #fff !important;
}

.lpl-calendar-dot {
    display: inline-block !important;

    width: 11px !important;
    height: 11px !important;
    min-width: 11px !important;

    padding: 0 !important;
    margin: 0 !important;

    border-radius: 0 !important;
}


/* ---------------------------------------------------------
   TITRE DU CALENDRIER
   --------------------------------------------------------- */

.lpl-calendar-page-title {
    margin: 0 0 18px;

    color: #fff !important;

    font-size: 30px;
    line-height: 1.1;
    font-weight: 700;

    text-align: center;
    text-transform: uppercase;
}


/* ---------------------------------------------------------
   LÉGENDE : 5 COLONNES / TYPE D'OPÉRATION
   --------------------------------------------------------- */

   --------------------------------------------------------- */

.lpl-calendar-status-legend {
    position: sticky;
    top: 12px;
    z-index: 50;

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;

    width: 100%;
    max-width: 1200px;
    margin: 12px auto 28px;
    padding: 10px;
    box-sizing: border-box;

    background: rgba(0,0,0,.94);
    border: 2px solid #fff;
    border-radius: 4px;
    box-shadow: 0 5px 18px rgba(0,0,0,.22);
}

.lpl-calendar-legend-heading {
    grid-column: 1 / -1;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    min-height: 34px;

    padding: 2px 4px 7px;
    box-sizing: border-box;

    color: #fff !important;
    text-align: center;
}

.lpl-calendar-legend-heading strong {
    color: #fff !important;
    font-size: 14px;
    line-height: 1;
    font-weight: 700;
}

.lpl-calendar-legend-heading span {
    color: rgba(255,255,255,.72) !important;
    font-size: 11px;
    line-height: 1.1;
}

.lpl-calendar-filter-reset {
    display: none;

    padding: 5px 10px;

    border: 1px solid rgba(255,255,255,.45);
    border-radius: 3px;

    background: transparent;
    color: #fff !important;

    font-family: inherit;
    font-size: 10px;
    font-weight: 700;

    cursor: pointer;
}

.lpl-calendar-filter-reset.is-visible {
    display: inline-flex;
}

.lpl-calendar-legend-column {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.lpl-calendar-legend-title {
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 5px;
    color: #fff !important;
    font-size: 12px;
    line-height: 1.1;
    font-weight: 700;
    text-align: center;
}

.lpl-calendar-legend-sample {
    min-width: 0;
    min-height: 48px;
    padding: 7px 8px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border-radius: 3px;
    font-size: 11px;
    line-height: 1.15;
    text-align: center;
    overflow-wrap: anywhere;
}

.lpl-calendar-legend-sample span {
    color: inherit !important;
}

.lpl-calendar-legend-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 23px;
    min-width: 23px;
    height: 23px;
}

.lpl-calendar-legend-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Boutons de légende : aucune apparence native du navigateur */
.lpl-calendar-legend-sample {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    font-family: inherit;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.lpl-calendar-legend-sample:hover {
    transform: translateY(-1px);
    filter: brightness(1.04);
}

.lpl-calendar-legend-sample.is-active {
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px rgba(0,0,0,.7);
    transform: translateY(-1px);
}

.lpl-calendar-event-filtered {
    display: none !important;
}

/* Précommande */
.lpl-legend-mise-en-avant-pre,
.lpl-legend-nouveaute-pre,
.lpl-legend-opportunite-pre,
.lpl-legend-promo-flash-pre,
.lpl-legend-operation-nationale-pre {
    color: #111 !important;
    font-weight: 400 !important;
}

.lpl-legend-mise-en-avant-pre { background: #8fb5d4 !important; }
.lpl-legend-nouveaute-pre { background: #82c09b !important; }
.lpl-legend-opportunite-pre,
.lpl-legend-promo-flash-pre { background: #e58a8a !important; }
.lpl-legend-operation-nationale-pre { background: #fff09a !important; }

/* Livraison */
.lpl-legend-mise-en-avant-liv,
.lpl-legend-nouveaute-liv,
.lpl-legend-opportunite-liv,
.lpl-legend-promo-flash-liv {
    color: #fff !important;
    font-weight: 700 !important;
}

.lpl-legend-mise-en-avant-liv { background: #024b8c !important; }
.lpl-legend-nouveaute-liv { background: #038331 !important; }
.lpl-legend-opportunite-liv,
.lpl-legend-promo-flash-liv { background: #c70607 !important; }

.lpl-legend-operation-nationale-liv {
    background: #fedf07 !important;
    color: #111 !important;
    font-weight: 700 !important;
}

/* ---------------------------------------------------------
   MOIS MASQUÉS
   --------------------------------------------------------- */

.lpl-calendar-month-hidden {
    display: none;
}


/* ---------------------------------------------------------
   BOUTON « AFFICHER LA SUITE »
   --------------------------------------------------------- */

.lpl-calendar-next {
    display: flex;
    justify-content: center;

    margin: 5px 0 50px;
}

.lpl-calendar-next-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-height: 46px;

    padding: 0 30px;
    box-sizing: border-box;

    cursor: pointer;

    appearance: none;
    font-family: inherit;

    background: #b0342c;
    border: 1px solid #b0342c;

    color: #fff !important;

    font-size: 13px;
    font-weight: 700;

    text-decoration: none !important;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.lpl-calendar-next-button:hover {
    background: #fff;
    color: #b0342c !important;
}


/* ---------------------------------------------------------
   RESPONSIVE
   --------------------------------------------------------- */

@media (max-width: 900px) {

    .lpl-calendar-month {
        overflow-x: auto;
    }

    .lpl-calendar-weeks {
        min-width: 850px;
    }

}


@media (max-width: 1100px) {
    .lpl-calendar-status-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .lpl-calendar-status-legend {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        top: 8px;
        margin-left: 8px;
        margin-right: 8px;
    }
}

@media (max-width: 700px) {
    .lpl-calendar-page-title {
        font-size: 24px;
    }

    .lpl-calendar-legend-heading {
        flex-wrap: wrap;
    }

    .lpl-calendar-legend-heading span {
        display: none;
    }
}

/* V25 — onglets Précommande / Livraison + filtre par type */
.lpl-calendar-period-tabs {
    width: 100%;
    max-width: 1180px;
    margin: 0 auto 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.lpl-calendar-period-tab {
    appearance: none;
    border: 2px solid rgba(255,255,255,.35);
    background: rgba(255,255,255,.08);
    color: #fff;
    min-height: 52px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: .18s ease;
}

.lpl-calendar-period-tab:hover {
    background: rgba(255,255,255,.15);
}

.lpl-calendar-period-tab.is-active {
    background: #fff;
    color: #111;
    border-color: #fff;
}

.lpl-calendar-status-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.lpl-calendar-status-legend .lpl-calendar-legend-heading {
    grid-column: 1 / -1 !important;
}

.lpl-calendar-status-legend .lpl-calendar-legend-column {
    min-width: 0 !important;
    width: auto !important;
}

.lpl-calendar-status-legend .lpl-calendar-legend-sample {
    width: 100% !important;
    min-height: 64px;
    justify-content: center;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 14px;
    border: 2px solid rgba(255,255,255,.16);
    background: rgba(255,255,255,.06);
    color: #fff;
    cursor: pointer;
}

.lpl-calendar-status-legend .lpl-calendar-legend-sample:hover {
    border-color: rgba(255,255,255,.55);
}

.lpl-calendar-status-legend .lpl-calendar-legend-sample.is-active {
    border-color: #fff !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,.18);
}

.lpl-calendar-legend-color {
    display: inline-block;
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
    border-radius: 50%;
}

.lpl-legend-mise-en-avant .lpl-calendar-legend-color { background: #024b8c; }
.lpl-legend-nouveaute .lpl-calendar-legend-color { background: #038331; }
.lpl-legend-opportunite-promo .lpl-calendar-legend-color { background: #c70607; }
.lpl-legend-operation-nationale .lpl-calendar-legend-color { background: #fedf07; }


/* ---------------------------------------------------------
   SEMAINES PASSÉES
   --------------------------------------------------------- */

.lpl-calendar-week-past {
    filter: grayscale(1);
    opacity: .48;
}

.lpl-calendar-week-header.lpl-calendar-week-past {
    background: #0b0b0b;
}

.lpl-calendar-week-column.lpl-calendar-week-past {
    background: #101010;
}

.lpl-calendar-week-column.lpl-calendar-week-past .lpl-calendar-event {
    filter: grayscale(1) !important;
}

/* Les opérations des semaines passées sont purement informatives.
   Elles ne réagissent pas au survol et ne sont plus cliquables. */
.lpl-calendar-event-past {
    pointer-events: none !important;
    cursor: default !important;
}

.lpl-calendar-event-past:hover {
    transform: none !important;
    filter: grayscale(1) !important;
}

.lpl-calendar-empty-filter {
    margin: 0 auto 18px;
    max-width: 1180px;
    padding: 18px 20px;
    border: 1px solid rgba(255,255,255,.25);
    color: #fff;
    text-align: center;
    font-weight: 700;
}

@media (max-width: 900px) {
    .lpl-calendar-status-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .lpl-calendar-period-tabs {
        grid-template-columns: 1fr !important;
    }

    .lpl-calendar-status-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }

    .lpl-calendar-status-legend .lpl-calendar-legend-sample {
        font-size: 11px;
        padding-left: 5px;
        padding-right: 5px;
    }
}


/* V28 — filtres par type d'opération : toujours sur une seule ligne */
.lpl-calendar-operation-filters {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    width: 100% !important;
    gap: 14px !important;
}

.lpl-calendar-operation-filters > * {
    min-width: 0 !important;
    width: 100% !important;
}

@media (max-width: 1100px) {
    .lpl-calendar-operation-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .lpl-calendar-operation-filters {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
}


/* V29 — les 4 filtres d'opération sur UNE SEULE LIGNE */
.lpl-calendar-status-legend {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.lpl-calendar-status-legend .lpl-calendar-legend-column {
    grid-column: auto !important;
    grid-row: auto !important;
    width: 100% !important;
    min-width: 0 !important;
}

.lpl-calendar-status-legend .lpl-calendar-legend-sample {
    width: 100% !important;
}

/* On conserve les 4 colonnes même dans les media queries */
@media (max-width: 1100px) {
    .lpl-calendar-status-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 700px) {
    .lpl-calendar-status-legend {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
}
