/* ============================================
   AdFinder - Consolidated Mobile-First Stylesheet
   Version 2.0 - Created: 2025-12-03

   This file consolidates modern.css and style.css
   into a single mobile-first responsive stylesheet.
   ============================================ */

/* ========== 1. CSS VARIABLES (DESIGN TOKENS) ========== */

:root {
    /* Primary Brand Colors (Modern Theme) */
    --brand-primary: #4154f1;
    --brand-primary-strong: #2d3dbe;
    --brand-accent: #f15bb5;
    --brand-amber: #ffb347;

    /* Neutral Colors */
    --ink: #0f172a;
    --muted: #5b6478;
    --surface: #ffffff;
    --surface-muted: #f5f7fb;
    --border-subtle: #e3e8ef;

    /* Legacy Color Aliases (for backwards compatibility) */
    --primary: #4361ee;
    --primary-light: #4895ef;
    --secondary: #3f37c9;
    --accent: #f72585;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --gray-light: #e9ecef;
    --success: #4cc9f0;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;

    /* Shadows */
    --shadow-strong: 0 18px 60px rgba(34, 40, 62, 0.12);
    --shadow-soft: 0 8px 30px rgba(37, 44, 74, 0.08);
    --box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);

    /* Design System Values */
    --border-radius: 8px;
    --transition: all 0.3s ease;
}


/* ========== 2. BASE STYLES (MOBILE-FIRST) ========== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-x: hidden;
    width: 100%;
}

body {
    font-family: 'Manrope', 'Space Grotesk', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: radial-gradient(120% 120% at 15% 20%, rgba(65, 84, 241, 0.12), transparent 35%),
                radial-gradient(90% 90% at 85% 15%, rgba(241, 91, 181, 0.12), transparent 35%),
                linear-gradient(180deg, #f8f9fe 0%, #eef2ff 100%);
    color: var(--ink);
    line-height: 1.6;
    padding-top: 60px; /* Mobile: Compact header */
    padding-bottom: 60px; /* Mobile: Bottom nav space */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 16px; /* Minimum readable size */
    overflow-x: hidden;
    width: 100%;
}

.page-gradient {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: radial-gradient(40% 40% at 10% 10%, rgba(65, 84, 241, 0.12), transparent 55%),
                radial-gradient(32% 32% at 90% 12%, rgba(241, 91, 181, 0.08), transparent 60%);
}

.page-main {
    padding: 16px 0 20px;
    flex: 1;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 8px;
    background: var(--brand-primary);
    color: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    z-index: 2000;
    text-decoration: none;
}

.skip-link:focus {
    left: 12px;
}

*:focus-visible {
    outline: 2px solid var(--brand-primary);
    outline-offset: 2px;
}

/* Prevent horizontal overflow on mobile */
@media (max-width: 767px) {
    body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    /* Target specific elements instead of wildcard */
    img, video, iframe, embed, object {
        max-width: 100%;
        height: auto;
    }

    p, h1, h2, h3, h4, h5, h6, li, td, th {
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    /* Fix: Neutralize Bootstrap .row negative margins on mobile */
    .container .row,
    .hero-panel .row,
    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        --bs-gutter-x: 0.5rem !important; /* Reduce from 1rem */
    }

    /* Also fix columns to prevent overflow */
    .row > [class*="col-"] {
        padding-left: 0.25rem !important;  /* 4px instead of 8px */
        padding-right: 0.25rem !important;
        min-width: 0; /* CRITICAL: Allow flex shrinkage */
    }

    /* Ensure container never exceeds viewport */
    .container,
    .hero-panel,
    .glass-card,
    .sidebar-section,
    .filters-panel,
    .detail-card {
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
}


/* ========== 3. LAYOUT COMPONENTS (MOBILE-FIRST) ========== */

/* Container - Mobile default */
.container {
    width: 100%;
    padding: 0 12px; /* Tight on mobile */
    margin: 0 auto;
}

/* Slight constraint on very small phones */
@media (max-width: 374px) {
    .container {
        padding: 0 10px;  /* Reduced from 12px */
    }
}

/* Main Content - Mobile: Single column, no sidebar */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 20px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Prevent flex/grid overflow */
.main-content > *,
.content-area > *,
.listings > * {
    min-width: 0; /* CRITICAL for flexbox/grid */
    max-width: 100%;
}

/* Sidebar - Hidden on mobile */
.sidebar {
    display: none;
}


/* ========== 4. HEADER & NAVIGATION (MOBILE-FIRST) ========== */

/* Header - Mobile: Minimal fixed header */
header,
.navbar-modern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: var(--shadow-soft);
    border-bottom: 1px solid rgba(227, 232, 239, 0.8);
    backdrop-filter: blur(14px);
    z-index: 1000;
    padding: 0 12px;
    transition: padding 0.2s ease, box-shadow 0.2s ease;
}

.header-content,
.navbar-modern .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 100%;
    gap: 8px;
}

/* Logo - Mobile */
.logo,
.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(65, 84, 241, 0.12), rgba(241, 91, 181, 0.08));
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.brand-icon {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--ink);
    color: #fff;
    font-size: 1rem;
}

.brand-icon-pink {
    background: linear-gradient(135deg, #ff8fb1, #f15bb5);
}

.brand-icon-blue {
    background: linear-gradient(135deg, #7ee0ff, #3b82f6);
}

.brand-type {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.brand-sub {
    display: none; /* Hidden on mobile */
    color: var(--muted);
    font-weight: 500;
    font-size: 0.85rem;
}

.logo i {
    font-size: 1.3rem;
}

/* Search Bar - Mobile: Full width, simplified */
.search-bar {
    flex: 1;
    max-width: 100%;
    margin: 0;
    min-width: 0; /* Allows flex shrink */
}

.search-bar form,
.theme-modern .search-bar form {
    display: flex;
    align-items: center;
    background: var(--surface);
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: 4px;
    gap: 4px;
    box-shadow: var(--shadow-soft);
}

.search-bar input,
.theme-modern .search-bar input {
    width: 100%;
    border: none;
    background: transparent;
    padding: 8px 10px;
    font-size: 0.9rem;
    min-width: 0;
}

.search-bar input:focus,
.theme-modern .search-bar input:focus {
    outline: none;
    box-shadow: none;
}

.search-bar button,
.theme-modern .search-bar button {
    border: none;
    background: var(--brand-primary);
    color: white;
    border-radius: 10px;
    padding: 8px 10px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.85rem;
    white-space: nowrap;
    display: grid;
    place-items: center;
}

.search-bar button:hover {
    background: var(--brand-primary-strong);
}

/* Nav Buttons - Hidden on mobile */
.nav-buttons {
    display: none;
}

/* Mobile Menu Toggle - Visible on mobile */
.mobile-menu-toggle {
    display: grid;
    place-items: center;
    background: var(--ink);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    font-size: 1.3rem;
    padding: 0;
    transition: var(--transition);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    transform: translateY(-1px);
}

/* Hamburger Menu - Mobile */
.hamburger-menu {
    position: fixed;
    top: 0;
    right: -280px;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    z-index: 2000;
    transition: right 0.3s ease;
    overflow-y: auto;
}

.hamburger-menu.active {
    right: 0;
}

.hamburger-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--border-subtle);
}

.hamburger-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--ink);
}

.hamburger-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--gray);
    cursor: pointer;
    padding: 5px;
    transition: var(--transition);
}

.hamburger-close:hover {
    color: var(--danger);
}

.hamburger-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.hamburger-links li {
    border-bottom: 1px solid var(--border-subtle);
}

.hamburger-links li.hamburger-divider {
    height: 1px;
    background: var(--border-subtle);
    margin: 10px 0;
    border: none;
}

.hamburger-links a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    color: var(--ink);
    text-decoration: none;
    transition: var(--transition);
}

.hamburger-links a:hover {
    background: var(--surface-muted);
    color: var(--brand-primary);
}

.hamburger-links a i {
    width: 20px;
    text-align: center;
    color: var(--brand-primary);
}

/* Hamburger Overlay */
.hamburger-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hamburger-overlay.active {
    display: block;
    opacity: 1;
}

/* Hamburger Categories Section */
.hamburger-categories {
    padding: 20px;
    border-top: 1px solid var(--border-subtle);
    background: var(--surface-muted);
    max-height: 50vh;
    overflow-y: auto;
}

.hamburger-categories-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 12px 0;
}

.hamburger-category-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.hamburger-category-pills .category-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: var(--ink);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
    min-height: 36px;
}

.hamburger-category-pills .category-pill:hover {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

.hamburger-category-pills .pill-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 0.75rem;
    font-weight: 700;
}

.hamburger-category-pills .category-pill:hover .pill-count {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Smooth scrolling for many categories */
.hamburger-categories::-webkit-scrollbar {
    width: 6px;
}

.hamburger-categories::-webkit-scrollbar-track {
    background: var(--surface);
}

.hamburger-categories::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 3px;
}

.hamburger-categories::-webkit-scrollbar-thumb:hover {
    background: var(--muted);
}

/* Bottom Navigation - Visible on mobile */
.bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: rgba(15, 23, 42, 0.94);
    box-shadow: 0 -10px 30px rgba(15, 23, 42, 0.18);
    z-index: 1000;
    padding: 8px 0;
    justify-content: space-around;
    align-items: center;
    transition: transform 0.25s ease;
}

.bottom-nav-hide {
    transform: translateY(100%);
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    color: #d0d4e0;
    text-decoration: none;
    transition: var(--transition);
    flex: 1;
    text-align: center;
    position: relative;
    min-height: 44px; /* Touch target */
    min-width: 44px;
}

.bottom-nav-item i {
    font-size: 1.3rem;
    margin-bottom: 4px;
}

.bottom-nav-item span {
    font-size: 0.7rem;
    font-weight: 500;
}

.bottom-nav-item:hover,
.bottom-nav-item.active {
    color: #fff;
}

.bottom-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: var(--brand-primary);
    border-radius: 0 0 3px 3px;
}

/* Primary action button */
.bottom-nav-primary i {
    font-size: 2rem;
    color: var(--brand-primary);
}

.bottom-nav-primary:hover i {
    transform: scale(1.1);
}

/* ============================================
   Mobile Quickbar (Homepage only)
   ============================================ */

.mobile-quickbar {
    display: none; /* Hidden by default */
}

@media (max-width: 767px) {
    .navbar-modern {
        display: none; /* Hide main navbar on mobile homepage */
    }

    .mobile-quickbar {
        position: sticky;
        top: 0;
        z-index: 1200;
        display: grid;
        grid-template-columns: max-content 1fr max-content;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        margin: 0 0 8px;  /* Remove negative margins */
        background: rgba(255, 255, 255, 0.96);
        box-shadow: 0 10px 30px rgba(15, 23, 42, 0.14);
        border-radius: 14px;
    }

    .mobile-brand {
        font-weight: 800;
        font-size: 1rem;
        color: var(--ink);
        text-decoration: none;
        letter-spacing: -0.01em;
    }

    .mobile-search {
        display: flex;
        align-items: center;
        gap: 6px;
        background: #f5f7fb;
        border: 1px solid var(--border-subtle);
        border-radius: 12px;
        padding: 4px 6px 4px 10px;
    }

    .mobile-search input {
        border: none;
        background: transparent;
        width: 100%;
        font-size: 0.95rem;
    }

    .mobile-search input:focus {
        outline: none;
    }

    .mobile-search button {
        border: none;
        background: var(--brand-primary);
        color: #fff;
        border-radius: 10px;
        padding: 8px 10px;
        display: grid;
        place-items: center;
    }

    .mobile-quick-actions {
        display: inline-flex;
        align-items: center;
        gap: 8px;
    }

    .mobile-post-btn,
    .mobile-quickbar .mobile-menu-toggle {
        width: 40px;
        height: 40px;
        border-radius: 12px;
        border: none;
        display: grid;
        place-items: center;
        box-shadow: var(--shadow-soft);
        text-decoration: none;
    }

    .mobile-post-btn {
        background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong));
        color: #fff;
    }

    .mobile-quickbar .mobile-menu-toggle {
        background: var(--ink);
        color: #fff;
    }

    .hero-panel {
        margin-top: 12px;
    }

    .hero-home-link {
        color: inherit;
        text-decoration: none;
    }

    .hero-actions {
        width: 100%;
    }
}

/* ========================================
   Portrait Mode: Brand Above Quickbar
   Using both orientation and aspect-ratio for better browser support
   ======================================== */
@media (max-width: 767px) and (orientation: portrait),
       (max-width: 767px) and (max-aspect-ratio: 5/8) {
    /* Override grid to remove brand column */
    .mobile-quickbar {
        grid-template-columns: 1fr max-content !important;
        padding-top: 50px !important;
        position: relative;
    }

    /* Position brand absolutely at top-left */
    .mobile-brand {
        position: absolute !important;
        top: 10px;
        left: 12px;
        font-size: 1.1rem;
        font-weight: 900;
        z-index: 1;
        color: var(--ink);
        text-decoration: none;
        letter-spacing: -0.02em;
    }
}

/* ========================================
   Landscape Mode: Brand Stays in Grid
   ======================================== */
@media (max-width: 767px) and (orientation: landscape) {
    /* Explicitly maintain 3-column layout */
    .mobile-quickbar {
        grid-template-columns: max-content 1fr max-content;
    }

    /* Ensure brand stays in grid flow */
    .mobile-brand {
        position: static;
    }
}


/* ========== 5. CONTENT COMPONENTS (MOBILE-FIRST) ========== */

/* Glass Cards & Panels */
.glass-card,
.sidebar-section,
.hero-panel,
.filters-panel,
.detail-card {
    background: rgba(255, 255, 255, 0.92);
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    backdrop-filter: blur(8px);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.sidebar-section {
    padding: 20px;
    margin-bottom: 20px;
}

.content-area {
    display: grid;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Section Titles */
.section-title {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 10px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--brand-primary);
    border-radius: 2px;
}

.section-title i {
    color: var(--brand-primary);
}

/* Hero Section - Mobile */
.hero,
.hero-panel {
    background: linear-gradient(135deg, rgba(65, 84, 241, 0.12), rgba(241, 91, 181, 0.08));
    padding: 16px;
    border-radius: 16px;
    position: relative;
    overflow: hidden;
    margin-bottom: 16px;
}

/* Reduce padding on very small phones */
@media (max-width: 374px) {
    .hero-panel {
        padding: 12px;  /* Reduced from 16px */
    }
}

.hero-panel::after {
    content: "";
    position: absolute;
    inset: 12px;
    border-radius: 16px;
    background: linear-gradient(120deg, rgba(65, 84, 241, 0.08), rgba(241, 91, 181, 0.08));
    z-index: 0;
    pointer-events: none;
}

.hero-panel > * {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: clamp(1.25rem, 4vw, 1.5rem); /* 20px-24px responsive */
    line-height: 1.2;
    margin-bottom: 12px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--ink);
    word-wrap: break-word;
}

.hero-lede,
.hero p {
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 16px;
    max-width: 620px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    width: 100%;
}

/* Reduce gap when buttons stack on mobile */
@media (max-width: 767px) {
    .hero-actions {
        gap: 10px;  /* Reduced from 12px for vertical stacking */
    }
}

.hero-stats {
    display: none; /* Hidden on mobile */
}

/* Listings Grid - Mobile (2 columns, 140px cards) */
.listings {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 20px;
    width: 100%;           /* Take full width of parent */
    max-width: 100%;       /* Never exceed parent width */
    box-sizing: border-box; /* Include padding in width calculation */
}

/* Listing Cards */
.listing-card {
    background: linear-gradient(180deg, rgba(65, 84, 241, 0.02), rgba(255, 255, 255, 0.9));
    border-radius: 16px;
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--ink);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    overflow: hidden;
    display: block;
    min-height: 44px; /* Touch target */
}

.listing-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-strong);
}

.listing-image {
    height: 120px;
    width: 100%;
    background-color: var(--surface-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid var(--border-subtle);
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.listing-content {
    padding: 12px;
    display: grid;
    gap: 8px;
}

.listing-price {
    font-size: 1rem;
    font-weight: 800;
    color: var(--ink);
    margin-bottom: 0;
}

.listing-title {
    font-weight: 700;
    font-size: 0.9rem;
    margin: 0;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.listing-description {
    display: none; /* Hidden on mobile */
}

.listing-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.85rem;
}

.listing-location {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Listing Badges */
.listing-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    border-radius: 10px;
    padding: 6px 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
    box-shadow: var(--shadow-soft);
    z-index: 1;
}

.badge-premium,
.listing-badge.badge-premium {
    background: linear-gradient(135deg, #ffd166, #ff8c37);
    color: #3a2000;
}

.badge-plus,
.listing-badge.badge-plus {
    background: linear-gradient(135deg, #72efdd, #3494e6);
    color: #0c3b5a;
}

.badge-featured,
.listing-badge.badge-featured {
    background: linear-gradient(135deg, #7ee0ff, #3b82f6);
    color: #0f305a;
}

.badge-urgent,
.listing-badge.badge-urgent {
    background: linear-gradient(135deg, #ff7b9e, #f33b67);
    color: #fff;
}

/* Favorite Pin */
.favorite-pin {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    display: grid;
    place-items: center;
    color: #d81b60;
    box-shadow: var(--shadow-soft);
    z-index: 1;
    transition: transform 0.2s ease;
}

.favorite-pin:hover {
    transform: translateY(-2px);
}

/* Verified Badge */
.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(16, 185, 129, 0.15);
    color: #0f5132;
    padding: 4px 8px;
    border-radius: 10px;
    font-size: 0.8rem;
}

/* Stat Chip */
.stat-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(65, 84, 241, 0.12), rgba(241, 91, 181, 0.10));
    color: var(--ink);
    font-weight: 700;
}

.stat-chip i {
    color: var(--brand-primary);
}

/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(65, 84, 241, 0.14);
    color: var(--brand-primary-strong);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

/* Categories */
.categories {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.category-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 16px;
    text-align: center;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none;
    color: var(--ink);
}

.category-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.category-icon {
    font-size: 2rem;
    color: var(--brand-primary);
    margin-bottom: 10px;
}

.category-card h3 {
    font-size: 0.95rem;
}

/* Category List */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}

.category-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    color: var(--ink);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(245, 247, 251, 0.9));
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.category-list a:hover {
    border-color: var(--border-subtle);
    box-shadow: var(--shadow-soft);
    transform: translateY(-1px);
}

.category-list a::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--brand-primary);
    margin-right: 10px;
    flex-shrink: 0;
    box-shadow: 0 0 0 6px rgba(65, 84, 241, 0.12);
}

.category-list a .count {
    background: rgba(15, 23, 42, 0.06);
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--muted);
}

.subcategory-list {
    margin-top: 8px;
    padding-left: 8px;
    border-left: 2px solid var(--border-subtle);
    display: grid;
    gap: 6px;
}

/* Category Pills */
.category-pill-row {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px;
    scrollbar-width: thin;
    width: 100%;             /* Take full container width */
    max-width: 100%;         /* Never exceed container */
    box-sizing: border-box;  /* Include padding in width */
}

.category-pill,
.category-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.08);
    color: var(--ink);
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
    border: 1px solid var(--border-subtle);
    outline: none;
    min-height: 44px; /* Touch target */
}

.category-pill:hover,
.category-pill-btn:hover {
    background: rgba(65, 84, 241, 0.12);
    color: var(--brand-primary-strong);
    border-color: var(--brand-primary);
}

/* Category Checkbox Labels */
.category-checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s ease;
    margin-bottom: 4px;
}

.category-checkbox-label:hover {
    background: rgba(65, 84, 241, 0.05);
}

.category-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.category-checkbox-label input[type="checkbox"]:checked + .category-name {
    font-weight: 600;
    color: var(--brand-primary-strong);
}

.category-checkbox-label .category-name {
    flex: 1;
}

.category-checkbox-label .count {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Category Actions */
.category-actions {
    position: sticky;
    bottom: 0;
    padding: 12px;
    background: white;
    border-top: 1px solid var(--border-subtle);
}

/* Category Pill Checkbox Styling */
.category-pill-checkbox {
    display: inline-block;
    cursor: pointer;
    margin: 0;
}

.category-pill-checkbox input:checked + .pill-text {
    background: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.category-pill-checkbox .pill-text {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.category-pill-checkbox:hover .pill-text {
    border-color: var(--brand-primary);
    background: rgba(65, 84, 241, 0.1);
}

/* Pagination */
.pagination {
    display: inline-flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft);
}

.pagination a,
.pagination span {
    padding: 8px 12px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    color: var(--ink);
    border: 1px solid var(--border-subtle);
    transition: var(--transition);
}

.pagination a:hover {
    background-color: var(--brand-primary);
    color: white;
    border-color: var(--brand-primary);
}

.pagination .current {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}


/* ========== 6. BUTTONS (MOBILE-FIRST) ========== */

.btn {
    border-radius: 12px;
    font-weight: 700;
    padding: 12px 20px; /* Larger on mobile for touch */
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    white-space: nowrap;
    text-decoration: none;
    min-height: 44px; /* Touch target */
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
}

/* Reduce large button padding on mobile */
@media (max-width: 767px) {
    .btn-lg {
        padding: 10px 16px;  /* Reduced from 14px 28px */
        font-size: 0.95rem;  /* Slightly smaller than 1rem */
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-strong));
    border-color: transparent;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--brand-primary-strong), #202c8f);
}

.btn-outline {
    background: #fff;
    border-color: var(--border-subtle);
    color: var(--ink);
}

.btn-outline:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary-strong);
    background: rgba(65, 84, 241, 0.08);
}

.btn-danger {
    background-color: var(--danger);
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}


/* ========== 7. FILTERS & SIDEBAR WIDGETS ========== */

.filters-panel {
    padding: 20px;
}

.filters-panel .form-group {
    margin-bottom: 18px;
}

.filters-panel label {
    font-weight: 700;
    color: var(--ink);
    display: block;
    margin-bottom: 8px;
}

.filters-panel input,
.filters-panel select {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    padding: 10px 12px;
    background: #fff;
    color: var(--ink);
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(65, 84, 241, 0.12);
    color: var(--brand-primary-strong);
    padding: 8px 12px;
    border-radius: 12px;
    font-weight: 700;
}


/* ========== 8. FORMS (MOBILE-FIRST) ========== */

.form-group {
    margin-bottom: 20px;
}

.form-group label,
form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: var(--ink);
}

.form-control,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    color: var(--ink);
    transition: all 0.2s ease;
}

input:focus,
.form-control:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(65, 84, 241, 0.12);
}

input::placeholder,
textarea::placeholder {
    color: var(--muted);
    opacity: 0.7;
}

.form-check-input {
    width: auto;
    height: auto;
    margin-right: 8px;
}

.errorlist {
    list-style: none;
    padding-left: 0;
    margin: 6px 0 0;
    color: var(--danger);
    font-size: 0.9rem;
}


/* ========== 9. MESSAGES & ALERTS ========== */

.messages-container {
    padding: 15px 0;
}

.messages-container .alert {
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    background: #fff;
}

.alert {
    padding: 12px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-error,
.alert-danger {
    background-color: rgba(220, 53, 69, 0.08);
    border: 1px solid rgba(220, 53, 69, 0.2);
    color: #8a1f2b;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

.alert-warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.close-alert {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: inherit;
    opacity: 0.5;
}

.close-alert:hover {
    opacity: 1;
}


/* ========== 10. DETAIL PAGES ========== */

.breadcrumb-modern {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-weight: 600;
    flex-wrap: wrap;
}

.breadcrumb-modern a {
    color: var(--brand-primary-strong);
    text-decoration: none;
}

.detail-card {
    padding: 20px;
}

.meta-row {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    color: var(--muted);
    font-size: 0.9rem;
}

.price-block {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(65, 84, 241, 0.1), rgba(241, 91, 181, 0.08));
    border: 1px solid var(--border-subtle);
}

.price-block .price {
    font-size: 1.8rem;
    font-weight: 800;
}

.table-modern {
    width: 100%;
    border-collapse: collapse;
}

.table-modern tr + tr td {
    border-top: 1px solid var(--border-subtle);
}

.table-modern td {
    padding: 12px 0;
    vertical-align: middle;
}

.table-modern td:first-child {
    font-weight: 700;
    color: var(--muted);
    width: 35%;
}


/* ========== 11. AUTH PAGES ========== */

.auth-shell {
    max-width: 520px;
    margin: 24px auto 48px;
}

.auth-card {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid var(--border-subtle);
    border-radius: 16px;
    box-shadow: var(--shadow-soft);
    padding: 24px;
}

.auth-header .auth-icon {
    font-size: 3rem;
    color: var(--brand-primary);
    margin-bottom: 10px;
}

.auth-header h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.auth-header p {
    margin: 0;
}

.auth-form .form-group {
    margin-bottom: 16px;
}

.auth-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border-subtle);
}

.auth-link {
    color: var(--brand-primary-strong);
    text-decoration: none;
}

.auth-link:hover {
    color: var(--brand-primary);
}


/* ========== 12. MESSAGES (MESSAGING SYSTEM) ========== */

.message-tab-btn {
    border: 1px solid var(--border-subtle);
    background: #fff;
    padding: 10px 14px;
    border-radius: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ink);
    cursor: pointer;
    transition: all 0.2s ease;
}

.message-tab-btn.active {
    background: var(--brand-primary);
    border-color: var(--brand-primary);
    color: #fff;
    box-shadow: var(--shadow-soft);
}

.message-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 14px;
    border: 1px solid var(--border-subtle);
    padding: 16px;
    box-shadow: var(--shadow-soft);
    outline: none;
    margin-bottom: 12px;
}

.message-card.is-unread {
    border-left: 4px solid var(--brand-primary);
    background: rgba(65, 84, 241, 0.04);
}

.message-card.is-read {
    border-left: 4px solid var(--border-subtle);
}

.message-listing {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 10px;
}

.message-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
}

.message-body {
    background: #fff;
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    padding: 12px;
}


/* ========== 13. FOOTER ========== */

footer {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.88));
    color: #e6e8ef;
    padding: 18px 0 16px;
    margin-top: auto;
}

.footer-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    font-weight: 800;
    color: #fff;
}

.footer-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    color: #d0d4e0;
    font-size: 0.9rem;
}

.footer-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    margin-top: 12px;
    padding-top: 10px;
    color: #c4c8d6;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    text-align: center;
    font-size: 0.85rem;
}

.legal-links {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
}

.legal-links a {
    color: #d0d4e0;
    text-decoration: none;
}

.legal-links a:hover {
    color: #fff;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.footer-column h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: #adb5bd;
    text-decoration: none;
    transition: var(--transition);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: white;
}


/* ========== 14. RESPONSIVE OVERRIDES (MOBILE-FIRST) ========== */

/* Small phones (320px) fallback */
@media (max-width: 374px) {
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
        gap: 8px;
    }

    .listing-image {
        height: 115px;  /* Slightly shorter for small screens */
    }

    .hamburger-menu {
        width: 90%;
        right: -90%;
    }

    .bottom-nav-item i {
        font-size: 1.1rem;
    }

    .bottom-nav-item span {
        font-size: 0.65rem;
    }

    .container {
        padding: 0 8px;
    }
}

/* Optimize for popular phone sizes (375-427px) */
@media (min-width: 375px) and (max-width: 427px) {
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(145px, 1fr));
        gap: 10px;
    }

    .listing-image {
        height: 125px;  /* Scale between 120px and 130px */
    }
}

/* Large phones (428px+) */
@media (min-width: 428px) {
    .hero-title {
        font-size: 1.75rem; /* 28px */
    }

    .listing-image {
        height: 130px;
    }
}

/* Medium phones (428-575px) */
@media (min-width: 428px) and (max-width: 575px) {
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    .listing-image {
        height: 130px;
    }
}

/* Small devices (576px+) - Bootstrap sm */
@media (min-width: 576px) {
    .container {
        padding: 0 16px;
    }

    .categories {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }

    /* Listings grid - Small tablets (576px+) */
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(165px, 1fr));
        gap: 14px;
    }

    .listing-image {
        height: 135px;
    }
}

/* Medium devices (768px+) - Tablets */
@media (min-width: 768px) {
    body {
        padding-top: 70px;
    }

    .page-main {
        padding: 20px 0 30px;
    }

    .container {
        padding: 0 20px;
        max-width: 720px;
    }

    .main-content {
        gap: 20px;
        margin-bottom: 30px;
    }

    .content-area {
        gap: 18px;
    }

    /* Hero */
    .hero-title {
        font-size: 2rem; /* 32px */
        margin-bottom: 16px;
    }

    .hero-lede,
    .hero p {
        font-size: 1.05rem;
    }

    /* Listings */
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 16px;
    }

    .listing-image {
        height: 140px;
    }

    /* Categories */
    .categories {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 20px;
    }

    /* Pagination */
    .pagination {
        justify-content: center;
        margin: 30px 0;
    }

    /* Search bar */
    .search-bar {
        max-width: 500px;
    }

    .search-bar input {
        padding: 10px 12px;
        font-size: 0.95rem;
    }

    /* Detail page */
    .price-block .price {
        font-size: 2rem;
    }

    .detail-card {
        padding: 24px;
    }

    /* Auth */
    .auth-shell {
        margin: 36px auto 60px;
    }

    .auth-card {
        padding: 32px;
    }

    .auth-header .auth-icon {
        font-size: 3.5rem;
    }

    .auth-header h1 {
        font-size: 1.8rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        gap: 30px;
    }
}

/* Large devices (992px+) - Desktop */
@media (min-width: 992px) {
    body {
        padding-top: 88px; /* Taller header */
        padding-bottom: 0; /* No bottom nav */
    }

    .page-main {
        padding: 24px 0 100px;
    }

    .container {
        max-width: 960px;
    }

    /* Header */
    header,
    .navbar-modern {
        height: auto;
        padding: 14px 0;
    }

    .brand-sub {
        display: block;
    }

    .brand-icon {
        width: 42px;
        height: 42px;
        font-size: 1.1rem;
    }

    .brand-mark {
        padding: 10px 14px;
        border-radius: 14px;
    }

    .search-bar {
        max-width: 640px;
        margin: 0 15px;
    }

    .search-bar form,
    .theme-modern .search-bar form {
        padding: 6px;
    }

    .search-bar input,
    .theme-modern .search-bar input {
        padding: 12px 14px;
        font-size: 0.95rem;
    }

    .search-bar button,
    .theme-modern .search-bar button {
        padding: 10px 16px;
    }

    /* Show desktop nav, hide mobile nav */
    .nav-buttons {
        display: flex !important;
        gap: 8px;
    }

    .nav-buttons .btn,
    .theme-modern .nav-buttons .btn {
        border-radius: 12px;
        padding: 10px 16px;
        font-weight: 700;
    }

    .mobile-menu-toggle {
        display: none;
    }

    .bottom-nav {
        display: none;
    }

    /* Main content with sidebar */
    .main-content {
        grid-template-columns: 280px 1fr; /* Sidebar + content */
        gap: 24px;
        margin-bottom: 50px;
    }

    .sidebar {
        display: block;
        position: sticky;
        top: 110px;
    }

    /* Hero */
    .hero-title {
        font-size: 2.4rem; /* 38.4px */
        margin-bottom: 20px;
    }

    .hero-lede {
        font-size: 1.15rem;
    }

    .hero-stats {
        display: flex;
    }

    .hero-panel {
        padding: 26px;
    }

    /* Listings */
    .listings {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 18px;
        margin-bottom: 50px;
    }

    /* Categories */
    .categories {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    /* Buttons */
    .btn {
        padding: 10px 16px;
        font-size: 0.9rem;
    }

    /* Detail page */
    .price-block .price {
        font-size: 2.2rem;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        margin-bottom: 40px;
    }

    footer {
        padding: 50px 0 20px;
    }
}

/* ========== INFINITE SCROLL UI ========== */

@media (max-width: 767px) {
    .infinite-scroll-loading {
        margin: 20px 0;
        animation: fadeIn 0.3s ease-in;
    }

    .infinite-scroll-sentinel {
        visibility: hidden;
        pointer-events: none;
    }

    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

/* Extra large devices (1200px+) */
@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }

    .main-content {
        grid-template-columns: 300px 1fr;
        gap: 30px;
    }

    .hero-title {
        font-size: 2.6rem; /* 41.6px */
    }

    .listings {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }

    .sidebar-section {
        padding: 25px;
    }
}

/* Extra extra large (1400px+) */
@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }

    .listings {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }
}


/* ========== 15. UTILITY CLASSES & MISC ========== */

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

/* Show/hide at specific breakpoints */
@media (min-width: 992px) {
    .d-lg-block {
        display: block !important;
    }

    .d-lg-none {
        display: none !important;
    }

    .d-lg-flex {
        display: flex !important;
    }
}

@media (max-width: 991px) {
    .d-lg-block {
        display: none !important;
    }
}

@media (min-width: 768px) {
    .d-md-block {
        display: block !important;
    }

    .d-md-none {
        display: none !important;
    }

    .d-md-inline-flex {
        display: inline-flex !important;
    }
}

@media (max-width: 767px) {
    .d-md-block {
        display: none !important;
    }
}

/* Touch target enforcement on mobile */
@media (max-width: 767px) {
    .btn,
    .bottom-nav-item,
    .mobile-menu-toggle,
    .category-pill-btn,
    a.listing-card {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Hover states only on devices that support hover */
@media (hover: hover) {
    .logo:hover,
    .brand-mark:hover {
        transform: translateY(-1px);
        box-shadow: 0 12px 30px rgba(65, 84, 241, 0.18);
    }

    .listing-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-strong);
    }
}

/* Print styles */
@media print {
    .navbar-modern,
    .bottom-nav,
    .hamburger-menu,
    .mobile-menu-toggle,
    .nav-buttons {
        display: none !important;
    }

    body {
        padding-top: 0;
        padding-bottom: 0;
    }
}


/* ========== MAP VIEW STYLES ========== */

/* Map container */
#map {
    width: 100%;
    height: 500px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

/* Mobile: Full viewport height minus header/nav */
@media (max-width: 767px) {
    #map {
        height: calc(100vh - 140px);
        border-radius: 0;
    }
}

/* Tablet: Larger but not full height */
@media (min-width: 768px) and (max-width: 991px) {
    #map {
        height: 600px;
    }
}

/* Desktop: Tall map */
@media (min-width: 992px) {
    #map {
        height: 700px;
    }
}

/* Custom info window styling */
.gm-style .gm-style-iw-c {
    border-radius: 12px !important;
    padding: 12px !important;
    max-width: 280px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
    max-height: 400px !important;
}

.gm-style .gm-style-iw-t::after {
    background: white !important;
}

/* Info window content */
.map-info-window {
    max-width: 250px;
    font-family: 'Manrope', 'Space Grotesk', sans-serif;
}

.map-info-window img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.map-info-window h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 8px 0;
    color: var(--ink);
    line-height: 1.3;
}

.map-info-window .price {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--brand-primary);
    margin-bottom: 8px;
}

.map-info-window .meta {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.map-info-window .meta div {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-info-window .meta i {
    width: 14px;
    text-align: center;
    color: var(--brand-primary);
}

.map-info-window .badges {
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.map-info-window .badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.map-info-window .badge-premium {
    background: linear-gradient(135deg, #ffd166, #ff8c37);
    color: #3a2000;
}

.map-info-window .badge-plus {
    background: linear-gradient(135deg, #72efdd, #3494e6);
    color: #0c3b5a;
}

.map-info-window .badge-featured {
    background: linear-gradient(135deg, #7ee0ff, #3b82f6);
    color: #0f305a;
}

.map-info-window .badge-urgent {
    background: linear-gradient(135deg, #ff7b9e, #f33b67);
    color: white;
}

.map-info-window .view-btn {
    display: inline-block;
    width: 100%;
    text-align: center;
    padding: 10px 16px;
    background: var(--brand-primary);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.map-info-window .view-btn:hover {
    background: var(--brand-primary-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-soft);
}

/* Loading overlay */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: var(--shadow-strong);
    z-index: 1000;
    display: none;
    font-weight: 600;
    color: var(--ink);
}

.map-loading.active {
    display: flex;
    align-items: center;
    gap: 12px;
}

.map-loading i {
    font-size: 1.2rem;
    color: var(--brand-primary);
}

/* Listing count badge */
.listing-count-badge {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 999px;
    box-shadow: var(--shadow-soft);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--ink);
    z-index: 100;
    display: none;
}

.listing-count-badge:not(:empty) {
    display: block;
}

/* Mobile: Position at bottom to avoid conflicting with map controls */
@media (max-width: 767px) {
    .listing-count-badge {
        top: auto;
        bottom: 80px;
        left: 10px;
        right: 10px;
        transform: none;
        text-align: center;
    }
}

/* Custom marker icon styling (for future HTML markers) */
.custom-marker {
    background: var(--brand-primary);
    border: 3px solid white;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.75rem;
}

.custom-marker.featured {
    background: linear-gradient(135deg, #ffd166, #ff8c37);
}

.custom-marker.urgent {
    background: linear-gradient(135deg, #ff7b9e, #f33b67);
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 4px 12px rgba(255, 123, 158, 0.6);
    }
}

/* Fix for Google Maps controls on mobile */
@media (max-width: 767px) {
    .gm-style .gm-style-cc {
        display: none !important;
    }

    .gm-style .gmnoprint {
        margin: 5px !important;
    }

    .gm-style button {
        min-width: 36px !important;
        min-height: 36px !important;
    }
}

/* Ensure map controls are accessible */
.gm-style button:focus {
    outline: 2px solid var(--brand-primary) !important;
    outline-offset: 2px !important;
}

/* ========== END OF ADFINDER.CSS ========== */
