/* ============================================
   TABLET & IPAD SPECIFIC STYLES
   Target devices: 768px - 1366px
   ============================================ */

/* ----------------------------------------
   Portrait Tablets (768px - 991px)
   Covers: iPad Mini, iPad, iPad Air portrait
   ---------------------------------------- */
@media only screen and (min-width: 768px) and (max-width: 991px) {
    .property-details-banner-spacing {
        margin-top: 17px !important;
    }

    /* Ensure price range dropdown is hidden by default on tablets */
    .price-range-dropdown {
        display: none !important;
    }
    section {
        padding: 70px 0;
        padding-bottom: 0;
    }

    /* Reduce padding between amenity icons for neat design */
    .property-map .property-box .amenities-section {
        gap: 0.35rem !important; /* Reduced from default 0.75rem */
        padding: 6px 0 !important; /* Reduced vertical padding */
    }

    .property-map .property-box .amenities-section i.fas {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Hide mobile menu, show only large screen menu - HIGH SPECIFICITY */
    body .largeNone,
    body .cstrow.largeNone,
    body header .largeNone,
    body .header-2 .largeNone,
    body .header-2 .container-fluid .largeNone {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    body .smallNone,
    body .cstrow.smallNone,
    body header .smallNone,
    body .header-2 .smallNone,
    html[dir="rtl"] body .smallNone,
    html[dir="rtl"] body .cstrow.smallNone,
    html[dir="rtl"] body header .smallNone,
    html[dir="rtl"] body .header-2 .smallNone {
        display: flex !important;
        visibility: visible !important;
    }

    /* Fix header row - ensure single line layout */
    .header-2 .cstrow {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* Move menu closer to logo - LTR only */
    html:not([dir="rtl"]) .header-2 .cstrow .col-md-1.cst-menu {
        margin-left: -220px !important;
        padding-left: 0 !important;
    }

    /* Fix header overflow - make action pills smaller */
    .header-actions {
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
    }

    .header-actions .action-pill {
        height: 40px !important;
        padding: 0 0.8rem !important;
        font-size: 13px !important;
        flex-shrink: 1 !important;
    }

    .header-actions .map-link {
        padding: 0 0.8rem !important;
    }

    .header-actions .nav-menu {
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
    }

    /* Reduce logo column and expand actions area */
    .header-2 .cstrow .col-md-2.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .header-2 .cstrow .col-md-1.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .header-2 .cstrow .col-md-5 {
        flex: 1 1 auto !important;
        width: auto !important;
        display: none !important; /* Hide empty center column to save space */
    }

    .header-2 .cstrow .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    /* Container padding adjustment */
    .header-2 .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow: visible !important;
    }

    /* Reset RTL header padding from ar-sheet.css for tablet symmetry */
    html[dir="rtl"] .header-2 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* RTL specific fixes for Arabic - Same layout as LTR */
    /* Both LTR and RTL: [Logo][Hamburger]---[Buttons] */

    html[dir="rtl"] .header-2 .cstrow {
        display: flex !important;
        flex-direction: row !important; /* Keep same direction as LTR */
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        overflow: visible !important;
    }

    /* Logo - stays on LEFT in RTL (same as LTR) */
    html[dir="rtl"] .header-2 .cstrow .col-md-2.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* Hamburger - next to logo on LEFT, pulled close to logo */
    html[dir="rtl"] .header-2 .cstrow .col-md-1.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
        margin-left: 75px !important; /* Space between logo and hamburger */
        margin-right: -20% !important;
        padding: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        order: 2 !important; /* After logo (order 1) */
    }

    /* Logo column - explicit order */
    html[dir="rtl"] .header-2 .cstrow .col-md-2.cst-menu {
        order: 1 !important;
    }

    html[dir="rtl"] .header-2 .cstrow .col-md-1.cst-menu .menu-toggle,
    html[dir="rtl"] .header-2 #menu-toggle-iconL {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        cursor: pointer !important;
    }

    html[dir="rtl"] .header-2 #menu-toggle-iconL svg {
        display: block !important;
        visibility: visible !important;
        width: 35px !important;
        height: 35px !important;
    }

    /* Empty center - keep hidden like LTR */
    html[dir="rtl"] .header-2 .cstrow .col-md-5 {
        flex: 1 1 auto !important;
        width: auto !important;
        display: none !important;
    }

    /* Buttons - stays on RIGHT in RTL (same as LTR) */
    html[dir="rtl"] .header-2 .cstrow .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
        justify-content: flex-end !important;
    }

    /* Keep button order consistent */
    html[dir="rtl"] .header-actions {
        flex-direction: row !important;
    }

    html[dir="rtl"] .header-actions .nav-menu {
        flex-direction: row !important;
    }

    /* Reset all margins for clean layout */
    html[dir="rtl"] .header-right {
        margin: 0 !important;
    }

    html[dir="rtl"] .header-actions .map-link {
        margin: 0 !important;
    }

    html[dir="rtl"] .header-actions .action-pill {
        margin: 0 !important;
    }

    /* Fix gap below header menu and banner on tablet */
    .clearfix {
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
    }

    main.pb-3 {
        padding-top: 0 !important;
    }

    .banner-section.mt-60,
    section.banner-section.mt-60 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Fix search bar for portrait mode - 2 controls per row layout */
    /* Only apply 2-per-row in portrait orientation, use orientation check for landscape */

    /* Increase container width for tablets */
    .video-search {
        max-width: 98% !important;
        width: 98% !important;
    }

    .container.hero-search-container,
    .hero-search-container {
        max-width: 98% !important;
        width: 98% !important;
    }
}

/* Landscape orientation within portrait tablet range - keep single row */
@media only screen and (min-width: 768px) and (max-width: 991px) and (orientation: landscape) {
    /* Ensure price range dropdown is hidden by default */
    .price-range-dropdown {
        display: none !important;
    }

    /* Increase map height to extend to footer in landscape orientation */
    .property-map #mapleaf {
        height: calc(100vh - 200px) !important; /* Extend map to near footer */
        min-height: 400px !important; /* Minimum height for better visibility */
        max-height: calc(100vh - 160px) !important; /* Maximum height to ensure footer is visible */
    }

    .video-search .row.g-3,
    .video-search form .row {
        flex-wrap: nowrap !important; /* Keep all in one row in landscape */
        gap: 0.5rem !important;
    }

    /* Reset to default Bootstrap widths for landscape */
    .video-search .row > .col-md-4:first-of-type,
    .video-search .row > .col-md-4:nth-of-type(2),
    form.video-search .row > .col-md-4:first-of-type,
    form.video-search .row > .col-md-4:nth-of-type(2) {
        flex: 0 0 auto !important;
        max-width: 33.333333% !important;
        width: auto !important;
        min-width: 0 !important;
        order: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-top: 0 !important;
    }

    .video-search .row > .col-md-3.price-col,
    form.video-search .row > .col-md-3.price-col {
        flex: 0 0 auto !important;
        max-width: 25% !important;
        width: auto !important;
        min-width: 0 !important;
        order: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-top: 0 !important;
        display: flex !important;
    }

    /* LTR: Position search button right next to price slider */
    html:not([dir="rtl"]) .video-search .row > .col-md-1.search-btn-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-1.search-btn-col {
        --bs-gutter-x: 0 !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        order: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 30px !important; /* Add 30px margin between slider and search button */
        margin-top: 0 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
    }

    /* LTR: Ensure price column doesn't have extra right padding */
    html:not([dir="rtl"]) .video-search .row > .col-md-3.price-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-3.price-col {
        padding-right: 0.25rem !important;
    }

    /* RTL Landscape: Ensure proper order - Slider first, Button after slider (left side) */
    /* In RTL, items with higher order appear later (visual left) */
    html[dir="rtl"] .video-search .row > .col-md-4:first-of-type,
    html[dir="rtl"] form.video-search .row > .col-md-4:first-of-type {
        order: 1 !important; /* Neighborhood - first (visual right) */
    }

    html[dir="rtl"] .video-search .row > .col-md-4:nth-of-type(2),
    html[dir="rtl"] form.video-search .row > .col-md-4:nth-of-type(2) {
        order: 2 !important; /* Property Type - second */
    }

    html[dir="rtl"] .video-search .row > .col-md-3.price-col,
    html[dir="rtl"] form.video-search .row > .col-md-3.price-col {
        order: 3 !important; /* Slider - third (before button) */
    }

    html[dir="rtl"] .video-search .row > .col-md-1.search-btn-col,
    html[dir="rtl"] form.video-search .row > .col-md-1.search-btn-col {
        order: 4 !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 30px !important; /* Add 30px margin between slider and search button */
        margin-top: 0 !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-end !important; /* Align to RIGHT - next to slider */
    }

    /* RTL: Ensure price column doesn't have extra left padding */
    html[dir="rtl"] .video-search .row > .col-md-3.price-col,
    html[dir="rtl"] form.video-search .row > .col-md-3.price-col {
        padding-left: 0.25rem !important;
        padding-right: 0 !important;
    }

    /* Property Cards - Fix overlapping Details button in landscape orientation (768px-991px) */
    .property-map .property-box .property-details {
        padding: 1rem 0.75rem !important;
    }

    /* Reduce price font size to prevent overlapping */
    .property-map .property-box .price-floor-section {
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.25rem !important;
    }

    .property-map .property-box .price-floor-section .clr-blue {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
    }

    .property-map .property-box .price-floor-section .clr-blue .cur {
        font-size: 0.85rem !important;
        margin-right: 2px !important;
    }

    .property-map .property-box .price-floor-section .fc-grey {
        font-size: 0.75rem !important;
        margin-top: 0.25rem !important;
    }

    /* Make Details button smaller and adjust positioning */
    .property-map .property-box .property-btn {
        margin-top: 0.5rem !important;
        justify-content: flex-end !important;
        display: flex !important;
        position: relative !important;
    }

    .property-map .property-box .property-btn .btn,
    .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2,
    .details-btn {
        min-height: 36px !important;
        padding: 0.45rem 0.9rem !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        width: auto !important;
        max-width: 45% !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .property-map .property-box .property-btn .btn::after,
    .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2::after,
    .details-btn::after {
        font-size: 14px !important;
        margin-left: 0.35rem !important;
    }

    /* RTL Support for Details button */
    [dir="rtl"] .property-map .property-box .property-btn .btn::after,
    [dir="rtl"] .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2::after,
    [dir="rtl"] .details-btn::after {
        margin-left: 0 !important;
        margin-right: 0.35rem !important;
    }

    /* Adjust property name and location text sizes */
    .property-map .property-box .property-details .text-primary strong {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }

    .property-map .property-box .property-details .text-dark {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }

    /* Adjust amenities section - reduce padding between icons */
    .property-map .property-box .amenities-section {
        margin-bottom: 0.5rem !important;
        padding: 6px 0 !important; /* Reduced vertical padding */
        gap: 0.35rem !important; /* Reduced gap between icons from default 0.75rem */
    }

    .property-map .property-box .amenities-section i.fas {
        font-size: 12px !important;
        margin: 0 !important; /* Remove all margins, use gap instead */
        padding: 0 !important;
    }

    /* Ensure proper spacing between price and button */
    .property-map .property-box .property-details .plist {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    /* Apartment Listing Cards - Portrait Tablet Landscape Fixes (768px-991px) */
    /* Reduce image container width to give more space for content */
    .apartment-image-container {
        flex: 0 0 240px !important;
        min-width: 240px !important;
    }

    .apartment-listing-img {
        min-height: 180px !important;
    }

    /* Increase padding in info section for better spacing */
    .apartment-info-section {
        padding: 0.875rem 0.75rem !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    /* Reduce price font size slightly */
    .apartment-price-highlight .price-value {
        font-size: 18px !important;
    }

    .apartment-price-highlight .price-value strong {
        font-size: 22px !important;
    }

    .apartment-price-highlight .price-value .cur {
        font-size: 13px !important;
    }

    /* Reduce spacing in details grid */
    .apartment-details-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.4rem !important;
        margin-bottom: 0.5rem !important;
    }

    /* Reduce padding and font sizes in detail items */
    .apartment-detail-item {
        padding: 0.45rem !important;
        gap: 0.35rem !important;
    }

    .detail-icon-wrapper {
        width: 30px !important;
        height: 30px !important;
        flex-shrink: 0 !important;
    }

    .detail-icon-wrapper i {
        font-size: 13px !important;
    }

    .apartment-detail-item .detail-label {
        font-size: 13px !important;
        line-height: 1.2 !important;
    }

    .apartment-detail-item .detail-sublabel {
        font-size: 9px !important;
        line-height: 1.2 !important;
    }

    .detail-content {
        min-width: 0 !important;
        overflow: visible !important;
    }

    /* Ensure action wrapper has proper spacing */
    .apartment-action-wrapper {
        margin-top: auto !important;
        padding-top: 0.5rem !important;
        padding-bottom: 0 !important;
        border-top: 1px solid #e5e7eb !important;
        display: flex !important;
        justify-content: flex-end !important;
    }

    .apartment-action-wrapper .details-btn {
        min-width: 120px !important;
        padding: 0.45rem 0.875rem !important;
        font-size: 12px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Ensure card content doesn't overflow */
    .apartment-card-content {
        overflow: visible !important;
        min-height: 180px !important;
    }

    .apartment-listing-card {
        overflow: visible !important;
    }

    /* Ensure header info has proper spacing */
    .apartment-header-info {
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.35rem !important;
    }
}

/* Portrait orientation - Single row with compact controls */
@media only screen and (min-width: 768px) and (max-width: 991px) and (orientation: portrait) {

    /* Single row layout - all controls in one line */
    .video-search .row.g-3,
    .video-search form .row {
        padding: 0.5rem !important;
        gap: 0.25rem !important;
        --bs-gutter-x: 0.25rem !important;
        --bs-gutter-y: 0 !important;
        display: flex !important;
        flex-wrap: nowrap !important; /* Keep all in single row */
        flex-direction: row !important;
        align-items: flex-end !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
    }

    /* Reset Bootstrap column margins */
    .video-search .row > [class*="col-md-"],
    .video-search .row > [class*="col-"] {
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-top: 0 !important;
        padding-left: 0.15rem !important;
        padding-right: 0.15rem !important;
    }

    /* Neighborhood dropdown - compact width */
    .video-search .row > .col-md-4:first-of-type,
    form.video-search .row > .col-md-4:first-of-type {
        flex: 1 1 28% !important;
        max-width: 28% !important;
        min-width: 0 !important;
        order: 1 !important;
    }

    /* Property Type dropdown - compact width */
    .video-search .row > .col-md-4:nth-of-type(2),
    form.video-search .row > .col-md-4:nth-of-type(2) {
        flex: 1 1 28% !important;
        max-width: 28% !important;
        min-width: 0 !important;
        order: 2 !important;
    }

    /* Price Range slider - compact width */
    .video-search .row > .col-md-3.price-col,
    form.video-search .row > .col-md-3.price-col {
        flex: 1 1 32% !important;
        max-width: 32% !important;
        min-width: 0 !important;
        order: 3 !important;
        display: flex !important;
    }

    /* Search Button - auto width, next to slider */
    .video-search .row > .col-md-1.search-btn-col,
    form.video-search .row > .col-md-1.search-btn-col {
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        order: 4 !important;
        display: flex !important;
        align-items: flex-end !important;
        padding-left: 0 !important;
        padding-right: 0.15rem !important;
    }

    /* LTR: Button next to slider */
    html:not([dir="rtl"]) .video-search .row > .col-md-1.search-btn-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-1.search-btn-col {
        justify-content: flex-start !important;
        margin-left: 30px !important; /* Add 30px margin between slider and search button */
    }

    /* RTL: Button next to slider */
    html[dir="rtl"] .video-search .row > .col-md-1.search-btn-col,
    html[dir="rtl"] form.video-search .row > .col-md-1.search-btn-col {
        justify-content: flex-end !important;
        margin-right: 30px !important; /* Add 30px margin between slider and search button */
    }

    /* Compact label font sizes */
    .video-search .form-label {
        font-size: 0.65rem !important;
        font-weight: 600 !important;
        margin-bottom: 0.15rem !important;
        line-height: 1.1 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Compact form select height - reduced from 36px to 32px */
    .video-search .form-select.sm-ht,
    .video-search .select2-container--default .select2-selection--single {
        height: 32px !important;
        padding: 4px 8px !important;
        font-size: 0.7rem !important;
        border-radius: 8px !important;
    }

    .video-search .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 32px !important;
        font-size: 0.7rem !important;
        padding-left: 8px !important;
        padding-right: 20px !important;
    }

    html[dir="rtl"] .video-search .select2-container--default .select2-selection--single .select2-selection__rendered {
        padding-right: 8px !important;
        padding-left: 20px !important;
    }

    .video-search .select2-container--default .select2-selection--single .select2-selection__arrow {
        top: 6px !important;
        right: 4px !important;
        width: 14px !important;
        height: 14px !important;
    }

    html[dir="rtl"] .video-search .select2-container--default .select2-selection--single .select2-selection__arrow {
        left: 4px !important;
        right: auto !important;
    }

    /* Compact search button - reduced to match input height */
    .video-search .btn-search-desktop {
        height: 32px !important;
        width: 32px !important;
        min-width: 32px !important;
        padding: 0 !important;
        border-radius: 8px !important;
        font-size: 0.75rem !important;
        margin: 0 !important;
    }

    .video-search .btn-search-desktop i {
        font-size: 0.75rem !important;
    }

    /* Compact price slider */
    .video-search .price-input-shell {
        gap: 2px !important;
    }

    .video-search .price-values-row {
        font-size: 0.6rem !important;
        gap: 0.25rem !important;
    }

    .video-search .price-range-display {
        font-size: 0.6rem !important;
    }

    .video-search .price-range-display .cur {
        font-size: 0.55rem !important;
    }

    /* Reduce hero search container padding */
    .hero-search-container {
        padding-left: 0.25rem !important;
        padding-right: 0.25rem !important;
    }

    /* Property cards - Display 2 per row in portrait mode */
    .property-2.row.column-space .col-xl-4,
    .property-2.row.column-space .col-md-4 {
        flex: 0 0 50% !important;
        max-width: 50% !important;
        width: 50% !important;
    }

    /* Replicate mobile behavior for Properties page - Portrait tablet mode */
    /* Property section adjustments to match mobile */
    .property-section {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Map section: Map icon first, then properties below */
    .property-map .col-md-7.map-section {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        order: 1 !important; /* Map section appears first */
        margin-bottom: 20px !important;
        position: relative !important;
    }
    
    /* Hide the actual map container by default - show only when .show-map is added */
    .property-map .col-md-7.map-section:not(.show-map) #mapleaf {
        display: none !important;
        height: 0px !important;
    }
    
    .property-map .col-md-7.map-section.show-map #mapleaf {
        display: block !important;
    }

    .property-map .filter-panel {
        margin-top: 95px;
        margin-bottom: 0px;
        border-bottom: none;
    }
    
    
    
   
    
    .property-map .map-section .map-icon:hover {
        background: #f8f9fa !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }
    
    .property-map .map-section .map-icon i {
        font-size: 20px !important;
        color: #0d6efd !important;
        padding: 8px !important;
        background: rgba(13, 110, 253, 0.1) !important;
        border-radius: 6px !important;
    }
    
    /* RTL support for map icon */
    [dir="rtl"] .property-map .map-section .map-icon,
    html[dir="rtl"] .property-map .map-section .map-icon {
        text-align: left !important;
    }

    /* Properties always stay at full width - appear below map icon */
    .property-map .col-md-5.prp {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        width: 100% !important;
        order: 2 !important; /* Properties appear below map icon */
    }

    /* Ensure parent row uses flex-direction column for vertical stacking */
    .property-map.row {
        flex-direction: column !important;
    }

    #mapleaf {
        height: 0px !important;
        overflow: hidden !important;
        transition: height 0.3s ease-in-out !important;
    }
    
    .property-map .map-section.show-map #mapleaf {
        height: 400px !important;
        overflow: visible !important;
        margin-top: 10px !important;
    }

    /* EXCLUSIVE RULE: Show mobile filter actions ONLY on tablet portrait (768px-991px portrait) */
    /* This rule is scoped to this media query only - won't affect mobile (<768px) or desktop (≥992px) */
    .property-map .filter-panel .mobile-filter-actions,
    .property-section .filter-panel .mobile-filter-actions,
    .filter-panel .mobile-filter-actions,
    .mobile-filter-actions {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        gap: 0.5rem !important;
        justify-content: flex-end !important;
        align-items: center !important;
        padding: 0 0.75rem !important;
        margin-top: 0 !important;
        margin-bottom: 0 !important;
    }

    /* Hide regular filter list by default, show as side panel when active */
    .filter-panel .grid-list-filter {
        position: fixed !important;
        top: 27px !important;
        left: -100% !important;
        width: 80% !important;
        max-width: 320px !important;
        height: 100vh !important;
        background: #fff !important;
        z-index: 1001 !important;
        overflow-y: auto !important;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15) !important;
        transition: left 0.3s ease !important;
        padding: 1.5rem 1rem !important;
        display: block !important;
    }

    /* Show filter list when active */
    .filter-panel .grid-list-filter.active {
        left: 0 !important;
    }

    /* Overlay styles */
    .filter-panel .filter-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        transition: opacity 0.3s ease;
    }

    /* Show overlay when active */
    .filter-panel .filter-overlay.active {
        display: block !important;
    }

    /* Sticky Filter Bar for Tablet Portrait */
    .filter-panel .top-panel {
        position: sticky !important;
        top: 60px !important;
        z-index: 998 !important;
        background: #ffffff !important;
        padding: 0.4rem 0 !important;
        margin-bottom: 0.25rem !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    }

    /* Map and Filter icon styling for tablet portrait */
    .mobile-filter-actions .map-icon,
    .mobile-filter-actions .filter-icon {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        cursor: pointer !important;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1) !important;
        background: #ffffff !important;
        border-radius: 8px !important;
        border: 1px solid rgba(0, 0, 0, 0.05) !important;
        transition: all 0.2s ease !important;
        margin: 0 !important;
        position: relative !important;
        flex-shrink: 0 !important;
    }

    .mobile-filter-actions .map-icon:hover,
    .mobile-filter-actions .map-icon:active,
    .mobile-filter-actions .filter-icon:hover,
    .mobile-filter-actions .filter-icon:active {
        background: #f8f9fa !important;
        box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15) !important;
        transform: translateY(-1px) !important;
    }

    .mobile-filter-actions .map-icon i,
    .mobile-filter-actions .filter-icon i {
        font-size: 16px !important;
        color: #0d6efd !important;
    }

    /* Properties display in single column (like mobile) on tablet portrait */
    .property-map .property-2.row.column-sm .col-md-12 {
        display: block !important;
    }

    .property-map .property-2.row.column-sm .col-md-12 > .property-box {
        width: 100% !important;
        max-width: 100% !important;
        margin: auto;
    }

    /* Mobile design for Details buttons on Properties page */
    .property-map .property-box .property-btn {
        position: relative !important;
        margin-top: 0.75rem !important;
        justify-content: flex-end !important;
        display: flex !important;
    }

    .property-map .property-box .property-btn .btn,
    .details-btn {
        min-height: 44px !important;
        padding: 0.6rem 1.2rem !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        border-radius: 12px !important;
        background: linear-gradient(135deg, #0d6efd 0%, #0a58ca 100%) !important;
        color: #ffffff !important;
        border: none !important;
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25) !important;
        display: inline-flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: auto !important;
        max-width: 50% !important;
        white-space: nowrap !important;
    }

    .property-map .property-box .property-btn .btn::after,
    .details-btn::after {
        content: '→';
        font-size: 18px;
        display: inline-block;
        margin-left: 0.5rem;
    }

    .property-map .property-box .property-btn .btn:hover,
    .property-map .property-box .property-btn .btn:active,
    .details-btn:hover,
    .details-btn:active {
        box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25) !important;
    }

    /* RTL Support */
    [dir="rtl"] .property-map .property-box .property-btn .btn::after,
    [dir="rtl"] .details-btn::after {
        content: '←';
        margin-left: 0;
        margin-right: 0.5rem;
    }

    /* Property Details Page - Fix title/location/buttons row layout */
    /* Ensure single-title container maintains proper layout and contains all children */
    .single-property-section .single-title {
        overflow: visible !important;
        padding: 20px 30px 30px 30px !important; /* Reduced bottom padding */
        position: relative !important;
        box-sizing: border-box !important;
        min-height: auto !important;
    }

    /* Make left-single container position relative for absolute positioning of buttons */
    .single-property-section .single-title .left-single {
        position: relative !important;
        display: block !important;
        width: 100% !important;
        overflow: visible !important;
        box-sizing: border-box !important;
        padding: 0 !important; /* Remove any padding that might push content out */
        margin: 0 !important;
    }

    /* Make title/location container a flex row with proper spacing */
    .single-property-section .single-title .left-single > .d-flex.flex-column.flex-md-row {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        gap: 0.5rem !important;
        width: 100% !important;
        margin-bottom: 0 !important;
        padding-right: 240px !important; /* Space for buttons on the right */
        position: relative !important;
    }

    /* Title - allow it to shrink to prevent overlap */
    .single-property-section .single-title .left-single h2 {
        flex: 0 1 auto !important;
        margin: 0 !important;
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
        min-width: 0 !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        white-space: nowrap !important;
    }

    .single-property-section .single-title .left-single h2 label {
        font-size: 1.1rem !important;
        line-height: 1.3 !important;
    }

    /* Location text - allow it to shrink */
    .single-property-section .single-title .left-single .property-location-text {
        flex: 0 1 auto !important;
        margin: 0 !important;
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
        min-width: 0 !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Position buttons absolutely to appear on same row as title/location */
    .single-property-section .left-single .share-buttons {
        position: absolute !important;
        right: 0 !important;
        top: 0 !important;
        display: flex !important;
        flex-direction: row !important; /* Buttons in a horizontal row */
        flex-wrap: nowrap !important;
        gap: 0.35rem !important;
        margin: 0 !important;
        align-items: center !important;
        z-index: 1 !important;
        width: auto !important;
    }

    .single-property-section .left-single .share-buttons > div {
        flex: 0 0 auto !important;
        display: inline-block !important;
    }

    /* Reduce button width and spacing */
    .single-property-section .left-single .share-buttons .btn {
        padding: 0.35rem 0.6rem !important;
        font-size: 0.8rem !important;
        min-width: auto !important;
        width: auto !important;
        white-space: nowrap !important;
        line-height: 1.2 !important;
        height: auto !important;
    }

    .single-property-section .left-single .share-buttons .btn i,
    .single-property-section .left-single .share-buttons .btn svg,
    .single-property-section .left-single .share-buttons .btn [data-feather] {
        width: 11px !important;
        height: 11px !important;
        margin-right: 0.25rem !important;
        vertical-align: middle !important;
    }

    .single-property-section .left-single .share-buttons .btn.ms-md-2,
    .single-property-section .left-single .share-buttons .btn.ms-1 {
        margin-left: 0 !important;
    }

    /* Price paragraph - reduce margins and ensure proper positioning */
    .single-property-section .left-single .property-price-desktop {
        margin: 0.3rem 0 0.2rem 0 !important; /* Reduced bottom margin */
        padding: 0 !important;
        padding-right: 52% !important; /* Space for amenities on the right */
        width: 100% !important;
        display: block !important;
        position: relative !important;
        box-sizing: border-box !important;
        line-height: 1.5 !important; /* Consistent line height for alignment */
    }

    /* Position amenities to align horizontally with price on the right */
    .single-property-section .left-single > ul.d-none.d-md-flex {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 0.2rem !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        /* Position absolutely to align horizontally with price paragraph */
        position: absolute !important;
        right: 0 !important;
        top: 3.8rem !important; /* Align vertically with price paragraph center */
        left: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-width: 48% !important;
        z-index: 1 !important;
        justify-content: flex-end !important;
        align-items: center !important;
        box-sizing: border-box !important;
        overflow: visible !important;
        height: auto !important;
        min-height: 0 !important;
    }

    /* Reduce space below price and amenities - adjust spacing before tabs */
    .single-property-section .description-section {
        margin-top: 0.5rem !important; /* Reduced from default */
        padding-top: 0 !important;
    }

    .single-property-section .description-section .nav-tabs,
    .single-property-section .description-section .line-tab {
        margin-top: 0.3rem !important; /* Reduced spacing */
        margin-bottom: 0.5rem !important;
    }

    .single-property-section .left-single > ul.d-none.d-md-flex li {
        margin: 0 !important;
        padding: 0 !important;
        flex: 0 0 auto !important;
    }

    .single-property-section .left-single > ul.d-none.d-md-flex li i {
        font-size: 13px !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* RTL Support for property details */
    [dir="rtl"] .single-property-section .single-title .left-single > .d-flex.flex-column.flex-md-row {
        padding-right: 0 !important;
        padding-left: 240px !important;
    }

    [dir="rtl"] .single-property-section .left-single .share-buttons {
        right: auto !important;
        left: 0 !important;
    }

    [dir="rtl"] .single-property-section .single-title .left-single h2 {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    [dir="rtl"] .single-property-section .left-single .share-buttons .btn i,
    [dir="rtl"] .single-property-section .left-single .share-buttons .btn svg,
    [dir="rtl"] .single-property-section .left-single .share-buttons .btn [data-feather] {
        margin-right: 0 !important;
        margin-left: 0.25rem !important;
    }

    /* RTL: Position amenities under buttons on the left */
    [dir="rtl"] .single-property-section .left-single > ul.d-none.d-md-flex {
        right: auto !important;
        left: 0 !important;
        justify-content: flex-start !important; /* Align to the left in RTL */
    }

    /* Profile Layout - Portrait Mode Fixes */
    /* Ensure user dashboard section has proper top margin to prevent overlap with header */
    .user-dashboard.small-section.mt-100 {
        margin-top: 85px !important;
        padding-top: 0 !important;
    }

    /* Fix sidebar menu toggle button - position it properly to prevent overlap with user profile */
    .dashboard-list {
        position: relative !important;
        margin-top: 1rem !important;
    }

    .dashboard-list .menu-toggle {
        position: relative !important;
        display: block !important;
        margin-bottom: 1rem !important;
        margin-left: 0 !important;
        margin-right: auto !important;
        top: 17px !important;
    }

    html[dir="rtl"] .dashboard-list .menu-toggle {
        margin-left: auto !important;
        margin-right: 0 !important;
    }

    /* Hide user profile section on tablet portrait mode */
    .sidebar-user .user-profile {
        display: none !important;
    }

    /* Ensure sidebar user profile section has proper positioning and padding */
    .sidebar-user {
        position: relative !important;
        padding-top: 0 !important;
    }

    /* Sticky positioning for sidebar on tablet portrait mode */
    .sticky-cls {
        position: sticky !important;
        z-index: 1 !important;
        top: 0px !important;
    }

    /* Remove padding-top from dashboard list on tablet portrait mode */
    .user-dashboard.small-section .sidebar-user .dashboard-list {
        padding-top: 0 !important;
    }

    /* Header buttons spacing - restore to normal size for tablet portrait mode */
    header.header-2 .header-actions,
    body .header-2 .header-actions {
        gap: 0.6rem !important;
        flex-wrap: nowrap !important;
    }

    header.header-2 .header-actions .action-pill,
    body .header-2 .header-actions .action-pill,
    .header-2 .header-actions li.action-pill {
        height: 48px !important;
        padding: 0 1.4rem !important;
        font-size: 14px !important;
        flex-shrink: 1 !important;
        line-height: 1.5 !important;
        min-width: auto !important;
        gap: 0.6rem !important;
    }

    header.header-2 .header-actions .map-link,
    body .header-2 .header-actions .map-link,
    .header-2 .header-actions a.map-link.action-pill {
        padding: 0 1.4rem !important;
        font-size: 14px !important;
        height: 48px !important;
        line-height: 1.5 !important;
        min-width: auto !important;
    }

    header.header-2 .header-actions .nav-menu,
    body .header-2 .header-actions .nav-menu,
    .header-2 .header-actions .header-right .nav-menu {
        gap: 0.6rem !important;
        flex-wrap: nowrap !important;
    }

    /* Restore dropdown button text size to normal */
    header.header-2 .header-actions .action-pill > a,
    header.header-2 .header-actions .dropdown > a,
    body .header-2 .header-actions .action-pill > a,
    body .header-2 .header-actions .dropdown > a,
    .header-2 .header-actions li.action-pill > a,
    .header-2 .header-actions li.dropdown.action-pill > a {
        font-size: 14px !important;
        padding: 0 !important;
        white-space: nowrap !important;
        overflow: visible !important;
        text-overflow: clip !important;
        max-width: none !important;
        gap: 0.6rem !important;
        line-height: 1.5 !important;
    }

    header.header-2 .header-actions .action-pill.gap-2,
    header.header-2 .header-actions .dropdown > a.gap-2,
    body .header-2 .header-actions .action-pill.gap-2,
    body .header-2 .header-actions .dropdown > a.gap-2 {
        gap: 0.5rem !important;
    }

    /* Restore icon sizes in buttons to normal */
    header.header-2 .header-actions .action-pill .langIcon,
    header.header-2 .header-actions .action-pill .fas,
    header.header-2 .header-actions .action-pill i,
    header.header-2 .header-actions .action-pill .fa-caret-down,
    header.header-2 .header-actions .action-pill span.fas,
    body .header-2 .header-actions .action-pill .langIcon,
    body .header-2 .header-actions .action-pill .fas,
    body .header-2 .header-actions .action-pill i,
    body .header-2 .header-actions .action-pill .fa-caret-down,
    body .header-2 .header-actions .action-pill span.fas {
        font-size: inherit !important;
        width: auto !important;
        height: auto !important;
    }

    /* Restore text sizes inside buttons to normal */
    header.header-2 .header-actions .action-pill span:not(.fas),
    header.header-2 .header-actions .map-link span,
    body .header-2 .header-actions .action-pill span:not(.fas),
    body .header-2 .header-actions .map-link span {
        font-size: 14px !important;
        line-height: 1.5 !important;
    }

    /* Invoice Page - Action Buttons Fix for Tablet Portrait */
    /* Arrange buttons in one row and prevent overlap with sidebar */
    .invoice-page-bg .action-buttons-wrapper {
        display: flex !important;
        justify-content: flex-end !important;
        margin-bottom: 1rem !important;
        width: 100% !important;
        position: relative !important;
        z-index: 1 !important;
        /* Add left padding to prevent overlap when sidebar menu is open */
        /* Sidebar is 300px wide, so we use 280px to provide safe spacing */
        padding-left: 280px !important;
        box-sizing: border-box !important;
    }

    .invoice-page-bg .action-group {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
        width: auto !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        flex-shrink: 0 !important;
    }

    .invoice-page-bg .action-group .btn {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;
        white-space: nowrap !important;
        padding: 0.5rem 0.875rem !important;
        font-size: 0.875rem !important;
    }

    /* Ensure container has proper spacing */
    .invoice-detail-wrapper {
        position: relative !important;
        z-index: 0 !important;
    }

    /* RTL Support for Invoice Buttons */
    [dir="rtl"] .invoice-page-bg .action-buttons-wrapper {
        justify-content: flex-start !important;
        padding-left: 0 !important;
        padding-right: 280px !important;
    }

    [dir="rtl"] .invoice-page-bg .action-group {
        margin-left: 0 !important;
        margin-right: auto !important;
    }
}

/* ----------------------------------------
   Landscape Tablets (992px - 1199px)
   Covers: iPad landscape, iPad Air landscape
   ---------------------------------------- */
@media only screen and (min-width: 992px) and (max-width: 1199px) {
    .property-details-banner-spacing {
        margin-top: 7px !important;
    }
    .map-icon.d-lg-block.d-none {
        display: none !important;
    }
    section {
        padding: 80px 0;
        padding-bottom: 0;
    }
    

    /* Ensure price range dropdown is hidden by default on tablets */
    .price-range-dropdown {
        display: none !important;
    }

    /* Increase map height to extend to footer on landscape tablets */
    .property-map #mapleaf {
        height: calc(100vh - 220px) !important; /* Extend map to near footer */
        min-height: 450px !important; /* Minimum height for better visibility */
        max-height: calc(100vh - 180px) !important; /* Maximum height to ensure footer is visible */
    }

    /* Reduce padding between amenity icons for neat design */
    .property-map .property-box .amenities-section {
        gap: 0.35rem !important; /* Reduced from default 0.75rem */
        padding: 6px 0 !important; /* Reduced vertical padding */
    }

    .property-map .property-box .amenities-section i.fas {
        margin: 0 !important;
        padding: 0 !important;
    }
    /* Increase container width for tablets */
    .video-search {
        max-width: 98% !important;
        width: 98% !important;
    }

    .container.hero-search-container,
    .hero-search-container {
        max-width: 98% !important;
        width: 98% !important;
    }

    /* Fix gap below header menu and banner on tablet */
    .clearfix {
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
    }

    main.pb-3 {
        padding-top: 0 !important;
    }

    .banner-section.mt-60,
    section.banner-section.mt-60 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Landscape mode: Keep all controls in single row, prevent button wrapping */
    .video-search .row.g-3,
    .video-search form .row {
        flex-wrap: nowrap !important; /* Prevent wrapping in landscape */
        gap: 0.5rem !important;
    }

    /* Reset all columns to default Bootstrap widths in landscape */
    .video-search .row > .col-md-4:first-of-type,
    .video-search .row > .col-md-4:nth-of-type(2),
    form.video-search .row > .col-md-4:first-of-type,
    form.video-search .row > .col-md-4:nth-of-type(2) {
        flex: 0 0 auto !important;
        max-width: 33.333333% !important;
        width: auto !important;
        min-width: 0 !important;
        order: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .video-search .row > .col-md-3.price-col,
    form.video-search .row > .col-md-3.price-col {
        flex: 0 0 auto !important;
        max-width: 25% !important;
        width: auto !important;
        min-width: 0 !important;
        order: 0 !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
        margin-top: 0 !important;
        display: flex !important;
    }

    /* LTR: Position search button right next to price slider */
    html:not([dir="rtl"]) .video-search .row > .col-md-1.search-btn-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-1.search-btn-col {
        --bs-gutter-x: 0 !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        order: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 30px !important; /* Add 30px margin between slider and search button */
        margin-top: 0 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-start !important;
    }

    /* LTR: Ensure price column doesn't have extra right padding */
    html:not([dir="rtl"]) .video-search .row > .col-md-3.price-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-3.price-col {
        padding-right: 0.25rem !important;
    }

    /* RTL Landscape: Ensure proper order - Slider first, Button after slider (left side) */
    html[dir="rtl"] .video-search .row > .col-md-4:first-of-type,
    html[dir="rtl"] form.video-search .row > .col-md-4:first-of-type {
        order: 1 !important; /* Neighborhood - first (visual right) */
    }

    html[dir="rtl"] .video-search .row > .col-md-4:nth-of-type(2),
    html[dir="rtl"] form.video-search .row > .col-md-4:nth-of-type(2) {
        order: 2 !important; /* Property Type - second */
    }

    html[dir="rtl"] .video-search .row > .col-md-3.price-col,
    html[dir="rtl"] form.video-search .row > .col-md-3.price-col {
        order: 3 !important; /* Slider - third (before button) */
    }

    html[dir="rtl"] .video-search .row > .col-md-1.search-btn-col,
    html[dir="rtl"] form.video-search .row > .col-md-1.search-btn-col {
        order: 4 !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
        min-width: auto !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 30px !important; /* Add 30px margin between slider and search button */
        margin-top: 0 !important;
        flex-grow: 0 !important;
        flex-shrink: 0 !important;
        display: flex !important;
        align-items: flex-end !important;
        justify-content: flex-end !important; /* Align to RIGHT - next to slider */
    }

    /* RTL: Ensure price column doesn't have extra left padding */
    html[dir="rtl"] .video-search .row > .col-md-3.price-col,
    html[dir="rtl"] form.video-search .row > .col-md-3.price-col {
        padding-left: 0.25rem !important;
        padding-right: 0 !important;
    }

    /* Property Cards - Fix overlapping Details button in landscape mode */
    .property-map .property-box .property-details {
        padding: 1rem 0.75rem !important;
    }

    /* Reduce price font size to prevent overlapping */
    .property-map .property-box .price-floor-section {
        margin-bottom: 0.5rem !important;
        padding-bottom: 0.25rem !important;
    }

    .property-map .property-box .price-floor-section .clr-blue {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
        font-weight: 600 !important;
    }

    .property-map .property-box .price-floor-section .clr-blue .cur {
        font-size: 0.85rem !important;
        margin-right: 2px !important;
    }

    .property-map .property-box .price-floor-section .fc-grey {
        font-size: 0.75rem !important;
        margin-top: 0.25rem !important;
    }

    /* Make Details button smaller and adjust positioning */
    .property-map .property-box .property-btn {
        margin-top: 0.5rem !important;
        justify-content: flex-end !important;
        display: flex !important;
        position: relative !important;
    }

    .property-map .property-box .property-btn .btn,
    .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2,
    .details-btn {
        min-height: 36px !important;
        padding: 0.45rem 0.9rem !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        border-radius: 10px !important;
        width: auto !important;
        max-width: 45% !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .property-map .property-box .property-btn .btn::after,
    .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2::after,
    .details-btn::after {
        font-size: 14px !important;
        margin-left: 0.35rem !important;
    }

    /* RTL Support for Details button */
    [dir="rtl"] .property-map .property-box .property-btn .btn::after,
    [dir="rtl"] .property-map .property-box .property-btn .btn.btn-dashed.btn-pill.color-2::after,
    [dir="rtl"] .details-btn::after {
        margin-left: 0 !important;
        margin-right: 0.35rem !important;
    }

    /* Adjust property name and location text sizes */
    .property-map .property-box .property-details .text-primary strong {
        font-size: 0.95rem !important;
        line-height: 1.3 !important;
    }

    .property-map .property-box .property-details .text-dark {
        font-size: 0.8rem !important;
        line-height: 1.3 !important;
        margin-bottom: 0.5rem !important;
    }

    /* Adjust amenities section - reduce padding between icons */
    .property-map .property-box .amenities-section {
        margin-bottom: 0.5rem !important;
        padding: 6px 0 !important; /* Reduced vertical padding */
        gap: 0.35rem !important; /* Reduced gap between icons from default 0.75rem */
    }

    .property-map .property-box .amenities-section i.fas {
        font-size: 12px !important;
        margin: 0 !important; /* Remove all margins, use gap instead */
        padding: 0 !important;
    }

    /* Ensure proper spacing between price and button */
    .property-map .property-box .property-details .plist {
        display: flex !important;
        flex-direction: column !important;
        gap: 0.25rem !important;
    }

    /* Apartment Listing Cards - Tablet Landscape Fixes */
    /* Reduce image container width to give more space for content */
    .apartment-image-container {
        flex: 0 0 260px !important;
        min-width: 260px !important;
    }

    .apartment-listing-img {
        min-height: 180px !important;
    }

    /* Increase padding in info section for better spacing */
    .apartment-info-section {
        padding: 1rem 0.875rem !important;
        min-width: 0 !important;
        overflow: visible !important;
    }

    /* Reduce price font size slightly */
    .apartment-price-highlight .price-value {
        font-size: 20px !important;
    }

    .apartment-price-highlight .price-value strong {
        font-size: 24px !important;
    }

    .apartment-price-highlight .price-value .cur {
        font-size: 14px !important;
    }

    /* Reduce spacing in details grid */
    .apartment-details-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem !important;
        margin-bottom: 0.625rem !important;
    }

    /* Reduce padding and font sizes in detail items */
    .apartment-detail-item {
        padding: 0.5rem !important;
        gap: 0.4rem !important;
    }

    .detail-icon-wrapper {
        width: 32px !important;
        height: 32px !important;
        flex-shrink: 0 !important;
    }

    .detail-icon-wrapper i {
        font-size: 14px !important;
    }

    .apartment-detail-item .detail-label {
        font-size: 14px !important;
        line-height: 1.2 !important;
    }

    .apartment-detail-item .detail-sublabel {
        font-size: 10px !important;
        line-height: 1.2 !important;
    }

    .detail-content {
        min-width: 0 !important;
        overflow: visible !important;
    }

    /* Ensure action wrapper has proper spacing */
    .apartment-action-wrapper {
        margin-top: auto !important;
        padding-top: 0.625rem !important;
        padding-bottom: 0 !important;
        border-top: 1px solid #e5e7eb !important;
        display: flex !important;
        justify-content: flex-end !important;
    }

    .apartment-action-wrapper .details-btn {
        min-width: 140px !important;
        padding: 0.5rem 1rem !important;
        font-size: 13px !important;
        font-weight: 600 !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* Ensure card content doesn't overflow */
    .apartment-card-content {
        overflow: visible !important;
        min-height: 180px !important;
    }

    .apartment-listing-card {
        overflow: visible !important;
    }

    /* Ensure header info has proper spacing */
    .apartment-header-info {
        margin-bottom: 0.625rem !important;
        padding-bottom: 0.4rem !important;
    }
}

/* ----------------------------------------
   iPad Pro 11" (834px - 1194px)
   ---------------------------------------- */
@media only screen and (min-width: 834px) and (max-width: 1194px) {
    /* iPad Pro 11 specific */
}

/* ----------------------------------------
   iPad Pro 12.9" (1024px - 1366px)
   ---------------------------------------- */
@media only screen and (min-width: 1024px) and (max-width: 1366px) {
    /* iPad Pro 12.9 specific */
}

/* ----------------------------------------
   All Tablets Combined (576px - 1024px)
   General tablet styles - covers phablets to tablets
   ---------------------------------------- */
@media only screen and (min-width: 576px) and (max-width: 1024px) {
    /* Reduce padding between amenity icons for neat design across all tablets */
    .property-map .property-box .amenities-section {
        gap: 0.35rem !important; /* Reduced from default 0.75rem */
        padding: 6px 0 !important; /* Reduced vertical padding */
    }

    .property-map .property-box .amenities-section i.fas {
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Increase container width for tablets */
    .video-search {
        max-width: 98% !important;
        width: 98% !important;
    }

    .container.hero-search-container,
    .container.hero-search-container,
    .hero-search-container {
        max-width: 98% !important;
        width: 98% !important;
    }

    /* Hide mobile menu, show only large screen menu - HIGH SPECIFICITY */
    body .largeNone,
    body .cstrow.largeNone,
    body header .largeNone,
    body .header-2 .largeNone,
    body .header-2 .container-fluid .largeNone {
        display: none !important;
        visibility: hidden !important;
        height: 0 !important;
        overflow: hidden !important;
    }

    body .smallNone,
    body .cstrow.smallNone,
    body header .smallNone,
    body .header-2 .smallNone,
    html[dir="rtl"] body .smallNone,
    html[dir="rtl"] body .cstrow.smallNone,
    html[dir="rtl"] body header .smallNone,
    html[dir="rtl"] body .header-2 .smallNone {
        display: flex !important;
        visibility: visible !important;
    }

    /* Fix header row - ensure single line layout */
    .header-2 .cstrow {
        display: flex !important;
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    /* Move menu closer to logo - LTR only */
    html:not([dir="rtl"]) .header-2 .cstrow .col-md-1.cst-menu {
        margin-left: -20% !important;
        padding-left: 0 !important;
    }

    /* Fix header overflow - make action pills smaller */
    .header-actions {
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
    }

    .header-actions .action-pill {
        height: 40px !important;
        padding: 0 0.8rem !important;
        font-size: 13px !important;
        flex-shrink: 1 !important;
    }

    .header-actions .map-link {
        padding: 0 0.8rem !important;
    }

    .header-actions .nav-menu {
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
    }

    /* Reduce logo column and expand actions area */
    .header-2 .cstrow .col-md-2.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .header-2 .cstrow .col-md-1.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    .header-2 .cstrow .col-md-5 {
        flex: 1 1 auto !important;
        width: auto !important;
        display: none !important;
    }

    .header-2 .cstrow .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
    }

    /* Container padding adjustment */
    .header-2 .container-fluid {
        padding-left: 10px !important;
        padding-right: 10px !important;
        overflow: visible !important;
    }

    /* Reset RTL header padding from ar-sheet.css for tablet symmetry */
    html[dir="rtl"] .header-2 {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    /* RTL specific fixes for Arabic - Same layout as LTR */
    /* Both LTR and RTL: [Logo][Hamburger]---[Buttons] */

    html[dir="rtl"] .header-2 .cstrow {
        display: flex !important;
        flex-direction: row !important; /* Keep same direction as LTR */
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        overflow: visible !important;
    }

    /* Logo - stays on LEFT in RTL (same as LTR) */
    html[dir="rtl"] .header-2 .cstrow .col-md-2.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
        margin: 0 !important;
    }

    /* Hamburger - next to logo on LEFT, pulled close to logo */
    html[dir="rtl"] .header-2 .cstrow .col-md-1.cst-menu {
        flex: 0 0 auto !important;
        width: auto !important;
        margin-left: 10px !important; /* Space between logo and hamburger */
        margin-right: -15% !important;
        padding: 0 !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        z-index: 10 !important;
        order: 2 !important; /* After logo (order 1) */
    }

    /* Logo column - explicit order */
    html[dir="rtl"] .header-2 .cstrow .col-md-2.cst-menu {
        order: 1 !important;
    }

    html[dir="rtl"] .header-2 .cstrow .col-md-1.cst-menu .menu-toggle,
    html[dir="rtl"] .header-2 #menu-toggle-iconL {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        cursor: pointer !important;
    }

    html[dir="rtl"] .header-2 #menu-toggle-iconL svg {
        display: block !important;
        visibility: visible !important;
        width: 35px !important;
        height: 35px !important;
    }

    /* Empty center - keep hidden like LTR */
    html[dir="rtl"] .header-2 .cstrow .col-md-5 {
        flex: 1 1 auto !important;
        width: auto !important;
        display: none !important;
    }

    /* Buttons - stays on RIGHT in RTL (same as LTR) */
    html[dir="rtl"] .header-2 .cstrow .col-md-4 {
        flex: 0 0 auto !important;
        width: auto !important;
        justify-content: flex-end !important;
    }

    /* Keep button order consistent */
    html[dir="rtl"] .header-actions {
        flex-direction: row !important;
    }

    html[dir="rtl"] .header-actions .nav-menu {
        flex-direction: row !important;
    }

    /* Reset all margins for clean layout */
    html[dir="rtl"] .header-right {
        margin: 0 !important;
    }

    html[dir="rtl"] .header-actions .map-link {
        margin: 0 !important;
    }

    html[dir="rtl"] .header-actions .action-pill {
        margin: 0 !important;
    }

    /* Fix gap below header menu and banner on tablet */
    .clearfix {
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
    }

    main.pb-3 {
        padding-top: 0 !important;
    }

    .banner-section.mt-60,
    section.banner-section.mt-60 {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Note: Portrait tablets (768px-991px) section above handles 2-per-row layout */
    /* This section only applies to non-portrait tablet sizes in the 576px-1024px range */

    .video-search .row {
        padding: 0.875rem !important;
        gap: 0.65rem !important;
    }

    /* Slightly reduce label font sizes for all tablets */
    .video-search .form-label {
       
        font-weight: 600 !important;
        margin-bottom: 0.3rem !important;
        line-height: 1.3 !important;
    }

    /* Reduce form select height and padding - reduced from 42px to 34px */
    .video-search .form-select.sm-ht,
    .video-search .select2-container--default .select2-selection--single {
        height: 34px !important;
        padding: 6px 12px !important;
        font-size: 0.85rem !important;
        border-radius: 12px !important;
    }

    .video-search .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 34px !important;
        font-size: 0.85rem !important;
    }

    /* Reduce search button size - reduced to match input height */
    .video-search .btn-search-desktop {
        height: 50px !important;
        width: 50px !important;
        min-width: 50px !important;
        border-radius: 12px !important;
        font-size: 0.9rem !important;
    }

    /* LTR: Position search button right next to price slider */
    html:not([dir="rtl"]) .video-search .row > .col-md-1.search-btn-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-1.search-btn-col {
        --bs-gutter-x: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0px !important; /* Add 30px margin between slider and search button */
        justify-content: flex-start !important;
        display: flex !important;
        align-items: flex-end !important;
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
    }

    /* LTR: Ensure price column doesn't have extra right padding */
    html:not([dir="rtl"]) .video-search .row > .col-md-3.price-col,
    html:not([dir="rtl"]) form.video-search .row > .col-md-3.price-col {
        padding-right: 0.25rem !important;
    }

    /* RTL: Position button next to slider */
    html[dir="rtl"] .video-search .row > .col-md-1.search-btn-col,
    html[dir="rtl"] form.video-search .row > .col-md-1.search-btn-col {
        justify-content: flex-end !important; /* Align button to RIGHT - next to slider */
        display: flex !important;
        align-items: flex-end !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-right: 0px !important; /* Add 30px margin between slider and search button */
        flex: 0 0 auto !important;
        width: auto !important;
        max-width: none !important;
    }

    /* RTL: Ensure price column doesn't have extra left padding */
    html[dir="rtl"] .video-search .row > .col-md-3.price-col,
    html[dir="rtl"] form.video-search .row > .col-md-3.price-col {
        padding-left: 0.25rem !important;
        padding-right: 0 !important;
    }
}
