/* ===========================
   HOMEPAGE HERO SEARCH FORM CUSTOMIZATION
   =========================== */

/* Increase the width of the search form container */
.rz-hero .rz-search-form {
    width: 100% !important;
    max-width: 450px !important;
}

/* Hide field labels/headings (Dates, Guests, Region) */
.rz-hero .rz-search-form .rz-search-mod-label,
.rz-hero .rz-search-form .rz-form-label,
.rz-hero .rz-search-form label:not(.rz-checkbox-label) {
    display: none !important;
}

/* Hide the Region/Country field entirely (4th element) */
.rz-hero .rz-search-form .rz-mod:nth-child(4),
.rz-hero .rz-search-form .rz-search-mods>*:nth-child(4),
.rz-hero .rz-search-form [data-type="region"],
.rz-hero .rz-search-form [data-type="country"] {
    display: none !important;
}

/* Increase size of the blue search button */
.rz-hero .rz-search-form .rz-search-submit button,
.rz-hero .rz-search-form button[type="submit"] {
    padding: 16px 32px !important;
    font-size: 1rem !important;
    min-width: 100% !important;
    margin-top: 8px !important;
}

/* Also hide "Edit search form" link if present */
.rz-hero .rz-search-form a[href*="elementor"],
.rz-hero .elementor-edit-area-active a {
    display: none !important;
}

/* ===========================
   BASE RESPONSIVE UTILITIES
   =========================== */
.bg-home {
    overflow-x: hidden;
}

/* ===========================
   MOBILE HEADER (< 768px)
   =========================== */
@media (max-width: 767px) {

    /* Header layout */
    .bg-header .bg-container {
        padding: 0 16px;
    }

    .bg-header-inner {
        flex-wrap: wrap;
    }

    /* Hide desktop nav, show mobile menu button */
    .bg-nav {
        display: none !important;
    }

    .bg-mobile-menu-btn {
        display: flex !important;
    }

    /* Logo sizing */
    .bg-logo-text {
        font-size: 1rem;
    }

    .bg-logo-icon {
        width: 28px;
        height: 28px;
    }

    /* Header actions */
    .bg-header-actions {
        gap: 8px;
    }

    .bg-btn-host {
        display: none !important;
    }

    .bg-login-btn {
        width: 36px;
        height: 36px;
    }
}

/* ===========================
   MOBILE HERO SECTION (< 768px)
   =========================== */
@media (max-width: 767px) {
    .bg-hero {
        min-height: auto;
        padding-top: 60px;
    }

    .bg-hero-bg {
        top: 60px;
        border-radius: 0 0 0 60px;
    }

    .bg-hero-content {
        margin-left: 0;
        margin-right: 0;
        padding: 24px 20px 32px;
        max-width: 100%;
        border-radius: 0 0 40px 0;
    }

    .bg-hero-title {
        font-size: 1.75rem;
        margin-bottom: 16px;
    }

    .bg-hero-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
    }

    /* Search form mobile */
    .bg-search-form-wrapper {
        width: 100%;
    }

    .bg-search-form-wrapper .rz-search-form {
        padding: 12px !important;
    }

    .bg-search-form-wrapper .rz-search-form .rz-search-mods {
        flex-direction: column !important;
        width: 100% !important;
    }

    .bg-search-form-wrapper .rz-search-form .rz-mod {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        padding: 12px 0 !important;
    }

    .bg-search-form-wrapper .rz-search-form .rz-mod:last-child {
        border-bottom: none !important;
    }
}

/* ===========================
   MOBILE SECTIONS (< 768px)
   =========================== */
@media (max-width: 767px) {

    /* Container padding */
    .bg-container {
        padding: 0 16px;
    }

    /* Section padding */
    .bg-section {
        padding: 48px 0;
    }

    /* Section titles */
    .bg-section-title {
        font-size: 1.5rem !important;
        margin-bottom: 12px;
    }

    .bg-section-subtitle {
        font-size: 0.9rem;
        margin-bottom: 24px;
    }

    /* Feature cards grid */
    .bg-features-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .bg-feature-card {
        padding: 20px;
    }

    /* Lifestyle cards grid */
    .bg-lifestyle-grid {
        grid-template-columns: 1fr !important;
        gap: 16px;
    }

    .bg-lifestyle-card {
        height: 250px;
    }

    .bg-lifestyle-title {
        font-size: 1.25rem;
    }

    .bg-lifestyle-text {
        font-size: 0.875rem;
    }

    /* Tech section */
    .bg-tech-content {
        flex-direction: column !important;
        gap: 32px;
    }

    .bg-tech-text {
        order: 1;
    }

    .bg-tech-mockup {
        order: 2;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .bg-tech-text h2 {
        font-size: 1.5rem;
    }

    /* Testimonials slider */
    .bg-testimonials-slider {
        flex-direction: column;
        gap: 24px;
    }

    .bg-testimonial-card {
        width: 100%;
    }

    /* Companies grid */
    .bg-companies-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 16px;
    }

    /* CTA section */
    .bg-cta {
        padding: 48px 0;
    }

    .bg-cta-content h2 {
        font-size: 1.5rem;
    }

    .bg-cta-button {
        width: 100%;
        text-align: center;
    }
}

/* ===========================
   TABLET ADJUSTMENTS (768px - 1024px)
   =========================== */
@media (min-width: 768px) and (max-width: 1024px) {
    .bg-hero-content {
        margin-left: 24px;
        padding: 32px 40px 40px;
        max-width: 500px;
    }

    .bg-features-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bg-lifestyle-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .bg-lifestyle-card:last-child {
        grid-column: span 2;
    }
}

/* ===========================
   ENHANCED HOMEPAGE SPECIFIC
   =========================== */
@media (max-width: 767px) {

    /* Introduction section */
    .bg-home section[style*="padding: 80px"] {
        padding: 48px 0 !important;
    }

    /* What's included grid */
    .bg-home div[style*="grid-template-columns: repeat(auto-fit, minmax(200px"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .bg-home div[style*="grid-template-columns: repeat(auto-fit, minmax(200px"]>div {
        padding: 20px 12px !important;
    }

    /* How it works steps */
    .bg-home div[style*="grid-template-columns: repeat(auto-fit, minmax(250px"] {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    /* Stats grid */
    .bg-home div[style*="grid-template-columns: repeat(4, 1fr)"] {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    .bg-home div[style*="grid-template-columns: repeat(4, 1fr)"]>div>div:first-child {
        font-size: 2rem !important;
    }

    /* For Property Owners section */
    .bg-home section[style*="background: #0a3d62"]>div>div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .bg-home section[style*="background: #0a3d62"] h2 {
        font-size: 1.5rem !important;
    }

    .bg-home section[style*="background: #0a3d62"] img {
        border-radius: 12px !important;
    }

    /* Featured apartments grid */
    .bg-home div[style*="grid-template-columns: repeat(auto-fill, minmax(300px"] {
        grid-template-columns: 1fr !important;
    }

    /* Neighborhoods grid */
    .bg-home div[style*="grid-template-columns: repeat(auto-fit, minmax(280px"] {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .bg-home div[style*="grid-template-columns: repeat(auto-fit, minmax(280px"]>a {
        height: 180px !important;
    }
}

/* ===========================
   INFO PAGES RESPONSIVE
   =========================== */
@media (max-width: 767px) {

    /* Info page hero */
    .info-hero {
        padding: 80px 20px 48px !important;
    }

    .info-hero h1 {
        font-size: 1.75rem !important;
    }

    .info-hero p {
        font-size: 1rem !important;
    }

    /* Info sections */
    .info-section {
        padding: 48px 0 !important;
    }

    .info-container {
        padding: 0 16px !important;
    }

    .info-section-title {
        font-size: 1.5rem !important;
    }

    /* Info cards grid */
    .info-cards-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .info-card {
        padding: 24px 20px !important;
    }

    /* Two column layouts */
    .info-two-col {
        grid-template-columns: 1fr !important;
        gap: 32px !important;
    }

    .info-two-col-image {
        order: -1;
    }

    /* Steps */
    .info-steps {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .info-step {
        padding: 24px !important;
    }

    /* Stats */
    .info-stats {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 24px !important;
    }

    .info-stat-number {
        font-size: 2rem !important;
    }

    /* CTA section */
    .info-cta {
        padding: 48px 20px !important;
    }

    .info-cta h2 {
        font-size: 1.5rem !important;
    }

    .info-cta-btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* Contact form */
    .info-contact-form {
        padding: 24px !important;
    }

    .info-contact-form div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
    }

    /* FAQ accordions */
    .info-faq-header {
        padding: 16px !important;
    }

    .info-faq-content {
        padding: 0 16px 16px !important;
    }
}

/* ===========================
   FOOTER RESPONSIVE
   =========================== */
@media (max-width: 767px) {
    .bg-footer .bg-container {
        padding: 0 16px;
    }

    .bg-footer-columns {
        grid-template-columns: 1fr 1fr !important;
        gap: 32px 16px;
    }

    .bg-footer-column h4 {
        font-size: 0.875rem;
        margin-bottom: 12px;
    }

    .bg-footer-column ul li {
        margin-bottom: 8px;
    }

    .bg-footer-column ul li a {
        font-size: 0.8rem;
    }

    .bg-footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }

    .bg-footer-legal {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .bg-footer-columns {
        grid-template-columns: 1fr !important;
    }
}

/* ===========================
   GLOBAL TOUCH IMPROVEMENTS
   =========================== */
@media (max-width: 1024px) {

    /* Larger touch targets */
    a,
    button {
        min-height: 44px;
        min-width: 44px;
    }

    /* Remove hover effects on touch devices */
    @media (hover: none) {

        .bg-feature-card:hover,
        .bg-lifestyle-card:hover,
        .info-card:hover {
            transform: none;
        }
    }
}

/* ===========================
   SMOOTH SCROLL
   =========================== */
html {
    scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   LISTING COVER — VIDEO TOUR INTEGRATION
   ========================================================================== */

.clr-cover-outer {
    position: relative;
}

.brk-cover, .brk-wall {
    position: relative;
}

/* Video Tile in Cover Grid */
.brk--image.clr-video-tile {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    background-color: #111;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.brk--image.clr-video-tile:hover {
    filter: brightness(1.08);
}

/* Dark gradient scrim on video tile */
.clr-video-tile-scrim {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at center, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.6) 100%);
    transition: background 0.3s ease;
    pointer-events: none;
}

.brk--image.clr-video-tile:hover .clr-video-tile-scrim {
    background: radial-gradient(circle at center, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.45) 100%);
}

/* Red YouTube Play Button Icon */
.clr-video-play-btn {
    position: relative;
    z-index: 2;
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    filter: drop-shadow(0 4px 14px rgba(0,0,0,0.5));
}

.clr-video-play-btn svg {
    display: block;
    width: 58px;
    height: 40px;
}

.brk--image.clr-video-tile:hover .clr-video-play-btn {
    transform: scale(1.15);
}

/* Video Tour Badge */
.clr-video-tile-badge {
    position: absolute;
    bottom: 12px;
    left: 12px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.3px;
    color: #fff;
    background: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.clr-video-tile-badge i {
    color: #ff3333;
    font-size: 10px;
}

/* Video Tour Button in Action Bar */
.brk-gallery-actions .clr-btn-video-tour {
    background: #fff;
    color: #111;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
}

.brk-gallery-actions .clr-btn-video-tour:hover {
    background: #ff0000;
    color: #fff;
}

.brk-gallery-actions .clr-btn-video-tour:hover i {
    color: #fff !important;
}

/* Video Tour Full Cover Theater Player */
.clr-cover-video-player {
    position: absolute;
    inset: 0;
    z-index: 20;
    background: #000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    display: none;
    flex-direction: column;
}

.clr-cover-video-player.is-active {
    display: flex;
    opacity: 1;
    pointer-events: auto;
}

/* Only-video listings (no photos) */
.clr-cover-video-player.is-only-video {
    display: flex;
    position: relative;
    opacity: 1;
    pointer-events: auto;
    min-height: 56vh;
}

/* Back to photos button */
.clr-video-back-btn {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 35;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: all 0.2s ease;
}

.clr-video-back-btn:hover {
    background: #ff0000;
    border-color: #ff0000;
    color: #fff;
    transform: translateY(-1px);
}

/* Frame wrapper */
.clr-cover-video-frame-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 56vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.clr-cover-video-frame-wrap iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    inset: 0;
}

/* Mobile Responsiveness (< 992px) */
@media (max-width: 991.98px) {
    .clr-cover-video-player {
        display: none;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        min-height: 0;
        padding-bottom: 0;
    }
    
    .clr-cover-video-player.is-active {
        display: flex;
        position: absolute;
        inset: 0;
        z-index: 30;
        width: 100%;
        height: 100%;
        opacity: 1;
        pointer-events: auto;
    }

    .clr-cover-video-player.is-only-video {
        display: flex;
        position: relative;
        width: 100%;
        min-height: 0;
        padding-bottom: 56.25%; /* 16:9 ratio */
        height: auto;
        opacity: 1;
        pointer-events: auto;
    }

    .clr-cover-video-frame-wrap {
        min-height: 0;
        height: 100%;
        position: relative;
        flex: 1;
    }

    .clr-cover-video-player.is-only-video .clr-cover-video-frame-wrap {
        position: absolute;
        inset: 0;
        height: 100%;
    }

    .brk-cover .brk--images .brk--image.clr-video-tile {
        padding-bottom: 100%;
    }

    .clr-video-tile-badge {
        font-size: 10px;
        padding: 4px 8px;
        bottom: 6px;
        left: 6px;
    }

    .clr-video-play-btn svg {
        width: 38px;
        height: 26px;
    }

    .clr-video-back-btn {
        top: 10px;
        left: 10px;
        padding: 6px 12px;
        font-size: 11px;
    }

    .brk-gallery-actions.brk--top {
        flex-wrap: wrap;
        gap: 6px;
        z-index: 10;
    }

    .brk-gallery-actions li {
        margin: 0;
    }

    .brk-gallery-actions a {
        font-size: 11px;
        padding: 5px 10px;
    }
}