/* AU City Page Styles — Konnex Explorer L3 */
/* Extends Explorer design system: warm palette, terracotta accents */
/* Consumer view with pin map, listing cards, suburb breakdown */

/* ===== LIGHT THEME (default) ===== */
:root {
    --bg: #F5F0EB;
    --surface: #EDE7E0;
    --surface-elevated: #E8E2DB;
    --border: rgba(0, 0, 0, 0.08);
    --border-strong: rgba(0, 0, 0, 0.14);
    --text: #1A1A1A;
    --text-secondary: #52525B;
    --text-tertiary: #71717A;
    --terracotta: #E8703A;
    --accent: #E8703A;
    --accent-deep: #C4581F;
    --accent-glow: rgba(232, 112, 58, 0.12);
    --accent-surface: rgba(232, 112, 58, 0.06);
    --nav-bg: rgba(245, 240, 235, 0.92);
    --radius: 12px;
    --radius-lg: 16px;
    --max-width: 1280px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body { font-family: 'Inter', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; overflow-x: hidden; }

/* ========== NAV ========== */
.nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}
.nav-inner {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
    display: flex; align-items: center; justify-content: space-between;
}
.nav-logo {
    display: flex; align-items: center; gap: 8px;
    text-decoration: none; color: var(--text);
    font-family: 'Lexend', sans-serif; font-weight: 700; font-size: 1.1rem;
}
.nav-logo img { width: 28px; height: 28px; }
.nav-links { display: flex; gap: 24px; }
.nav-link {
    color: var(--text-secondary); text-decoration: none;
    font-size: 0.85rem; font-weight: 500;
    transition: color 0.2s;
}
.nav-link:hover { color: var(--text); }

/* ========== CONTAINER ========== */
.container {
    max-width: var(--max-width);
    margin: 0 auto; padding: 80px 24px 40px;
}
/* Second .container after map resets top padding */
.cv-layout + .cv-sheet-trigger + .container,
.cv-sheet-trigger + .container {
    padding-top: 40px;
}

/* ========== BREADCRUMB ========== */
.breadcrumb {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    font-size: 0.8rem; color: var(--text-tertiary);
    margin-bottom: 24px;
}
.breadcrumb a {
    color: var(--text-secondary); text-decoration: none;
    transition: color 0.2s;
}
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb .sep { color: var(--text-tertiary); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ========== H1 ========== */
h1 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.75rem; font-weight: 700;
    margin-bottom: 12px;
    line-height: 1.2;
}

/* ========== INTRO TEXT ========== */
.intro-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 700px;
    margin-bottom: 32px;
    line-height: 1.7;
}

/* ========== STAT GRID ========== */
.stat-grid {
    display: grid;
    gap: 16px;
    margin-bottom: 32px;
}
.stat-grid-4 {
    grid-template-columns: repeat(4, 1fr);
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    text-align: center;
    transition: border-color 0.2s, transform 0.2s;
}
.stat-card:hover {
    border-color: var(--border-strong);
    transform: translateY(-2px);
}
.stat-value {
    font-family: 'Lexend', sans-serif;
    font-size: 1.6rem; font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}
.stat-label {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

/* ========== CONSUMER VIEW LAYOUT — Full-width map breakout ========== */
.full-width-breakout {
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
}
.cv-layout {
    display: flex;
    height: 680px;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    margin-bottom: 0;
}

/* ========== MAP ========== */
.cv-map-container {
    flex: 1;
    position: relative;
    min-width: 0;
}
.cv-map {
    width: 100%;
    height: 100%;
}
.cv-map-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex; align-items: center; justify-content: center;
    gap: 8px;
    background: var(--surface);
    color: var(--text-tertiary);
    font-size: 0.85rem;
    z-index: 1;
}
.cv-map-spinner {
    width: 20px; height: 20px;
    border: 2px solid var(--border-strong);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ========== MAP PINS ========== */
.cv-pin {
    width: 18px; height: 18px;
    background: var(--accent);
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: transform 0.15s;
}
.cv-pin:hover {
    transform: scale(1.25);
}

/* ========== MAP LOGO — bottom-right ========== */
.cv-map .mapboxgl-ctrl-bottom-left {
    left: auto;
    right: 0;
}

/* ========== MAP POPUP ========== */
.cv-popup { font-family: 'Inter', sans-serif; font-size: 0.82rem; line-height: 1.5; }
.cv-popup strong { font-size: 0.9rem; display: block; margin-bottom: 2px; }
.cv-popup-rating { color: var(--accent); font-weight: 600; margin-bottom: 2px; }
.cv-popup-addr { color: var(--text-secondary); margin-bottom: 4px; }
.cv-popup-phone {
    display: inline-block;
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
}
.cv-popup-phone:hover { text-decoration: underline; }

/* ========== LISTINGS PANEL (desktop) ========== */
.cv-panel {
    width: 380px;
    flex-shrink: 0;
    background: var(--bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.cv-panel-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}
.cv-panel-title {
    font-family: 'Lexend', sans-serif;
    font-size: 1rem; font-weight: 600;
    margin-bottom: 2px;
}
.cv-panel-count {
    font-size: 0.78rem;
    color: var(--text-tertiary);
}
.cv-panel-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}
.cv-panel-empty {
    padding: 24px 20px;
    color: var(--text-tertiary);
    font-size: 0.85rem;
    text-align: center;
}

/* ========== LISTING CARDS ========== */
.cv-card {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.15s;
}
.cv-card:hover {
    background: var(--surface);
}
.cv-card--active {
    background: var(--accent-surface);
    border-left: 3px solid var(--accent);
}
.cv-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}
.cv-card-name {
    font-family: 'Lexend', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}
.cv-card-rating {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--accent);
    white-space: nowrap;
    flex-shrink: 0;
}
.cv-card-star { font-size: 0.9rem; }
.cv-card-reviews {
    font-weight: 400;
    color: var(--text-tertiary);
    font-size: 0.75rem;
}
.cv-card-subtitle {
    font-size: 0.78rem;
    color: var(--text-tertiary);
    margin-bottom: 2px;
}
.cv-card-address {
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}
.cv-card-actions {
    display: flex;
    gap: 8px;
}
.cv-card-cta {
    display: inline-block;
    padding: 6px 12px;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    border: none;
    font-family: inherit;
}
.cv-card-cta--phone {
    background: var(--accent);
    color: #fff;
}
.cv-card-cta--phone:hover {
    background: var(--accent-deep);
}
.cv-card-cta--revealed {
    background: var(--surface);
    color: var(--text);
    cursor: default;
    user-select: all;
}
.cv-card-cta--web,
.cv-card-cta--connect {
    background: var(--surface);
    color: var(--accent-deep);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.cv-card-cta--web:hover,
.cv-card-cta--connect:hover {
    background: var(--accent-surface);
    color: var(--accent);
}
.cv-card-cta--fallback {
    background: var(--surface);
    color: var(--text-secondary);
    font-weight: 500;
    text-decoration: none;
}
.cv-card-cta--fallback:hover {
    color: var(--text);
}
.cv-card-cta--phone svg {
    vertical-align: -2px;
    margin-right: 4px;
}

/* ========== VIEW TOGGLE ========== */
.view-toggle-bar {
    max-width: var(--max-width);
    margin: 0 auto 16px;
    padding: 0 24px;
    display: flex;
    justify-content: center;
}
.view-toggle-pill {
    display: inline-flex;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
}
.view-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: 'Lexend', sans-serif;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.view-toggle-btn:hover {
    background: var(--surface-elevated);
    color: var(--text);
}
.view-toggle-btn--active {
    background: var(--accent);
    color: #fff;
    font-weight: 600;
}
.view-toggle-btn--active:hover {
    background: var(--accent-deep);
    color: #fff;
}
.view-toggle-btn svg {
    flex-shrink: 0;
}

/* ========== OWNER DISCOVERY BANNER ========== */
.cv-owner-banner {
    position: relative;
    margin: 20px 0;
    padding: 16px 48px 16px 20px;
    background: linear-gradient(135deg, var(--surface-elevated) 0%, var(--accent-surface) 100%);
    border: 1px solid var(--accent-glow);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
}
.cv-owner-banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.cv-owner-banner-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cv-owner-banner-text strong {
    font-family: 'Lexend', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.cv-owner-banner-text span {
    font-size: 0.82rem;
    color: var(--text-secondary);
}
.cv-owner-banner-cta {
    display: inline-block;
    padding: 9px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-family: 'Lexend', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
    white-space: nowrap;
}
.cv-owner-banner-cta:hover {
    background: var(--accent-deep);
    transform: translateY(-1px);
}
.cv-owner-banner-dismiss {
    position: absolute;
    top: 8px; right: 8px;
    width: 28px; height: 28px;
    background: transparent;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.2rem;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}
.cv-owner-banner-dismiss:hover {
    background: var(--border);
    color: var(--text);
}

/* ========== MOBILE BOTTOM SHEET TRIGGER ========== */
.cv-sheet-trigger {
    display: none;
}

/* ========== SECTIONS ========== */
.section {
    margin-bottom: 40px;
}
.section h2 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.25rem; font-weight: 600;
    margin-bottom: 16px;
}

/* ========== DATA TABLE ========== */
.table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
}
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    border-bottom: 1px solid var(--border-strong);
    background: var(--surface-elevated);
}
.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}
.data-table tr:last-child td { border-bottom: none; }
.data-table td a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
}
.data-table td a:hover { color: var(--accent); }

/* ========== LINK GRIDS ========== */
.link-grid {
    display: flex; flex-wrap: wrap; gap: 10px;
}
.sibling-link, .cross-ind-link {
    display: inline-block;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
}
.sibling-link:hover, .cross-ind-link:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* ========== COMPARISON SECTION ========== */
.comparison-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 40px;
}
.comparison-section h2 {
    margin-bottom: 8px;
}
.comparison-summary {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 20px;
}
.comparison-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.comparison-item {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
}
.comparison-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}
.comparison-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.comparison-value {
    font-family: 'Lexend', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
}
.comparison-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}
.badge-above {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}
.badge-below {
    background: rgba(239, 68, 68, 0.12);
    color: #dc2626;
}
.comparison-context {
    font-size: 0.8rem;
    color: var(--text-tertiary);
}

/* ========== FAQ SECTION ========== */
.faq-section {
    margin-bottom: 40px;
}
.faq-item {
    border: 1px solid var(--border);
    border-radius: 8px;
    margin-bottom: 8px;
    background: var(--surface);
    overflow: hidden;
}
.faq-item[open] {
    border-color: var(--border-strong);
}
.faq-question {
    padding: 14px 18px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.faq-question::-webkit-details-marker { display: none; }
.faq-question::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--text-tertiary);
    font-weight: 400;
    flex-shrink: 0;
    margin-left: 12px;
    transition: transform 0.2s;
}
.faq-item[open] .faq-question::after {
    content: '\2212';
}
.faq-answer {
    padding: 0 18px 14px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* ========== CTA ========== */
.cta-section {
    background: linear-gradient(135deg, var(--terracotta) 0%, var(--accent-deep) 100%);
    border-radius: var(--radius-lg);
    padding: 48px 40px;
    text-align: center;
    margin: 48px 0;
}
.cta-section h2 {
    font-family: 'Lexend', sans-serif;
    font-size: 1.5rem; font-weight: 700;
    color: #fff;
    margin-bottom: 12px;
}
.cta-section p {
    color: rgba(255, 255, 255, 0.85);
    font-size: 0.95rem;
    margin-bottom: 24px;
}
.cta-btn {
    display: inline-block;
    padding: 12px 28px;
    background: #fff;
    color: var(--accent-deep);
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

/* ========== BACK LINK ========== */
.back-link {
    margin-bottom: 32px;
}
.back-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link a:hover { color: var(--accent); }

/* ========== FOOTER ========== */
.footer {
    border-top: 1px solid var(--border);
    padding: 24px 0;
    margin-top: 40px;
}
.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto; padding: 0 24px;
    display: flex; justify-content: space-between; align-items: center;
    font-size: 0.8rem; color: var(--text-tertiary);
}
.footer-links { display: flex; gap: 20px; }
.footer-links a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.2s;
}
.footer-links a:hover { color: var(--text); }

/* ========== RELATED INDUSTRIES (Contract 3 — Type B) ========== */
.related-businesses-section { margin-bottom: 40px; }
.related-industry-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.related-industry-card {
    display: flex; flex-direction: column;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 16px 18px; text-decoration: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.related-industry-card:hover { border-color: var(--accent); box-shadow: 0 2px 12px var(--accent-glow); }
.ri-name { font-weight: 600; font-size: 0.9rem; color: var(--text); margin-bottom: 4px; }
.ri-count { font-size: 0.78rem; color: var(--text-tertiary); }
.ri-badge {
    display: inline-block; font-size: 0.65rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.04em;
    padding: 2px 8px; border-radius: 4px; margin-bottom: 4px; align-self: flex-start;
}
.badge-complementary { background: rgba(59, 130, 246, 0.1); color: #2563eb; }
.badge-subcontract { background: rgba(168, 85, 247, 0.1); color: #7c3aed; }
.badge-related { background: rgba(34, 197, 94, 0.1); color: #15803d; }
.badge-referral { background: rgba(232, 112, 58, 0.1); color: var(--accent-deep); }

/* ========== RESPONSIVE ========== */

/* Tablet */
@media (max-width: 1024px) {
    .cv-layout {
        flex-direction: column;
        height: auto;
    }
    .cv-map-container {
        height: 350px;
        order: -1; /* Map on top when stacked */
    }
    .cv-panel {
        width: 100%;
        border-right: none;
        border-top: 1px solid var(--border);
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .stat-grid-4 { grid-template-columns: repeat(2, 1fr); }
    .comparison-grid { grid-template-columns: 1fr; }
    .comparison-section { padding: 20px; }
    .related-industry-grid { grid-template-columns: repeat(2, 1fr); }
    h1 { font-size: 1.35rem; }
    .cta-section { padding: 32px 24px; }
    .cta-section h2 { font-size: 1.25rem; }
    .nav-links { gap: 16px; }
    .nav-link { font-size: 0.8rem; }

    /* Mobile: map full width, hide desktop panel, show sheet trigger */
    .cv-layout {
        flex-direction: column;
        height: 300px;
    }
    .cv-map-container {
        height: 300px;
        order: -1; /* Map on top when stacked */
    }
    .cv-panel {
        display: none;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        z-index: 900;
        max-height: 60vh;
        border-radius: 16px 16px 0 0;
        border: none;
        border-top: 1px solid var(--border-strong);
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
        width: 100%;
    }
    .cv-panel--mobile-open {
        display: flex;
    }
    .cv-sheet-trigger {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 800;
        padding: 8px 16px 12px;
        background: var(--bg);
        border-top: 1px solid var(--border);
    }
    .cv-sheet-trigger-btn {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 20px;
        background: var(--accent);
        color: #fff;
        border: none;
        border-radius: 10px;
        font-family: 'Lexend', sans-serif;
        font-size: 0.9rem;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.15s;
    }
    .cv-sheet-trigger-btn:hover {
        background: var(--accent-deep);
    }
    .cv-sheet-trigger-arrow {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .container { padding: 70px 16px 32px; }
    .cv-layout + .cv-sheet-trigger + .container,
    .cv-sheet-trigger + .container {
        padding-top: 32px;
    }
    .stat-grid { gap: 10px; }
    .stat-value { font-size: 1.3rem; }
    .comparison-value { font-size: 1.1rem; }
    .related-industry-grid { grid-template-columns: 1fr; }
    .footer-inner { flex-direction: column; gap: 12px; text-align: center; }
    .breadcrumb { font-size: 0.75rem; }
    .cv-card { padding: 12px 16px; }
    .cv-card-name { font-size: 0.85rem; }
}
