/* WC Product Page Enhancer — Frontend CSS v5.13.1 */

.wcpe-noscroll { overflow:hidden !important; }

/* ── Verrouille la visibilité des overlays (CoA + card pureté) ───────────
   Garantit qu'aucun :hover du thème (Salient zoom, opacity overlay, etc.)
   ne puisse les masquer ou les rendre non-cliquables. */
.wcpe-coa-overlay,
.wcpe-purity-card,
.woocommerce-product-gallery:hover .wcpe-coa-overlay,
.woocommerce-product-gallery:hover .wcpe-purity-card,
.woocommerce-product-gallery__image:hover .wcpe-coa-overlay,
.woocommerce-product-gallery__image:hover .wcpe-purity-card,
.woocommerce-product-gallery__wrapper:hover .wcpe-coa-overlay,
.woocommerce-product-gallery__wrapper:hover .wcpe-purity-card {
    opacity:1 !important;
    visibility:visible !important;
    pointer-events:auto !important;
    z-index:100 !important;
}

/* Masque les widgets chat tiers quand le modal COA est ouvert.
   visibility (et pas display:none) pour préserver le state interne du widget. */
body.wcpe-modal-open .crisp-client,
body.wcpe-modal-open #crisp-chatbox,
body.wcpe-modal-open #intercom-container,
body.wcpe-modal-open .intercom-lightweight-app,
body.wcpe-modal-open #tawkchat-container,
body.wcpe-modal-open iframe[title*="chat" i],
body.wcpe-modal-open .wcpe-modal-hide-target {
    visibility: hidden !important;
}

.wcpe-product-label { font-size:13px; font-style:italic; color:#666; margin:0 0 4px; }

.wcpe-rating-wrap { display:flex; align-items:center; gap:8px; margin:0 0 12px; flex-wrap:wrap; }
.wcpe-review-count { font-size:13px; color:#555; }
.wcpe-rating-wrap .star-rating span::before,
.woocommerce .star-rating span::before { color:#f5a623; }
.woocommerce .star-rating::before { color:#ddd; }

.wcpe-alias-tags { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 18px; }
.wcpe-alias-tag { border:1px solid #d0d0d0; border-radius:20px; padding:4px 14px; font-size:12px; color:#444; background:#fff; }


/* ── Badge "−X% vs prix marché" (sous le prix) ─────── */
.wcpe-market-badge {
    display:inline-flex !important;
    align-items:center !important;
    gap:7px;
    background:#e8f8ef;
    border:1px solid #a8dbb9;
    border-radius:30px;
    padding:6px 14px 6px 11px;
    margin:8px 0 14px;
    font-size:13px;
    font-weight:600;
    color:#1a7a42;
    line-height:1;
    width:auto !important;
    max-width:max-content !important;
}
.wcpe-market-badge .wcpe-market-icon,
.wcpe-market-icon {
    width:14px !important;
    height:14px !important;
    max-width:14px !important;
    max-height:14px !important;
    min-width:14px !important;
    flex-shrink:0 !important;
    flex-grow:0 !important;
    display:inline-block !important;
}

/* ── Badge stock & livraison express ─────── */
.wcpe-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e8f8ef;
    border: 1px solid #a8dbb9;
    border-radius: 30px;
    padding: 6px 14px 6px 10px;
    margin: 0 0 14px;
    font-size: 13px;
    font-weight: 600;
    color: #1a7a42;
}
.wcpe-stock-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #2ecc71;
    border-radius: 50%;
    flex-shrink: 0;
    animation: wcpe-pulse 1.8s ease-in-out infinite;
}
@keyframes wcpe-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(46,204,113,.6); }
    60%  { box-shadow: 0 0 0 7px rgba(46,204,113,0); }
    100% { box-shadow: 0 0 0 0 rgba(46,204,113,0); }
}

.wcpe-coa-btn {
    display:inline-flex; align-items:center; gap:7px;
    background:#fff; border:2px solid #111; border-radius:30px;
    padding:9px 18px; font-size:13px; font-weight:600;
    cursor:pointer; color:#111; font-family:inherit;
    transition:background .18s, color .18s;
    white-space:nowrap;
}
.wcpe-coa-btn:hover, .wcpe-coa-btn:focus-visible { background:#111; color:#fff; outline:none; }

/* Bouton superposé sur l'image principale */
.wcpe-coa-overlay {
    position:absolute;
    bottom:14px;
    right:14px;
    z-index:10;
    box-shadow:0 2px 12px rgba(0,0,0,.22);
}

/* ── Card pureté/test (overlay top-right de l'image) ─────────── */
.wcpe-purity-card {
    position:absolute;
    top:14px;
    right:14px;
    z-index:9;
    background:rgba(255,255,255,.82);
    -webkit-backdrop-filter:blur(12px) saturate(140%);
    backdrop-filter:blur(12px) saturate(140%);
    border:1px solid rgba(255,255,255,.5);
    border-radius:14px;
    padding:10px 14px;
    box-shadow:0 6px 20px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    cursor:pointer;
    transition:transform .15s ease, box-shadow .15s ease;
    min-width:140px;
    user-select:none;
    font-family:inherit;
}
.wcpe-purity-card:hover, .wcpe-purity-card:focus-visible {
    transform:translateY(-1px);
    box-shadow:0 10px 28px rgba(0,0,0,.12), 0 2px 4px rgba(0,0,0,.06);
    outline:none;
}
.wcpe-purity-headline {
    display:flex;
    align-items:center;
    gap:6px;
}
.wcpe-purity-check {
    display:inline-flex;
    align-items:center;
    flex-shrink:0;
}
.wcpe-purity-headline-label {
    font-size:11px;
    color:#6b7280;
    font-weight:500;
    letter-spacing:.3px;
    text-transform:uppercase;
}
.wcpe-purity-value {
    margin-left:auto;
    font-size:15px;
    font-weight:800;
    color:#1a7a42;
    letter-spacing:-.01em;
}
.wcpe-purity-meta {
    margin-top:7px;
    padding-top:7px;
    border-top:1px solid rgba(0,0,0,.06);
}
.wcpe-purity-row {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:10px;
    font-size:11px;
    line-height:1.4;
}
.wcpe-purity-row + .wcpe-purity-row { margin-top:2px; }
.wcpe-purity-label {
    color:#6b7280;
    font-weight:500;
}
.wcpe-purity-sub {
    color:#1a1a1a;
    font-weight:600;
    text-align:right;
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:90px;
}

/* Desktop : texte long visible, texte court caché */
.wcpe-coa-label-long { display:inline; }
.wcpe-coa-label-short { display:none; }

.wcpe-shipping-bar { display:flex; border:1px solid #e5e5e5; border-radius:10px; padding:14px 10px; margin:16px 0; background:#fafafa; justify-content:space-around; flex-wrap:wrap; gap:12px; }
.wcpe-ship-item { display:flex; align-items:center; gap:10px; font-size:12px; color:#333; flex:1; min-width:120px; }
.wcpe-ship-icon { width:24px; height:24px; flex-shrink:0; stroke:#27ae60; }
.wcpe-ship-item div { display:flex; flex-direction:column; line-height:1.4; }
.wcpe-ship-label { color:#777; font-size:11px; }
.wcpe-ship-item strong { font-size:12px; }

.wcpe-payment-row { display:flex; align-items:center; gap:10px; flex-wrap:wrap; margin-top:8px; }
.wcpe-payment-label { font-size:12px; color:#666; flex-shrink:0; }
.wcpe-payment-icons { display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.wcpe-pay-icon { border-radius:4px; box-shadow:0 1px 3px rgba(0,0,0,.18); object-fit:contain; height:24px; width:auto; max-width:48px; }

.wcpe-modal-overlay { position:fixed; inset:0; background:rgba(0,0,0,.55); z-index:999999; display:flex; align-items:center; justify-content:center; padding:20px; }
.wcpe-modal-overlay[hidden] { display:none; }
.wcpe-modal-box { background:#fff; border-radius:20px; width:100%; max-width:520px; max-height:90vh; overflow-y:auto; padding:32px; position:relative; box-shadow:0 20px 60px rgba(0,0,0,.25); animation:wcpe-in .18s ease; }
@keyframes wcpe-in { from { opacity:0; transform:translateY(10px) scale(.97); } to { opacity:1; transform:translateY(0) scale(1); } }
.wcpe-modal-close { position:absolute; top:14px; right:18px; background:none; border:none; font-size:26px; cursor:pointer; color:#555; line-height:1; padding:4px 8px; border-radius:6px; font-family:inherit; }
.wcpe-modal-close:hover { background:#f0f0f0; }
.wcpe-modal-title { display:flex; align-items:center; gap:10px; font-size:18px; font-weight:700; margin:0 0 20px; color:#111; }
.wcpe-coa-iframe { width:100%; height:520px; border:none; border-radius:6px; display:block; }

.wcpe-cs-wrap { padding:4px 0 0; }
.wcpe-cs-icon-wrap { width:72px; height:72px; background:#f0f0f0; border-radius:50%; display:flex; align-items:center; justify-content:center; margin-bottom:20px; color:#555; }
.wcpe-cs-title { font-size:24px; font-weight:800; color:#111; margin:0 0 14px; line-height:1.2; }
.wcpe-cs-pill { display:inline-block; border:1.5px solid #d0d0d0; border-radius:20px; padding:5px 16px; font-size:13px; color:#444; margin-bottom:20px; background:#fff; }
.wcpe-cs-desc { font-size:15px; line-height:1.65; color:#444; margin:0 0 24px; }
.wcpe-cs-desc-sub { font-size:14px; line-height:1.55; color:#666; margin:0 0 24px; }

/* ── Trust badges dans la modal ─────── */
.wcpe-cs-trust { margin:0 0 20px; padding:14px 18px; background:#f0faf4; border-radius:12px; border:1px solid #d4edda; }
.wcpe-cs-trust-item { display:flex; align-items:center; gap:10px; font-size:13px; color:#1a7a42; font-weight:500; line-height:1.4; }
.wcpe-cs-trust-item + .wcpe-cs-trust-item { margin-top:8px; }
.wcpe-cs-trust-item svg { flex-shrink:0; }

/* ── Formulaire COA ─────── */
.wcpe-cs-form-wrap { margin-bottom:24px; }
.wcpe-cs-input-group { display:flex; align-items:center; background:#f2f2f2; border-radius:50px; padding:6px 6px 6px 20px; gap:8px; }
.wcpe-cs-email { flex:1; border:none; background:transparent; font-size:14px; color:#333; outline:none; min-width:0; font-family:inherit; }
.wcpe-cs-email::placeholder { color:#aaa; }
.wcpe-cs-notify-btn { background:#111; color:#fff; border:none; border-radius:50px; padding:11px 22px; font-size:14px; font-weight:700; cursor:pointer; white-space:nowrap; font-family:inherit; flex-shrink:0; }
.wcpe-cs-notify-btn:hover { background:#333; }

/* ── Checkbox newsletter opt-in ─────── */
.wcpe-cs-optin { display:flex; align-items:flex-start; gap:10px; margin:14px 0 0; cursor:pointer; font-size:12px; color:#666; line-height:1.5; }
.wcpe-cs-optin input[type="checkbox"] { margin-top:2px; flex-shrink:0; accent-color:#111; width:16px; height:16px; cursor:pointer; }
.wcpe-cs-optin span { flex:1; }
.wcpe-cs-optin-error { color:#e74c3c; }
.wcpe-cs-optin-error input[type="checkbox"] { outline:2px solid #e74c3c; border-radius:3px; }

/* ── Messages de succès ─────── */
.wcpe-cs-success { margin-top:10px; font-size:13px; color:#3dbfa0; font-weight:600; }
.wcpe-cs-success[hidden] { display:none; }
.wcpe-cs-success-email { margin-top:16px; font-size:14px; color:#3dbfa0; font-weight:600; text-align:center; padding:16px; background:#f0faf4; border-radius:12px; border:1px solid #d4edda; }
.wcpe-cs-success-email[hidden] { display:none; }

/* ── Lien reveal (mode "juste afficher") ─────── */
.wcpe-cs-reveal-link { margin-top:16px; text-align:center; padding:20px; background:#f0faf4; border-radius:12px; border:1px solid #d4edda; }
.wcpe-cs-reveal-link[hidden] { display:none; }
.wcpe-cs-reveal-text { font-size:14px; color:#3dbfa0; font-weight:600; margin:0 0 14px; }
.wcpe-cs-reveal-btn { display:inline-block; background:#111; color:#fff; text-decoration:none; padding:13px 32px; border-radius:50px; font-size:14px; font-weight:700; letter-spacing:0.3px; transition:background .18s; }
.wcpe-cs-reveal-btn:hover { background:#333; color:#fff; text-decoration:none; }

/* ── Erreur ─────── */
.wcpe-cs-error { margin-top:10px; font-size:13px; color:#e74c3c; font-weight:600; }
.wcpe-cs-error[hidden] { display:none; }

/* ── Footer modal ─────── */
.wcpe-cs-footer { border-top:1px solid #e8e8e8; padding-top:16px; text-align:center; }
.wcpe-cs-footer p { font-size:12px; color:#999; margin:0; line-height:1.5; }

/* ── Disclaimer entre image et thumbnails ─────── */
.wcpe-gallery-disclaimer {
    width:100%;
    text-align:center;
    padding:10px 14px;
    margin:8px 0 6px;
    background:#fdf2f2;
    border:1.5px solid #e8a0a0;
    border-radius:8px;
    box-sizing:border-box;
}
.wcpe-disclaimer-text {
    font-size:10px;
    font-weight:700;
    letter-spacing:0.5px;
    line-height:1.6;
    color:#c0392b;
    text-transform:uppercase;
}

/* ── Thumbs row : 4 cellules égales (2 images + 2 badges) ─────── */
.wcpe-thumbs-row {
    display:grid;
    grid-template-columns:repeat(4, 1fr);
    gap:8px;
    width:100%;
    margin-top:8px;
    margin-bottom:15px;
}

/* Cellules images */
.wcpe-thumbs-cell--img {
    cursor:pointer;
    border-radius:8px;
    overflow:hidden;
    border:none;
    transition:opacity .15s;
}
.wcpe-thumbs-cell--img img {
    display:block;
    width:100%;
    height:100%;
    object-fit:cover;
    border-radius:8px;
}
.wcpe-thumbs-cell--img:not(.wcpe-thumb-active) { opacity:.6; }
.wcpe-thumbs-cell--img.wcpe-thumb-active { opacity:1; }
.wcpe-thumbs-cell--img:hover { opacity:1; }

/* Cellules badges — light, centré, icône au-dessus */
.wcpe-gallery-badge {
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    text-align:center;
    gap:6px;
    background:#f3f4f6;
    border-radius:8px;
    padding:12px 8px;
    box-sizing:border-box;
    cursor:default;
    min-width:0;
}
.wcpe-gbadge-icon {
    display:flex;
    align-items:center;
    justify-content:center;
    flex-shrink:0;
}
.wcpe-gbadge-content {
    display:flex;
    flex-direction:column;
    align-items:center;
    min-width:0;
}
.wcpe-gbadge-content strong {
    font-size:11px;
    font-weight:700;
    color:#1a1a1a;
    white-space:nowrap;
}
.wcpe-gbadge-sub {
    font-size:9.5px;
    color:#6b7280;
    line-height:1.3;
    margin-top:2px;
}

/* Fallback si pas Flickity */
.wcpe-gallery-badges {
    display:flex;
    gap:8px;
    width:100%;
    margin-top:8px;
}
.wcpe-gallery-badges .wcpe-gallery-badge { flex:1; }

@media (max-width: 640px) {
    .wcpe-shipping-bar   { flex-direction:column; gap:10px; }
    .wcpe-modal-box      { padding:24px 16px; border-radius:14px; }
    .wcpe-coa-iframe     { height:380px; }
    .wcpe-cs-input-group { flex-direction:column; border-radius:16px; padding:12px; }
    .wcpe-cs-notify-btn  { width:100%; text-align:center; }

    /* Gallery disclaimer + badges mobile */
    .wcpe-gallery-disclaimer { padding:8px 10px; }
    .wcpe-thumbs-row { grid-template-columns:repeat(4, 1fr); gap:4px; }
    .wcpe-gbadge-content strong { font-size:9px; }
    .wcpe-gbadge-sub { font-size:8px; }
    .wcpe-gallery-badge { padding:6px 6px; gap:4px; }

    /* COA bouton mobile : icône + "CoA" seulement */
    .wcpe-coa-overlay { padding:7px 12px; font-size:12px; bottom:10px; right:10px; }
    .wcpe-coa-label-long { display:none; }
    .wcpe-coa-label-short { display:inline; }

    /* Card pureté mobile : compacte */
    .wcpe-purity-card { top:8px; right:8px; padding:7px 10px; min-width:115px; border-radius:11px; }
    .wcpe-purity-headline-label { font-size:9px; }
    .wcpe-purity-value { font-size:13px; }
    .wcpe-purity-row { font-size:10px; }
    .wcpe-purity-sub { max-width:70px; }
    .wcpe-purity-meta { margin-top:5px; padding-top:5px; }
}
