/* PJF Préventes — front (chargé uniquement pour les administrateurs, système actif) */

/* ---- toast d'ajout au panier ---- */
.pjf-presales-toast {
    position: fixed; right: 24px; bottom: 24px; z-index: 100000;
    max-width: 340px; background: #1F3527; color: #FBF8F0;
    border-radius: 10px; box-shadow: 0 16px 40px rgba(31, 53, 39, 0.28);
    padding: 14px 16px; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    display: flex; flex-direction: column; gap: 4px;
    opacity: 0; transform: translateY(12px); pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
}
.pjf-presales-toast.pjf-presales-toast--visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.pjf-presales-toast-tag {
    align-self: flex-start; font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
    background: #C97B3A; color: #fff; padding: 2px 8px; border-radius: 999px;
}
.pjf-presales-toast-msg { font-size: 13.5px; line-height: 1.4; }

/* ---- icône cadeau (mini-cart, module Header) ---- */
.pjf-h-cart-gift-flag:empty { display: none; }
.pjf-presales-gift-icon {
    position: absolute; bottom: -5px; right: -7px; width: 20px; height: 20px; border-radius: 50%;
    background: linear-gradient(135deg, #D89561, #C97B3A);
    color: #fff; display: flex; align-items: center; justify-content: center;
    box-shadow: 0 0 0 2.5px #FBF8F0, 0 3px 8px rgba(160, 90, 40, 0.45);
    animation: pjf-presales-gift-pop .3s cubic-bezier(.34,1.56,.64,1);
}
@keyframes pjf-presales-gift-pop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.15); }
    100% { transform: scale(1); }
}

/* ---- bannière cadeau dans le panneau du mini-cart ---- */
.pjf-presales-banner {
    display: flex; align-items: center; gap: 10px; margin: 12px 20px 0; padding: 10px 12px;
    background: #F4E2D0; border-radius: 8px; font-size: 12.5px; color: #A05A28; font-weight: 500; line-height: 1.4;
}
.pjf-presales-banner svg { flex: 0 0 auto; }
.pjf-presales-banner--selected { background: #DCE5D3; color: #1F3527; }

/* ===========================================================
   BANNIÈRE DE CAMPAGNE — compte à rebours + barre de progression
   Fidèle à la maquette Claude Design 1.0.6 (page-preorder-banner.jsx).
   Deux variantes : --full (accueil, panier, paiement) et --compact
   (au-dessus des résultats boutique, message + barre + compte à
   rebours sur une seule ligne, tronqués/réordonnés si besoin).
   =========================================================== */

/* ---- variante pleine ---- */
.pjf-presales-campaign--full {
    background: #FBF8F0; border: 1px solid #EAE5D5; border-radius: 16px;
    padding: 20px 28px 22px; box-shadow: 0 1px 2px rgba(31, 53, 39, .04);
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0 0 24px;
}
.pjf-presales-campaign-top { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.pjf-presales-campaign-intro { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.pjf-presales-campaign-text { font-size: 14.5px; color: #1B1D17; font-weight: 500; }

.pjf-presales-campaign-badge {
    display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; white-space: nowrap;
    padding: 5px 12px; border-radius: 999px; background: #F4E2D0; color: #A05A28;
    font-size: 11.5px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}

/* ---- variante compacte ---- */
.pjf-presales-campaign--compact {
    display: flex; align-items: center; gap: 16px; padding: 10px 16px; border-radius: 8px;
    background: #FBF8F0; border: 1px solid #EAE5D5; font-size: 13px;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    margin: 0 0 16px;
}
.pjf-presales-campaign--compact .pjf-presales-campaign-badge { padding: 3px 9px; font-size: 10.5px; letter-spacing: .03em; gap: 5px; }
.pjf-presales-campaign-msg {
    color: #4A4F44; flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pjf-presales-campaign-bar { width: 120px; flex: 0 0 auto; }

/* ---- compte à rebours ---- */
.pjf-presales-countdown { display: flex; gap: 16px; align-items: center; flex: 0 0 auto; }
.pjf-presales-countdown--compact { gap: 8px; }
.pjf-presales-count-unit { display: flex; flex-direction: column; align-items: center; }
.pjf-presales-count-unit strong {
    font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600; color: #1F3527;
    font-size: 20px; line-height: 1; font-variant-numeric: tabular-nums;
}
.pjf-presales-count-unit small {
    font-size: 10px; color: #7A7E73; letter-spacing: .06em; text-transform: uppercase; margin-top: 3px;
}
.pjf-presales-countdown--compact .pjf-presales-count-unit strong { font-size: 15px; }
.pjf-presales-countdown--compact .pjf-presales-count-unit small { font-size: 9px; }
.pjf-presales-count-sep { color: #D9D4C3; font-size: 18px; margin-top: -12px; }
.pjf-presales-countdown--compact .pjf-presales-count-sep { font-size: 13px; }

/* ---- barre de progression (repères par palier) ---- */
.pjf-presales-progress { position: relative; padding-top: 4px; margin-top: 18px; }
.pjf-presales-progress--compact { padding-top: 0; margin-top: 0; }
.pjf-presales-progress-track { position: relative; height: 7px; border-radius: 999px; background: #EAE5D5; overflow: hidden; }
.pjf-presales-progress--compact .pjf-presales-progress-track { height: 4px; }
.pjf-presales-progress-fill {
    height: 100%; border-radius: 999px; background: linear-gradient(90deg, #3D5E3F, #C97B3A); transition: width .5s ease;
}
.pjf-presales-progress-markers { position: relative; height: 26px; }
.pjf-presales-progress--compact .pjf-presales-progress-markers { height: 16px; }
.pjf-presales-progress-marker {
    position: absolute; top: -13px; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.pjf-presales-progress--compact .pjf-presales-progress-marker { top: -10px; }
.pjf-presales-progress-marker-dot {
    width: 20px; height: 20px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    background: #fff; border: 2px solid #D9D4C3;
}
.pjf-presales-progress--compact .pjf-presales-progress-marker-dot { width: 14px; height: 14px; border-width: 1.5px; }
.pjf-presales-progress-marker.is-reached .pjf-presales-progress-marker-dot {
    background: #2C4A2E; border-color: #2C4A2E; box-shadow: 0 0 0 3px #EEF2E8;
}
.pjf-presales-progress-marker-label { font-size: 11px; font-weight: 600; color: #7A7E73; white-space: nowrap; }
.pjf-presales-progress-marker.is-reached .pjf-presales-progress-marker-label { color: #2C4A2E; }

/* ---- message de progression (variante pleine + mini-cart uniquement) ---- */
.pjf-presales-progress-message {
    display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 13.5px; color: #4A4F44; font-weight: 500;
}
.pjf-presales-progress-message svg { flex: 0 0 auto; color: #3D5E3F; }
.pjf-presales-progress-message.is-done { color: #A05A28; font-weight: 600; }
.pjf-presales-progress-message.is-done svg { color: #C97B3A; }

/* Mini-cart : mêmes styles clairs, juste les marges à ajuster au panneau */
.pjf-h-cart-panel .pjf-presales-progress { margin: 14px 20px 0; padding-top: 4px; }
.pjf-h-cart-panel .pjf-presales-progress-message { margin: 12px 20px 0; }

/* ---- responsive : bannière de campagne (≤780px, comme la maquette) ---- */
@media (max-width: 780px) {
    .pjf-presales-campaign-top { flex-direction: column; align-items: stretch; gap: 14px; }
    .pjf-presales-campaign-intro { width: 100%; }
    .pjf-presales-campaign--full .pjf-presales-countdown {
        width: 100%; justify-content: space-between; gap: 6px;
    }
    .pjf-presales-campaign--full .pjf-presales-countdown .pjf-presales-count-unit { flex: 1; min-width: 0; }
    .pjf-presales-campaign--full .pjf-presales-countdown .pjf-presales-count-sep { display: none; }

    .pjf-presales-campaign--compact { flex-wrap: wrap; row-gap: 10px; padding: 12px 14px; }
    .pjf-presales-campaign-msg {
        white-space: normal; flex-basis: 100%; order: 2; font-size: 12.5px; line-height: 1.4;
    }
    .pjf-presales-campaign-bar { flex: 1 1 auto; order: 3; width: auto; }
    .pjf-presales-campaign--compact .pjf-presales-countdown { order: 4; flex: 0 0 auto; }

    .pjf-presales-progress-marker-label { display: none; }
}

/* ===========================================================
   SÉLECTEUR DE CADEAU SUR LA PAGE PANIER — cartes par slot + sidebar
   =========================================================== */
.pjf-presales-cart-gift {
    margin: 24px 0; padding: 20px 22px; background: #FBF8F0; border: 1px solid #F4E2D0; border-radius: 14px; max-width: 720px;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pjf-presales-cart-gift-head { display: flex; align-items: center; gap: 10px; font-size: 14.5px; color: #A05A28; }
.pjf-presales-cart-gift-head svg { flex: 0 0 auto; }

/* ---- cartes de slot (une par arbre offert débloqué) ---- */
.pjf-presales-gift-slots {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; margin-top: 14px;
}
.pjf-presales-gift-slot {
    position: relative; display: flex; flex-direction: column; align-items: stretch; text-align: left;
    background: #fff; border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.pjf-presales-gift-slot--empty {
    border: 1.5px dashed #D9D4C3; align-items: center; justify-content: center; gap: 8px;
    padding: 28px 12px; color: #7A7E73; aspect-ratio: 3 / 4;
}
.pjf-presales-gift-slot--empty:hover { border-color: #C97B3A; color: #A05A28; background: #FDF8EE; }
.pjf-presales-gift-slot-plus {
    width: 30px; height: 30px; border-radius: 50%; background: #EAE5D5; display: flex; align-items: center;
    justify-content: center; font-size: 18px; line-height: 1; color: #4A4F44;
}
.pjf-presales-gift-slot--empty:hover .pjf-presales-gift-slot-plus { background: #F4E2D0; color: #A05A28; }
.pjf-presales-gift-slot-label { font-size: 12px; font-weight: 600; text-align: center; }

.pjf-presales-gift-slot--filled { border: 1.5px solid #EAE5D5; }
.pjf-presales-gift-slot--filled:hover { border-color: #C97B3A; box-shadow: 0 6px 16px rgba(160, 90, 40, .14); transform: translateY(-2px); }

.pjf-presales-gift-slot-img { display: block; width: 100%; aspect-ratio: 1 / 1; background: #EDE6D4; overflow: hidden; }
.pjf-presales-gift-slot-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pjf-presales-gift-slot-body { display: flex; flex-direction: column; gap: 3px; padding: 10px 12px 6px; }
.pjf-presales-gift-slot-name {
    font-family: "Cormorant Garamond", Georgia, serif; font-size: 15px; font-weight: 600; color: #1F3527; line-height: 1.25;
}
.pjf-presales-gift-slot-variation { font-size: 11px; color: #7A7E73; }
.pjf-presales-gift-slot-tag {
    align-self: flex-start; margin-top: 2px; font-size: 10.5px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .04em; background: #DCE5D3; color: #1F3527; border-radius: 999px; padding: 2px 8px;
}
.pjf-presales-gift-slot-change {
    display: block; text-align: center; padding: 8px 10px; margin-top: auto; font-size: 11.5px; font-weight: 600;
    color: #fff; background: #2C4A2E; transition: background .15s ease;
}
.pjf-presales-gift-slot--filled:hover .pjf-presales-gift-slot-change { background: #1F3527; }

.pjf-presales-gift-slot-remove {
    position: absolute; top: 6px; right: 6px; z-index: 2; width: 22px; height: 22px; border-radius: 50%; border: none;
    background: rgba(31, 53, 39, .55); color: #fff; font-size: 13px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.pjf-presales-gift-slot-remove:hover { background: rgba(31, 53, 39, .85); }

/* ---- quantité "offert" (page panier / totaux) ---- */
.pjf-presales-gift-qty { font-weight: 600; }

/* ---- sidebar de sélection cadeau ---- */
.pjf-presales-gift-backdrop {
    position: fixed; inset: 0; background: rgba(31, 53, 39, .4); z-index: 100000;
    opacity: 0; transition: opacity .2s ease;
}
.pjf-presales-gift-backdrop.is-open { opacity: 1; }

.pjf-presales-gift-sidebar {
    position: fixed; top: 50%; left: 50%; width: 560px; max-width: 92vw; max-height: 82vh;
    background: #FBF8F0; z-index: 100001; display: flex; flex-direction: column; overflow: hidden;
    border-radius: 18px; box-shadow: 0 24px 64px rgba(31, 53, 39, .28);
    transform: translate(-50%, -47%) scale(.97); opacity: 0; transition: transform .2s ease, opacity .2s ease;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pjf-presales-gift-sidebar.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }

.pjf-presales-gift-sidebar-head {
    display: flex; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #EAE5D5; flex: 0 0 auto;
}
.pjf-presales-gift-sidebar-title {
    flex: 1; min-width: 0; font-family: "Cormorant Garamond", Georgia, serif; font-size: 19px; font-weight: 600; color: #1F3527;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pjf-presales-gift-sidebar-back, .pjf-presales-gift-sidebar-close {
    flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%; border: none; background: #EAE5D5; color: #1F3527;
    font-size: 18px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pjf-presales-gift-sidebar-back:hover, .pjf-presales-gift-sidebar-close:hover { background: #D9D4C3; }

.pjf-presales-gift-sidebar-body { flex: 1 1 auto; overflow-y: auto; padding: 16px 18px; }

.pjf-presales-gift-panel-loading, .pjf-presales-gift-panel-empty { color: #7A7E73; font-size: 13px; padding: 20px 4px; }

/* ---- barre de progression factice (remplace "Chargement…") ---- */
.pjf-presales-gift-loading { padding: 38px 6px 12px; }
.pjf-presales-gift-loading-label { font-size: 12.5px; color: #7A7E73; text-align: center; margin: 0 0 12px; }
.pjf-presales-gift-loading-track { height: 6px; border-radius: 999px; background: #EAE5D5; overflow: hidden; }
.pjf-presales-gift-loading-fill {
    height: 100%; width: 0%; border-radius: 999px; background: linear-gradient(90deg, #3D5E3F, #C97B3A);
    transition: width .4s ease;
}

.pjf-presales-gift-cat-btn {
    display: flex; align-items: center; width: 100%; text-align: left; padding: 13px 14px; margin-bottom: 8px;
    background: #fff; border: 1px solid #EAE5D5; border-radius: 10px; font-size: 13.5px; font-weight: 600; color: #1F3527;
    cursor: pointer; transition: border-color .15s ease, background .15s ease;
}
.pjf-presales-gift-cat-btn:hover { border-color: #C97B3A; background: #FDF8EE; }
.pjf-presales-gift-cat-btn::after { content: '›'; margin-left: auto; color: #C97B3A; font-size: 16px; }

.pjf-presales-gift-cat-btn--all {
    background: #FDF8EE; border-style: dashed; color: #A05A28; margin-bottom: 14px;
}
.pjf-presales-gift-cat-btn--all::after { content: '⊞'; }

.pjf-presales-gift-panel-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.pjf-presales-gift-tile {
    display: flex; flex-direction: column; align-items: stretch; text-align: left; background: #fff;
    border: 1.5px solid #EAE5D5; border-radius: 12px; padding: 0; overflow: hidden; cursor: pointer; font-family: inherit;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pjf-presales-gift-tile:hover { border-color: #C97B3A; box-shadow: 0 6px 16px rgba(160, 90, 40, .14); }
.pjf-presales-gift-tile-img { display: block; width: 100%; aspect-ratio: 1 / 1; background: #EDE6D4; overflow: hidden; }
.pjf-presales-gift-tile-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pjf-presales-gift-tile-body { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; }
.pjf-presales-gift-tile-name {
    font-family: "Cormorant Garamond", Georgia, serif; font-size: 13.5px; font-weight: 600; color: #1F3527; line-height: 1.25;
}
.pjf-presales-gift-tile-variation { font-size: 10.5px; color: #7A7E73; }
.pjf-presales-gift-tile-price { font-size: 11.5px; color: #A05A28; font-weight: 600; margin-top: 2px; }
.pjf-presales-gift-tile-price del { font-weight: 400; opacity: .6; margin-right: 3px; }

/* ===========================================================
   POP-UP D'ANNONCE "ARBRE OFFERT" — fiche produit, une fois par visiteur
   =========================================================== */
.pjf-presales-announce-backdrop {
    position: fixed; inset: 0; background: rgba(31, 53, 39, .5); z-index: 100002;
    opacity: 0; transition: opacity .25s ease;
}
.pjf-presales-announce-backdrop.is-open { opacity: 1; }

.pjf-presales-announce-modal {
    position: fixed; top: 50%; left: 50%; width: 440px; max-width: 92vw; max-height: 88vh;
    overflow: hidden auto; background: #FBF8F0; z-index: 100003;
    border-radius: 22px; box-shadow: 0 28px 70px rgba(31, 53, 39, .32);
    transform: translate(-50%, -47%) scale(.96); opacity: 0;
    transition: transform .25s cubic-bezier(.34,1.2,.4,1), opacity .2s ease;
    font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.pjf-presales-announce-modal.is-open { transform: translate(-50%, -50%) scale(1); opacity: 1; }

/* ---- visuel du haut : dégradé + icône cadeau ---- */
.pjf-presales-announce-visual {
    position: relative; display: flex; align-items: center; justify-content: center;
    height: 132px; background: linear-gradient(135deg, #2C4A2E, #3D5E3F 55%, #C97B3A);
}
.pjf-presales-announce-visual svg {
    color: #fff; filter: drop-shadow(0 6px 14px rgba(31, 53, 39, .3));
}

/* ---- bouton fermer : grand, contrasté, visible sur le dégradé ---- */
.pjf-presales-announce-close {
    position: absolute; top: 14px; right: 14px; z-index: 1;
    width: 36px; height: 36px; border-radius: 50%; border: none;
    background: rgba(255, 255, 255, .92); color: #1F3527;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
    transition: background .15s ease, transform .15s ease;
}
.pjf-presales-announce-close:hover { background: #fff; transform: scale(1.06); }

.pjf-presales-announce-body { padding: 26px 28px 28px; text-align: center; }

.pjf-presales-announce-badge {
    display: inline-flex; align-items: center; padding: 5px 14px; border-radius: 999px;
    background: #F4E2D0; color: #A05A28; font-size: 11.5px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
}

.pjf-presales-announce-title {
    margin: 14px 0 0; font-family: "Cormorant Garamond", Georgia, serif; font-weight: 600;
    font-size: 27px; line-height: 1.2; color: #1F3527;
}

.pjf-presales-announce-text {
    margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: #4A4F44;
}

.pjf-presales-announce-body .pjf-presales-countdown { justify-content: center; margin: 20px 0 4px; }

.pjf-presales-announce-cta {
    display: block; width: 100%; margin-top: 22px; padding: 14px; border: none; border-radius: 999px;
    background: #2C4A2E; color: #fff; font-family: inherit; font-size: 15px; font-weight: 700;
    cursor: pointer; transition: background .15s ease, transform .15s ease;
}
.pjf-presales-announce-cta:hover { background: #1F3527; transform: translateY(-1px); }

@media (max-width: 480px) {
    .pjf-presales-announce-visual { height: 108px; }
    .pjf-presales-announce-body { padding: 22px 20px 24px; }
    .pjf-presales-announce-title { font-size: 23px; }
}

/* ---- plein écran sur mobile (bottom sheet, pas de fenêtre centrée) ---- */
@media (max-width: 640px) {
    .pjf-presales-gift-sidebar {
        top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-width: 100%; max-height: 86vh;
        border-radius: 16px 16px 0 0; opacity: 1; transform: translateY(100%);
    }
    .pjf-presales-gift-sidebar.is-open { transform: translateY(0); }
    .pjf-presales-gift-panel-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}
