/* Pop-up du site (contenu fourni par Dolibarr) : tout est préfixé .bs-popup- */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&display=swap');

.bs-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    box-sizing: border-box;
    background: radial-gradient(ellipse at center, rgba(20, 10, 12, 0.55) 0%, rgba(8, 4, 5, 0.82) 100%);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    animation: bs-popup-fade 0.3s ease-out;
}

/* Boîte sans marge : le contenu Dolibarr va jusqu'aux bords, cerclé d'un filet doré */
.bs-popup-box {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    max-width: 680px;
    max-height: 100%;
    overflow: auto;
    border: 1px solid rgba(216, 164, 65, 0.6);
    border-radius: 18px;
    background: #1c1012;
    box-shadow:
        0 40px 100px rgba(0, 0, 0, 0.6),
        0 10px 30px rgba(0, 0, 0, 0.35),
        0 0 40px rgba(216, 164, 65, 0.12);
    font-family: Arial, sans-serif;
    color: #222;
    -webkit-font-smoothing: antialiased;
    animation: bs-popup-entree 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Second filet doré à l'intérieur, façon étiquette de grand cru */
.bs-popup-box::after {
    content: "";
    position: absolute;
    inset: 12px;
    z-index: 1;
    border: 1px solid rgba(245, 215, 150, 0.35);
    border-radius: 10px;
    pointer-events: none;
}

.bs-popup-box.bs-popup-photo .bs-popup-body > :first-child {
    border-radius: 0 !important;
    padding: 40px 36px !important;
}

/* Sans photo : carte ivoire, mêmes filets dorés */
.bs-popup-box:not(.bs-popup-photo) {
    padding: 44px 40px 40px;
    background: linear-gradient(160deg, #fffaf1 0%, #f6ecdc 100%);
}

.bs-popup-box:not(.bs-popup-photo)::after {
    border-color: rgba(123, 30, 43, 0.25);
}

/* Titre (bloc en 1.5em fourni par Dolibarr) en Playfair, comme les titres du site */
.bs-popup-body [style*="font-size:1.5em"] {
    font-family: 'Playfair Display', Georgia, serif !important;
    font-size: 1.85em !important;
    letter-spacing: 0.01em;
}

/* Bouton fourni par Dolibarr : version plus habillée */
.bs-popup-body a[style*="background"] {
    padding: 13px 30px !important;
    border: 1px solid rgba(245, 201, 106, 0.7) !important;
    border-radius: 999px !important;
    background: linear-gradient(135deg, #8e2433 0%, #6a1824 100%) !important;
    font-size: 0.8em !important;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    text-shadow: none !important;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.bs-popup-body a[style*="background"]:hover {
    background: linear-gradient(135deg, #a32b3c 0%, #7b1e2b 100%) !important;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(245, 201, 106, 0.9) !important;
    transform: translateY(-1px);
}

.bs-popup-body img {
    max-width: 100%;
    filter: drop-shadow(0 18px 22px rgba(0, 0, 0, 0.5));
}

.bs-popup-body {
    overflow-wrap: anywhere;
}

/* Pastille de fermeture cerclée d'or, posée dans le filet intérieur */
.bs-popup-close {
    position: absolute;
    top: 22px;
    right: 22px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin: 0;
    padding: 0;
    border: 1px solid rgba(245, 215, 150, 0.7);
    border-radius: 50%;
    background: rgba(20, 10, 12, 0.45);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #f5d796;
    font-family: Arial, sans-serif;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.bs-popup-close:hover {
    background: #d8a441;
    color: #1c1012;
    transform: rotate(90deg);
}

.bs-popup-box:not(.bs-popup-photo) .bs-popup-close {
    border-color: rgba(123, 30, 43, 0.35);
    background: transparent;
    color: #7b1e2b;
}

.bs-popup-box:not(.bs-popup-photo) .bs-popup-close:hover {
    background: #7b1e2b;
    color: #fff;
}

/* Contour seulement au clavier, pas à l'ouverture */
.bs-popup-close:focus {
    outline: none;
}

.bs-popup-close:focus-visible {
    box-shadow: 0 0 0 2px #1c1012, 0 0 0 4px #d8a441;
}

@media (max-width: 480px) {
    .bs-popup-box::after {
        inset: 8px;
    }

    .bs-popup-box.bs-popup-photo .bs-popup-body > :first-child {
        padding: 36px 24px 28px !important;
    }

    .bs-popup-box:not(.bs-popup-photo) {
        padding: 40px 24px 28px;
    }

    .bs-popup-close {
        top: 16px;
        right: 16px;
    }

    .bs-popup-body [style*="font-size:1.5em"] {
        font-size: 1.55em !important;
    }
}

@keyframes bs-popup-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes bs-popup-entree {
    from { opacity: 0; transform: translateY(18px) scale(0.97); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .bs-popup-overlay,
    .bs-popup-box {
        animation: none;
    }

    .bs-popup-close,
    .bs-popup-body a[style*="background"] {
        transition: none;
    }

    .bs-popup-close:hover {
        transform: none;
    }
}
