/* Shared checkout panel — desktop sticky / mobile bottom sheet (Phase A+B) */
.checkout-panel {
    box-sizing: border-box;
    position: relative;
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 1px 4px rgb(0 0 0 / 0.12);
    padding: 20px;
    z-index: 3;
}

.checkout-panel__body p {
    margin-bottom: 10px;
}
.checkout-panel[hidden],
.checkout-panel.is-empty {
    display: none !important;
}

.checkout-panel.is-open {
    display: block !important;
}

.checkout-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.checkout-panel__header h6 {
    margin: 0;
    flex: 1;
    min-width: 0;
}

.date-service-pack .date_back span, .date-service-pack .date_start span {
    font-weight: 600;
    margin-left: 5px;
}
.checkout-panel__close {
    display: none;
    flex-shrink: 0;
    border: 0;
    background: #f2f2f2;
    color: #40464d;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.checkout-panel .price-pack {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-left: 0;
    margin-right: 0;
}

.checkout-panel .price-pack > [class*="col-"] {
    flex: 0 0 50%;
    max-width: 50%;
    padding-left: 0;
    padding-right: 0;
}

.checkout-panel .price-pack p {
    margin-bottom: 0;
}

/* Line items: always 8:4 (name : price), including mobile */
.checkout-panel .info-service-pack > .row,
.checkout-panel .info-service-pack > .row.item {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    margin-left: 0;
    margin-right: 0;
}

.checkout-panel .info-service-pack > .row > .col-md-8,
.checkout-panel .info-service-pack > .row > .col-8,
.checkout-panel .info-service-pack > .row > .type.col,
.checkout-panel .info-service-pack > .row > .col:first-child {
    flex: 0 0 66.66667%;
    max-width: 66.66667%;
    width: 66.66667%;
    padding-left: 0;
    padding-right: 8px;
}

.checkout-panel .info-service-pack > .row > .col-md-4,
.checkout-panel .info-service-pack > .row > .col-4,
.checkout-panel .info-service-pack > .row > .price.col,
.checkout-panel .info-service-pack > .row > .col:last-child {
    flex: 0 0 33.33333%;
    max-width: 33.33333%;
    width: 33.33333%;
    padding-left: 0;
    padding-right: 0;
}

.checkout-panel .price-pack-mobile {
    display: none;
}

.checkout-panel-rail {
    position: relative;
}

@media (min-width: 768px) {
    .checkout-panel-rail {
        padding-left: 8px;
    }

    .checkout-panel.is-open {
        position: sticky;
        top: 120px;
        width: 100%;
        max-width: 360px;
        margin-left: auto;
    }

    .checkout-panel .checkout-panel__body,
    .checkout-panel .price-pack {
        display: flex;
        margin-bottom: 15px;
    }

    .checkout-panel .checkout-panel__body {
        display: block;
    }

    .checkout-panel .price-pack-mobile,
    .checkout-panel .checkout-panel__close {
        display: none !important;
    }
}

@media (max-width: 767px) {
    .checkout-panel-rail {
        position: static;
        width: 0;
        height: 0;
        padding: 0;
        margin: 0;
        overflow: visible;
    }

    .checkout-panel.is-open {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: none;
        margin: 0;
        padding: 15px;
        z-index: 10050;
        border-radius: 12px 12px 0 0;
        box-shadow: 0 -6px 24px rgb(0 0 0 / 0.16);
    }

    .checkout-panel .bn-detail {
        display: inline-block;
    }

    .checkout-panel:not(.is-expanded) .checkout-panel__body,
    .checkout-panel:not(.is-expanded) .price-pack {
        display: none !important;
    }

    .checkout-panel:not(.is-expanded) .price-pack-mobile {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
    }

    .checkout-panel.is-expanded .checkout-panel__body {
        display: block !important;
    }

    .checkout-panel.is-expanded .price-pack {
        display: flex !important;
        flex-wrap: nowrap;
        align-items: center;
        margin-bottom: 10px;
    }

    .checkout-panel.is-expanded .price-pack-mobile .bn-detail {
        display: none;
    }

    .checkout-panel.is-expanded .checkout-panel__close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .checkout-panel.is-expanded {
        max-height: min(85vh, 640px);
        overflow: auto;
    }
}

/* Legacy packs (hotel/fasttrack/etc.): mobile bn-detail from 768 down */
@media (max-width: 767px) {
    .checkout-service-pack:not(.checkout-panel) .bn-detail {
        display: block;
    }

    /* Keep Crisp + WhatsApp visible above the checkout sheet (do not hide). */
    body.yv-checkout-sheet-open .crisp-client {
        transform: translateY(calc(-1 * var(--yv-checkout-sheet-h, 0px)));
        transition: transform 0.2s ease;
    }

    body.yv-checkout-sheet-open #chat-boxes {
        bottom: calc(var(--yv-checkout-sheet-h, 0px) + 12px) !important;
        transition: bottom 0.2s ease;
    }
}
