/* ========================================================
   NearbyProperty — Global Mobile Responsive Styles
   Covers: public site, admin panel, dashboard, forms,
   tables, cards, modals, property cards, maps, etc.
   ======================================================== */

/* ---------- ROOT / TYPOGRAPHY ---------- */
@media (max-width: 575.98px) {
    html { font-size: 14px; }
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }
    h3 { font-size: 1.3rem !important; }
    h4 { font-size: 1.15rem !important; }
    h5 { font-size: 1rem !important; }
    h6 { font-size: 0.9rem !important; }
}

/* ---------- NAVBAR (Public) ---------- */
@media (max-width: 991.98px) {
    .np-navbar .navbar-collapse {
        background: var(--navy-dark);
        margin-top: 12px;
        border-radius: 12px;
        padding: 16px;
    }
    .np-navbar .navbar-nav {
        gap: 0 !important;
    }
    .np-navbar .np-nav-link {
        padding: 12px 8px !important;
        border-bottom: 1px solid rgba(255,255,255,0.08);
        font-size: 0.95rem;
    }
    .np-navbar .np-nav-link:last-child {
        border-bottom: none;
    }
    .np-navbar .np-btn-login {
        display: inline-block;
        margin-top: 12px;
        padding: 10px 24px;
    }
    .np-brand img { height: 30px !important; }
    .np-brand span { font-size: 1.1rem !important; }
}

/* ---------- HERO SECTION ---------- */
@media (max-width: 991.98px) {
    .np-hero { min-height: auto !important; padding: 40px 0; }
    .np-hero-title { font-size: 2rem !important; }
    .np-hero-subtitle { font-size: 1rem !important; }
    .np-search-box { max-width: 100% !important; }
    .np-search-tabs { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 4px; }
    .np-search-tab { white-space: nowrap; flex-shrink: 0; }
    .np-quick-cats { overflow-x: auto; flex-wrap: nowrap !important; padding-bottom: 8px; }
    .np-cat-pill { flex-shrink: 0; }
}

@media (max-width: 575.98px) {
    .np-hero-title { font-size: 1.6rem !important; }
    .np-search-input-group { flex-direction: column !important; }
    .np-search-field { width: 100% !important; }
    .np-btn-search { width: 100% !important; margin-top: 8px; }
}

/* ---------- PROPERTY CARDS ---------- */
@media (max-width: 575.98px) {
    .np-prop-card { margin-bottom: 12px; }
    .np-prop-img-wrapper { height: 180px !important; }
    .np-prop-title { font-size: 1rem !important; }
    .np-prop-price { font-size: 1.1rem !important; }
    .np-prop-specs {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    .np-prop-actions {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .np-prop-actions .btn,
    .np-prop-actions a {
        font-size: 0.82rem;
        padding: 6px 10px !important;
    }
}

/* ---------- CARDS (Generic) ---------- */
@media (max-width: 575.98px) {
    .np-card { padding: 16px !important; }
    .card { margin-bottom: 12px; }
}

/* ---------- TABLES ---------- */
@media (max-width: 991.98px) {
    /* Make tables horizontally scrollable on tablets */
    .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .table { min-width: 600px; }
    .table th, .table td {
        padding: 10px 8px;
        font-size: 0.85rem;
        white-space: nowrap;
    }
}

@media (max-width: 575.98px) {
    .table { min-width: 500px; }
    .table th, .table td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    /* Convert card-based tables to stacked layout */
    .np-table-mobile thead { display: none; }
    .np-table-mobile tbody, .np-table-mobile tr, .np-table-mobile td {
        display: block;
        width: 100%;
    }
    .np-table-mobile tr {
        margin-bottom: 12px;
        border: 1px solid #e2e8f0;
        border-radius: 10px;
        padding: 8px;
    }
    .np-table-mobile td {
        border: none;
        text-align: right;
        padding: 6px 0;
    }
    .np-table-mobile td::before {
        content: attr(data-label);
        float: left;
        font-weight: 600;
        color: #64748b;
    }
}

/* ---------- FORMS ---------- */
@media (max-width: 575.98px) {
    .form-control, .form-select, .form-control-sm {
        font-size: 16px; /* prevents iOS zoom */
    }
    .input-group { flex-wrap: wrap; }
    .input-group .btn { width: 100%; margin-top: 8px; border-radius: 8px !important; }
    .input-group .form-control { border-radius: 8px !important; }
    textarea.form-control { min-height: 100px; }
}

/* ---------- MODALS ---------- */
@media (max-width: 575.98px) {
    .modal-dialog {
        margin: 8px;
        max-width: calc(100% - 16px);
    }
    .modal-content { padding: 16px !important; }
    .modal-header, .modal-footer { padding: 12px 16px !important; }
    .modal-body { padding: 16px !important; }
    .modal-title { font-size: 1.1rem !important; }
}

/* ---------- ADMIN SIDEBAR ---------- */
@media (max-width: 991.98px) {
    .np-admin-sidebar {
        position: fixed !important;
        top: 0;
        left: 0;
        bottom: 0;
        z-index: 1050;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 20px rgba(0,0,0,0.3);
    }
    .np-admin-sidebar.show {
        transform: translateX(0);
    }
    .np-admin-main {
        margin-left: 0 !important;
        width: 100%;
    }
    .np-admin-topbar {
        padding: 10px 16px !important;
    }
    .np-admin-search { display: none !important; }
    /* Overlay when sidebar is open */
    .np-admin-overlay {
        display: none;
        position: fixed;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 1040;
    }
    .np-admin-overlay.show { display: block; }
}

@media (max-width: 575.98px) {
    .np-admin-brand .text-white { font-size: 0.9rem !important; }
    .np-admin-nav-item {
        padding: 10px 14px !important;
        font-size: 0.88rem !important;
    }
}

/* ---------- ADMIN DASHBOARD CARDS ---------- */
@media (max-width: 991.98px) {
    .np-admin-main > .p-4 { padding: 16px !important; }
}

@media (max-width: 575.98px) {
    .np-admin-main > .p-4 { padding: 12px !important; }
    .np-stat-card { padding: 12px !important; }
    .np-stat-card .fs-4 { font-size: 1.2rem !important; }
    .np-stat-card .small { font-size: 0.72rem !important; }
}

/* ---------- ADMIN TABLES / LIST PAGES ---------- */
@media (max-width: 991.98px) {
    .np-admin-main .card { margin-bottom: 16px; }
    .np-admin-main .d-flex.justify-content-between {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start !important;
    }
    .np-admin-main .d-flex.justify-content-between .btn {
        width: 100%;
    }
}

/* ---------- FOOTER ---------- */
@media (max-width: 767.98px) {
    .np-footer-brand { text-align: center; }
    .np-footer-social { justify-content: center; }
    footer .col-lg-4, footer .col-lg-3, footer .col-lg-2 {
        text-align: center;
        margin-bottom: 20px;
    }
    footer .list-unstyled {
        display: inline-block;
        text-align: left;
    }
    footer .d-flex.align-items-start {
        justify-content: center;
    }
    footer .row.align-items-center .col-md-6 {
        text-align: center;
        margin-bottom: 8px;
    }
    footer .d-flex.gap-1, footer .d-flex.gap-2 {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* ---------- DASHBOARD (User) ---------- */
@media (max-width: 991.98px) {
    .dashboard-sidebar, .seller-sidebar {
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 20px;
    }
    .dashboard-main, .seller-main {
        margin-left: 0 !important;
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .dashboard-tabs, .seller-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    .dashboard-tab, .seller-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ---------- PROPERTY DETAILS PAGE ---------- */
@media (max-width: 991.98px) {
    .np-prop-detail-gallery { flex-direction: column; }
    .np-prop-detail-gallery .np-prop-main-img {
        width: 100% !important;
        height: 250px !important;
    }
    .np-prop-detail-gallery .np-prop-thumbs {
        flex-direction: row !important;
        overflow-x: auto;
        width: 100% !important;
    }
    .np-prop-detail-gallery .np-prop-thumb {
        flex-shrink: 0;
        width: 80px !important;
        height: 60px !important;
    }
}

@media (max-width: 575.98px) {
    .np-prop-detail-info {
        flex-direction: column;
        gap: 12px;
    }
    .np-prop-detail-specs {
        flex-wrap: wrap;
        gap: 8px !important;
    }
    .np-prop-contact-card {
        position: static !important;
        margin-top: 20px;
    }
}

/* ---------- MAP SEARCH ---------- */
@media (max-width: 991.98px) {
    .np-map-search-container {
        flex-direction: column;
    }
    .np-map-sidebar {
        width: 100% !important;
        max-height: 300px;
        overflow-y: auto;
    }
    .np-map-canvas {
        height: 350px !important;
    }
}

/* ---------- BLOG / BLOG DETAILS ---------- */
@media (max-width: 575.98px) {
    .np-blog-card .np-blog-img { height: 160px !important; }
    .np-blog-detail-content { padding: 16px !important; }
    .np-blog-detail-content img { max-width: 100%; height: auto; }
}

/* ---------- AGENTS PAGE ---------- */
@media (max-width: 575.98px) {
    .np-agent-card { margin-bottom: 16px; }
    .np-agent-card .d-flex { flex-direction: column; text-align: center; }
    .np-agent-card img { margin: 0 auto 12px !important; }
}

/* ---------- COMPARE PAGE ---------- */
@media (max-width: 767.98px) {
    .np-compare-table { overflow-x: auto; }
    .np-compare-table table { min-width: 500px; }
}

/* ---------- CHAT ---------- */
@media (max-width: 767.98px) {
    .np-chat-container { flex-direction: column; height: calc(100vh - 120px); }
    .np-chat-sidebar { width: 100% !important; max-height: 200px; border-right: none !important; border-bottom: 1px solid #e2e8f0; }
    .np-chat-main { flex: 1; }
}

/* ---------- LOGIN / REGISTER ---------- */
@media (max-width: 767.98px) {
    .np-auth-wrapper { flex-direction: column; }
    .np-auth-brand-panel { display: none; }
    .np-auth-form-panel { flex: 1; padding: 20px 16px; }
}

/* ---------- PAGINATION ---------- */
@media (max-width: 575.98px) {
    .pagination { flex-wrap: wrap; gap: 4px; }
    .pagination .page-link {
        padding: 6px 10px;
        font-size: 0.85rem;
    }
}

/* ---------- FILTERS / SIDEBAR ---------- */
@media (max-width: 991.98px) {
    .np-filter-sidebar {
        position: static !important;
        width: 100% !important;
        margin-bottom: 20px;
    }
    .np-filter-toggle { display: block !important; }
    .np-filter-sidebar.collapse { display: none; }
    .np-filter-sidebar.show { display: block; }
}

/* ---------- STATS / COUNTERS ---------- */
@media (max-width: 575.98px) {
    .np-stat-row .col-md-3, .np-stat-row .col-6 {
        margin-bottom: 16px;
    }
    .np-stat-num { font-size: 1.5rem !important; }
}

/* ---------- UPLOAD FIELDS ---------- */
@media (max-width: 575.98px) {
    .np-upload-field .input-group { flex-wrap: wrap; }
    .np-upload-field .input-group .form-control { width: 100%; border-radius: 8px !important; margin-bottom: 8px; }
    .np-upload-field .input-group .btn { width: 100%; border-radius: 8px !important; }
}

/* ---------- GENERAL UTILITY ---------- */
@media (max-width: 575.98px) {
    .container { padding-left: 12px; padding-right: 12px; }
    .py-5 { padding-top: 2rem !important; padding-bottom: 2rem !important; }
    .mb-5 { margin-bottom: 1.5rem !important; }
    .fs-1 { font-size: 1.5rem !important; }
    .fs-2 { font-size: 1.3rem !important; }
    .fs-3 { font-size: 1.15rem !important; }
    .btn-lg { padding: 8px 20px; font-size: 0.95rem; }
    .d-flex.gap-4 { gap: 1rem !important; flex-wrap: wrap; }
    .d-flex.gap-3 { gap: 0.5rem !important; flex-wrap: wrap; }
    .position-absolute.np-auth-feature-icon { display: none; }
    /* Make images responsive */
    img { max-width: 100%; height: auto; }
    /* Prevent horizontal scroll */
    body, html { overflow-x: hidden; }
}

/* ---------- PRINT ---------- */
@media print {
    .np-navbar, .np-admin-sidebar, .np-admin-topbar, footer, .btn, .pagination { display: none !important; }
    .np-admin-main { margin-left: 0 !important; }
}

/* ========================================================
   NEW NAVBAR (White, inline-styled) — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    #mainNavbar .navbar-collapse {
        background: #ffffff !important;
        margin-top: 8px;
        border-radius: 12px;
        padding: 16px;
        border: 1px solid #e8eef5;
        box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    }
    #mainNavbar .navbar-nav {
        gap: 0 !important;
        width: 100%;
    }
    #mainNavbar .navbar-nav .nav-link {
        padding: 12px 8px !important;
        border-bottom: 1px solid #f1f5f9;
        font-size: 0.95rem;
        color: #334155 !important;
        text-align: left;
    }
    #mainNavbar .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    #mainNavbar .d-flex.align-items-center.gap-2.ms-lg-auto {
        margin-top: 12px;
        padding-top: 12px;
        border-top: 1px solid #f1f5f9;
        justify-content: flex-start !important;
        flex-wrap: wrap;
        gap: 8px !important;
    }
    #mainNavbar .navbar-brand img { height: 28px !important; }
}

@media (max-width: 575.98px) {
    #mainNavbar .d-flex.align-items-center.gap-2.ms-lg-auto {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px !important;
    }
    #mainNavbar .d-flex.align-items-center.gap-2.ms-lg-auto .btn-link {
        padding: 6px !important;
    }
    #mainNavbar .d-flex.align-items-center.gap-2.ms-lg-auto > a:last-child {
        flex: 1;
        text-align: center;
        font-size: 0.8rem !important;
        padding: 0.45rem 0.8rem !important;
    }
}

/* ========================================================
   NEW HERO SECTION — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    section.position-relative[style*="min-height: 620px"] {
        min-height: 500px !important;
    }
    section.position-relative[style*="min-height: 620px"] h1 {
        font-size: 2rem !important;
    }
    section.position-relative[style*="min-height: 620px"] .col-lg-4,
    section.position-relative[style*="min-height: 620px"] .col-lg-8 {
        text-align: center !important;
    }
    section.position-relative[style*="min-height: 620px"] .col-lg-4 p {
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 767.98px) {
    section.position-relative[style*="min-height: 620px"] {
        min-height: auto !important;
        padding-bottom: 0;
    }
    section.position-relative[style*="min-height: 620px"] .position-relative.d-flex {
        min-height: auto !important;
    }
    section.position-relative[style*="min-height: 620px"] h1 {
        font-size: 1.7rem !important;
    }
    section.position-relative[style*="min-height: 620px"] .col-lg-4 {
        padding-top: 2rem;
    }
    /* Search panel: stack vertically */
    section.position-relative[style*="min-height: 620px"] .bg-white.rounded-4 .row.g-2 > div {
        margin-bottom: 8px;
    }
}

@media (max-width: 575.98px) {
    section.position-relative[style*="min-height: 620px"] h1 {
        font-size: 1.5rem !important;
    }
    section.position-relative[style*="min-height: 620px"] .container {
        padding-top: 2rem !important;
    }
    /* Search tabs: horizontal scroll */
    section.position-relative[style*="min-height: 620px"] .d-flex.gap-2.mb-3 {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }
    section.position-relative[style*="min-height: 620px"] .d-flex.gap-2.mb-3 .btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
    /* Popular searches: horizontal scroll */
    section.position-relative[style*="min-height: 620px"] .d-flex.flex-wrap.align-items-center.gap-2.mt-3 {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    section.position-relative[style*="min-height: 620px"] .d-flex.flex-wrap.align-items-center.gap-2.mt-3 .badge {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

/* ========================================================
   CATEGORY CARDS (Below Hero) — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .col-6.col-md-4.col-lg-2 {
        margin-bottom: 8px;
    }
}

/* ========================================================
   PROPERTY CARDS (Featured) — Inline Style Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .card .position-relative.overflow-hidden[style*="height: 200px"] {
        height: 160px !important;
    }
    .card .d-flex.gap-2.mt-auto {
        flex-direction: column;
        gap: 6px !important;
    }
    .card .d-flex.gap-2.mt-auto .btn {
        font-size: 0.75rem !important;
        padding: 6px 10px !important;
    }
}

/* ========================================================
   STATS / COUNTERS (Inline) — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .row.text-center.g-4 .col-6.col-md-3 .fw-bold.fs-3 {
        font-size: 1.3rem !important;
    }
}

/* ========================================================
   BUY/RENT/SELL CARDS — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .col-md-4 {
        margin-bottom: 16px;
    }
}

/* ========================================================
   TESTIMONIALS — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .col-lg-4 .card.p-4 {
        padding: 16px !important;
        margin-bottom: 12px;
    }
}

/* ========================================================
   FAQ ACCORDION — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .accordion .accordion-button {
        font-size: 0.9rem !important;
        padding: 12px 14px !important;
    }
    .accordion .accordion-body {
        font-size: 0.85rem !important;
        padding: 12px 14px !important;
    }
}

/* ========================================================
   PROPERTIES LISTING PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    .np-filter-card {
        margin-bottom: 20px;
    }
    .np-filter-section {
        margin-bottom: 12px;
    }
}

@media (max-width: 575.98px) {
    .np-card .row.g-0 {
        flex-direction: column;
    }
    .np-card .row.g-0 > .col-md-4 {
        width: 100%;
    }
    .np-card .row.g-0 > .col-md-4 img {
        min-height: 180px !important;
        height: 180px !important;
    }
    .np-card .row.g-0 > .col-md-8 {
        padding: 16px !important;
    }
    .np-prop-specs {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .np-prop-actions {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .np-prop-actions .btn,
    .np-prop-actions a {
        font-size: 0.78rem !important;
        padding: 6px 10px !important;
    }
    .np-prop-price {
        font-size: 1.1rem !important;
    }
    .np-prop-title {
        font-size: 0.95rem !important;
    }
}

/* ========================================================
   PROPERTY DETAILS PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    .property-details .row > .col-lg-8,
    .property-details .row > .col-lg-4 {
        width: 100%;
    }
}

@media (max-width: 575.98px) {
    .property-details h1,
    .property-details h2,
    .property-details h3 {
        font-size: 1.2rem !important;
    }
    .property-details .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .property-details .d-flex.gap-2 .btn {
        flex: 1;
        font-size: 0.8rem !important;
    }
}

/* ========================================================
   BLOG / BLOG DETAILS — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .blog-card .card-body {
        padding: 12px !important;
    }
    .blog-card img {
        height: 160px !important;
    }
    .blog-detail-content {
        padding: 16px !important;
    }
    .blog-detail-content img {
        max-width: 100%;
        height: auto;
    }
}

/* ========================================================
   CONTACT PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .contact-page .d-flex.gap-3 {
        flex-direction: column;
        gap: 12px !important;
    }
    .contact-page .col-md-6,
    .contact-page .col-lg-6 {
        margin-bottom: 16px;
    }
}

/* ========================================================
   ABOUT PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .about-page .row.g-4 .col-lg-6 {
        margin-bottom: 20px;
    }
    .about-page img {
        height: 200px !important;
        object-fit: cover;
    }
}

/* ========================================================
   AGENTS PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .agents-page .col-md-6,
    .agents-page .col-lg-4 {
        margin-bottom: 16px;
    }
    .agents-page .card .d-flex {
        flex-direction: column;
        text-align: center;
    }
    .agents-page .card .d-flex img {
        margin: 0 auto 12px !important;
        width: 80px !important;
        height: 80px !important;
    }
}

/* ========================================================
   DASHBOARD / SELLER DASHBOARD — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    .dashboard-sidebar,
    .seller-sidebar {
        width: 100% !important;
        min-height: auto !important;
        margin-bottom: 20px;
        position: static !important;
    }
    .dashboard-main,
    .seller-main {
        margin-left: 0 !important;
        width: 100%;
    }
    .dashboard-tabs,
    .seller-tabs {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    .dashboard-tab,
    .seller-tab {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 575.98px) {
    .dashboard-main .card,
    .seller-main .card {
        margin-bottom: 16px;
    }
    .dashboard-main .d-flex.justify-content-between,
    .seller-main .d-flex.justify-content-between {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start !important;
    }
    .dashboard-main .d-flex.justify-content-between .btn,
    .seller-main .d-flex.justify-content-between .btn {
        width: 100%;
    }
}

/* ========================================================
   LOGIN / REGISTER — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .login-page .row,
    .register-page .row {
        margin: 0;
    }
    .login-page .col-lg-6,
    .register-page .col-lg-6 {
        padding: 0 12px;
    }
    .login-page .d-flex[style*="min-height"],
    .register-page .d-flex[style*="min-height"] {
        min-height: auto !important;
    }
}

/* ========================================================
   POST PROPERTY — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .post-property .row.g-3 > div {
        margin-bottom: 8px;
    }
    .post-property .d-flex.gap-2 {
        flex-direction: column;
        gap: 8px !important;
    }
}

/* ========================================================
   MAP SEARCH — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    .map-search .d-flex[style*="height"] {
        flex-direction: column !important;
        height: auto !important;
    }
    .map-search .col-lg-4 {
        width: 100%;
        max-height: 300px;
        overflow-y: auto;
        margin-bottom: 12px;
    }
    .map-search .col-lg-8 {
        width: 100%;
    }
    .map-search #map,
    .map-search #mapCanvas,
    .map-search .leaflet-container {
        height: 350px !important;
    }
}

/* ========================================================
   COMPARE PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .compare-page .table-responsive {
        overflow-x: auto;
    }
    .compare-page table {
        min-width: 500px;
    }
}

/* ========================================================
   CHAT PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 767.98px) {
    .chat-page .d-flex[style*="height"] {
        flex-direction: column !important;
        height: calc(100vh - 140px) !important;
    }
    .chat-page .col-lg-3,
    .chat-page .col-lg-9 {
        width: 100%;
    }
    .chat-page .col-lg-3 {
        max-height: 200px;
        overflow-y: auto;
        border-right: none !important;
        border-bottom: 1px solid #e2e8f0;
    }
}

/* ========================================================
   SUBSCRIPTIONS / PAYMENT — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .subscriptions .col-md-4,
    .payment .col-md-6 {
        margin-bottom: 16px;
    }
    .subscriptions .card {
        margin-bottom: 16px;
    }
}

/* ========================================================
   FAQS PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .faqs-page .accordion-button {
        font-size: 0.9rem !important;
    }
}

/* ========================================================
   404 / PRIVACY / TERMS — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    .error-page h1,
    .legal-page h1 {
        font-size: 1.5rem !important;
    }
    .legal-page p,
    .legal-page li {
        font-size: 0.9rem !important;
    }
}

/* ========================================================
   GENERAL INLINE-STYLE FIXES (Override inline styles)
   ======================================================== */
@media (max-width: 575.98px) {
    /* Force stack any row that uses inline col widths */
    .row > [class*="col-md-"]:not([class*="col-12"]),
    .row > [class*="col-lg-"]:not([class*="col-12"]) {
        width: 100%;
        margin-bottom: 12px;
    }
    /* Reduce large inline font sizes */
    [style*="font-size: 3rem"],
    [style*="font-size:2.5rem"] {
        font-size: 1.5rem !important;
    }
    [style*="font-size: 2rem"] {
        font-size: 1.3rem !important;
    }
    [style*="font-size: 1.5rem"] {
        font-size: 1.15rem !important;
    }
    /* Reduce large inline paddings */
    [style*="padding-top: 4rem"],
    [style*="padding-top:4rem"] {
        padding-top: 2rem !important;
    }
    [style*="padding-bottom: 2rem"],
    [style*="padding-bottom:2rem"] {
        padding-bottom: 1rem !important;
    }
    /* Make inline min-heights auto on mobile */
    [style*="min-height: 620px"],
    [style*="min-height:620px"] {
        min-height: auto !important;
    }
    [style*="min-height: 500px"],
    [style*="min-height:500px"] {
        min-height: auto !important;
    }
    /* Prevent horizontal overflow from inline widths */
    [style*="width: 500px"],
    [style*="width:500px"] {
        width: 100% !important;
        max-width: 100% !important;
    }
    /* Force flex-wrap on inline nowrap containers */
    .d-flex[style*="flex-wrap: nowrap"] {
        flex-wrap: wrap !important;
    }
    /* Make inline max-widths responsive */
    [style*="max-width: 900px"],
    [style*="max-width:900px"],
    [style*="max-width: 700px"],
    [style*="max-width:700px"],
    [style*="max-width: 600px"],
    [style*="max-width:600px"] {
        max-width: 100% !important;
    }
}

@media (max-width: 767.98px) {
    /* Stack any 2-column layout on tablets */
    .row > [class*="col-md-6"]:not([class*="col-12"]) {
        width: 100%;
        margin-bottom: 16px;
    }
    /* Reduce hero min-heights on tablet */
    [style*="min-height: 620px"],
    [style*="min-height:620px"] {
        min-height: 400px !important;
    }
}

/* ========================================================
   ADMIN PANEL — Mobile Fixes (Additional)
   ======================================================== */
@media (max-width: 991.98px) {
    .np-admin-main .container-fluid {
        padding: 12px !important;
    }
    .np-admin-main .row.g-3 > div {
        margin-bottom: 12px;
    }
    .np-admin-main .card .card-body {
        padding: 16px !important;
    }
}

@media (max-width: 575.98px) {
    .np-admin-main .d-flex.justify-content-between.align-items-center {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 10px;
    }
    .np-admin-main .d-flex.gap-2 {
        flex-wrap: wrap;
        gap: 6px !important;
    }
    .np-admin-main .btn {
        font-size: 0.82rem !important;
        padding: 6px 12px !important;
    }
    .np-admin-main .form-control,
    .np-admin-main .form-select {
        font-size: 16px;
    }
    .np-admin-main .col-md-6,
    .np-admin-main .col-md-4,
    .np-admin-main .col-md-3 {
        margin-bottom: 12px;
    }
}

/* ========================================================
   SETTINGS PAGE — Mobile Fixes
   ======================================================== */
@media (max-width: 991.98px) {
    .np-tabs-nav {
        overflow-x: auto;
        flex-wrap: nowrap !important;
        padding-bottom: 4px;
    }
    .np-tab-btn {
        white-space: nowrap;
        flex-shrink: 0;
    }
}

@media (max-width: 575.98px) {
    .np-card.p-4,
    .np-card.p-lg-5 {
        padding: 16px !important;
    }
    .np-card .row.g-3 > div {
        margin-bottom: 8px;
    }
}

/* ========================================================
   FLOATING WHATSAPP BUTTON — Mobile Fixes
   ======================================================== */
@media (max-width: 575.98px) {
    a.position-fixed[style*="width: 56px"][style*="height: 56px"] {
        width: 48px !important;
        height: 48px !important;
        margin: 12px !important;
    }
    a.position-fixed[style*="width: 56px"][style*="height: 56px"] i {
        font-size: 1.4rem !important;
    }
}

/* ========================================================
   PREVENT HORIZONTAL SCROLL GLOBALLY
   ======================================================== */
@media (max-width: 575.98px) {
    body, html {
        overflow-x: hidden;
        max-width: 100vw;
    }
    .container {
        max-width: 100% !important;
        padding-left: 12px !important;
        padding-right: 12px !important;
    }
    .row {
        margin-left: -6px !important;
        margin-right: -6px !important;
    }
    [class*="col-"] {
        padding-left: 6px !important;
        padding-right: 6px !important;
    }
    img {
        max-width: 100%;
        height: auto;
    }
    .position-absolute {
        max-width: 100%;
    }
}
