/**
 * Guesty Booking Bridge — Frontend Structural CSS
 * assets/css/gbb-frontend.css
 *
 * STRUCTURAL STYLES ONLY — layout, positioning, grid, z-index, overflow.
 * No brand colors, fonts, or spacing values.
 * Enqueued automatically on all front-end pages via wp_enqueue_scripts.
 *
 * Brand and design customization belongs in Elementor → Site Settings → Custom CSS.
 * See the GBB starter CSS reference for Layer 2 (design) styles.
 */

/* ============================================================
   BOOKING WIDGET — STRUCTURE
   ============================================================ */

.gbb-booking-widget {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.gbb-booking-widget__form {
    display: flex;
    flex-direction: column;
}

.gbb-booking-widget__field {
    display: flex;
    flex-direction: column;
}

.gbb-booking-widget__input {
    width: 100%;
    box-sizing: border-box;
}

.gbb-booking-widget__button--primary,
.gbb-booking-widget__button--secondary {
    width: 100%;
    cursor: pointer;
    display: block;
}

.gbb-widget-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-top: 10px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================================
   MODAL — STRUCTURE
   ============================================================ */

.gbb-modal__backdrop {
    position: fixed;
    inset: 0;
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gbb-modal__container {
    position: relative;
    z-index: 9999;
    width: 100%;
    max-width: 520px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.gbb-modal__close {
    position: absolute;
    top: 16px;
    right: 20px;
    line-height: 1;
    cursor: pointer;
}

.gbb-modal__field {
    display: flex;
    flex-direction: column;
}

.gbb-modal__field-row {
    display: flex;
    gap: 12px;
}

.gbb-modal__field-row .gbb-modal__field {
    flex: 1;
}

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

.gbb-modal__quote-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.gbb-modal__confirmation-icon {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.gbb-modal__confirmation-message {
    font-size: 12px;
}

.gbb-modal__confirmation-summary {
    font-size: 14px;
}

.gbb-modal__payment-schedule {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gbb-border-color);
}

.gbb-modal__payment-schedule-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gbb-text-light);
    margin-bottom: 8px;
}

.gbb-modal__payment-policy-note {
    font-size: 12px;
    color: var(--gbb-text-light);
    margin: 8px 0 0;
    line-height: 1.5;
}

[id^="gbb-state-confirmation-"] .gbb-modal__title {
    text-align: center;
}

/* Trust badges */
.gbb-trust-badges {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.gbb-trust-badges__cards {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
}

.gbb-card-logo {
    width: 40px;
    height: 26px;
    border-radius: 3px;
}

.gbb-trust-badges__message {
    display: flex;
    align-items: center;
    gap: 5px;
    text-transform: uppercase;
}

/* ============================================================
   PET FEE
   ============================================================ */

.gbb-modal__pet-fee-label {
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
}

.gbb-modal__pet-fee-checkbox {
    flex-shrink: 0;
    margin-right: 6px;
    width: 16px;
    height: 16px;
    accent-color: #094151;
    cursor: pointer;
}

.gbb-modal__pet-fee-note {
    margin-left: 0;
}

.gbb-modal__pet-fee-amount {
    font-weight: bold;
    white-space: nowrap;
}

/* ============================================================
   COUPON
   ============================================================ */

.gbb-modal__coupon {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--gbb-border-color);
}

.gbb-modal__coupon-form {
    display: flex;
    gap: 8px;
}

.gbb-modal__coupon-input {
    flex: 1;
    padding: 14px 16px !important;
    color: #094151 !important;
    background: #ffffff;
}

.gbb-modal__coupon-btn {
    background: var(--gbb-primary-color) !important;
    color: #ffffff !important;
    border: solid 1px var(--gbb-primary-color) !important;
    width: 15% !important;
}

.gbb-modal__coupon-error {
    color: var(--gbb-error-color);
    font-size: 12px;
    margin-top: 6px;
}

.gbb-modal__coupon-success {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-top: 8px;
}

.gbb-modal__coupon-remove {
    background: #094151 !important;
    border: 1px solid #094151 !important;
    color: #ffffff !important;
    text-decoration: none;
    padding: 14px 16px !important;
}

/* ============================================================
   INLINE FIELD VALIDATION ERRORS
   ============================================================ */

.gbb-field-error {
    display: none;
    font-size: 1.2em;
    color: #e74c3c;
    margin-top: 4px;
}

/* ============================================================
   GUESTY TOKENIZATION IFRAME CONTAINER
   ============================================================ */

[id^="guesty-tokenization-container-"] {
    min-height: 400px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 16px;
}

/* ============================================================
   REVIEWS — STRUCTURE
   ============================================================ */

.gbb-reviews__header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gbb-reviews__list {
    display: flex;
    flex-direction: column;
}

.gbb-reviews__item-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.gbb-reviews__stars,
.gbb-reviews__item-stars,
.gbb-reviews-summary__stars {
    display: flex;
}

.gbb-reviews-summary {
    display: flex;
    align-items: center;
}

/* ============================================================
   HERO GALLERY — STRUCTURE
   ============================================================ */

.custom-hero-gallery {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
}

.custom-hero-gallery__hero {
    position: relative;
    overflow: hidden;
}

.custom-hero-gallery__hero a {
    display: block;
    position: absolute;
    inset: 0;
}

.custom-hero-gallery__hero img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

.custom-hero-gallery__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    height: 100%;
}

.custom-hero-gallery__thumb {
    position: relative;
    overflow: hidden;
}

.custom-hero-gallery__thumb a {
    display: block;
    position: absolute;
    inset: 0;
}

.custom-hero-gallery__thumb img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover;
    display: block;
}

@media (max-width: 767px) {
    .custom-hero-gallery {
        grid-template-columns: 1fr !important;
        height: auto !important;
    }

    .custom-hero-gallery__hero {
        height: 300px;
    }

    .custom-hero-gallery__grid {
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: 120px 120px !important;
        height: auto !important;
    }

    .custom-hero-gallery__thumb {
        height: 120px !important;
    }
}

/* ============================================================
   LOCATION FILTERS — STRUCTURE
   ============================================================ */

.gbb-filter-field {
    position: relative;
}

.gbb-filter-label {
    position: absolute;
    top: 8px;
    left: 16px;
    z-index: 1;
    pointer-events: none;
}

.gbb-filter-date-input {
    width: 100%;
    box-sizing: border-box;
}

/* ============================================================
   AMENITIES GRID — STRUCTURE
   ============================================================ */

.gbb-amenities-grid {
    display: grid;
    width: 100%;
}

/* ============================================================
   SEARCH BAR — STRUCTURE
   ============================================================ */

.gbb-search-bar {
    width: 100%;
}

.gbb-search-bar__form {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    width: 100%;
}

.gbb-search-bar__field {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex: 1;
    position: relative;
}

.gbb-search-bar__input {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
}

.gbb-search-bar__select {
    width: 100%;
    box-sizing: border-box;
    border: none;
    background: transparent;
}

.gbb-search-bar__button {
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
    align-self: stretch;
}

@media (max-width: 767px) {
    .gbb-search-bar__form {
        flex-direction: column;
    }
}

/* ============================================================
   FILTER SIDEBAR TOGGLE — STRUCTURE
   ============================================================ */

@media (max-width: 767px) {
    #filter-sidebar {
        overflow: hidden;
        max-height: 2000px;
        transition: max-height 0.35s ease, padding 0.35s ease;
    }

    #filter-sidebar.filter-sidebar--collapsed {
        max-height: 0 !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        border-width: 0 !important;
    }

    .jet-select__control {
        -webkit-appearance: none;
        appearance: none;
    }

    .jet-smart-filters-select .jet-select {
        position: relative;
    }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS — STRUCTURAL
   ============================================================ */

@media (max-width: 1024px) {
    .gbb-amenities-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 767px) {
    .gbb-modal__field-row {
        flex-direction: column;
        gap: 0;
    }
}

@media (max-width: 480px) {
    .gbb-modal__container {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%;
        max-height: 90vh;
    }

    .gbb-reviews__date {
        margin-left: 0;
        width: 100%;
    }
}

/* ── Availability filtering ──────────────────────────────────────────────── */
.gbb-listing-unavailable {
    display: none;
}

.gbb-unavailable-badge {
    display: none;
}
