/* ==============================================
   STICKY BAR
   ============================================== */

/* === STICKY BOOKING BAR === */

.sticky-booking-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.97);
    padding: 0.25rem 2rem;
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 9999;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(10px);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
}

.sticky-booking-bar.visible {
    transform: translateY(0);
}

/* Animacja uwagi — gdy pojawia się cena po wyborze pełnego zakresu */
@keyframes sticky-attention {
    0%   { box-shadow: 0 -10px 30px rgba(0,0,0,0.08); background: rgba(255,255,255,0.97); }
    25%  { box-shadow: 0 -10px 50px rgba(180,140,60,0.35), 0 -2px 0 rgba(180,140,60,0.6); background: rgba(255,248,225,0.99); }
    60%  { box-shadow: 0 -10px 40px rgba(180,140,60,0.2), 0 -2px 0 rgba(180,140,60,0.3); background: rgba(255,252,240,0.98); }
    100% { box-shadow: 0 -10px 30px rgba(0,0,0,0.08); background: rgba(255,255,255,0.97); }
}

.sticky-booking-bar.attention {
    animation: sticky-attention 0.7s ease-out forwards;
}

/* Stan poprawny — zielony przycisk + większy tekst */
.sticky-apt-panel.valid {
    font-size: 1.2em;
    transition: font-size 0.35s ease;
}

.sticky-apt-panel.valid .sticky-reserve-btn {
    background: #2e7d32 !important;
    border-color: #2e7d32 !important;
    color: #fff !important;
}

.sticky-apt-panel.valid .sticky-reserve-btn:hover {
    background: #1b5e20 !important;
    border-color: #1b5e20 !important;
    color: #fff !important;
}

/* Stan niepoprawny — mniejszy tekst */
.sticky-apt-panel.invalid {
    font-size: 0.82em;
    transition: font-size 0.35s ease;
}

.sticky-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 1200px;
    width: 100%;
    justify-content: center;
}

/* Sticky bar — stan z datami */
.sticky-active {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    width: 100%;
    max-width: 1400px;
}

.sticky-apt-panel {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1 1 calc(50% - 0.75rem);
    max-width: calc(50% - 0.75rem);
    min-width: 0;
    position: relative;
}



.sticky-apt-dates {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sticky-date-sep {
    color: rgba(0,0,0,0.3);
    font-size: 1.1rem;
    line-height: 1;
    user-select: none;
}

.sticky-field {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 0.3rem;
    border: none;
    background: none;
    padding: 0;
    border-radius: 0;
    min-width: auto;
}



.sticky-field-value {
    font-family: var(--font-hull);
    font-size: 1.35rem;
    font-weight: 400;
    color: #1a1a1a;
    line-height: 1.1;
    white-space: nowrap;
    order: 1;
}

.sticky-date-main {
    font-size: 1.75rem;
    font-weight: 500;
}



.sticky-field-value.empty {
    color: rgba(0,0,0,0.25);
    font-weight: 300;
    font-style: italic;
    font-size: 0.9rem;
}

/* Error message in sticky bar — in-flow, replaces dates/price */
.sticky-bar-error {
    display: none;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    font-size: 0.95rem;
    color: #fff;
    font-weight: 600;
    line-height: 1.4;
    white-space: normal;
    background: #c62828;
    padding: 8px 16px;
    border-radius: 6px;
    align-items: center;
    justify-content: center;
    text-align: center;
    animation: fade-in-error 0.2s ease;
}

@keyframes fade-in-error {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sticky-bar-error.visible {
    display: flex;
}

/* When error is visible, hide dates and price inside the same panel */
.sticky-apt-panel:has(.sticky-bar-error.visible) .sticky-apt-dates,
.sticky-apt-panel:has(.sticky-bar-error.visible) .sticky-apt-price {
    display: none !important;
}

/* preview class removed — hover dates keep same style as confirmed */

.sticky-apt-price {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.75rem;
    flex-shrink: 0;
}

.sticky-apt-total {
    color: #1a1a1a;
    font-family: var(--font-hull);
    font-size: 1.3rem;
    font-weight: 700;
    white-space: nowrap;
}

.sticky-price-main {
    font-size: 1.7rem;
}

.sticky-price-currency {
    font-size: 1.1rem;
    font-weight: 500;
    opacity: 0.5;
}

.sticky-reserve-btn {
    padding: 8px 22px !important;
    font-size: 0.95rem !important;
    background: #1a1a1a !important;
    color: #fff !important;
    border: 1px solid #1a1a1a !important;
    white-space: nowrap;
    transition: all 0.3s ease !important;
}

.sticky-reserve-btn:hover {
    background: #333 !important;
    border-color: #333 !important;
    color: #fff !important;
}

.sticky-text {
    color: #1a1a1a;
    font-family: var(--font-hull);
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.4s 0.1s;
}

.sticky-booking-bar.visible .sticky-text {
    opacity: 1;
    transform: translateY(0);
}

.sticky-btn {
    padding: 8px 24px;
    font-size: 0.9rem;
    background: #1a1a1a !important;
    color: #fff !important;
    border: 1px solid #1a1a1a !important;
    transition: all 0.3s ease !important;
}

.sticky-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--storm-foam) !important;
    z-index: -1;
    transition: left 0.4s cubic-bezier(0.7, 0, 0.3, 1);
}

.sticky-btn:hover {
    background: #444 !important;
    color: #fff !important;
    border-color: #444 !important;
}

.sticky-phone-btn {
    padding: 8px 16px;
    font-size: 1.1rem;
    background: transparent !important;
    color: #1a1a1a !important;
    border: 1px solid rgba(0,0,0,0.15) !important;
    white-space: nowrap;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sticky-phone-btn:hover {
    border-color: rgba(0,0,0,0.3) !important;
    color: #1a1a1a !important;
    background: rgba(0,0,0,0.03) !important;
}

@media (min-width: 1024px) {
    .sticky-phone-btn {
        pointer-events: none;
        color: #1a1a1a !important;
        border-color: transparent !important;
    }
}

.sticky-btn:hover::before {
    left: 0;
}

/* === STICKY BAR MOBILE RESPONSIVENESS === */

/* Narrow desktop — scale down sticky bar to fit both panels */
@media (max-width: 1280px) and (min-width: 769px) {
    .sticky-apt-panel {
        gap: 0.5rem;
    }
    .sticky-active {
        gap: 0.75rem;
    }
    .sticky-field-value {
        font-size: clamp(0.95rem, 1.8vw, 1.35rem);
    }
    .sticky-date-main {
        font-size: clamp(1.1rem, 2.2vw, 1.75rem);
    }
    .sticky-apt-total {
        font-size: clamp(0.9rem, 1.8vw, 1.3rem);
    }
    .sticky-price-main {
        font-size: clamp(1.1rem, 2.2vw, 1.7rem);
    }
    .sticky-reserve-btn {
        padding: 6px 14px !important;
        font-size: clamp(0.75rem, 1.3vw, 0.95rem) !important;
    }
    .sticky-apt-price {
        gap: 0.4rem;
    }
}

/* Desktop: show full text, hide mobile text */
.btn-text-mobile {
    display: none;
}

.btn-text-full {
    display: inline;
}

@media (max-width: 768px) {
    /* Mobile: show mobile text, hide full text */
    .btn-text-mobile {
        display: inline;
    }
    
    .btn-text-full {
        display: none;
    }
    
    .sticky-booking-bar {
        padding: 0.4rem 0.75rem;
    }
    
    .sticky-content {
        display: flex;
        flex-wrap: nowrap;
        gap: 0.75rem;
        justify-content: center;
    }

    .sticky-active {
        flex-direction: column;
        gap: 0.4rem;
        width: 100%;
        max-width: none;
    }

    /* Separator między panelami apartamentów */
    .sticky-apt-panel + .sticky-apt-panel {
        border-top: 1px solid rgba(0,0,0,0.08);
        padding-top: 0.4rem;
    }
    
    .sticky-text {
        display: none;
    }
    
    .sticky-btn {
        padding: 10px 20px;
        font-size: 0.85rem;
        flex: 1;
        justify-content: center;
        text-align: center;
    }
    
    .sticky-phone-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
        flex: 0 0 auto;
        justify-content: center;
        text-align: center;
        pointer-events: auto;
    }

    /* Sticky apt panel: keep dates + price in first row; move only button under price */
    .sticky-apt-panel {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "dates price"
            "button button";
        flex: 1 1 100%;
        max-width: 100%;
        width: 100%;
        gap: 0.2rem 0.6rem;
        align-items: center;
    }

    /* Disable desktop panel scaling states on mobile (they break the layout) */
    .sticky-apt-panel.valid,
    .sticky-apt-panel.invalid {
        font-size: 1em;
    }

    .sticky-apt-dates {
        grid-area: dates;
        min-width: 0;
    }

    .sticky-apt-price {
        display: contents;
    }

    .sticky-apt-total {
        grid-area: price;
        text-align: right;
        align-self: center;
        justify-self: end;
    }

    .sticky-reserve-btn {
        grid-area: button;
        width: 100%;
        white-space: normal;
        line-height: 1.2;
        padding: 8px 10px !important;
        font-size: 0.82rem !important;
    }

    .sticky-date-main {
        font-size: 1.2rem;
    }

    .sticky-price-main {
        font-size: 1.3rem;
    }
}

/* --- STYLES FOR PRICING OPTION 2.2 --- */
.option-box {
    display: flex;
    align-items: center;
    padding: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
    background: white;
    position: relative;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.option-box:hover {
    transform: scale(1.02);
    border-color: #999;
    box-shadow: 0 5px 20px rgba(0,0,0,0.06);
    z-index: 10;
}

.option-box:has(input:checked) {
    transform: scale(1.05); 
    border: 1px solid #1a1a1a;
    background: #fafafa;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08); /* Większy cień dla głębi */
    z-index: 20;
}

.option-box input[type="radio"] {
    margin-right: 20px;
    transform: scale(1.3);
    accent-color: #1a1a1a;
    flex-shrink: 0;
    outline: none;
    box-shadow: none;
}

.smart-badge {
    border: 1px solid #1a1a1a;
    padding: 2px 8px;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
    /* Clean rendering fix */
    box-shadow: 0 0 0 0 transparent;
    transform: translateZ(0);
    backface-visibility: hidden;
}
