/* ==========================================================================
   small-basket-modern / style.css
   Match prod gettsleep.com — v13-let-js-control-28feb
   ========================================================================== */

/* ==========================================================================
   1. OFFERS THIRD BLOCK
   ========================================================================== */

.offers-third-block {
    display: flex;
    flex-direction: column;
    width: 100%;
    padding: 10px;
    box-sizing: border-box;
    gap: 8px;
}

.offers-third-block .tariffs             { order: 1; }
.offers-third-block .offers__prices      { order: 2; }
.offers-third-block .offers__count       { order: 3; }
.offers-third-block .offers__button-book { order: 4; }
.offers-third-block .offers__price-btn-wrap { order: 5; }

/* ==========================================================================
   2. PRICES BLOCK
   ========================================================================== */

.offers__prices {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-start;
    gap: 6px;
    padding: 4px 0;
    width: 100%;
    box-sizing: border-box;
    position: static !important;
}

.offers__price_new {
    font-weight: 700;
    font-size: 22px;
    color: #131313;
    margin: 0;
    order: 1;
    line-height: 1.2;
}

.offers__price_old {
    font-size: 14px;
    color: #b9b9b9;
    text-decoration: line-through;
    margin: 0;
    order: 0;
    line-height: 1.2;
}

.offers__price_discount-percent {
    font-size: 14px;
    color: #ff7f00;
    margin: 0;
    order: 2;
    line-height: 1.2;
}

.offers__hours_number {
    width: 100%;
    text-align: left;
    font-size: 13px;
    color: #666;
    margin: 0;
    order: 3;
    line-height: 1.4;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   3. TARIFFS
   ========================================================================== */

.tariffs {
    width: 100%;
    box-sizing: border-box;
}

.tariffs-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-radio {
    display: none;
}

.custom-radio-wrapper {
    position: relative;
}

.custom-radio-wrapper label {
    display: flex;
    cursor: pointer;
    padding: 10px 12px;
    border: none;
    border-radius: 0;
    background: transparent;
    transition: none;
    box-sizing: border-box;
}

.custom-radio:checked + label {
    border: none;
    background: transparent;
}

.custom-radio-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 4px;
}

.custom-radio-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.custom-radio-indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 2px solid #ccc;
    flex-shrink: 0;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    box-sizing: border-box;
}

.custom-radio:checked + label .custom-radio-indicator {
    border-color: #ff7f00;
    background: #ff7f00;
}

.custom-radio-name {
    font-size: 14px;
    font-weight: 600;
    flex: 1;
    line-height: 1.3;
}

.custom-radio-bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-left: 24px;
    gap: 4px;
}

.custom-radio-price {
    font-size: 16px;
    font-weight: 700;
    color: #131313;
    white-space: nowrap;
    flex-shrink: 0;
}

.custom-radio-text {
    font-size: 12px;
    color: #888;
    text-align: left;
    line-height: 1.4;
}

/* ==========================================================================
   4. COUNT CONTROLS
   ========================================================================== */

.offers__count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    user-select: none;
    width: 100%;
}

.offers__count-value {
    margin: 0 15px;
    font-weight: 700;
    min-width: 24px;
    text-align: center;
    user-select: none;
    font-size: 18px;
}

.offers__count-control {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 22px;
    transition: color 0.2s, background 0.2s;
    user-select: none;
    cursor: pointer;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
    box-sizing: border-box;
}

.offers__count-control:hover {
    color: #fff;
    background: #ff7f00;
    border-color: #ff7f00;
}

/* ==========================================================================
   5. BOOK BUTTON
   ========================================================================== */

.offers__button.offers__button-book {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 46px;
    background: #ff7f00;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    border: 2px solid #ff7f00;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s;
    text-align: center;
    box-sizing: border-box;
}

.offers__button.offers__button-book:hover {
    background: transparent;
    color: #ff7f00;
}

/* ==========================================================================
   6. ADD / DELETE BUTTONS
   ========================================================================== */

.offers__price-btn.offers__price-btn-wrap {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.offers__button.offers__button_grey {
    display: none;
    width: 100%;
    align-items: center;
    justify-content: center;
    height: 40px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s, color 0.3s, border-color 0.3s;
    box-sizing: border-box;
    border: 2px solid transparent;
}

.offers__button.offers__button_grey.js-add.active {
    display: flex;
    background: #f0f0f0;
    color: #444;
    border-color: #e0e0e0;
}

.offers__button.offers__button_grey.js-add.active:hover {
    background: #e0e0e0;
    color: #222;
    border-color: #ccc;
}

.offers__button.offers__button_grey.js-delete.active {
    display: flex;
    background: transparent;
    color: #ff7f00;
    border-color: #ff7f00;
}

.offers__button.offers__button_grey.js-delete.active:hover {
    background: #ff7f00;
    color: #fff;
}

/* ==========================================================================
   7. TOOLTIP
   ========================================================================== */

.tooltip-new {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.tooltip__btn {
    background: rgba(0, 0, 0, 0.15);
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
    box-sizing: border-box;
}

.tooltip__content {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    right: 0;
    min-width: 220px;
    max-width: 280px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 12px;
    color: #333;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 200;
    white-space: normal;
    line-height: 1.4;
    box-sizing: border-box;
}

.tooltip-new:hover .tooltip__content {
    display: block;
}

/* ==========================================================================
   8. DESKTOP BASKET — v13-let-js-control-28feb
   
   On prod, JS (script.js from booking.list) sets inline styles:
     position: fixed; top: 344px; left: 1547px; transform: none;
   
   Our previous versions used !important which BLOCKED the JS inline styles.
   
   v13 strategy:
   - NO !important on position/top/left/right/bottom/transform for desktop
   - JS inline styles win over regular CSS (CSS specificity < inline)
   - CSS provides fallback IF JS doesn't run:
     position: fixed + calc() for approximate right-of-container placement
   - Only visual styles (background, border, shadow) on the wrapper
   - Mobile (<=1024px): !important overrides remain (JS doesn't handle mobile)
   ========================================================================== */

/* DESKTOP: CSS fallback — JS inline styles will override these */
.offers-modern__footer-wrapper {
    /* Position fallback (JS overrides with inline styles) */
    position: fixed;
    top: 300px;
    left: calc(50% + 555px + 10px); /* center + half of ~1110px container + gap */
    right: auto;
    bottom: auto;
    transform: none;
    width: 220px;
    max-width: 220px;
    min-width: 200px;
    z-index: 1000;
    /* Visual styles */
    background: #fff;
    border: 1px solid #e8e8e8;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    overflow: hidden;
}

.offers-modern__footer-container {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
}

.footer__navigation {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    height: auto;
    padding: 12px 14px;
    box-sizing: border-box;
    gap: 10px;
}

.offers-modern__footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    width: 100%;
}

.offers-modern__footer img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
}

.offers-modern__footer-bl {
    display: flex;
    align-items: center;
    min-width: 0;
    flex: 1;
}

.offers-modern__total {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    width: 100%;
}

.offers-modern__count {
    font-size: 15px;
    font-weight: 700;
    color: #131313;
    margin: 0;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.offers-modern__total-value-wrap {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 2px;
    white-space: nowrap;
}

.offers-modern__total-title {
    font-size: 14px;
    font-weight: 400;
    color: #666;
}

.offers-modern__total-value {
    font-size: 16px;
    font-weight: 700;
    color: #131313;
    line-height: 1.2;
}

.offers-modern__total-currency {
    font-size: 14px;
    font-weight: 400;
    color: #131313;
}

.nav__block.nav__next {
    display: flex;
    justify-content: stretch;
    padding: 0;
    flex-shrink: 0;
    width: 100%;
}

.nav__btn.nav__next-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 20px;
    height: 48px;
    width: 100%;
    background: #ff7f00 !important;
    color: #fff !important;
    font-size: 17px;
    font-weight: 700;
    border: 2px solid #ff7f00;
    border-radius: 12px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.3s, color 0.3s;
    white-space: nowrap;
    box-sizing: border-box;
    flex-shrink: 0;
}

.nav__btn.nav__next-btn span {
    color: #fff !important;
}

.nav__btn.nav__next-btn svg path {
    stroke: #fff !important;
}

.nav__btn.nav__next-btn:hover {
    background: transparent !important;
    color: #ff7f00 !important;
}

.nav__btn.nav__next-btn:hover span {
    color: #ff7f00 !important;
}

.nav__btn.nav__next-btn:hover svg path {
    stroke: #ff7f00 !important;
}

.nav__btn.nav__next-btn[disabled],
.nav__btn.nav__next-btn[disabled="true"] {
    background: transparent !important;
    color: #b5b5b5 !important;
    border-color: #b5b5b5;
    pointer-events: none;
    cursor: default;
}

.nav__btn.nav__next-btn[disabled] span,
.nav__btn.nav__next-btn[disabled="true"] span {
    color: #b5b5b5 !important;
}

.nav__btn.nav__next-btn[disabled] svg path,
.nav__btn.nav__next-btn[disabled="true"] svg path {
    stroke: #b5b5b5 !important;
}

/* ==========================================================================
   9. RESPONSIVE — Tablet + Mobile <=1024px
   !important to take full control (JS doesn't handle mobile)
   ========================================================================== */

@media (max-width: 1024px) {

    .offers-modern__footer-wrapper {
        position: fixed !important;
        bottom: calc(12px + env(safe-area-inset-bottom)) !important;
        left: 12px !important;
        right: 12px !important;
        top: auto !important;
        transform: none !important;
        width: auto !important;
        max-width: calc(100vw - 24px) !important;
        min-width: 0 !important;
        border-radius: 8px !important;
        border: 1px solid #e8e8e8 !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
    }

    .offers-modern__footer-wrapper .container {
        max-width: none;
        padding-left: 0;
        padding-right: 0;
    }

    .footer__navigation {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 10px 14px;
        height: auto;
        min-height: 60px;
        gap: 12px;
    }

    .offers-modern__footer {
        flex-direction: row;
        align-items: center;
        gap: 10px;
        flex: 1 1 0;
        min-width: 0;
        overflow: hidden;
    }

    .offers-modern__footer img {
        width: 30px;
        height: 30px;
    }

    .offers-modern__total {
        align-items: flex-start;
    }

    .offers-modern__count {
        font-size: 13px;
        font-weight: 700;
    }

    .offers-modern__total-title {
        font-size: 13px;
    }

    .offers-modern__total-value {
        font-size: 15px;
    }

    .offers-modern__total-currency {
        font-size: 14px;
    }

    .nav__block.nav__next {
        flex-shrink: 0;
        width: auto;
        padding: 0;
    }

    .nav__btn.nav__next-btn {
        width: auto;
        min-width: 140px;
        height: 52px;
        padding: 0 22px;
        font-size: 17px;
        border-radius: 12px;
    }

    .offers__prices {
        padding: 2px 0;
        gap: 4px;
    }

    .offers-third-block {
        gap: 6px;
        padding: 6px;
    }

    .offers__count-control {
        width: 44px;
        height: 44px;
    }

    .offers__count-value {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}
