/* Calendar search container */
.be-search-container {
    min-height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    background: #B5D0FF; /* baby-blue z brandbooka */
}

.be-search-wrapper {
    max-width: 800px;
    width: 100%;
    text-align: center;
    position: relative;
}

.be-search-title {
    color: #002C91; /* navy - granatowy na jasnym tle */
    font-size: 42px;
    font-weight: 700;
    margin-bottom: 20px;
    font-family: 'Playfair Display', 'Didot', 'Bodoni MT', serif;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.be-search-subtitle {
    color: rgba(255,255,255,0.9);
    font-size: 18px;
    margin-bottom: 40px;
    font-family: 'Poppins', sans-serif;
}

/* Calendar widget */
.calendar__container {
    display: flex;
    align-items: center;
    background-color: #fff;
    height: 60px;
    width: 100%;
    max-width: 900px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    border-radius: 8px;
    margin: 0 auto;
    position: relative;
}

.calendar__container .inputsDate {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 1;
    min-width: 0;
}

.calendar__container .inputsDate:hover {
    background-color: #f8f9fa;
}

.calendar__container .inputsDate svg {
    width: 16px;
    height: 16px;
    fill: #666;
    margin-left: 8px;
    flex-shrink: 0;
}

.calendar__container .inputsDate .placeholder {
    font-size: 13px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Poppins', sans-serif;
}

.calendar__container .divider {
    width: 1px;
    height: 30px;
    background-color: #e6e6e6;
}

.calendar__container .inputsNumber {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 1;
    min-width: 0;
}

.calendar__container .inputsNumber:hover {
    background-color: #f8f9fa;
}

.calendar__container .inputsMeals {
    display: flex;
    align-items: center;
    position: relative;
    padding: 0 15px;
    cursor: pointer;
    transition: background-color 0.2s;
    flex: 1;
    min-width: 0;
}

.calendar__container .inputsMeals:hover {
    background-color: #f8f9fa;
}

.calendar__container .send button {
    background: linear-gradient(135deg, #002C91 0%, #213B55 100%);
    color: #fff;
    border: none;
    padding: 0 30px;
    height: 60px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border-radius: 0 8px 8px 0;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    flex-shrink: 0;
}

.calendar__container .send button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 43, 127, 0.4);
}

/* Inline calendar container */
.inline-calendar-container {
    margin-top: 40px;
    display: none;
    justify-content: center;
    width: 100%;
}

.inline-calendar-container.active {
    display: flex;
}

/* Lightpick calendar - inline 2 miesiące */
.lightpick {
    position: absolute !important;
    top: calc(100% - 350px) !important;
    left: 50% !important;
    transform: translateX(-50%) scale(1.3) !important;
    transform-origin: top center !important;
    z-index: 1000 !important;
}

.lightpick .lightpick__months {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
}

.lightpick .lightpick__month {
    min-width: 280px !important;
}

.lightpick .is-today {
    background-color: #002C91 !important;
    color: white !important;
    font-weight: bold !important;
    border: 2px solid #213B55 !important;
}

/* Ukryj czerwone kropki/obwódki Lightpick */
.lightpick .is-start-date::after,
.lightpick .is-end-date::after {
    display: none !important;
}

.lightpick--inlined {
    display: none;
}

.lightpick--inlined.active {
    display: block !important;
}

/* Modal styles */
.be-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 999999;
    animation: fadeIn 0.3s ease-in-out;
    overflow: hidden;
}

.be-modal.active {
    display: block;
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Close button */
.be-modal-close {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 50px;
    height: 50px;
    background-color: rgba(0, 0, 0, 0.7);
    border: 2px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 2147483647 !important;
    pointer-events: auto !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
}

.be-modal-close:hover {
    background-color: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.8);
    transform: rotate(90deg);
}

.be-modal-close:hover::before,
.be-modal-close:hover::after {
    background-color: #000;
}

.be-modal-close::before,
.be-modal-close::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 3px;
    background-color: #fff;
    transition: background-color 0.3s;
}

.be-modal-close::before {
    transform: rotate(45deg);
}

.be-modal-close::after {
    transform: rotate(-45deg);
}

/* Loading spinner */
.be-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    z-index: 100;
    pointer-events: none;
}

.be-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(0, 43, 127, 0.2);
    border-top-color: #002C91;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    flex-shrink: 0;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.be-loading-text {
    color: #002C91;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    font-family: 'Poppins', sans-serif;
    white-space: nowrap;
    line-height: 1;
}

/* Iframe container */
.be-iframe-container {
    width: 100%;
    height: 100vh;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1;
    pointer-events: auto;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background-color: #ffffff;
}

.be-iframe-container iframe {
    width: 100%;
    height: 100%;
    min-height: 100vh;
    border: none;
    opacity: 0;
    transition: opacity 0.3s;
    display: block;
    pointer-events: auto;
}

.be-iframe-container iframe.loaded {
    opacity: 1;
}

/* Persons selector controls */
.persons-selector {
    position: relative;
    cursor: pointer;
}

.persons-display {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    cursor: pointer;
    user-select: none;
    width: 100%;
    position: relative;
}

.persons-counts {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 8px;
    position: relative;
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

.person-count {
    display: flex !important;
    flex-direction: row !important;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    font-family: 'Poppins', sans-serif;
    position: relative;
    white-space: nowrap;
}

.person-count svg {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

.person-count span {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
}

.person-icon {
    flex-shrink: 0;
    display: inline-block !important;
    vertical-align: middle;
    width: 16px;
    height: 16px;
}

.adult-icon {
    fill: #333;
}

.kid-icon {
    fill: #666;
}

.kids-count {
    display: none;
}

.dropdown-icon {
    flex-shrink: 0;
    transition: transform 0.3s;
    width: 10px;
    height: 10px;
}

.persons-selector.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Persons Picker Dropdown */
.persons-picker {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 320px;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.persons-picker.active {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.picker-header h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.picker-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
}

.picker-row:last-child {
    border-bottom: none;
}

.picker-label {
    display: flex;
    flex-direction: column;
}

.picker-label strong {
    font-size: 14px;
    color: #333;
    font-family: 'Poppins', sans-serif;
    margin-bottom: 4px;
}

.picker-label small {
    font-size: 12px;
    color: #999;
    font-family: 'Poppins', sans-serif;
}

.picker-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.picker-controls span {
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
    font-family: 'Poppins', sans-serif;
}

.picker-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    color: #333;
    font-size: 20px;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
}

.picker-btn:hover:not(:disabled) {
    border-color: #002C91;
    color: #002C91;
    background: #f0f3ff;
}

.picker-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    pointer-events: none;
}

.picker-divider {
    margin: 15px 0;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.picker-toggle label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-family: 'Poppins', sans-serif;
}

.picker-toggle input[type="checkbox"] {
    width: 40px;
    height: 20px;
    margin-right: 10px;
    cursor: pointer;
}

.picker-toggle span {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.picker-kids {
    animation: slideDown 0.3s ease-out;
}

.picker-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.picker-confirm-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #002C91 0%, #213B55 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Poppins', sans-serif;
}

.picker-confirm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 43, 127, 0.4);
}

/* Meals Selector */
.meals-selector {
    position: relative;
    cursor: pointer;
}

.meals-display {
    display: flex !important;
    align-items: center;
    gap: 6px;
    width: 100%;
    height: 100%;
    justify-content: space-between;
}

.meals-display #mealsText {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
    color: #333;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

.meal-icon {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
}

.meals-selector.active .dropdown-icon {
    transform: rotate(180deg);
}

/* Meals Picker Dropdown */
.meals-picker {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 20px;
    min-width: 320px;
    z-index: 1000;
    animation: slideDown 0.3s ease-out;
}

.meals-picker.active {
    display: block;
}

.meal-option {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s;
}

.meal-option:last-child {
    border-bottom: none;
}

.meal-option:hover {
    background-color: #f8f9ff;
}

.meal-option span {
    font-size: 14px;
    color: #333;
    font-family: 'Poppins', sans-serif;
}

.meal-option.selected {
    background-color: #f0f3ff;
}

.meal-option.selected span {
    color: #002C91;
    font-weight: 600;
}


/* Mobile responsive */
@media screen and (max-width: 1022px) {
    /* Lightpick calendar */
    .lightpick {
        position: absolute !important;
        overflow: visible !important;
        z-index: 10000 !important;
    }

    .lightpick .lightpick__inner {
        position: relative !important;
        overflow: visible !important;
    }

    .lightpick .lightpick__months {
        grid-template-columns: 1fr !important;
        overflow: visible !important;
    }

    .lightpick .lightpick__month:nth-child(2) {
        display: none !important;
    }

    .lightpick .lightpick__day {
        font-size: 14px !important;
        padding: 8px 4px !important;
    }

    .be-search-title {
        font-size: 32px;
    }

    .be-search-subtitle {
        font-size: 16px;
    }

    .calendar__container {
        flex-direction: column;
        width: 100%;
        max-width: 300px;
        height: auto;
    }

    .calendar__container .inputsDate,
    .calendar__container .inputsNumber,
    .calendar__container .inputsMeals {
        width: 100%;
        height: 42px !important;
        min-height: 42px !important;
        max-height: 42px !important;
        border-bottom: 1px solid #e6e6e6;
        padding: 0 20px;
    }

    .calendar__container .divider {
        display: none;
    }

    .calendar__container .send {
        width: 100%;
        height: auto;
        display: flex;
    }

    .calendar__container .send button {
        width: 100%;
        border-radius: 0 0 8px 8px;
        height: 45px;
    }

    .be-modal-close {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
    }

    .persons-picker,
    .meals-picker {
        position: fixed !important;
        left: 50% !important;
        right: auto !important;
        top: 50% !important;
        bottom: auto !important;
        transform: translate(-50%, -50%) !important;
        min-width: 280px;
        max-width: 90vw;
        z-index: 10000 !important;
        background: white !important;
        border-radius: 12px !important;
        box-shadow: 0 10px 40px rgba(0,0,0,0.2) !important;
        padding: 20px !important;
    }

    .persons-picker.active,
    .meals-picker.active {
        display: block !important;
        transform: translate(-50%, -50%) !important;
    }

    /* Overlay dla dropdownów mobile - use backdrop-filter instead */
    /* When picker is active, dim the background behind it */
    .persons-picker.active,
    .meals-picker.active {
        box-shadow: 0 10px 40px rgba(0,0,0,0.2), 0 0 0 100vmax rgba(0,0,0,0.5) !important;
    }

    /* Ensure picker styles are visible on mobile */
    .persons-picker .picker-header,
    .meals-picker .picker-header {
        margin-bottom: 15px;
    }

    .persons-picker .picker-header h3,
    .meals-picker .picker-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: #333;
        font-family: 'Poppins', sans-serif;
    }

    .persons-picker .picker-row,
    .meals-picker .picker-row {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .persons-picker .picker-btn {
        width: 36px;
        height: 36px;
        border-radius: 50%;
        border: 2px solid #e0e0e0;
        background: white;
        color: #333;
        font-size: 20px;
        font-weight: 400;
        cursor: pointer;
        transition: all 0.2s;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .persons-picker .picker-confirm-btn {
        width: 100%;
        padding: 12px 24px;
        background: linear-gradient(135deg, #002C91 0%, #213B55 100%);
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        cursor: pointer;
        margin-top: 15px;
        font-family: 'Poppins', sans-serif;
    }

    .meals-picker .picker-options {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .meals-picker .meal-option {
        padding: 15px;
        background: white;
        border-bottom: 1px solid #f0f0f0;
        cursor: pointer;
        transition: all 0.2s;
        font-family: 'Poppins', sans-serif;
        font-size: 14px;
        color: #333;
    }

    .meals-picker .meal-option:hover,
    .meals-picker .meal-option.selected {
        background: #f0f3ff;
        color: #002C91;
    }

    .meals-picker .meal-option:first-child {
        border-radius: 8px 8px 0 0;
    }

    .meals-picker .meal-option:last-child {
        border-radius: 0 0 8px 8px;
        border-bottom: none;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}

/* ========================================
   OFFER PAGE - Dropdown Positioning Override
   ======================================== */
/* Force dropdowns to position relative to widget on offer pages (single-offers.php) */
/* This overrides the mobile fixed centering for offer pages only */

.offer-page-widget .persons-picker,
.offer-page-widget .meals-picker {
    position: absolute !important;
    top: calc(100% + 10px) !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translateX(-50%) !important;
    min-width: 320px;
    z-index: 1000 !important;
}

@media screen and (max-width: 1022px) {
    .offer-page-widget .persons-picker,
    .offer-page-widget .meals-picker {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        left: 50% !important;
        right: auto !important;
        bottom: auto !important;
        transform: translateX(-50%) !important;
        min-width: 280px;
        max-width: 90vw;
        z-index: 10000 !important;
    }

    .offer-page-widget .persons-picker.active,
    .offer-page-widget .meals-picker.active {
        display: block !important;
        transform: translateX(-50%) !important;
    }
}

/* ========================================
   APARTMENT PAGE - Vertical Widget Layout
   ======================================== */
/* This applies ONLY to widget inside .columns .col (single-apartaments.php)
   and does NOT affect horizontal layout on other pages */

/* Fix responsive layout - ensure columns shrink proportionally */
.textCenter .outer .columns {
    min-width: 0;
}

.textCenter .col {
    min-width: 0;
    flex-shrink: 1;
}

.textCenter .col:nth-child(1) {
    min-width: 0;
}

.textCenter .col:nth-child(2) {
    min-width: 0;
}

/* Force vertical layout for widget in apartment page columns */
.columns .col .calendar__container {
    flex-direction: column;
    width: 100%;
    max-width: 300px;
    height: auto;
    margin: 50px auto;
}

.columns .col .calendar__container .inputsDate,
.columns .col .calendar__container .inputsNumber,
.columns .col .calendar__container .inputsMeals {
    width: 100%;
    height: 38px !important;
    min-height: 38px !important;
    max-height: 38px !important;
    border-bottom: 1px solid #e6e6e6;
    padding: 0 20px;
}

.columns .col .calendar__container .divider {
    display: none;
}

.columns .col .calendar__container .send {
    width: 100%;
}

.columns .col .calendar__container .send button {
    width: 100%;
    border-radius: 0 0 8px 8px;
    height: 45px;
}

/* Fix persons display alignment - match other inputs */
.columns .col .inputsNumber {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.columns .col .persons-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0;
    flex: 1;
}

.columns .col .persons-display .persons-counts {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.columns .col .persons-display .dropdown-icon {
    flex-shrink: 0;
    margin-left: auto;
}

/* Position pickers for apartment page */
.columns .col .persons-picker,
.columns .col .meals-picker {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 300px;
    max-width: 300px;
    min-width: 300px;
    right: auto;
}

/* ========================================
   OFFER-SPECIFIC STYLES
   ======================================== */

/* Highlighted dates in calendar (offer dates) */
.lightpick__day.is-offer-date {
    background-color: #FFD700 !important;
    color: #000 !important;
    font-weight: bold;
    position: relative;
}

/* Selected range styling - POPRAWIONE dla lepszej widoczności */
.lightpick__day.is-start-date,
.lightpick__day.is-end-date {
    background-color: #002C91 !important;
    color: #fff !important;
    font-weight: bold !important;
    border: 2px solid #213B55 !important;
    position: relative !important;
    z-index: 10 !important;
}

.lightpick__day.is-in-range {
    background-color: rgba(0, 43, 127, 0.3) !important;
    color: #000 !important;
    font-weight: 600 !important;
}

/* Selected range on offer dates - zachowaj żółte tło z granatowym overlay */
.lightpick__day.is-offer-date.is-in-range {
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.7) 0%, rgba(0, 43, 127, 0.3) 100%) !important;
    color: #000 !important;
    font-weight: bold !important;
}

.lightpick__day.is-offer-date.is-start-date,
.lightpick__day.is-offer-date.is-end-date {
    background-color: #002C91 !important;
    color: #fff !important;
    border: 2px solid #213B55 !important;
}

/* Disabled dates (outside offer range) */
.lightpick__day.is-disabled-offer {
    background-color: #f0f0f0 !important;
    color: #ccc !important;
    cursor: not-allowed !important;
    position: relative;
}

.lightpick__day.is-disabled-offer::after {
    content: '?';
    position: absolute;
    top: 2px;
    right: 2px;
    font-size: 10px;
    color: #999;
}

/* Prevent clicking on disabled dates */
.lightpick__day.is-disabled-offer.is-locked {
    pointer-events: auto; /* Allow clicks for alert */
}

/* Hidden meal options (filtered by config) */
.meal-option[style*="display: none"] {
    display: none !important;
}

/* Visual feedback for limit reached */
@keyframes limitReached {
    0%, 100% { background-color: transparent; }
    50% { background-color: #ffebee; }
}

/* ========================================
   AUTO-HIDE MEALS SELECTOR (v2.7)
   ======================================== */
/* Hide meals selector when only 1 rate plan is configured */
.forced-meal-plan {
    display: none !important;
}
