/* Fenêtre de réservation (fiche de pack) */

/* Pas de panier tant que le paiement en ligne n'est pas activé */
.item-availability .add-to-cart,
.item-availability .togo-ajax-success {
    display: none !important;
}

html.bwb-open,
html.bwb-open body {
    overflow: hidden;
}

#bw-book {
    position: fixed;
    inset: 0;
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.bwb-overlay {
    position: absolute;
    inset: 0;
    background: rgba(23, 23, 23, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bwb-panel {
    position: relative;
    width: min(520px, 100%);
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    padding: 30px 28px 26px;
    border-radius: 24px;
    background: var(--bw-ivory, #fcfaf5);
    box-shadow: 0 30px 80px rgba(23, 23, 23, 0.3);
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.3s ease, transform 0.4s cubic-bezier(0.22, 0.8, 0.3, 1);
}

#bw-book.on .bwb-overlay { opacity: 1; }
#bw-book.on .bwb-panel { opacity: 1; transform: none; }

.bwb-x {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid rgba(23, 23, 23, 0.12);
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
}

.bwb-x i {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 14px;
    height: 1.6px;
    margin: -0.8px 0 0 -7px;
    background: #171717;
    transform: rotate(45deg);
}

.bwb-x i + i { transform: rotate(-45deg); }

.bwb-kicker {
    margin: 0 0 4px;
    color: var(--bw-gold, #a88447);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.bwb-panel h3 {
    margin: 0 40px 16px 0;
    font-size: 22px;
    line-height: 1.25;
}

.bwb-sum {
    margin: 0 0 18px;
    padding: 4px 16px;
    border-radius: 16px;
    background: #fff;
    list-style: none;
}

.bwb-sum li {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid #efe9dc;
    font-size: 14px;
}

.bwb-sum li:last-child { border-bottom: 0; }
.bwb-sum span { color: #8e887c; }
.bwb-sum b { font-weight: 500; text-align: right; }
.bwb-total b { font-size: 17px; font-weight: 700; }

.bwb-panel form { display: grid; gap: 12px; margin: 0; }

.bwb-panel label {
    display: grid;
    gap: 5px;
    color: #57534b;
    font-size: 13px;
}

.bwb-panel input,
.bwb-panel textarea {
    width: 100%;
    min-height: 46px;
    padding: 10px 14px;
    border: 1px solid #e8e1d3;
    border-radius: 14px;
    background: #fff;
    color: #171717;
    font: inherit;
    font-size: 16px;
}

.bwb-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 12px; }
.bwb-hp { position: absolute !important; left: -9999px !important; }
.bwb-err { min-height: 0; margin: 0; color: #c53030; font-size: 14px; }
.bwb-err:empty { display: none; }

.bwb-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    border: 0;
    border-radius: 999px;
    background: var(--bw-orange, #f46b32);
    color: #171717 !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.25s ease, color 0.25s ease;
}

.bwb-btn:hover { background: #171717; color: #fcfaf5 !important; }
.bwb-btn:disabled { opacity: 0.6; cursor: wait; }
.bwb-note { margin: 0; color: #8e887c; font-size: 12.5px; text-align: center; }

/* Étape 2 : confirmation */
#bw-book.is-done .bwb-form { display: none; }

.bwb-done { display: grid; gap: 12px; text-align: center; }
.bwb-done h3 { margin: 4px 0 0 !important; }
.bwb-ref { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: 0.04em; }

.bwb-badge {
    justify-self: center;
    padding: 6px 14px;
    border-radius: 999px;
    background: #fff6e0;
    color: #b7791f;
    font-size: 13px;
    font-weight: 600;
}

.bwb-txt { margin: 4px 0 6px; color: #57534b; font-size: 15px; }
.bwb-wa { background: var(--bw-gold, #a88447); color: #fcfaf5 !important; }
.bwb-ghost { border: 1px solid #171717; background: transparent; }
.bwb-link { color: var(--bw-gold, #a88447); font-size: 14px; }

.bwb-check svg { width: 64px; height: 64px; }
.bwb-check circle { fill: none; stroke: var(--bw-gold, #a88447); stroke-width: 2.5; stroke-dasharray: 160; stroke-dashoffset: 160; animation: bwb-draw 0.6s ease forwards; }
.bwb-check path { fill: none; stroke: var(--bw-gold, #a88447); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: bwb-draw 0.4s ease 0.45s forwards; }

@keyframes bwb-draw { to { stroke-dashoffset: 0; } }

@media (max-width: 767px) {
    #bw-book { align-items: flex-end; padding: 0; }
    .bwb-panel { width: 100%; max-height: 92vh; border-radius: 24px 24px 0 0; padding-bottom: calc(26px + env(safe-area-inset-bottom)); transform: translateY(40px); }
    .bwb-2 { grid-template-columns: 1fr 1fr; }
}
