/* ============================================================================
   FRANCK LATEST OFFERS
   Carrousel de promotions (offres dynamiques BDD).
   Préfixes :
     - BEM : franck-latest-offers
     - Variables CSS : --flo-*
   Piloté par les tokens de thème Maurin : var(--flo-x, var(--theme-x, fallback)).
   -> Couleurs/typo/arrondis suivent automatiquement le thème actif
      (Maurin par défaut ; la variante de marque éventuelle redéfinit --theme-*).
   ============================================================================ */

/* =====================  VARIABLES PAR DÉFAUT (câblées sur le thème)  ===================== */
.franck-latest-offers {
    /* Layout */
    --flo-content-padding-x: 0px;
    --flo-inner-max: 86%;
    --flo-cards-desktop: 4;
    --flo-gap: 24px;

    /* Média card */
    --flo-image-height: 200px;
    --flo-object-fit: contain;
    --flo-media-bg: transparent;

    /* Typo / couleurs (héritent du thème Maurin) */
    --flo-font: var(--theme-text-font, 'Geist', -apple-system, sans-serif);
    --flo-pretitle-color: var(--theme-border-accent-color, #c5393a);
    --flo-section-title-color: var(--theme-section-title-color, #2a6d47);
    --flo-section-subtitle-color: var(--theme-section-subtitle-color, #212221);

    /* Card — plate par défaut (look souhait.png) ; pilotable via thème */
    --flo-card-bg: transparent;
    --flo-card-radius: 0px;
    --flo-card-border-color: transparent;
    --flo-title-color: var(--theme-block-title-color, #2a6d47);
    --flo-text-color: var(--theme-block-text-color, #212221);
    --flo-line-color: var(--theme-section-title-color, #1a1a1a);
    --flo-link-color: var(--theme-link-color, #2a6d47);
    --flo-accent: var(--theme-border-accent-color, #c5393a);

    /* Bouton (token bouton du thème : pill vert sur Maurin, etc.) */
    --flo-btn-bg: var(--theme-button-bg, #2a6d47);
    --flo-btn-color: var(--theme-button-text-color, #ffffff);
    --flo-btn-bg-hover: var(--theme-button-bg-hover, #3c9a65);
    --flo-btn-color-hover: #ffffff;

    /* Carrousel */
    --flo-arrow-bg: var(--theme-button-bg, #2a6d47);
    --flo-arrow-color: var(--theme-button-text-color, #ffffff);
    --flo-indicator-color: var(--theme-button-bg, #2a6d47);

    position: relative;
    box-sizing: border-box;
    width: 100%;
    font-family: var(--flo-font);
    color: var(--theme-text-color, #212221);
    background: var(--flo-section-bg, transparent);
}
.franck-latest-offers *,
.franck-latest-offers *::before,
.franck-latest-offers *::after { box-sizing: border-box; }

/* =====================  WRAPPER (full-bleed)  ===================== */
.franck-latest-offers-wrapper { position: relative; width: 100%; box-sizing: border-box; }
.franck-latest-offers-wrapper--full { width: 100vw; margin-left: calc(50% - 50vw); }

/* =====================  INNER (densité)  ===================== */
.franck-latest-offers__inner {
    position: relative;
    width: var(--flo-inner-max);
    max-width: 1680px;
    margin: 0 auto;
    padding-left: var(--flo-content-padding-x);
    padding-right: var(--flo-content-padding-x);
}

/* =====================  ENTÊTE DE SECTION  ===================== */
.franck-latest-offers__header { margin-bottom: 34px; display: flex; flex-direction: column; gap: 12px; }
.franck-latest-offers__header--center { text-align: center; align-items: center; }
.franck-latest-offers__header--right { text-align: right; align-items: flex-end; }
.franck-latest-offers__pretitle {
    color: var(--flo-pretitle-color);
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.franck-latest-offers__section-title {
    margin: 0;
    color: var(--flo-section-title-color);
    font-family: var(--theme-title-font, var(--flo-font));
    font-size: 38px;
    font-weight: 800;
    line-height: 1.15;
}
.franck-latest-offers__section-subtitle {
    margin: 0;
    color: var(--flo-section-subtitle-color);
    font-size: 18px;
    font-weight: 500;
    line-height: 1.45;
}

/* =====================  CARROUSEL  ===================== */
.franck-latest-offers__carousel { position: relative; }
.franck-latest-offers__viewport { position: relative; overflow: hidden; }
.franck-latest-offers__track {
    display: flex;
    gap: var(--flo-gap);
    will-change: transform;
    transition: transform .45s cubic-bezier(.4, 0, .2, 1);
}
.franck-latest-offers__track.is-dragging { transition: none; }

/* Une card visible = (largeur - (N-1) gaps) / N  (var * px : valide en calc) */
.franck-latest-offers__slide {
    flex: 0 0 calc((100% - (var(--flo-cards-desktop) - 1) * var(--flo-gap)) / var(--flo-cards-desktop));
    max-width: calc((100% - (var(--flo-cards-desktop) - 1) * var(--flo-gap)) / var(--flo-cards-desktop));
    min-width: 0;
}

/* =====================  CARD  ===================== */
.franck-latest-offers__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: var(--flo-card-bg);
    border: 0;
    border-radius: var(--flo-card-radius);
    overflow: hidden;
}

/* Média : HAUTEUR FIXE + object-fit (contain par défaut) sur fond clair */
.franck-latest-offers__media {
    position: relative;
    width: 100%;
    height: var(--flo-image-height);
    flex-shrink: 0;
    background: var(--flo-media-bg);
    overflow: hidden;
}
.franck-latest-offers__media img {
    width: 100%;
    height: 100%;
    object-fit: var(--flo-object-fit);
    display: block;
}
.franck-latest-offers__media picture { display: block; width: 100%; height: 100%; }
.franck-latest-offers__media picture > img { width: 100%; height: 100%; object-fit: var(--flo-object-fit); display: block; }
.franck-latest-offers__media-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c9c9c9;
}
.franck-latest-offers__media-placeholder svg { width: 54px; height: 54px; }

/* Corps de card */
.franck-latest-offers__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    padding: 18px 0 0;
}
.franck-latest-offers__title {
    margin: 0;
    color: var(--flo-title-color);
    font-family: var(--theme-title-font, var(--flo-font));
    font-size: 22px;
    font-weight: 700;
    line-height: 1.25;
}

/* Trait de séparation court (fin, foncé — suit le thème) */
.franck-latest-offers__line {
    display: block;
    width: 46px;
    height: 2px;
    margin: 14px 0 16px;
    background: var(--flo-line-color);
    flex-shrink: 0;
}

/* Zone de texte (HTML TinyMCE) — limitée à 3 lignes + … */
.franck-latest-offers__text {
    color: var(--flo-text-color);
    font-size: 15px;
    font-weight: 400;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: var(--flo-text-lines, 3);
    line-clamp: var(--flo-text-lines, 3);
    overflow: hidden;
}
/* Lignes contiguës : on neutralise les marges des blocs internes pour que
   le line-clamp compte bien 3 lignes (TinyMCE génère des <p>). */
.franck-latest-offers__text p,
.franck-latest-offers__text ul,
.franck-latest-offers__text ol { margin: 0; }
.franck-latest-offers__text a { color: inherit; text-decoration: underline; }

/* Pied de card : bouton + lien collés en bas */
.franck-latest-offers__footer {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: auto;
    padding-top: 18px;
}

/* Bouton « profitez de l'offre » (token bouton du thème) */
.franck-latest-offers__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: flex-start;
    min-height: var(--theme-button-height, 48px);
    padding: 0 var(--theme-button-padding-x, 22px);
    background: var(--flo-btn-bg);
    color: var(--flo-btn-color);
    border: 1px solid var(--flo-btn-bg);
    border-radius: var(--theme-button-radius, 999px);
    font-family: var(--theme-button-font, var(--flo-font));
    font-size: var(--theme-button-font-size, 15px);
    font-weight: var(--theme-button-font-weight, 900);
    line-height: 1;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease;
}
.franck-latest-offers__button:hover,
.franck-latest-offers__button:focus-visible {
    background: var(--flo-btn-bg-hover);
    color: var(--flo-btn-color-hover);
    border-color: var(--flo-btn-bg-hover);
}

/* Lien bas de card avec chevron accent */
.franck-latest-offers__link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    color: var(--flo-link-color);
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
}
.franck-latest-offers__link:hover { text-decoration: underline; }
.franck-latest-offers__link svg { width: 16px; height: 16px; color: var(--flo-accent); flex-shrink: 0; }

/* =====================  FLÈCHES (overlay)  ===================== */
.franck-latest-offers__arrow {
    position: absolute;
    top: calc(var(--flo-image-height) / 2);
    transform: translateY(-50%);
    z-index: 3;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: var(--theme-button-radius, 999px);
    background: var(--flo-arrow-bg);
    color: var(--flo-arrow-color);
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .15);
    transition: opacity .18s ease, transform .18s ease;
}
.franck-latest-offers__arrow--prev { left: -10px; }
.franck-latest-offers__arrow--next { right: -10px; }
.franck-latest-offers__arrow:hover { opacity: .9; }
.franck-latest-offers__arrow:disabled { opacity: 0; pointer-events: none; }
.franck-latest-offers__arrow svg { width: 22px; height: 22px; display: block; }

/* =====================  PASTILLES (dots)  ===================== */
.franck-latest-offers__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 26px;
}
.franck-latest-offers__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #d3d3d3;
    cursor: pointer;
    transition: background .18s ease, transform .18s ease;
}
.franck-latest-offers__dot:hover { transform: scale(1.15); }
.franck-latest-offers__dot.is-active { background: var(--flo-indicator-color); }

/* =====================  ÉTAT VIDE  ===================== */
.franck-latest-offers__empty {
    padding: 40px 0;
    text-align: center;
    color: var(--theme-section-text-color, #6f6f6f);
    font-size: 16px;
}

/* =====================  RESPONSIVE  ===================== */
@media (max-width: 1024px) {
    .franck-latest-offers__slide {
        flex-basis: calc((100% - var(--flo-gap)) / 2);
        max-width: calc((100% - var(--flo-gap)) / 2);
    }
    .franck-latest-offers__arrow--prev { left: 4px; }
    .franck-latest-offers__arrow--next { right: 4px; }
}
@media (max-width: 600px) {
    .franck-latest-offers__slide { flex-basis: 100%; max-width: 100%; }
    .franck-latest-offers__section-title { font-size: 30px; }
}

/* =====================  BUILDER : preview à 75%  ===================== */
.franck-latest-offers-preview-container {
    width: 100%;
    max-width: 1760px;     /* 1320 / 0.75 */
    margin: 0 auto;
    padding: 0 16px;
    box-sizing: border-box;
}
.franck-latest-offers-scale-outer .franck-latest-offers-wrapper--full,
.is-builder-preview .franck-latest-offers-wrapper--full {
    width: 100%;
    margin-left: 0;
    max-width: 100%;
}
.franck-latest-offers-scale-inner { box-sizing: border-box; }
