/* ============================================================
   MCHONGO — Design System
   Light + Dark mode via [data-theme]
   ============================================================ */

/* --- LIGHT MODE (default) --- */
:root, [data-theme="light"] {
    --bg-body: #f5f0ec;
    --bg-surface: #ffffff;
    --bg-surface-hover: #f3f4f6;

    --text-primary: #111827;
    --text-secondary: #64748b;
    --text-muted: #9ca3af;

    --border-color: #e5e7eb;
    --border-strong: #d1d5db;

    --nav-active-bg: #eef2f6;
    --nav-active-color: #0f172a;

    --accent: #111827;
    --accent-text: #ffffff;
    --accent-coral: #4f8a6c;

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --radius-pill: 99px;

    --nav-height-desktop: 80px;
    --nav-height-mobile: 64px;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-float: 0 15px 35px -5px rgba(0, 0, 0, 0.1);

    --scrollbar-thumb: #c4c4c4;
    --scrollbar-track: transparent;
}

/* --- DARK MODE --- */
[data-theme="dark"] {
    --bg-body: #0f0f0f;
    --bg-surface: #1a1a1a;
    --bg-surface-hover: #252525;

    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;

    --border-color: #2a2a2a;
    --border-strong: #3a3a3a;

    --nav-active-bg: #252525;
    --nav-active-color: #f0f0f0;

    --accent: #f0f0f0;
    --accent-text: #0f0f0f;
    --accent-coral: #6ba989;

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    --shadow-float: 0 15px 35px -5px rgba(0, 0, 0, 0.5);

    --scrollbar-thumb: #444;
    --scrollbar-track: transparent;
}

/* --- BASE RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-body);
    color: var(--text-primary);
    overflow-x: hidden;
    line-height: 1.5;
}

button, a {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-family: inherit;
    outline: none;
    text-decoration: none;
}

input, textarea, select {
    font-family: inherit;
    outline: none;
    border: none;
}

/* ============================================================
   CUSTOM SCROLLBAR
   ============================================================ */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
    background: var(--scrollbar-thumb);
    border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}
/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
}
/* Hide scrollbar on category tabs */
.category-tabs, .map-filters, .search-overlay-cats, .detail-thumbs {
    scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar,
.map-filters::-webkit-scrollbar,
.search-overlay-cats::-webkit-scrollbar,
.detail-thumbs::-webkit-scrollbar {
    display: none;
}

/* --- APP LAYOUT --- */
.app-wrapper {
    width: 100%;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* ============================================================
   PAGE LOADING SPINNER
   ============================================================ */
.page-spinner {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease;
}

.page-spinner.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner-ring {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--text-primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- DESKTOP TOP NAV (sticky) --- */
.top-nav {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    height: var(--nav-height-desktop);
    border-bottom: 1px solid var(--border-color);
    background-color: var(--bg-surface);
    flex-shrink: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
}

@media (min-width: 1024px) {
    .top-nav { display: flex; }
}

.brand {
    font-size: 20px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-primary);
    text-decoration: none;
}
.brand-logo { display: block; border-radius: 50%; }
.brand-logo-text {
    display: block;
    height: 95px;
    width: auto;
    max-width: 420px;
}
@media (max-width: 768px) {
  .brand-logo-text { height: 64px; max-width: 260px; }
}

.desktop-nav-links {
    display: flex;
    align-items: center;
    height: 100%;
    gap: 8px;
}

.d-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 0 18px;
    height: 100%;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 12px;
    line-height: 1.1;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
}

.d-nav-item i { font-size: 20px; line-height: 1; }
.d-nav-item span { font-size: 11px; font-weight: 500; }

.d-nav-item:hover { color: var(--text-primary); }

.d-nav-item.active {
    color: var(--text-primary);
    border-bottom-color: var(--text-primary);
    font-weight: 600;
}

.top-nav-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-surface-hover);
    color: var(--text-secondary);
    font-size: 18px;
    transition: var(--transition);
    cursor: pointer;
}
.theme-toggle:hover { color: var(--text-primary); background: var(--border-color); }

.top-nav-user {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.top-nav-user img,
.avatar-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
}
.avatar-circle {
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-body); color: var(--text-primary);
    font-size: 14px; font-weight: 600; flex-shrink: 0;
}

/* --- ACCOUNT DROPDOWN --- */
.account-menu { position: relative; }
.account-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 10px 16px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 999px;
    font-size: 14px; font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    font-family: inherit;
    transition: background .12s, border-color .12s, color .12s;
}
.account-btn:hover { background: var(--bg-surface-hover); }
.account-btn .account-caret { font-size: 12px; opacity: .7; transition: transform .15s; }
.account-menu.open .account-btn .account-caret { transform: rotate(180deg); }

.account-dropdown {
    position: absolute;
    top: calc(100% + 10px); right: 0;
    width: 320px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    box-shadow: 0 20px 50px -10px rgba(0,0,0,.18), 0 6px 14px rgba(0,0,0,.06);
    padding: 8px;
    display: none;
    z-index: 1000;
    overflow: hidden;
}
.account-menu.open .account-dropdown { display: block; }

.account-dropdown-header {
    padding: 14px 14px 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 6px;
}
.account-dropdown-name { font-size: 15px; font-weight: 700; color: var(--text-primary); line-height: 1.2; }
.account-dropdown-sub  { font-size: 13px; color: var(--text-secondary); margin-top: 4px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.account-dropdown-section { padding: 4px 0; }
.account-dropdown-section + .account-dropdown-section {
    border-top: 1px solid var(--border-color);
    margin-top: 4px; padding-top: 8px;
}

.account-dropdown-item {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px; font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    cursor: pointer;
    background: transparent; border: 0; width: 100%; text-align: left;
    font-family: inherit;
    justify-content: space-between;
}
.account-dropdown-item .ad-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-dropdown-item .ad-left i { font-size: 18px; flex-shrink: 0; opacity: .85; }
.account-dropdown-item:hover { background: var(--bg-surface-hover); text-decoration: none; color: var(--text-primary); }
.account-dropdown-item.danger { color: #e06b5f; }
.account-dropdown-item.danger:hover { background: rgba(224, 107, 95, 0.1); color: #e06b5f; }

.account-dropdown-value { font-size: 13px; color: var(--text-secondary); display: inline-flex; align-items: center; gap: 4px; }
.account-dropdown-value i { font-size: 14px; }

.account-lang-pills {
    display: inline-flex; background: var(--bg-body); border-radius: 999px; padding: 3px;
}
.account-lang-pills button {
    border: 0; background: transparent; padding: 4px 10px;
    font-size: 12px; font-weight: 600; border-radius: 999px;
    color: var(--text-secondary); cursor: pointer; font-family: inherit;
}
.account-lang-pills button.active { background: var(--bg-surface); color: var(--text-primary); box-shadow: var(--shadow-sm); }

.account-cta-row { display: flex; gap: 8px; padding: 4px; }
.account-cta-row .btn-cta {
    flex: 1;
    padding: 11px 12px;
    border-radius: 10px;
    font-size: 14px; font-weight: 600;
    text-align: center;
    text-decoration: none;
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.account-cta-row .btn-cta.primary {
    background: var(--accent); color: var(--accent-text);
}
.account-cta-row .btn-cta.primary:hover { opacity: .9; text-decoration: none; }
.account-cta-row .btn-cta.ghost {
    background: transparent; color: var(--text-primary);
    border: 1px solid var(--border-color);
}
.account-cta-row .btn-cta.ghost:hover { background: var(--bg-surface-hover); text-decoration: none; }

/* --- MAIN CONTENT --- */
.main-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background-color: var(--bg-body);
    padding-bottom: calc(var(--nav-height-mobile) + 16px);
}

@media (min-width: 1024px) {
    .main-content { padding-bottom: 40px; }
}

.main-content.ai-layout {
    display: flex;
    flex-direction: column;
    padding-bottom: 0;
    overflow: hidden;
}

@media (max-width: 1023px) {
    .main-content.ai-layout {
        padding-bottom: calc(var(--nav-height-mobile) + env(safe-area-inset-bottom, 0px));
    }
}

.main-content.map-layout {
    padding-bottom: 0;
    overflow: hidden;
}

.main-content.listings-layout {
    padding-bottom: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* ============================================================
   LISTINGS PAGE — Sticky header, scrollable grid
   ============================================================ */
.listings-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.page-header {
    flex-shrink: 0;
    background: var(--bg-body);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1024px) {
    .page-header { padding: 24px 48px; }
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Search icon button */
.search-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
}
.search-icon-btn:hover { color: var(--text-primary); background: var(--bg-surface-hover); }

/* ============================================================
   SEARCH OVERLAY (full screen)
   ============================================================ */
.search-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-body);
    z-index: 600;
    display: none;
    flex-direction: column;
}

.search-overlay.open { display: flex; }

.search-overlay-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-overlay-header .search-back {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: var(--text-primary);
    cursor: pointer;
    flex-shrink: 0;
}

.search-overlay-header input {
    flex: 1;
    font-size: 16px;
    background: transparent;
    color: var(--text-primary);
    padding: 10px 0;
}
.search-overlay-header input::placeholder { color: var(--text-muted); }

.search-overlay-cats {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.search-overlay-results {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.search-overlay-results .product-grid {
    padding: 0;
}

/* Search result items (list style) */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 0;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
    color: inherit;
    text-decoration: none;
}
.search-result-item:hover { background: var(--bg-surface-hover); margin: 0 -16px; padding-left: 16px; padding-right: 16px; }

.search-result-img {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-result-img img { width: 100%; height: 100%; object-fit: cover; }
.search-result-img i { font-size: 20px; color: var(--text-muted); }

.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-result-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.search-result-price { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.search-empty {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================================
   CATEGORY TABS
   ============================================================ */
.category-tabs-wrapper {
    flex-shrink: 0;
    background: var(--bg-body);
}

.category-tabs {
    display: flex;
    gap: 8px;
    padding: 0 20px 16px 20px;
    overflow-x: auto;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

@media (min-width: 1024px) { .category-tabs { padding: 0 48px 24px 48px; } }

.cat-tab {
    padding: 8px 20px;
    border-radius: var(--radius-pill);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    white-space: nowrap;
    transition: var(--transition);
    background-color: transparent;
    border: 1px solid transparent;
}

.cat-tab:hover { color: var(--text-primary); }

.cat-tab.active {
    background-color: var(--bg-surface);
    color: var(--text-primary);
    font-weight: 600;
    border-color: var(--border-color);
    box-shadow: var(--shadow-sm);
}

/* ============================================================
   PRODUCT GRID (scrollable area)
   ============================================================ */
.listings-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    padding-bottom: calc(var(--nav-height-mobile) + 16px);
}

@media (min-width: 1024px) {
    .listings-scroll { padding-bottom: 40px; }
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
    padding: 0 20px 32px 20px;
    max-width: 1400px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 24px;
    }
}

@media (min-width: 1024px) {
    .product-grid { padding: 0 48px 48px 48px; }
}

.product-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    color: inherit;
}

.product-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.p-image-container {
    width: 100%;
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    background-color: var(--bg-body);
    border-radius: var(--radius-md);
    overflow: hidden;
}

@media (min-width: 768px) { .p-image-container { height: 180px; } }

.p-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.p-info { display: flex; flex-direction: column; gap: 4px; position: relative; }
.p-title { font-size: 14px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 24px; }
.p-price { font-size: 14px; font-weight: 500; color: var(--text-secondary); margin-bottom: 8px; }
.p-stats { display: flex; gap: 12px; font-size: 12px; color: var(--text-muted); flex-wrap: wrap; }
.p-stats span { display: flex; align-items: center; gap: 4px; }

.p-arrow {
    position: absolute;
    top: -4px;
    right: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .p-arrow {
    opacity: 1;
    background-color: var(--accent);
    color: var(--accent-text);
}

@media (max-width: 768px) {
    .p-arrow { opacity: 1; }
}

.btn-add { display: none; }

/* ============================================================
   MAP PAGE — Top search + split view (sidebar + map)
   ============================================================ */
.map-page {
    display: flex;
    flex-direction: column;
    height: calc(100vh - var(--nav-height-desktop));
    overflow: hidden;
}

@media (max-width: 1023px) {
    .map-page {
        height: calc(100vh - var(--nav-height-mobile));
    }
}

/* Full-width top search */
.map-top-search {
    position: relative;
    flex-shrink: 0;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 16px;
    z-index: 30;
}
.map-top-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    transition: var(--transition);
}
.map-top-search-bar:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.08);
}
.map-top-search-bar i { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.map-top-search-bar input {
    flex: 1;
    width: 100%;
    font-size: 15px;
    background: transparent;
    color: var(--text-primary);
}
.map-top-search-bar input::placeholder { color: var(--text-muted); }

.map-top-search .map-search-suggestions {
    position: absolute;
    left: 16px;
    right: 16px;
    top: calc(100% - 2px);
    margin-top: 0;
}

/* Body row: sidebar + canvas */
.map-page-body {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    position: relative;
}
@media (max-width: 1023px) {
    .map-page-body { flex-direction: column; }
}

/* --- Map Sidebar --- */
.map-sidebar {
    width: 380px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-right: 1px solid var(--border-color);
    overflow: hidden;
}

@media (max-width: 1023px) {
    .map-sidebar {
        display: none;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: auto;
        z-index: 40;
        border-right: none;
    }
    .map-sidebar.open { display: flex; }
}

.map-sidebar-header {
    padding: 16px;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.map-search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-pill);
    padding: 10px 16px;
}

.map-search-box i { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.map-search-box input { width: 100%; font-size: 14px; background: transparent; color: var(--text-primary); }
.map-search-box input::placeholder { color: var(--text-muted); }

/* Map search suggestions dropdown */
.map-search-suggestions {
    display: none;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    max-height: 300px;
    overflow-y: auto;
    margin-top: 8px;
    z-index: 20;
}
.map-search-suggestions.open { display: block; }

.map-suggest-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid var(--border-color);
}
.map-suggest-item:last-child { border-bottom: none; }
.map-suggest-item:hover { background: var(--bg-surface-hover); }

.map-suggest-title { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.map-suggest-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.map-suggest-icon { font-size: 18px; color: var(--text-muted); flex-shrink: 0; }

.map-filters {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.map-cat-chip {
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    cursor: pointer;
}

.map-cat-chip:hover { color: var(--text-primary); }

.map-cat-chip.active {
    background: var(--text-primary);
    color: var(--bg-surface);
    border-color: var(--text-primary);
}

/* --- Map List --- */
.map-list {
    flex-grow: 1;
    overflow-y: auto;
}

.map-list-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}

.map-list-item:hover { background: var(--bg-surface-hover); }
.map-list-item.active { background: var(--bg-surface-hover); }

.map-list-item-img {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--bg-body);
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-list-item-img img { width: 100%; height: 100%; object-fit: cover; }
.map-list-item-img i { font-size: 22px; color: var(--text-muted); }
.map-list-item-info { flex-grow: 1; min-width: 0; }

.map-list-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-list-item-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.map-list-item-price { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

.map-list-empty {
    padding: 40px 16px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

/* --- Map Canvas --- */
.map-canvas-area {
    flex-grow: 1;
    position: relative;
    min-height: 0;
}

.map-canvas-area #map-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.map-spinner {
    position: absolute;
    inset: 0;
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: opacity 0.3s ease;
}
.map-spinner.hidden { opacity: 0; pointer-events: none; }

.map-mobile-search { display: none !important; }

.map-toggle-view {
    display: none;
    position: fixed;
    bottom: calc(var(--nav-height-mobile) + env(safe-area-inset-bottom, 0px) + 16px);
    right: 16px;
    z-index: 999;
    width: 48px; height: 48px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-surface);
    font-size: 20px;
    font-weight: 500;
    box-shadow: var(--shadow-lg);
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    border: none;
    cursor: pointer;
}

@media (max-width: 1023px) {
    .map-toggle-view { display: flex; }
}
@media (min-width: 1024px) {
    .map-toggle-view { display: none; }
}

/* --- Map Popup Card — CENTERED --- */
.map-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 380px;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    display: none;
    z-index: 15;
    border: 1px solid var(--border-color);
    overflow: hidden;
}

.map-card.active {
    display: block;
    animation: cardPop 0.25s ease;
}

@keyframes cardPop {
    from { opacity: 0; transform: translate(-50%, -50%) scale(0.95); }
    to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

.map-card-inner { display: flex; flex-direction: row; }

.map-card-img {
    width: 120px;
    min-height: 120px;
    object-fit: cover;
    background: var(--bg-body);
    flex-shrink: 0;
}

.map-card-body {
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
    min-width: 0;
}

.map-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
}

.map-card-title {
    font-weight: 600;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.map-card-price {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 10px;
}

.map-card-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--text-primary);
    color: var(--bg-surface);
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    text-align: center;
    font-weight: 500;
    font-size: 13px;
}

.map-card-btn:hover { box-shadow: var(--shadow-md); }

.map-card-close { color: var(--text-muted); flex-shrink: 0; margin-left: 8px; }
.map-card-close i { font-size: 18px; }

/* --- Cluster Popup --- */
.cluster-popup {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 90%; max-width: 340px;
    max-height: 70vh;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    border: 1px solid var(--border-color);
    z-index: 20;
    display: flex; flex-direction: column;
    overflow: hidden;
    animation: cardPop 0.25s ease;
}
.cluster-popup-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px;
    font-size: 14px; font-weight: 600;
    border-bottom: 1px solid var(--border-color);
}
.cluster-popup-header button {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 18px; display: flex;
}
.cluster-popup-list {
    overflow-y: auto; flex: 1;
}
.cluster-popup-item {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-color);
    text-decoration: none; color: inherit;
    transition: background 0.15s;
}
.cluster-popup-item:last-child { border-bottom: none; }
.cluster-popup-item:hover { background: var(--bg-surface-hover); }
.cluster-popup-thumb {
    width: 48px; height: 48px; border-radius: var(--radius-md);
    overflow: hidden; flex-shrink: 0; background: var(--bg-body);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); font-size: 20px;
}
.cluster-popup-thumb img { width: 100%; height: 100%; object-fit: cover; }
.cluster-popup-title { font-size: 13px; font-weight: 600; }
.cluster-popup-price { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* ============================================================
   AI CHAT
   ============================================================ */
.ai-page {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    background: var(--bg-body);
    overflow: hidden;
    position: relative;
}

/* --- Chat History Sidebar --- */
.ai-sidebar {
    position: absolute; top: 0; left: 0; bottom: 0; width: 280px;
    background: var(--bg-surface); z-index: 50;
    display: flex; flex-direction: column;
    transform: translateX(-100%); transition: transform 0.25s ease;
    border-right: 1px solid var(--border-color);
}
.ai-sidebar.open { transform: translateX(0); }
@media (min-width: 768px) { .ai-sidebar { width: 320px; } }

.ai-sidebar-overlay {
    position: absolute; inset: 0; z-index: 40;
    background: rgba(0,0,0,0.3); opacity: 0;
    pointer-events: none; transition: opacity 0.25s ease;
}
.ai-sidebar-overlay.open { opacity: 1; pointer-events: auto; }

.ai-sidebar-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; border-bottom: 1px solid var(--border-color); flex-shrink: 0;
}
.ai-sidebar-title { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.ai-sidebar-close {
    width: 28px; height: 28px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: var(--transition); background: none; border: none; cursor: pointer;
}
.ai-sidebar-close:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.ai-sidebar-new {
    display: flex; align-items: center; gap: 8px;
    margin: 12px; padding: 10px 14px; border-radius: var(--radius-md);
    background: var(--bg-body); border: 1px solid var(--border-color);
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    cursor: pointer; transition: var(--transition);
}
.ai-sidebar-new:hover { background: var(--bg-surface-hover); }
.ai-sidebar-new i { font-size: 16px; }

.ai-sidebar-list {
    flex: 1; overflow-y: auto; padding: 0 8px;
}

.ai-sidebar-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px; padding: 40px 16px; color: var(--text-muted); font-size: 13px;
}
.ai-sidebar-empty i { font-size: 28px; }

.ai-sidebar-item {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition);
    margin-bottom: 2px;
}
.ai-sidebar-item:hover { background: var(--bg-surface-hover); }
.ai-sidebar-item.active { background: var(--bg-surface-hover); }

.ai-sidebar-item-text {
    flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px;
}
.ai-sidebar-item-title {
    font-size: 13px; font-weight: 500; color: var(--text-primary);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-sidebar-item-time { font-size: 11px; color: var(--text-muted); }

.ai-sidebar-item-del {
    flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; transition: var(--transition); opacity: 0;
}
.ai-sidebar-item:hover .ai-sidebar-item-del { opacity: 1; }
.ai-sidebar-item-del:hover { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.ai-sidebar-item-del i { font-size: 14px; }

.ai-sidebar-clear {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    margin: 8px 12px 12px; padding: 8px;
    font-size: 12px; color: var(--text-muted);
    background: none; border: none; cursor: pointer; transition: var(--transition);
    border-top: 1px solid var(--border-color); padding-top: 12px;
}
.ai-sidebar-clear:hover { color: #ef4444; }
.ai-sidebar-clear i { font-size: 14px; }

/* --- History button in input row --- */
.chat-history-btn {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    color: var(--text-muted); cursor: pointer; transition: var(--transition);
}
.chat-history-btn:hover { color: var(--text-primary); background: var(--bg-surface-hover); }
.chat-history-btn i { font-size: 18px; }

.ai-welcome {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    text-align: center;
    gap: 8px;
}

.ai-welcome-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--text-primary);
    box-shadow: var(--shadow-md);
    margin-bottom: 12px;
    border: 1px solid var(--border-color);
}

.ai-welcome-greeting { font-size: 18px; font-weight: 400; color: var(--text-secondary); }

.ai-welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 4px;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .ai-welcome-title { font-size: 36px; }
    .ai-welcome-greeting { font-size: 22px; }
}

.ai-welcome-sub {
    font-size: 13px;
    color: var(--text-secondary);
    max-width: 380px;
    margin-bottom: 24px;
    line-height: 1.6;
}

@media (min-width: 768px) {
    .ai-welcome-sub { font-size: 14px; max-width: 440px; }
}

.ai-suggestion-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: 100%;
    max-width: 360px;
}

@media (min-width: 768px) {
    .ai-suggestion-cards {
        display: flex;
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
        max-width: 700px;
    }
}

.ai-card {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    text-align: left;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

@media (min-width: 768px) {
    .ai-card { min-width: 170px; max-width: 200px; padding: 18px; gap: 12px; }
}

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

.ai-card-icon {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: var(--text-secondary);
}

@media (min-width: 768px) {
    .ai-card-icon { width: 40px; height: 40px; font-size: 20px; }
}

.ai-card-text { display: flex; flex-direction: column; gap: 2px; }
.ai-card-text strong { font-size: 13px; font-weight: 600; color: var(--text-primary); }
.ai-card-text span { font-size: 11px; color: var(--text-muted); }

@media (min-width: 768px) {
    .ai-card-text strong { font-size: 14px; }
    .ai-card-text span { font-size: 12px; }
}

.chat-area {
    flex-grow: 1;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 24px 16px;
    background: var(--bg-body);
    max-width: 720px;
    width: 100%;
    margin: 0 auto;
}
@media (min-width: 768px) { .chat-area { padding: 24px 24px; } }
.chat-area.has-messages { display: flex; }

.message {
    max-width: 80%;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
    padding: 10px 14px;
    border-radius: var(--radius-lg);
}

@media (min-width: 768px) {
    .message { max-width: 520px; font-size: 15px; padding: 12px 16px; }
}

/* User bubble — right aligned */
.msg-user {
    align-self: flex-end;
    background: var(--accent);
    color: var(--accent-text);
    border-bottom-right-radius: 4px;
}

/* AI message — left aligned, no bg for text-only, transparent */
.msg-ai {
    align-self: flex-start;
    background: var(--bg-surface);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    max-width: 90%;
}
@media (min-width: 768px) { .msg-ai { max-width: 580px; } }

/* Labels */
.msg-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
    margin-top: 10px;
    padding: 0 4px;
}
.msg-label:first-child { margin-top: 0; }
.msg-label-right { text-align: right; }

/* Typing indicator */
.msg-typing {
    align-self: flex-start;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-bottom-left-radius: 4px;
    padding: 14px 20px;
}

/* --- AI message rich content --- */
.msg-ai p { margin: 0 0 6px 0; }
.msg-ai p:last-child { margin-bottom: 0; }
.msg-ai strong { font-weight: 700; }
.msg-ai em { font-style: italic; }
.msg-ai ul, .msg-ai ol { margin: 6px 0; padding-left: 18px; }
.msg-ai li { margin-bottom: 3px; }
.msg-ai a:not(.ai-product-card):not(.source-circle) { color: var(--accent-coral); font-weight: 500; text-decoration: underline; }
.msg-ai a:not(.ai-product-card):not(.source-circle):hover { opacity: 0.8; }
.msg-ai .ai-product-card, .msg-ai .source-circle { text-decoration: none; color: inherit; }
.msg-ai table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 13px; }
.msg-ai th, .msg-ai td { padding: 6px 10px; border: 1px solid var(--border-color); text-align: left; }
.msg-ai th { background: var(--bg-surface-hover); font-weight: 600; }
.msg-ai code { background: var(--bg-surface-hover); padding: 1px 5px; border-radius: 4px; font-size: 13px; }
.msg-ai h3, .msg-ai h4 { font-size: 14px; font-weight: 700; margin: 10px 0 4px; }

/* --- AI auth gate (after 3 free guest messages) --- */
.ai-auth-gate { padding: 4px 0; }
.ai-auth-gate-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-primary); }
.ai-auth-gate-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ai-auth-gate-actions .btn-cta {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 14px; border-radius: 10px;
    font-size: 13px; font-weight: 600;
    text-decoration: none; cursor: pointer;
}
.ai-auth-gate-actions .btn-cta.primary { background: var(--accent); color: var(--accent-text); }
.ai-auth-gate-actions .btn-cta.ghost { background: transparent; color: var(--text-primary); border: 1px solid var(--border-color); }
.ai-auth-gate-actions .btn-cta:hover { text-decoration: none; opacity: .92; }

/* --- Product cards inside AI messages --- */
.ai-product-card {
    background: var(--bg-body);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 10px 12px;
    margin: 6px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}
.ai-product-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.ai-product-card-img {
    width: 44px; height: 44px; border-radius: var(--radius-sm);
    background: var(--bg-surface-hover); overflow: hidden; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
}
.ai-product-card-img img { width: 100%; height: 100%; object-fit: cover; }
.ai-product-card-img i { font-size: 18px; color: var(--text-muted); }
.ai-product-card-info { flex: 1; min-width: 0; }
.ai-product-card-title { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ai-product-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 1px; }
.ai-product-card-meta .ai-dist { color: var(--accent-coral); font-weight: 500; }
.ai-product-card-price { font-size: 13px; font-weight: 600; color: var(--text-primary); white-space: nowrap; }

/* Typing cursor animation */
.typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    background: var(--text-primary);
    margin-left: 1px;
    animation: blink 0.7s step-end infinite;
    vertical-align: text-bottom;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Source circles --- */
.msg-sources {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
}
.msg-sources-label {
    width: 100%;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 2px;
}

.source-circle {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--border-color);
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
    background: var(--bg-surface-hover);
    display: flex;
    align-items: center;
    justify-content: center;
}
.source-circle:hover { border-color: var(--accent-coral); transform: scale(1.1); }
.source-circle img { width: 100%; height: 100%; object-fit: cover; }
.source-circle i { font-size: 18px; color: var(--text-muted); }

/* Source popover on hover */
.source-popover {
    display: none;
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: 220px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 12px;
    z-index: 20;
    text-decoration: none;
    color: inherit;
}
.source-circle:hover .source-popover { display: block; }
.source-popover-img {
    width: 100%; height: 100px; border-radius: var(--radius-sm);
    object-fit: cover; background: var(--bg-body); margin-bottom: 8px;
}
.source-popover-title { font-size: 13px; font-weight: 600; color: var(--text-primary); margin-bottom: 2px; }
.source-popover-price { font-size: 12px; font-weight: 500; color: var(--text-secondary); margin-bottom: 2px; }
.source-popover-meta { font-size: 11px; color: var(--text-muted); }
.source-popover-dist { font-size: 11px; color: var(--accent-coral); font-weight: 500; margin-top: 2px; }

.typing-dots { display: inline-flex; gap: 4px; align-items: center; }
.typing-dots span {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-muted);
    animation: typingBounce 1.2s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

.chat-input-area {
    padding: 10px 16px 14px;
    flex-shrink: 0;
    background: var(--bg-body);
}

@media (min-width: 1024px) {
    .chat-input-area { padding: 16px 20px 24px; }
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 720px;
    margin: 0 auto;
}

.chat-settings-btn {
    display: none;
}

.chat-input-wrapper {
    display: flex; align-items: center; flex-grow: 1;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-pill); padding: 6px 6px 6px 16px;
    transition: var(--transition); gap: 8px;
}
.chat-input-wrapper:focus-within { border-color: var(--text-muted); box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.1); }

.chat-input-icon { color: var(--text-muted); font-size: 18px; flex-shrink: 0; }
.chat-input-wrapper input { flex-grow: 1; background: transparent; font-size: 14px; color: var(--text-primary); min-width: 0; }
.chat-input-wrapper input::placeholder { color: var(--text-muted); }

.btn-send {
    display: flex; align-items: center; gap: 4px;
    padding: 8px 16px; border-radius: var(--radius-pill);
    background: var(--accent-coral); color: #fff;
    font-size: 13px; font-weight: 600; flex-shrink: 0;
    transition: var(--transition); white-space: nowrap;
}
.btn-send i { font-size: 14px; }
.btn-send:hover { opacity: 0.9; transform: scale(1.02); }

/* ============================================================
   FAB + Modal
   ============================================================ */
.fab {
    position: fixed; bottom: 32px; right: 32px;
    width: 56px; height: 56px; border-radius: 50%;
    background: var(--text-primary); color: var(--bg-surface);
    display: none; align-items: center; justify-content: center;
    font-size: 24px; box-shadow: var(--shadow-lg);
    z-index: 100; transition: var(--transition); cursor: pointer; border: none;
}
.fab:hover { transform: scale(1.08); box-shadow: var(--shadow-float); }
@media (min-width: 1024px) { .fab { display: flex; } }

.modal-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.5);
    display: none; align-items: flex-end; justify-content: center; z-index: 1100;
}
.modal-overlay.open { display: flex; }
@media (min-width: 768px) { .modal-overlay { align-items: center; } }

.modal-sheet {
    background: var(--bg-surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    width: 100%; max-width: 480px; max-height: 85vh;
    overflow-y: auto; padding: 24px;
    padding-bottom: calc(24px + var(--nav-height-mobile, 56px) + env(safe-area-inset-bottom, 0px));
    animation: sheetUp 0.3s ease;
}
@media (min-width: 768px) { .modal-sheet { border-radius: var(--radius-xl); max-height: 80vh; padding-bottom: 24px; } }

@keyframes sheetUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 18px; font-weight: 700; }

.modal-close {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted); transition: var(--transition);
}
.modal-close:hover { background: var(--bg-surface-hover); color: var(--text-primary); }

.modal-form { display: flex; flex-direction: column; gap: 14px; }

/* --- Image upload area --- */
.upload-area { display: flex; flex-direction: column; gap: 10px; }
.upload-buttons { display: flex; gap: 10px; }
.upload-btn {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 14px 12px; border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color); background: var(--bg-body);
    color: var(--text-secondary); font-size: 13px; font-weight: 500;
    cursor: pointer; transition: var(--transition);
}
.upload-btn i { font-size: 20px; }
.upload-btn:hover { border-color: var(--text-primary); color: var(--text-primary); background: var(--bg-surface-hover); }

.image-preview-row { display: flex; gap: 8px; flex-wrap: wrap; }
.image-preview-row .preview-thumb {
    width: 60px; height: 60px; border-radius: var(--radius-md);
    object-fit: cover; border: 1px solid var(--border-color);
    position: relative;
}

/* --- Form fields --- */
.modal-form .form-input {
    background: var(--bg-body); border: 1px solid var(--border-color);
    border-radius: var(--radius-md); padding: 12px 16px;
    font-size: 14px; color: var(--text-primary); width: 100%;
    transition: var(--transition);
}
.modal-form .form-input:focus { border-color: var(--text-primary); box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.08); }
.modal-form textarea.form-input { resize: none; min-height: 80px; font-family: inherit; line-height: 1.5; }
.modal-form .form-label {
    font-size: 12px; font-weight: 600; color: var(--text-muted);
    text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: -6px;
}

.price-row { display: flex; gap: 10px; }
.price-row .form-input { flex-grow: 1; }
.currency-select {
    width: 90px !important; flex-shrink: 0; flex-grow: 0 !important;
    appearance: none; cursor: pointer; text-align: center; font-weight: 600;
    background: var(--bg-surface-hover); border-color: var(--border-color);
}

.btn-submit {
    background: var(--text-primary); color: var(--bg-surface);
    padding: 14px; border-radius: var(--radius-pill);
    font-weight: 600; font-size: 15px; transition: var(--transition);
    width: 100%; border: none; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-submit i { font-size: 18px; }
.btn-submit:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-submit:disabled { opacity: 0.5; pointer-events: none; }

/* ============================================================
   ACCOUNT VIEW
   ============================================================ */
.account-page { max-width: 800px; margin: 0 auto; padding-top: 24px; width: 100%; }
.account-header { padding: 24px 20px; display: flex; align-items: center; gap: 20px; }
.account-avatar {
    width: 72px; height: 72px; border-radius: 50%;
    background: var(--bg-surface); display: flex; align-items: center; justify-content: center;
    font-size: 24px; font-weight: 600; border: 1px solid var(--border-color); flex-shrink: 0;
}
.account-name { font-size: 20px; font-weight: 700; }
.account-email { color: var(--text-secondary); font-size: 14px; }

.settings-list { padding: 0 20px 24px 20px; display: flex; flex-direction: column; gap: 12px; }
.setting-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; background: var(--bg-surface);
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    cursor: pointer; transition: var(--transition); color: inherit;
}
.setting-item:hover { box-shadow: var(--shadow-sm); transform: translateY(-1px); }
.setting-item-left { display: flex; align-items: center; gap: 12px; font-weight: 500; }
.setting-item-left i { font-size: 20px; color: var(--text-secondary); }
.setting-item-right { color: var(--text-muted); }

/* Toggle switch */
.toggle-switch {
    width: 48px; height: 28px; border-radius: 14px;
    background: var(--border-strong); position: relative;
    transition: background 0.25s ease; flex-shrink: 0;
}
.toggle-switch.active { background: var(--accent); }
.toggle-knob {
    width: 22px; height: 22px; border-radius: 50%;
    background: #fff; position: absolute; top: 3px; left: 3px;
    transition: transform 0.25s ease; box-shadow: var(--shadow-sm);
}
.toggle-switch.active .toggle-knob { transform: translateX(20px); }

.setting-item.danger { border-color: #fca5a5; }
.setting-item.danger .setting-item-left { color: #ef4444; font-weight: 600; }

/* Language select */
.lang-select {
    padding: 6px 12px; border-radius: var(--radius-sm);
    border: 1px solid var(--border-color); background: var(--bg-surface);
    color: var(--text-primary); font-size: 14px; font-family: inherit;
    cursor: pointer; outline: none; transition: var(--transition);
}
.lang-select:focus { border-color: var(--accent); }

/* ============================================================
   DETAIL PAGE (redesigned)
   ============================================================ */
.detail-page {
    max-width: 1100px; margin: 0 auto; width: 100%;
    padding: 12px 12px 100px;
}
@media (min-width: 1024px) { .detail-page { padding: 28px 32px 48px; } }

.detail-back {
    display: inline-flex; align-items: center; gap: 6px;
    color: var(--text-secondary); font-size: 14px; font-weight: 500;
    margin-bottom: 14px; transition: var(--transition);
}
.detail-back:hover { color: var(--text-primary); }
.detail-back i { font-size: 18px; }

.detail-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    overflow: visible;
}
@media (min-width: 1024px) { .detail-card { padding: 0; } }

.detail-layout { display: grid; gap: 14px; }
@media (min-width: 1024px) {
    .detail-layout { grid-template-columns: 1.05fr 1fr; gap: 36px; align-items: start; }
}

/* Gallery */
.detail-gallery { width: 100%; display: flex; flex-direction: column; gap: 10px; }
.detail-main-img {
    position: relative;
    width: 100%; aspect-ratio: 4 / 3;
    background: var(--bg-surface);
    border-radius: var(--radius-lg);
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
}
@media (min-width: 1024px) { .detail-main-img { aspect-ratio: 1 / 1; border-radius: var(--radius-xl, 20px); } }
.detail-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-img-placeholder {
    color: var(--text-muted); font-size: 64px; opacity: 0.3;
}

.detail-fav-btn {
    position: absolute; top: 14px; right: 14px;
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255,255,255,0.92); color: var(--text-primary);
    display: flex; align-items: center; justify-content: center;
    box-shadow: var(--shadow-sm); transition: var(--transition);
    backdrop-filter: blur(6px);
}
.detail-fav-btn:hover { transform: scale(1.05); }
.detail-fav-btn.active { color: var(--accent-coral); }
.detail-fav-btn i { font-size: 18px; }

.detail-dots {
    display: flex; justify-content: center; gap: 6px;
}
.detail-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--border-color); transition: var(--transition);
}
.detail-dot.active { width: 20px; border-radius: 3px; background: var(--accent-coral); }

.detail-thumbs {
    display: flex; gap: 10px; overflow-x: auto;
    padding: 2px;
}
.detail-thumbs::-webkit-scrollbar { display: none; }
.detail-thumb {
    width: 56px; height: 56px; border-radius: var(--radius-md);
    border: 2px solid transparent; overflow: hidden;
    cursor: pointer; flex-shrink: 0; transition: var(--transition);
    background: var(--bg-surface);
}
@media (min-width: 1024px) { .detail-thumb { width: 72px; height: 72px; } }
.detail-thumb.active { border-color: var(--accent-coral); }
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Info column */
.detail-info { display: flex; flex-direction: column; gap: 12px; padding: 0; }
@media (min-width: 1024px) { .detail-info { padding: 4px 0 0; gap: 18px; } }

.detail-brand {
    display: flex; align-items: center; gap: 10px;
}
.detail-brand-badge {
    width: 36px; height: 36px; border-radius: 10px;
    background: color-mix(in srgb, var(--accent-coral) 14%, transparent);
    color: var(--accent-coral);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.detail-brand-name {
    font-size: 13px; font-weight: 600; color: var(--text-secondary);
    text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-brand-spacer { flex: 1; }
.detail-ref {
    font-size: 11px; font-weight: 600; color: var(--text-muted);
    letter-spacing: 0.8px; background: var(--bg-body);
    padding: 4px 10px; border-radius: var(--radius-pill);
}

.detail-title {
    font-size: 20px; font-weight: 700; color: var(--text-primary);
    line-height: 1.25; margin: 0;
}
@media (min-width: 1024px) { .detail-title { font-size: 30px; } }

.detail-rating {
    display: flex; align-items: center; gap: 10px;
}
.detail-stars { display: inline-flex; gap: 2px; color: #f59e0b; font-size: 15px; }
.detail-stars i.ph { color: var(--border-color); }
.detail-rating-meta { font-size: 13px; color: var(--text-muted); }

.detail-price-row {
    display: flex; align-items: baseline; gap: 10px;
    padding: 6px 0;
}
.detail-price {
    font-size: 26px; font-weight: 800; color: var(--text-primary);
    line-height: 1;
}
@media (min-width: 1024px) { .detail-price { font-size: 40px; } }

.detail-attrs {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
    padding: 12px; border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}
.detail-attr { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.detail-attr-label {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px;
    color: var(--text-muted); font-weight: 600;
}
.detail-attr-value {
    font-size: 13px; font-weight: 600; color: var(--text-primary);
    display: flex; align-items: center; gap: 4px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.detail-attr-value i { font-size: 14px; color: var(--accent-coral); }

.detail-section-title {
    font-size: 14px; font-weight: 700; color: var(--text-primary);
    margin: 0 0 6px; text-transform: uppercase; letter-spacing: 0.5px;
}
.detail-description {
    font-size: 14px; line-height: 1.7; color: var(--text-secondary);
}

.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.detail-tag {
    padding: 5px 12px; border-radius: var(--radius-pill);
    background: var(--bg-body);
    font-size: 12px; font-weight: 500; color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.detail-seller {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px;
    background: var(--bg-surface); border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}
.detail-seller-avatar {
    width: 44px; height: 44px; border-radius: 50%;
    background: var(--accent-coral); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 16px; flex-shrink: 0;
}
.detail-seller-info { flex: 1; min-width: 0; }
.detail-seller-name { font-weight: 700; font-size: 14px; color: var(--text-primary); }
.detail-seller-sub { font-size: 12px; color: var(--text-muted); }
.detail-seller-chat {
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--bg-surface); color: var(--text-primary);
    border: 1px solid var(--border-color);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); flex-shrink: 0;
}
.detail-seller-chat:hover { border-color: var(--accent-coral); color: var(--accent-coral); }

/* CTA bar */
.detail-cta-bar {
    display: flex; gap: 10px; align-items: stretch;
    position: sticky; bottom: 16px;
    margin-top: 4px;
}
@media (max-width: 1023px) {
    .detail-cta-bar {
        position: fixed; left: 0; right: 0;
        bottom: calc(var(--nav-height-mobile) + env(safe-area-inset-bottom, 0px));
        margin: 0; padding: 10px 12px;
        background: var(--bg-surface);
        border-top: 1px solid var(--border-color);
        z-index: 50;
    }
}
.detail-cta-btn {
    display: inline-flex; align-items: center; justify-content: center;
    gap: 8px; font-weight: 700; font-size: 15px;
    padding: 14px 20px; border-radius: var(--radius-pill);
    transition: var(--transition);
}
.detail-cta-btn.primary {
    flex: 1;
    background: var(--text-primary); color: var(--bg-surface);
}
.detail-cta-btn.primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.detail-cta-btn.icon {
    width: 52px; flex-shrink: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}
.detail-cta-btn.icon.active { color: var(--accent-coral); border-color: var(--accent-coral); }
.detail-cta-btn i { font-size: 18px; }

/* ============================================================
   MOBILE BOTTOM NAV
   ============================================================ */
.mobile-nav-wrapper {
    position: fixed; bottom: 0; left: 0; right: 0;
    z-index: 1000; background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
@media (min-width: 1024px) { .mobile-nav-wrapper { display: none; } }

.mobile-nav {
    display: flex; align-items: center; justify-content: space-around;
    height: var(--nav-height-mobile); max-width: 500px; margin: 0 auto;
}

.m-nav-item {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    flex: 1; height: 100%; color: var(--text-muted);
    transition: var(--transition); text-decoration: none; gap: 2px;
}
.m-nav-item i { font-size: 22px; }
.m-nav-item span { font-size: 10px; font-weight: 500; }
.m-nav-item.active { color: var(--text-primary); }

.m-nav-fab {
    display: flex; align-items: center; justify-content: center;
    flex: 1; height: 100%;
}
.m-nav-fab-btn {
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--text-primary); color: var(--bg-surface);
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; border: none; cursor: pointer;
    box-shadow: var(--shadow-md); transition: var(--transition);
}
.m-nav-fab-btn:hover { transform: scale(1.05); }

/* ============================================================
   TOAST
   ============================================================ */
.toast {
    position: fixed; bottom: 80px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--text-primary); color: var(--bg-surface);
    padding: 12px 24px; border-radius: var(--radius-pill);
    font-size: 14px; font-weight: 500;
    display: flex; align-items: center; gap: 8px;
    opacity: 0; pointer-events: none; transition: all 0.3s ease;
    z-index: 9999; box-shadow: var(--shadow-lg);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============================================================
   PWA INSTALL BANNER
   ============================================================ */
.pwa-install-banner {
    position: fixed; bottom: 68px; left: 50%;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 32px); max-width: 420px;
    background: var(--bg-surface); color: var(--text-primary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
    padding: 14px 16px;
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    opacity: 0; pointer-events: none;
    transition: all 0.35s cubic-bezier(.4,0,.2,1);
    z-index: 9998;
}
.pwa-install-banner.show {
    opacity: 1; pointer-events: auto;
    transform: translateX(-50%) translateY(0);
}
.pwa-install-content {
    display: flex; align-items: center; gap: 12px;
    flex: 1; min-width: 0;
}
.pwa-install-icon {
    width: 40px; height: 40px; border-radius: var(--radius-md);
    flex-shrink: 0;
}
.pwa-install-text {
    display: flex; flex-direction: column; min-width: 0;
}
.pwa-install-text strong {
    font-size: 14px; font-weight: 600;
}
.pwa-install-text span {
    font-size: 12px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pwa-install-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.pwa-install-btn {
    background: var(--accent); color: var(--accent-text);
    border: none; border-radius: var(--radius-pill);
    padding: 8px 18px; font-size: 13px; font-weight: 600;
    cursor: pointer; white-space: nowrap;
}
.pwa-install-dismiss {
    background: none; border: none; color: var(--text-muted);
    cursor: pointer; font-size: 18px; padding: 4px;
    display: flex; align-items: center; justify-content: center;
}
@media (min-width: 769px) {
    .pwa-install-banner { bottom: 24px; }
}

/* ============================================================
   EMPTY STATE
   ============================================================ */
.no-listings { grid-column: 1 / -1; text-align: center; padding: 48px 20px; color: var(--text-muted); }
.no-listings i { font-size: 48px; margin-bottom: 16px; display: block; }
.no-listings h3 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }

/* ============================================================
   MESSAGES PAGE
   ============================================================ */
.messages-page { max-width: 800px; margin: 0 auto; padding: 48px 20px; text-align: center; width: 100%; }
.empty-state { color: var(--text-muted); }
.empty-state i { font-size: 48px; margin-bottom: 16px; display: block; }
.empty-state h2 { font-size: 18px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.empty-state p { font-size: 14px; }

/* ============================================================
   ANIMATIONS & UTILITIES
   ============================================================ */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeIn 0.3s ease forwards; }

.maplibregl-popup-content {
    border-radius: var(--radius-md) !important; padding: 12px 16px !important;
    box-shadow: var(--shadow-md) !important; border: 1px solid var(--border-color) !important;
    font-family: 'Inter', sans-serif !important;
}
.maplibregl-popup-close-button { font-size: 16px; padding: 4px 8px; }
.maplibregl-ctrl-group {
    border-radius: var(--radius-sm) !important;
    border: 1px solid var(--border-color) !important;
    box-shadow: var(--shadow-sm) !important;
}

/* Center map controls vertically on mobile */
@media (max-width: 1023px) {
    .map-canvas-area .maplibregl-ctrl-top-right {
        top: 50% !important;
        transform: translateY(-50%);
    }
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

/* ============================================================
   MAP — Custom HTML Markers (inline SVG pins + clusters)
   ============================================================ */

/* Classic teardrop pin: inline-SVG base + Phosphor icon on top */
.sk-pin {
    --pin-color: #4f8a6c;
    position: relative;
    width: 32px;
    height: 44px;
    cursor: pointer;
    transform-origin: 50% 100%;
    transition: transform 0.18s ease;
    will-change: transform;
    filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}
.sk-pin:hover { transform: scale(1.12); z-index: 2; }

.sk-pin-svg {
    display: block;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.sk-pin-icon {
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--pin-color);
    font-size: 14px;
    line-height: 1;
    pointer-events: none;
}
.sk-pin-price { display: none; }
.sk-pin-tail { display: none; }
.sk-pin-body { display: none; }

/* Cluster bubble */
.sk-cluster {
    position: relative;
    width: 40px; height: 40px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform 0.2s ease;
}
.sk-cluster.md { width: 48px; height: 48px; }
.sk-cluster.lg { width: 58px; height: 58px; }
.sk-cluster:hover { transform: scale(1.06); }

.sk-cluster-ring {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: rgba(79, 138, 108, 0.22);
    animation: sk-cluster-pulse 2.2s ease-out infinite;
    pointer-events: none;
}
.sk-cluster-core {
    position: relative;
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    border-radius: 50%;
    background: linear-gradient(135deg, #5ea17f 0%, #3f7355 100%);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    border: 3px solid #fff;
    box-shadow: 0 6px 18px rgba(63, 115, 85, 0.35), 0 2px 4px rgba(0,0,0,0.12);
}
.sk-cluster.md .sk-cluster-core {
    background: linear-gradient(135deg, #4f8a6c 0%, #34664d 100%);
    box-shadow: 0 6px 18px rgba(52, 102, 77, 0.4), 0 2px 4px rgba(0,0,0,0.12);
}
.sk-cluster.lg .sk-cluster-core {
    background: linear-gradient(135deg, #111827 0%, #0f172a 100%);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4), 0 2px 4px rgba(0,0,0,0.12);
}
.sk-cluster-count {
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.2px;
}

/* Cluster-filter banner inside sidebar list */
.map-list-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 16px;
    background: var(--bg-surface-hover);
    border-bottom: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    position: sticky;
    top: 0;
    z-index: 1;
}
.map-list-banner-text { display: flex; align-items: center; gap: 8px; }
.map-list-banner-text i { color: var(--accent-coral); font-size: 16px; }
.map-list-banner-clear {
    width: 28px; height: 28px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: var(--transition);
}
.map-list-banner-clear:hover { color: var(--text-primary); background: var(--bg-body); }
.sk-cluster.md .sk-cluster-count { font-size: 15px; }
.sk-cluster.lg .sk-cluster-count { font-size: 16px; }

@keyframes sk-cluster-pulse {
    0%   { transform: scale(0.9); opacity: 0.8; }
    70%  { transform: scale(1.35); opacity: 0; }
    100% { transform: scale(1.35); opacity: 0; }
}

/* ============================================================
   ACCOUNT — centered profile + grouped settings
   ============================================================ */
.account-header.centered {
    flex-direction: column;
    text-align: center;
    gap: 10px;
    padding: 32px 20px 20px;
}
.account-header.centered .account-avatar {
    width: 96px; height: 96px;
    font-size: 36px;
    margin: 0 auto;
    background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-hover) 100%);
    box-shadow: var(--shadow-md);
}
.account-header.centered .account-name {
    margin-top: 6px;
    font-size: 22px;
}
.account-header.centered .account-email { font-size: 14px; }

/* Settings group (collapsible) */
.setting-group {
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
}
.setting-group .setting-group-header {
    width: 100%;
    border: none;
    border-radius: 0;
    background: transparent;
    text-align: left;
}
.setting-group .setting-group-header:hover {
    box-shadow: none; transform: none;
    background: var(--bg-surface-hover);
}
.setting-group-caret {
    transition: transform 0.25s ease;
}
.setting-group.open .setting-group-caret { transform: rotate(180deg); }

.setting-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.setting-group.open .setting-group-body { max-height: 400px; }

.setting-item.sub {
    border: none;
    border-top: 1px solid var(--border-color);
    border-radius: 0;
    background: transparent;
    padding-left: 28px;
}
.setting-item.sub:hover { box-shadow: none; transform: none; background: var(--bg-surface-hover); }

/* ============================================================
   MAP — Route panel (distance + ETA overlay)
   ============================================================ */
.route-panel {
    position: absolute;
    left: 50%;
    bottom: 20px;
    transform: translateX(-50%) translateY(20px);
    width: calc(100% - 32px);
    max-width: 420px;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-float);
    z-index: 18;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.25s ease;
}
.route-panel.active {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}
.route-panel-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
}
.route-panel-icon {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: var(--accent-coral);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    font-size: 20px;
}
.route-panel-icon.warn { background: #d97706; }
.route-panel-info { flex: 1; min-width: 0; }
.route-panel-eta {
    font-size: 15px; font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}
.route-panel-meta {
    font-size: 12px;
    color: var(--text-secondary);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.route-panel-close {
    width: 32px; height: 32px;
    border-radius: 50%;
    color: var(--text-muted);
    background: var(--bg-surface-hover);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: var(--transition);
}
.route-panel-close:hover { color: var(--text-primary); }

@media (max-width: 1023px) {
    .route-panel {
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    }
}
