/* =============================================
   RoomSarthi — Complete Responsive Design
   Breakpoints:
   Extra Small : max-width 380px
   Mobile      : max-width 576px
   Tablet      : max-width 768px
   Laptop      : max-width 992px
   Wide Laptop : max-width 1200px
============================================= */

/* ── Prevent horizontal overflow GLOBALLY ── */
html, body { overflow-x: hidden; }
*, *::before, *::after { box-sizing: border-box; }
img { max-width: 100%; height: auto; }
table { width: 100%; overflow-x: auto; display: block; }

.mobile-bottom-nav {
  display: none;
}

/* ══════════════════════════════════════════════
   WIDE LAPTOP (≤1200px)
   ══════════════════════════════════════════════ */
@media (max-width: 1200px) {
  .container { padding: 0 24px; }
  .navbar { padding: 14px 28px; }
  .navbar-actions { gap: 8px; }
  .owner-list-btn { padding: 8px 10px; }
  .owner-list-btn .add-icon-label { display: none; }
  .featured-grid { grid-template-columns: repeat(3, 1fr); }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); gap: 32px; }
  .owners-layout { grid-template-columns: 200px 1fr; }
  .results-layout { grid-template-columns: 220px 1fr; }
}

/* ══════════════════════════════════════════════
   LAPTOP (≤992px)
   ══════════════════════════════════════════════ */
@media (max-width: 992px) {

  /* ── Navbar ── */
  .navbar { padding: 12px 20px; }
  .navbar-links { display: none; }
  .hamburger { display: flex; }
  .navbar-links.active {
    display: flex; flex-direction: column;
    position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 999; gap: 4px;
  }
  html.dark .navbar-links.active {
    background: #161820;
    border-bottom-color: #2D3140;
  }
  .navbar-links.active a {
    padding: 10px 12px; border-radius: 8px;
    font-size: 0.95rem;
  }
  .navbar-links.active a:hover { background: #F1F5F9; }
  html.dark .navbar-links.active a:hover { background: #252833; }

  /* Profile menu - tablet */
  .profile-btn-text { display: none; }
  .profile-chevron { display: none; }
  .profile-btn { gap: 0; padding: 2px; }
  .profile-btn img { width: 34px; height: 34px; }
  .profile-dropdown { width: 210px; right: 0; }
  .add-icon-label { display: none; }
  .btn-add-icon { padding: 8px; border-radius: 8px; }

  /* Hero */
  .hero h1 { font-size: 2rem; }
  .hero { padding: 48px 20px 32px; }

  /* Search bar V2 */
  .search-bar-v2 {
    max-width: 340px;
    width: 100%;
  }
  .search-v2-divider {
    display: none;
  }

  /* Category tabs */
  .category-strip { padding: 20px 0 0; }
  .category-tabs { gap: 24px; }
  .cat-tab-icon { width: 20px; height: 20px; }
  .cat-tab-icon svg { width: 20px; height: 20px; }

  /* Old search bar (listing page) */
  .search-bar {
    flex-direction: column; border-radius: var(--radius);
    padding: 16px; gap: 0;
  }
  .search-bar .search-field {
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 12px 0; width: 100%;
  }
  .search-bar .search-field:last-of-type { border-bottom: none; }
  .search-btn { width: 100%; height: 48px; border-radius: var(--radius-sm); margin-top: 8px; }

  /* Property Grids */
  .featured-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonials-grid { grid-template-columns: 1fr; }

  /* Property Listing page */
  .listing-page { flex-direction: column; height: auto; }
  .listing-panel { flex: none; width: 100%; }
  .listing-map { height: 280px; }

  /* Results page */
  .results-layout { grid-template-columns: 1fr; }
  .filter-sidebar {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 12px; position: static; border-radius: 12px;
  }
  .filter-sidebar h4 { grid-column: 1 / -1; }
  .filter-group { margin-bottom: 0; }

  /* Property detail */
  .detail-content { grid-template-columns: 1fr; }
  .detail-sidebar { position: static; }
  .photo-gallery { grid-template-columns: 1fr 1fr; grid-template-rows: 240px 140px; }
  .photo-gallery .main-photo { grid-column: 1 / 3; }
  /* Login */
  .login-brand { display: none; }
  .login-form-panel { padding: 40px 28px; }

  /* Dashboard */
  .dashboard-layout { flex-direction: column; }
  .sidebar {
    width: 100%; border-right: none; border-bottom: 1px solid var(--border);
    padding: 12px 16px; display: flex; overflow-x: auto; gap: 8px;
    scrollbar-width: none; /* Hide default scrollbars for elegance */
    -ms-overflow-style: none;
    background: var(--card-bg, #fff);
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .sidebar-section { display: flex; flex-direction: row; gap: 8px; margin-bottom: 0; }
  .sidebar-section h5 { display: none; }
  .sidebar-section[style] {
    margin-top: 0 !important;
    border-top: none !important;
    padding-top: 0 !important;
    margin-bottom: 0 !important;
  }
  .sidebar-link {
    white-space: nowrap;
    padding: 10px 16px !important;
    margin-bottom: 0 !important;
    font-size: 0.84rem !important;
    border-radius: 20px !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    background: #F1F5F9;
    color: var(--text-secondary, #475569) !important;
    border: 1px solid var(--border) !important;
    transition: all 0.2s ease !important;
    font-weight: 600 !important;
  }
  .sidebar-link.active {
    background: var(--primary, #2563EB) !important;
    color: #fff !important;
    border-color: var(--primary) !important;
  }
  html.dark .sidebar-link {
    background: #1C1F28 !important;
    color: #ECF0F6 !important;
    border-color: #2D3140 !important;
  }
  html.dark .sidebar-link.active {
    background: #2563EB !important;
    color: #fff !important;
    border-color: #2563EB !important;
  }
  .dashboard-main { padding: 20px; width: 100%; min-width: 0; max-width: 100vw; box-sizing: border-box; overflow: hidden; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  
  /* Table Responsiveness */
  .table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #fff;
  }
  html.dark .table-responsive {
    background: #1C1F28 !important;
    border-color: #2D3140 !important;
  }
  .table-responsive .data-table {
    display: table !important;
    width: 100%;
    min-width: 850px !important;
    margin-bottom: 0 !important;
    border: none !important;
    overflow: visible !important;
  }
  .data-table th, .data-table td {
    white-space: nowrap;
  }
  .data-table th:first-child,
  .data-table td:first-child {
    padding-left: 20px !important;
  }
  .data-table th:last-child,
  .data-table td:last-child {
    padding-right: 24px !important;
  }

  /* Owners page */
  .owners-layout { grid-template-columns: 1fr; }
  .area-sidebar {
    display: flex; flex-wrap: wrap; gap: 8px;
    padding: 14px; position: static;
  }
  .area-sidebar h4 { width: 100%; margin-bottom: 0; }
  .area-item { padding: 6px 12px; font-size: 0.82rem; }
  .owners-grid { grid-template-columns: repeat(2, 1fr); }

  /* List Property form */
  .owner-card-btns { flex-direction: column; }
}

/* ══════════════════════════════════════════════
   TABLET (≤768px)
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* Typography */
  .section-title { font-size: 1.5rem; }
  .section { padding: 48px 0; }

  /* Navbar */
  .navbar {
    padding: 8px 12px;
    height: 56px;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    position: relative !important;
  }
  .navbar-logo {
    font-size: 1.05rem !important;
    font-weight: 800;
    gap: 6px;
    margin-right: auto;
    display: flex !important;
    align-items: center !important;
  }
  .navbar-logo svg {
    width: 22px !important;
    height: 22px !important;
    vertical-align: middle !important;
  }
  .navbar-actions {
    margin-left: auto;
    margin-right: 0 !important;
    display: flex;
    align-items: center;
    gap: 8px !important;
  }
  body[data-page="home"] .dark-mode-toggle,
  .dark-mode-toggle {
    display: none !important;
  }
  .mobile-search-nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    color: var(--text);
    background: transparent;
    transition: background 0.2s;
  }
  .mobile-search-nav-btn:hover {
    background: var(--bg-alt);
  }
  .mobile-search-nav-btn svg {
    width: 22px !important;
    height: 22px !important;
    vertical-align: middle !important;
  }
  .navbar-actions .btn-sm {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: auto;
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
    border-radius: var(--radius-sm) !important;
  }
  .hamburger {
    display: none !important;
  }
  .navbar-actions .btn:not(.btn-sm) { display: none; }

  /* ── Sticky Bottom Mobile Navigation ── */
  .mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    padding-bottom: env(safe-area-inset-bottom);
    box-sizing: border-box;
  }

  .mobile-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 500;
    text-decoration: none;
    width: 20%;
    height: 100%;
    gap: 4px;
    transition: color 0.2s ease, transform 0.1s ease;
  }

  .mobile-nav-item svg {
    stroke-width: 2.2;
    width: 20px;
    height: 20px;
    transition: transform 0.2s ease;
  }

  .mobile-nav-item.active {
    color: var(--primary);
    font-weight: 600;
  }

  .mobile-nav-item:active {
    transform: scale(0.92);
  }

  html.dark .mobile-bottom-nav {
    background: rgba(22, 24, 32, 0.95);
    border-top-color: var(--border);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.25);
  }

  body {
    padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important;
  }

  /* Compact search hidden on tablet — full search used instead */
  .compact-search { display: none; }

  /* Profile menu */
  .profile-btn-text { display: none; }
  .profile-chevron { display: none; }
  .profile-btn { gap: 0; padding: 2px; }
  .profile-btn img { width: 32px; height: 32px; }
  .profile-dropdown { width: 200px; right: -8px; }
  .profile-dropdown-header { padding: 12px 14px; }
  .profile-dropdown-header p { font-size: 0.85rem; }
  .profile-dropdown-header span { font-size: 0.7rem; }
  .profile-dropdown-list li a { padding: 9px 14px; font-size: 0.82rem; gap: 10px; }
  .profile-dropdown-list li a svg { width: 15px; height: 15px; }
  .add-icon-label { display: none; }
  .btn-add-icon { padding: 8px; border-radius: 8px; }
  .owner-list-btn { padding: 7px 8px; border-radius: 999px; min-width: 34px; justify-content: center; }
  .owner-list-btn .add-icon-label { display: none !important; }

  /* Hero */
  .hero h1 { font-size: 1.7rem; line-height: 1.3; }
  .hero { padding: 40px 16px 28px; text-align: center; }
  .hero-sub { font-size: 0.9rem; }
  .rs-hero-sub { font-size: 0.875rem !important; line-height: 1.6 !important; }

  /* Search V2 */
  .search-v2-icon { width: 34px; height: 34px; border-radius: 8px; }
  .search-v2-input-wrap label { font-size: 0.65rem; }
  .search-v2-input-wrap input,
  .search-v2-input-wrap select { font-size: 0.85rem; }
  .category-strip { padding: 16px 0 0; }
  .category-tabs { gap: 20px; }
  .cat-tab { padding: 8px 10px 10px; font-size: 0.85rem; gap: 6px; }
  .cat-tab-icon { width: 20px; height: 20px; }
  .cat-tab-icon svg { width: 20px; height: 20px; }

  /* Featured/Grid */
  .featured-grid, .listing-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }

  /* Property listing results */
  .listing-map { height: 220px; }
  .result-card { flex-direction: column; }
  .result-card-img { width: 100%; height: 200px; }
  .result-card-body { padding: 16px; }

  /* Owners */
  .owners-grid { grid-template-columns: 1fr; }
  .owners-hero h1 { font-size: 1.5rem; }
  .owners-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
  .toolbar-right { width: 100%; }
  .owner-search { flex: 1; }
  .owner-search input { width: 100%; }

  /* Owner CTA Banner */
  .owner-cta { padding: 32px 24px; flex-direction: column; align-items: flex-start; }
  .owner-cta-btn { width: 100%; justify-content: center; }

  /* Photos */
  .property-details-container {
    display: flex;
    flex-direction: column;
  }
  .photo-gallery-container { 
    position: relative; 
    margin-bottom: 16px;
    order: -1; /* Images first on mobile */
    margin-left: -16px;
    margin-right: -16px;
    margin-top: -8px;
  }
  .gallery-arrow {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.92);
    border: none;
    border-radius: 50%;
    color: #1E293B;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    z-index: 10;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
  }
  .gallery-arrow:active { transform: translateY(-50%) scale(0.92); }
  .gallery-arrow.prev-arrow { left: 8px; }
  .gallery-arrow.next-arrow { right: 8px; }
  
  .photo-gallery { 
    display: flex !important;
    flex-wrap: nowrap; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    gap: 0; 
    padding: 0;
    margin: 0;
    height: 280px;
    border-radius: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-behavior: smooth;
  }
  .photo-gallery::-webkit-scrollbar { display: none; }
  .photo-gallery img { 
    display: block !important;
    flex: 0 0 100%;
    height: 100%; 
    scroll-snap-align: start; 
    border-radius: 0;
    object-fit: cover;
  }
  .photo-gallery .photo-overlay {
    display: block !important;
    flex: 0 0 100%;
    height: 100%;
    scroll-snap-align: start;
  }
  .photo-gallery .photo-overlay img { width: 100%; height: 100%; border-radius: 0; }
  .photo-gallery .main-photo { grid-column: auto; }

  /* Hide breadcrumb on mobile */
  .property-details-container > .breadcrumb {
    display: none !important;
  }

  /* Hide badges (VERIFIED, STUDENT HOSTEL, rating) on mobile */
  .detail-header > div > div:first-child {
    display: none !important;
  }

  /* Hide Share & Save from header on mobile */
  .detail-header .detail-actions {
    display: none !important;
  }

  /* Detail header — only name + location visible */
  .detail-header { 
    flex-direction: column; 
    gap: 4px; 
    margin-bottom: 16px;
    padding: 0;
  }
  .detail-header h1 { font-size: 1.3rem; line-height: 1.3; margin-bottom: 2px; }

  /* Details page grids */
  .amenities-grid { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid { grid-template-columns: 1fr; }

  /* Dashboard stats */
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-section { padding: 16px; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden; }

  /* List Property form */
  .list-page { padding: 24px 16px 60px; }
  .form-section { padding: 20px 16px; }
  .type-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
  .type-card {
    padding: 10px 6px !important;
    border-radius: 10px !important;
  }
  .type-card .type-icon {
    width: 36px !important;
    height: 36px !important;
    margin-bottom: 6px !important;
  }
  .type-card .type-icon svg {
    width: 18px !important;
    height: 18px !important;
  }
  .type-card .type-name {
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
  }
  .type-card .type-desc {
    display: none !important;
  }
  .type-card .badge-check {
    width: 16px !important;
    height: 16px !important;
    font-size: 0.6rem !important;
    top: 6px !important;
    right: 6px !important;
  }
  .location-row { grid-template-columns: 1fr !important; }
  .pricing-row { grid-template-columns: 1fr !important; }
  .amenity-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .photo-preview-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .form-actions { flex-direction: column; }
  .form-actions .btn { width: 100%; }

  /* Login */
  .login-form-panel { padding: 28px 20px; }
  .login-card { width: 100%; min-height: 100vh; border-radius: 0; }
  .social-login { flex-direction: column; gap: 10px; }
  .otp-inputs { gap: 8px; }
  .otp-inputs input { width: 52px !important; height: 52px !important; font-size: 1.2rem; }

  /* Footer */
  .footer { padding: 40px 0 20px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }

  /* Booking page — ensure summary card is readable */
  .bk-sum-img { height: 160px; }

  /* Property listing navbar icons */
  body[data-page="property-listing"] .navbar-links:not(.active) {
    display: none !important;
  }

  /* Hide any top header search icons, buttons, or nav buttons on mobile */
  .navbar-actions .mobile-search-nav-btn,
  .navbar-actions [class*="search"],
  .navbar [class*="search-nav"],
  .navbar .search-nav-btn {
    display: none !important;
  }

  /* Menu Drawer Horizontal Align & Styling */
  .navbar-links.active {
    padding: 12px 16px !important;
    gap: 4px !important;
    border-radius: 0 0 12px 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    height: auto !important;
  }
  .navbar-links.active a {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 12px !important;
    padding: 10px 12px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    color: var(--text) !important;
    text-decoration: none !important;
  }
  .navbar-links.active a svg {
    width: 20px !important;
    height: 20px !important;
    stroke-width: 2.2 !important;
    margin: 0 !important;
    vertical-align: middle !important;
    display: inline-block !important;
    color: var(--text-muted) !important;
    flex-shrink: 0 !important;
  }
  .navbar-links.active a.active svg {
    color: var(--primary) !important;
  }

  /* Dynamically injected Dark Mode Row in menu */
  .menu-dark-mode-row {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 10px 12px !important;
    margin-top: 4px !important;
    border-top: 1px solid var(--border) !important;
  }
  .menu-dark-mode-row span {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    font-size: 0.95rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
  }
  .menu-dark-mode-row span svg {
    width: 20px !important;
    height: 20px !important;
    color: var(--text-muted) !important;
    flex-shrink: 0 !important;
  }
  .menu-dark-toggle-btn {
    background: var(--bg-alt, #f1f5f9) !important;
    border: 1px solid var(--border) !important;
    color: var(--text) !important;
    padding: 6px 12px !important;
    font-size: 0.8rem !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
    cursor: pointer;
    outline: none;
    transition: background 0.2s, border-color 0.2s;
  }
  html.dark .menu-dark-toggle-btn {
    background: #252833 !important;
  }

  /* Owners Page Overhaul */
  .area-sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    padding: 16px !important;
  }
  .area-sidebar h4 {
    grid-column: 1 / -1;
    margin-bottom: 4px !important;
  }
  .area-item {
    border-radius: 20px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 14px !important;
    min-height: 44px !important;
    font-size: 0.85rem !important;
  }
  .owners-hero {
    padding: 24px 16px 20px !important;
    text-align: center !important;
    border-radius: 12px !important;
    margin-bottom: 16px !important;
  }
}

/* ══════════════════════════════════════════════
   MOBILE (≤576px)
   ══════════════════════════════════════════════ */
@media (max-width: 576px) {

  /* Navbar */
  .navbar { padding: 10px 14px; }
  .navbar-links.active .btn-primary {
    display: inline-flex; width: 100%;
    justify-content: center; margin-top: 8px;
  }

  /* Profile menu */
  .navbar-actions { gap: 4px !important; margin-right: 6px; }
  .profile-menu-wrap { position: static; }
  .profile-btn-text { display: none !important; }
  .profile-chevron { display: none !important; }
  .profile-btn { gap: 0; padding: 2px; }
  .profile-btn img { width: 30px; height: 30px; border-width: 1px; }
  .profile-dropdown {
    position: fixed; top: 54px; left: 8px; right: 8px;
    width: auto; border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
  }
  .profile-dropdown-header { padding: 14px 16px; }
  .profile-dropdown-header p { font-size: 0.9rem; }
  .profile-dropdown-list li a { padding: 13px 16px; font-size: 0.88rem; gap: 12px; }
  .add-icon-label { display: none; }
  .btn-add-icon { padding: 7px; border-radius: 8px; }
  .owner-list-btn { padding: 6px 7px; border-radius: 999px; min-width: 32px; justify-content: center; }
  .owner-list-btn .add-icon-label { display: none !important; }

  /* Hero */
  .hero h1 { font-size: 1.6rem; font-weight: 800; line-height: 1.3; }
  .hero { padding: 40px 16px 24px; }
  .hero .hero-sub { font-size: 0.95rem; margin-bottom: 32px; }
  .rs-hero-sub { font-size: 0.8rem !important; line-height: 1.55 !important; }

  /* Search Bar V2 (Mobile Card Override) */
  .search-bar-v2 {
    flex-direction: row !important;
    border-radius: 60px !important;
    border: 1.5px solid var(--border) !important;
    box-shadow: 0 4px 24px rgba(37, 99, 235, 0.08) !important;
    padding: 0 6px 0 16px !important;
    align-items: center !important;
    gap: 0 !important;
    background: #fff !important;
    max-width: 320px !important;
    width: calc(100% - 32px) !important;
    margin: 0 auto !important;
    height: 52px !important;
  }
  .search-v2-fields {
    flex-direction: row !important;
    width: auto !important;
    flex: 1 !important;
  }
  .search-v2-field {
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    width: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
  }
  .search-v2-divider {
    display: none !important;
  }
  .search-v2-icon {
    width: 32px !important;
    height: 32px !important;
    border-radius: 50% !important;
    background: var(--primary-light) !important;
    color: var(--primary) !important;
  }
  .search-v2-btn {
    width: 40px !important;
    height: 40px !important;
    min-height: 40px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    align-self: center !important;
  }

  /* Hero Actions V2 (Responsive) */
  .hero-actions-v2 {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    margin: 24px auto 0;
    padding: 0 16px;
    box-sizing: border-box;
  }
  .hero-action-btn {
    width: 100%;
    height: 42px;
  }

  /* Category tabs */
  .category-strip {
    padding: 16px 0 0 !important;
    margin-bottom: 24px !important;
  }
  .category-tabs-wrap {
    justify-content: flex-start !important;
    overflow-x: auto !important;
    overflow-y: visible !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
    padding: 0 12px 0 !important;
  }
  .category-tabs-wrap::-webkit-scrollbar { display: none !important; }
  .category-tabs {
    display: flex !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    flex-shrink: 0 !important;
    width: max-content !important;
    gap: 12px !important;
    padding: 0 4px 4px !important;
  }
  .category-strip-view-all {
    font-size: 0.82rem !important;
  }
  .cat-tab {
    flex: 0 0 auto !important;
    min-width: 60px !important;
    padding: 8px 10px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 0.78rem !important;
    font-weight: 600 !important;
  }
  .cat-tab-icon {
    width: 42px !important;
    height: 42px !important;
    border-radius: 14px !important;
    background: #F1F5F9 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s, color 0.2s !important;
  }
  .cat-tab-icon svg {
    width: 22px !important;
    height: 22px !important;
    color: #64748B !important;
  }
  .cat-tab.active .cat-tab-icon {
    background: #EFF6FF !important;
  }
  .cat-tab.active .cat-tab-icon svg {
    color: var(--primary, #2563EB) !important;
  }

  /* Trust Section */
  .trust-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
  .trust-item {
    padding: 24px 12px !important;
  }
  .trust-item h4 {
    font-size: 0.85rem !important;
    margin-bottom: 4px !important;
  }
  .trust-item p {
    font-size: 0.75rem !important;
    line-height: 1.4 !important;
  }

  /* Cards */
  .featured-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
    padding: 0 !important;
  }
  .card {
    border-radius: 16px !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04) !important;
    border: 1px solid var(--border) !important;
    max-width: 100% !important;
  }
  .card-img { height: 210px !important; }
  .card-body { padding: 18px !important; }

  /* Results / Listing */
  .result-card-price { font-size: 1rem; }
  .result-card-title { font-size: 0.95rem; }
  .result-card-body { padding: 14px; }
  .result-card-footer { flex-direction: column; align-items: flex-start; gap: 10px; }
  .result-card-footer .btn { width: 100%; justify-content: center; }
  .sort-bar { gap: 6px; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .sort-btn { white-space: nowrap; padding: 5px 10px; font-size: 0.78rem; }
  .results-top { flex-direction: column; align-items: flex-start; }
  .filter-tags { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }

  /* Dashboard */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 12px !important; }
  .stat-card { padding: 12px 14px !important; }
  .stat-value { font-size: 1.25rem !important; }
  .stat-label { font-size: 0.72rem !important; }
  .stat-change { font-size: 0.68rem !important; }
  .listing-card { flex-direction: column; }
  .listing-cards { gap: 12px; }
  .listing-card-img { width: 100% !important; height: 160px; }
  .listing-card-meta { flex-direction: column; align-items: flex-start; gap: 8px; }
  .listing-card-actions { width: 100%; display: flex; gap: 8px; }
  .listing-card-actions .btn { flex: 1; justify-content: center; }

  /* Detail page */
  .detail-header h1 { font-size: 1.25rem; }
  .booking-card { margin: 0; border-radius: var(--radius); }
  .amenities-grid { grid-template-columns: 1fr; }
  .booking-price { font-size: 1.2rem; }
  .room-option { padding: 10px 14px; }
  .room-option .room-name { font-size: 0.85rem; }
  .breadcrumb { font-size: 0.78rem; padding: 10px 0; flex-wrap: wrap; }

  /* Login / OTP */
  .login-wrap { padding: 0; }
  .auth-card { border-radius: 0; min-height: 100vh; padding: 28px 18px; }
  .otp-inputs { gap: 6px; }
  .otp-inputs input { width: 46px !important; height: 46px !important; }
  .social-login { flex-direction: column; }
  .login-form-container h2 { font-size: 1.4rem; }

  /* List Property */
  .list-page > h1 { font-size: 1.4rem; }
  .type-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
  .amenity-grid { grid-template-columns: 1fr !important; }
  .section-header { flex-direction: row; }
  .form-section { padding: 16px 14px; margin-bottom: 16px; }

  /* Owners */
  .owners-hero h1 { font-size: 1.3rem; }
  .owners-page { padding: 20px 14px 48px; }
  .owner-card { padding: 16px; }
  .owner-stats { grid-template-columns: 1fr 1fr; }
  .owner-card-btns { flex-direction: row; }
  .owner-card-btns .btn { font-size: 0.78rem; padding: 8px 10px; }

  /* Admin panel */
  .admin-section-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .data-table { font-size: 0.78rem; }
  .data-table th, .data-table td { padding: 8px 10px; }
  .action-btns { flex-direction: row; gap: 6px; }
  .action-btns .btn { width: auto; justify-content: center; font-size: 0.7rem; padding: 4px 10px; }

  /* Owner CTA Banner */
  .owner-cta { padding: 28px 20px; flex-direction: column; align-items: stretch; }
  .owner-cta h2 { font-size: 1.35rem; }
  .owner-cta-btn { width: 100%; text-align: center; justify-content: center; }

  /* Footer */
  .footer-grid { gap: 20px; }
  .footer-brand p { font-size: 0.85rem; }
  .footer ul li a { font-size: 0.85rem; }

  /* Hamburger menu adjustments */
  .navbar-actions { gap: 6px; }
  .navbar-actions .btn-sm { padding: 8px 12px; font-size: 0.82rem; display: inline-flex; }
  .navbar-actions .btn-outline { display: none; }
  .navbar-actions .owner-list-btn { display: inline-flex; }

  /* Back button sizing */
  .nav-back-btn {
    width: 36px !important;
    height: 36px !important;
    border-radius: 8px;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }
  .nav-back-btn svg {
    width: 22px !important;
    height: 22px !important;
    vertical-align: middle !important;
  }

  /* Booking page */
  .bk-page-header h1 { font-size: 1.35rem; }
  .bk-sum-img { height: 140px; }
  .bk-sum-title { font-size: 0.95rem; }
  .bk-prices h4 { font-size: 0.88rem; }
  .bk-ptotal { font-size: 1.1rem !important; }
  .bk-confirm { padding: 12px; font-size: 0.92rem; }
  .bk-navbar { padding: 0 14px; height: 54px; }
  .bk-nav-logo { font-size: 0.95rem; }
  .bk-nav-logo svg { width: 18px; height: 18px; }
}

/* ══════════════════════════════════════════════
   EXTRA SMALL (≤380px)
   ══════════════════════════════════════════════ */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.25rem; }
  .rs-hero-sub { font-size: 0.75rem !important; line-height: 1.5 !important; }
  .navbar-logo span, .navbar-logo { font-size: 1rem; }
  .search-v2-field { gap: 6px; padding: 8px 4px; }
  .search-v2-icon { width: 28px; height: 28px; border-radius: 6px; }
  .search-v2-icon svg { width: 14px; height: 14px; }
  .cat-tab { padding: 7px 12px; font-size: 0.78rem; }
  .otp-inputs input { width: 40px !important; height: 40px !important; font-size: 1rem; }
  .owner-card-btns { flex-direction: column; }
  .owners-grid { grid-template-columns: 1fr; }
  .type-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px !important; }
  .btn-lg { padding: 12px 20px; font-size: 0.9rem; }
  .container { padding: 0 12px; }

  /* Profile - extra small */
  .profile-btn img { width: 28px; height: 28px; }
  .profile-dropdown { top: 50px; left: 4px; right: 4px; }

  /* Cards */
  .card-img { height: 160px; }
  .result-card-img { height: 170px; }
  .card-body { padding: 12px; }

  /* Booking */
  .bk-page { padding: 14px 10px 48px; }
  .bk-card { padding: 16px; }
  .bk-grid2 { gap: 12px; }
  .bk-page-header h1 { font-size: 1.2rem; }
  .bk-cal-grid { padding: 8px 6px 10px; }
  .bk-d { padding: 6px 1px; font-size: 0.78rem; }
  .bk-cal-month { font-size: 0.82rem; }
  .bk-cal-arrow { width: 26px; height: 26px; }

  /* Details */
  .detail-header h1 { font-size: 1.1rem; }
  .booking-price { font-size: 1.1rem; }
}

/* ══════════════════════════════════════════════
   LANDSCAPE PHONE ORIENTATION
   ══════════════════════════════════════════════ */
@media (max-height: 500px) and (orientation: landscape) {
  .hero { padding: 24px 16px 20px; }
  .hero h1 { font-size: 1.5rem; }
  .search-bar { padding: 10px; }
  .section { padding: 32px 0; }
  .bk-layout { gap: 16px; }
  .bk-page { padding: 12px 16px 40px; }
  .navbar-links.active {
    max-height: 60vh;
    overflow-y: auto;
  }
}

/* ══════════════════════════════════════════════
   HAMBURGER ANIMATION
   ══════════════════════════════════════════════ */
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ══════════════════════════════════════════════
   TOUCH-FRIENDLY TARGETS
   Minimum 44px tap targets for mobile
   ══════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  .btn { padding: 13px 24px; min-height: 44px; }
  .btn-sm { padding: 10px 16px; min-height: 40px; }
  .type-option { padding: 16px; }
  .area-item { padding: 12px 16px; min-height: 44px; }
  .sort-btn { padding: 8px 16px; min-height: 40px; }
  .sidebar-link { padding: 12px 16px; min-height: 44px; }
  .filter-check { padding: 6px 0; min-height: 40px; }
  .nav-back-btn { min-width: 40px; min-height: 40px; }
  .bk-nav-back { min-width: 40px; min-height: 40px; }
  .map-back-btn { min-width: 40px; min-height: 40px; }
  .bk-cnt { min-width: 40px; min-height: 40px; }
  .bk-cal-arrow { min-width: 36px; min-height: 36px; }
  .bk-d { min-height: 36px; display: flex; align-items: center; justify-content: center; }
  .heart-btn { width: 38px; height: 38px; }
  .hamburger { padding: 8px; }
  
  /* Larger touch targets for owner card buttons */
  .owner-card-btns .btn { min-height: 44px; }

  /* Better tap area for property cards */
  .result-card { min-height: 0; }
}

/* ══════════════════════════════════════════════
   HIGH-DPI / RETINA SCREENS
   ══════════════════════════════════════════════ */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .navbar { border-bottom-width: 0.5px; }
  .card { border-width: 0.5px; }
  .bk-card { border-width: 0.5px; }
  .bk-summary { border-width: 0.5px; }
}

/* ══════════════════════════════════════════════
   SAFE AREA INSETS (Notched phones)
   ══════════════════════════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .bk-page { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
  .bk-confirm { margin-bottom: env(safe-area-inset-bottom); }
  .navbar { 
    padding-left: max(16px, env(safe-area-inset-left)); 
    padding-right: max(16px, env(safe-area-inset-right)); 
    padding-top: max(10px, env(safe-area-inset-top)); 
  }
  .bk-navbar { 
    padding-left: max(14px, env(safe-area-inset-left)); 
    padding-right: max(14px, env(safe-area-inset-right)); 
    padding-top: env(safe-area-inset-top); 
    height: auto;
    min-height: 54px;
  }
}

/* ══════════════════════════════════════════════
   PRINT STYLES
   ══════════════════════════════════════════════ */
@media print {
  .navbar, .hamburger, .navbar-actions, .footer, .bk-navbar { display: none !important; }
  .hero { padding: 20px 0; }
  body { background: #fff !important; }
  .card, .result-card, .bk-card, .bk-summary { box-shadow: none; border: 1px solid #ddd; }
}

/* ══════════════════════════════════════════════
   REDUCED MOTION PREFERENCE
   ══════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ══════════════════════════════════════════════
   MOBILE-FIRST GLOBAL OVERRIDES
   ══════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* 8px Spacing Grid System */
  :root {
    --radius: 10px !important;
    --radius-sm: 8px !important;
  }

  /* Global Button Heights & Rounded Corners */
  .btn {
    height: 44px !important;
    padding: 0 16px !important;
    border-radius: var(--radius-sm) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-sizing: border-box !important;
    white-space: nowrap !important;
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    gap: 8px !important;
  }

  .btn-sm {
    height: 36px !important;
    padding: 0 12px !important;
    font-size: 0.82rem !important;
    border-radius: 6px !important;
  }

  .btn-lg {
    height: 48px !important;
    padding: 0 24px !important;
    font-size: 0.95rem !important;
  }

  /* Property Cards aspect ratios & layout alignment */
  .result-card, .card {
    border-radius: 14px !important;
    overflow: hidden !important;
    position: relative !important;
  }

  .result-card-img, .card-img {
    aspect-ratio: 16/10 !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
  }

  .result-card-body, .card-body {
    padding: 16px !important;
  }

  /* Price and CTA button alignment */
  .result-card-price {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    color: var(--primary) !important;
  }

  .result-card-footer {
    display: flex !important;
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    margin-top: 12px !important;
    padding-top: 12px !important;
    border-top: 1px solid var(--border) !important;
  }

  .result-card-footer .btn-sm {
    margin-left: auto !important;
    width: auto !important;
    min-width: 100px !important;
  }

  /* Home Hero elements & typography */
  .rs-hero {
    padding: 40px 16px 32px !important;
    text-align: center !important;
  }

  .rs-hero-title {
    font-size: 1.6rem !important;
    line-height: 1.3 !important;
    margin-bottom: 12px !important;
  }

  .rs-hero-sub {
    font-size: 0.85rem !important;
    line-height: 1.55 !important;
    margin-bottom: 24px !important;
  }

  /* Login and auth page spacing */
  .login-form-container {
    padding: 0 8px !important;
  }

  .login-form-container h2 {
    font-size: 1.45rem !important;
    margin-bottom: 8px !important;
  }

  .login-form-container .subtitle {
    margin-bottom: 24px !important;
  }

  /* Social logins heights & button dimensions */
  .social-login {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .social-login .btn {
    flex: 1 !important;
    height: 44px !important;
    margin: 0 !important;
    justify-content: center !important;
  }

  .otp-input-wrap input {
    height: 44px !important;
  }

  /* Section Spacing & breathing space */
  .section {
    padding: 24px 0 !important;
  }

  .section-title {
    font-size: 1.35rem !important;
    margin-bottom: 8px !important;
  }

  .section-subtitle {
    font-size: 0.85rem !important;
    margin-bottom: 24px !important;
  }
}
