/**
 * Mobile Booking Sticky Overlay
 * Isolated CSS for id="tour-booking-mobile"
 * 
 * @package TravelerChildTheme
 * @since 3.1.0
 */

/* Sticky mobile booking overlay */
#tour-booking-mobile.sticky-mobile-booking {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%; /* Explicit width constraint */
    max-width: 100%; /* Prevent overflow beyond viewport (% not vw to avoid scrollbar) */
    box-sizing: border-box; /* Include padding in width calculation */
    background: white;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.1);
    padding: 16px 20px;
    display: flex !important; /* Override Bootstrap's .d-block !important */
    justify-content: space-between;
    align-items: center;
    z-index: 1100; /* Above general sticky UI; below modals/sheet */
    gap: 16px;
    transform: translateY(0);
    opacity: 1;
    transition: transform 180ms ease, opacity 180ms ease;
    will-change: transform, opacity;
    pointer-events: auto;
    overflow: hidden; /* Prevent content overflow */
}

#tour-booking-mobile .booking-left {
    flex: 1;
    min-width: 0; /* Allow flex shrinking */
    overflow: hidden; /* Prevent text overflow */
}

#tour-booking-mobile .booking-right {
    flex: 0 0 auto;
    flex-shrink: 0;
    width: auto;
}

#tour-booking-mobile .booking-right .st-review-booking-form {
    width: auto;
}

#tour-booking-mobile .booking-right .st-review-box-top {
    display: flex;
    align-items: center;
    width: auto;
}

#tour-booking-mobile .price-display {
    font-weight: 600;
    font-size: 16px;
    color: #222;
    margin-bottom: 4px;
    line-height: 1.2;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

/* Override any inherited price styling in mobile booking */
#tour-booking-mobile .price-display * {
    font-size: inherit !important;
    color: inherit !important;
    font-weight: inherit !important;
    text-decoration: none !important;
    display: inline !important;
}

/* Hide sale price elements in mobile booking */
#tour-booking-mobile .price-display .onsale {
    display: none !important;
}

#tour-booking-mobile .price-display .text-small {
    display: none !important;
}

#tour-booking-mobile .feature-pill {
    background: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    display: inline-block;
    font-weight: 400;
}

#tour-booking-mobile .book-now-btn {
    background: #324fbe;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    transition: background-color 0.2s ease;
    width: auto;
    white-space: nowrap; /* Prevent button text wrapping */
    flex-shrink: 0; /* Prevent button from shrinking */
    min-width: 0; /* Allow shrinking if absolutely necessary on tiny screens */
    max-width: min(180px, 45vw); /* Smarter responsive constraint */
}

#tour-booking-mobile .book-now-btn:hover {
    background: #2a4299;
    color: white;
    text-decoration: none;
}

#tour-booking-mobile .book-now-btn:active {
    background: #1f3677;
}

/* Hide class for mobile booking bar - uses transform to avoid layout shift */
#tour-booking-mobile.hide {
    transform: translateY(100%);
    opacity: 0;
    pointer-events: none;
}

/* Add bottom padding to body to prevent content overlap - scoped to pages with bar */
@media screen and (max-width: 991px) {
    body.has-mobile-booking-bar {
        padding-bottom: 80px;
        overflow-x: hidden !important; /* Prevent horizontal overflow from fixed bar */
        max-width: 100%; /* Constrain body width */
    }
}