/* © 2026 H.W. & H. Investments Pty Ltd. All rights reserved. */
/**
 * AYIO Sales — Location Pages Styles
 */

/* ── Location Hero ── */
.loc-hero {
    background: linear-gradient(135deg, #0f1a2e 0%, var(--navy, #0f1f3d) 60%, #1a3460 100%);
    color: var(--white, #fff);
    padding: 3rem 0;
    margin-bottom: 2rem;
}
.loc-hero h1 {
    margin: 0 0 0.5rem;
    font-size: 2rem;
    font-weight: 800;
    color: var(--gold, #f0a500);
}
.loc-hero p {
    margin: 0;
    opacity: 0.88;
    max-width: 600px;
    font-size: 1.05rem;
}

/* ── Page layout ── */
.locations-page .page-header { margin-bottom: 32px; }
.locations-page .page-header h1 { font-size: 1.75rem; margin-bottom: 4px; }
.locations-page .page-subtitle { color: var(--text-muted, var(--grey-500, #8892a4)); }

/* ── State/Suburb Page Header ── */
.loc-page-header {
    margin-bottom: 1.5rem;
}
.loc-page-header h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--navy, #0f1f3d);
    margin: 0 0 0.25rem;
}
.loc-page-header .page-subtitle {
    color: var(--grey-500, #8892a4);
    font-size: 0.95rem;
}

/* ── State grid ── */
.state-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
    margin-bottom: 40px;
}

.state-card {
    display: block;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    padding: 20px 24px;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s, transform 0.15s;
}
.state-card:hover {
    border-color: var(--gold, #f0a500);
    box-shadow: var(--shadow-md, 0 4px 20px rgba(15,31,61,0.10));
    transform: translateY(-2px);
}
.state-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.state-card-header h2 {
    font-size: 1.1rem;
    margin: 0;
}
.state-code {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--brand-primary);
    background: rgba(247, 195, 46, 0.12);
    padding: 2px 8px;
    border-radius: 4px;
}
.state-count {
    font-size: 0.9rem;
    color: var(--text-muted, #64748b);
}

/* ── Map ── */
.locations-map-section {
    margin-bottom: 40px;
}
.locations-map-section h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}
.locations-map {
    height: 420px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

/* ── Popular suburbs chips ── */
.popular-suburbs {
    margin-bottom: 40px;
}
.popular-suburbs h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
}
.suburb-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.suburb-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    text-decoration: none;
    color: var(--text, #1e293b);
    font-size: 0.85rem;
    transition: background 0.15s, border-color 0.15s;
}
.suburb-chip:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.suburb-chip:hover .chip-count { color: rgba(255,255,255,0.8); }
.chip-count {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

/* ── Two-column layout for state/suburb ── */
.locations-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
}

.locations-sidebar {
    position: sticky;
    top: 80px;
    align-self: start;
}

.locations-sidebar-map {
    height: 200px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    margin-bottom: 16px;
}

.sidebar-section {
    margin-bottom: 20px;
}
.sidebar-section h3 {
    font-size: 1rem;
    margin-bottom: 10px;
}

.suburb-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.suburb-list li {
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.suburb-list li:last-child { border-bottom: 0; }
.suburb-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
    text-decoration: none;
    color: var(--text, #1e293b);
    font-size: 0.85rem;
    transition: color 0.15s;
}
.suburb-list a:hover { color: var(--brand-primary); }
.suburb-postcode {
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
}
.suburb-count {
    margin-left: auto;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
}
.suburb-distance {
    margin-left: auto;
    color: var(--text-muted, #64748b);
    font-size: 0.8rem;
    font-style: italic;
}

/* ── Results grid ── */
.locations-results .listing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}

.locations-results .no-results {
    text-align: center;
    padding: 48px 24px;
    background: var(--bg-card, #fff);
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

/* ── Nearby listings section (listing detail page) ── */
.nearby-listings {
    margin-top: 32px;
}
.nearby-listings h3 {
    font-size: 1.2rem;
    margin-bottom: 16px;
}
.nearby-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}
.nearby-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.nearby-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.nearby-card-img {
    height: 120px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-muted, #f1f5f9);
}
.nearby-card-body {
    padding: 10px 12px;
}
.nearby-card-body h4 {
    font-size: 0.85rem;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nearby-price {
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.9rem;
}
.nearby-distance {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

/* ── Search map view ── */
.search-map-container {
    height: 500px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    margin-bottom: 16px;
}
.search-map-container.split-map {
    height: 400px;
}

/* Split view layout */
.search-results-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
.search-results-split .search-map-container {
    position: sticky;
    top: 80px;
    height: calc(100vh - 100px);
    margin-bottom: 0;
}
.search-results-split .listing-grid {
    max-height: calc(100vh - 100px);
    overflow-y: auto;
}

/* Location autocomplete in sidebar */
.location-autocomplete-wrap {
    position: relative;
}
.location-autocomplete-wrap .autocomplete-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--white);
    border: 1px solid var(--border, #e2e8f0);
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    max-height: 240px;
    overflow-y: auto;
}
.location-autocomplete-wrap .autocomplete-item {
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-light, #f1f5f9);
}
.location-autocomplete-wrap .autocomplete-item:hover,
.location-autocomplete-wrap .autocomplete-item.active {
    background: var(--bg-hover, #f8fafc);
}

/* ── Map preview on create form ── */
.create-map-preview {
    height: 250px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
    margin-top: 12px;
}
.create-map-hint {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-top: 6px;
}

/* ── Get directions link ── */
.directions-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    font-size: 0.9rem;
    color: var(--brand-primary);
    text-decoration: none;
}
.directions-link:hover { text-decoration: underline; }

/* ── Homepage browse by location ── */
.section-locations .state-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.section-locations .state-mini-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    font-size: 0.9rem;
    transition: box-shadow 0.15s, border-color 0.15s;
}
.section-locations .state-mini-card:hover {
    border-color: var(--brand-primary);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.section-locations .state-mini-count {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}
.section-locations .locations-mini-map {
    height: 300px;
    border-radius: 12px;
    border: 1px solid var(--border, #e2e8f0);
}

/* ── Location input row with Near Me button ── */
.location-input-row {
    display: flex;
    gap: 6px;
}
.location-input-row input[type="text"] {
    flex: 1;
    min-width: 0;
}

/* ── Near Me button ── */
.near-me-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 8px;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.near-me-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}
.near-me-btn.loading {
    pointer-events: none;
    opacity: 0.6;
}
.near-me-btn.loading svg {
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Radius pills ── */
.radius-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.radius-pill {
    padding: 4px 12px;
    font-size: 0.8rem;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 16px;
    cursor: pointer;
    color: var(--text, #1e293b);
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}
.radius-pill:hover {
    border-color: var(--brand-primary);
    color: var(--brand-primary);
}
.radius-pill.active {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* ── Active location tag ── */
.location-active-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(59, 130, 246, 0.08);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--brand-accent);
    margin-bottom: 12px;
}
.location-active-tag svg {
    flex-shrink: 0;
}
.tag-radius {
    color: rgba(59, 130, 246, 0.7);
    font-size: 0.8rem;
}
.tag-clear {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: rgba(59, 130, 246, 0.5);
    padding: 0 2px;
    line-height: 1;
    transition: color 0.15s;
}
.tag-clear:hover {
    color: var(--color-danger);
}

/* ── Distance badge on cards ── */
.card-distance {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 0.75rem;
    color: var(--brand-accent);
    font-weight: 500;
}

/* ── Mobile fullscreen map ── */
.mobile-fullscreen-map {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh !important;
    width: 100vw !important;
    z-index: 9999;
    border-radius: 0 !important;
    margin: 0 !important;
}
.map-back-btn {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    background: var(--white);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.map-back-btn:hover {
    background: var(--brand-primary);
    color: #fff;
    border-color: var(--brand-primary);
}

/* ── Homepage "Near You" section ── */
.section-near-you .near-you-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
}
.section-near-you .near-you-empty {
    text-align: center;
    padding: 24px;
    color: var(--text-muted, #64748b);
    font-size: 0.9rem;
}
.near-you-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 12px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.15s;
}
.near-you-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}
.near-you-card-img {
    height: 140px;
    background-size: cover;
    background-position: center;
    background-color: var(--bg-muted, #f1f5f9);
    position: relative;
}
.near-you-distance-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
}
.near-you-card-body {
    padding: 10px 12px;
}
.near-you-card-body h4 {
    font-size: 0.85rem;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.near-you-price {
    font-weight: 600;
    color: var(--brand-primary);
    font-size: 0.9rem;
}
.near-you-location {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    margin-top: 2px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .state-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .locations-layout {
        grid-template-columns: 1fr;
    }
    .locations-sidebar {
        position: static;
        order: -1;
    }
    .locations-sidebar-map {
        height: 160px;
    }
    .locations-map {
        height: 280px;
    }
    .search-results-split {
        grid-template-columns: 1fr;
    }
    .search-results-split .search-map-container {
        position: static;
        height: 300px;
    }
    .search-results-split .listing-grid {
        max-height: none;
        overflow-y: visible;
    }
    .section-locations .state-cards-row {
        grid-template-columns: repeat(2, 1fr);
    }
    /* Mobile: full-width location + Near Me stacked */
    .location-input-row {
        width: 100%;
    }
    /* Mobile: radius pills horizontal scroll */
    .radius-pills {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 4px;
        scrollbar-width: none;
    }
    .radius-pills::-webkit-scrollbar { display: none; }
    /* Mobile: near you grid */
    .section-near-you .near-you-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .near-you-card-img { height: 110px; }
    .state-card:hover,
    .near-you-card:hover,
    .nearby-card:hover { transform: none; }
}

@media (max-width: 480px) {
    .state-grid {
        grid-template-columns: 1fr;
    }
    .section-locations .state-cards-row {
        grid-template-columns: 1fr 1fr;
    }
}
