/* ==========================================
   NordMart - Nordic Marketplace
   Mobile-First Responsive Design
   ========================================== */

/* ---------- Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400&display=swap');

/* ---------- Variables ---------- */
:root {
    --font-body: 'DM Sans', system-ui, sans-serif;
    --font-display: 'Fraunces', Georgia, serif;

    --primary: #1a5c3a;
    --primary-light: #2d8a5e;
    --primary-dark: #0f3d26;
    --primary-bg: #f0f7f3;

    --accent: #d4763a;
    --accent-light: #e8945e;
    --accent-bg: #fdf3ec;

    --surface: #ffffff;
    --surface-raised: #fafbfc;
    --surface-hover: #f5f6f8;
    --surface-border: #e4e7eb;

    --text: #1a1d21;
    --text-secondary: #5a6069;
    --text-muted: #8b929b;
    --text-inverse: #ffffff;

    --success: #1a8754;
    --warning: #d4a13a;
    --danger: #c0392b;
    --info: #2980b9;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.04);
    --shadow-lg: 0 12px 32px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.04);

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

    --header-height: 60px;
    --bottom-nav-height: 64px;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    color: var(--text);
    background: var(--surface-raised);
    -webkit-font-smoothing: antialiased;
    padding-bottom: var(--bottom-nav-height);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-light); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}
button { cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.3; }

/* ---------- Utilities ---------- */
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
    height: var(--header-height);
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 12px;
}
.logo {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.logo span { color: var(--accent); }
.logo svg { width: 28px; height: 28px; }

.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.header-search input {
    width: 100%;
    padding: 10px 14px 10px 40px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-xl);
    background: var(--surface-raised);
    font-size: 14px;
    transition: all 0.2s;
}
.header-search input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--surface);
    box-shadow: 0 0 0 3px rgba(26,92,58,0.1);
}
.header-search .search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
}

.header-actions { display: flex; align-items: center; gap: 8px; }
.header-actions .btn { padding: 8px 16px; font-size: 14px; }

/* Mobile: hide search in header, show in hero */
@media (max-width: 640px) {
    .header-search { display: none; }
    .logo { font-size: 20px; }
}

/* ---------- Bottom Navigation (Mobile) ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: var(--surface);
    border-top: 1px solid var(--surface-border);
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: var(--bottom-nav-height);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.bottom-nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    color: var(--text-muted);
    font-size: 11px;
    font-weight: 500;
    padding: 6px 12px;
    transition: color 0.2s;
    text-decoration: none;
}
.bottom-nav a.active,
.bottom-nav a:hover { color: var(--primary); }
.bottom-nav svg { width: 24px; height: 24px; }
.bottom-nav .nav-sell {
    background: var(--primary);
    color: white;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: -16px;
    box-shadow: var(--shadow-md);
}
.bottom-nav .nav-sell:hover { background: var(--primary-light); color: white; }
.bottom-nav .nav-sell svg { width: 24px; height: 24px; }
.bottom-nav .badge {
    position: absolute;
    top: -2px;
    right: -4px;
    background: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 16px;
    height: 16px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* Hide bottom nav on desktop */
@media (min-width: 769px) {
    .bottom-nav { display: none; }
    body { padding-bottom: 0; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 15px;
    transition: all 0.2s;
    white-space: nowrap;
    cursor: pointer;
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn-primary {
    background: var(--primary);
    color: var(--text-inverse);
}
.btn-primary:hover { background: var(--primary-light); color: var(--text-inverse); }
.btn-accent {
    background: var(--accent);
    color: var(--text-inverse);
}
.btn-accent:hover { background: var(--accent-light); color: var(--text-inverse); }
.btn-outline {
    background: transparent;
    border: 2px solid var(--surface-border);
    color: var(--text);
}
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
}
.btn-ghost:hover { background: var(--surface-hover); color: var(--text); }
.btn-danger { background: var(--danger); color: white; }
.btn-danger:hover { background: #a93226; color: white; }
.btn-sm { padding: 8px 16px; font-size: 13px; border-radius: var(--radius-sm); }
.btn-lg { padding: 16px 32px; font-size: 17px; }
.btn-block { width: 100%; }
.btn-icon {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: var(--radius-md);
}

/* ---------- Cards ---------- */
.card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}
.card-body { padding: 14px; }

/* ---------- Listing Card ---------- */
.listing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    .listing-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
}
@media (min-width: 960px) {
    .listing-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
}

.listing-card { position: relative; }
.listing-card a { color: inherit; text-decoration: none; display: block; }
.listing-card .card-image {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: var(--surface-hover);
}
.listing-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}
.listing-card:hover .card-image img { transform: scale(1.05); }
.listing-card .card-image .no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: var(--text-muted);
}
.listing-card .card-image .no-image svg { width: 40px; height: 40px; }
.listing-card .price-tag {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 14px;
    backdrop-filter: blur(4px);
}
.listing-card .card-badges {
    position: absolute;
    top: 8px;
    left: 8px;
    display: flex;
    gap: 4px;
}
.listing-card .badge-featured {
    background: var(--accent);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.listing-card .badge-urgent {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}
.listing-card .fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
    backdrop-filter: blur(4px);
}
.listing-card .fav-btn:hover,
.listing-card .fav-btn.active { color: var(--danger); }
.listing-card .fav-btn svg { width: 18px; height: 18px; }
.listing-card .card-title {
    font-size: 14px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 4px;
}
.listing-card .card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}
.listing-card .card-meta svg { width: 12px; height: 12px; flex-shrink: 0; }
.listing-card .card-details {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.listing-card .card-detail {
    font-size: 11px;
    color: var(--text-secondary);
    background: var(--surface-raised);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
}

/* ---------- Hero Section ---------- */
.hero {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
    color: var(--text-inverse);
    padding: 32px 0 40px;
    position: relative;
    overflow: hidden;
}
.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(ellipse, rgba(212,118,58,0.15) 0%, transparent 70%);
    pointer-events: none;
}
.hero h1 {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
}
.hero p {
    font-size: 15px;
    opacity: 0.85;
    margin-bottom: 20px;
}
.hero-search {
    position: relative;
    max-width: 500px;
}
.hero-search input {
    width: 100%;
    padding: 14px 54px 14px 18px;
    border: none;
    border-radius: var(--radius-xl);
    font-size: 16px;
    background: rgba(255,255,255,0.95);
    color: var(--text);
    box-shadow: var(--shadow-lg);
}
.hero-search input::placeholder { color: var(--text-muted); }
.hero-search input:focus { outline: none; background: white; }
.hero-search button {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hero-search button svg { width: 18px; height: 18px; }

@media (min-width: 769px) {
    .hero { padding: 48px 0 56px; }
    .hero h1 { font-size: 40px; }
    .hero p { font-size: 17px; }
}

/* ---------- Category Bar ---------- */
.category-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.category-bar::-webkit-scrollbar { display: none; }
.category-bar-inner {
    display: flex;
    gap: 4px;
    padding: 10px 16px;
    min-width: max-content;
}
.category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s;
    text-decoration: none;
    white-space: nowrap;
    min-width: 72px;
}
.category-chip:hover,
.category-chip.active {
    background: var(--primary-bg);
    color: var(--primary);
}
.category-chip svg { width: 24px; height: 24px; }
.category-chip .chip-count {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ---------- Section ---------- */
.section { padding: 24px 0; }
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.section-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
}
.section-link {
    font-size: 14px;
    font-weight: 500;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 4px;
}
.section-link svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.form-group { margin-bottom: 20px; }
.form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text);
}
.form-hint {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26,92,58,0.1);
}
.form-select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%238b929b' stroke-width='2' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}
.form-textarea { resize: vertical; min-height: 120px; }
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-error {
    font-size: 13px;
    color: var(--danger);
    margin-top: 4px;
}
.form-checkbox {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.form-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
}

/* ---------- Alerts ---------- */
.alert {
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}
.alert svg { width: 20px; height: 20px; flex-shrink: 0; }
.alert-success { background: #edf7f0; color: var(--success); border: 1px solid #c3e6cb; }
.alert-error { background: #fdeaea; color: var(--danger); border: 1px solid #f5c6cb; }
.alert-warning { background: #fff8e6; color: #856404; border: 1px solid #ffeeba; }

/* ---------- Listing Detail ---------- */
.listing-detail { padding: 0 0 32px; }
.listing-gallery {
    position: relative;
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-hover);
}
.listing-gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    backdrop-filter: blur(4px);
}
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    background: rgba(255,255,255,0.9);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
}
.gallery-nav.prev { left: 12px; }
.gallery-nav.next { right: 12px; }
.gallery-nav svg { width: 18px; height: 18px; }

.listing-info { padding: 20px 16px; }
.listing-price {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 4px;
}
.listing-title {
    font-family: var(--font-display);
    font-size: 22px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 12px;
}
.listing-meta-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
    border-top: 1px solid var(--surface-border);
    border-bottom: 1px solid var(--surface-border);
    margin-bottom: 16px;
}
.listing-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
}
.listing-meta-item svg { width: 16px; height: 16px; color: var(--text-muted); }
.listing-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--surface-border);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
}
.listing-spec {
    background: var(--surface);
    padding: 12px 14px;
}
.listing-spec dt {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 2px;
}
.listing-spec dd {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}
.listing-description {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: 24px;
    white-space: pre-line;
}

/* Seller card */
.seller-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
}
.seller-info {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}
.seller-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: var(--primary-bg);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 700;
    font-family: var(--font-display);
    flex-shrink: 0;
}
.seller-name { font-weight: 600; font-size: 16px; }
.seller-location { font-size: 13px; color: var(--text-muted); }
.seller-since { font-size: 12px; color: var(--text-muted); }

.contact-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.contact-actions .btn { width: 100%; }

/* Actions bar (sticky on mobile) */
.listing-action-bar {
    position: fixed;
    bottom: var(--bottom-nav-height);
    left: 0;
    right: 0;
    z-index: 50;
    background: var(--surface);
    border-top: 1px solid var(--surface-border);
    padding: 10px 16px;
    display: flex;
    gap: 10px;
    align-items: center;
    box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}
.listing-action-bar .action-price {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--primary);
    flex: 1;
}
@media (min-width: 769px) {
    .listing-action-bar { display: none; }
}

/* ---------- Search/Filter ---------- */
.search-bar {
    background: var(--surface);
    border-bottom: 1px solid var(--surface-border);
    padding: 12px 0;
}
.search-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}
.filter-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    background: var(--surface);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.filter-toggle svg { width: 18px; height: 18px; }
.filter-toggle .filter-count {
    background: var(--primary);
    color: white;
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-select {
    padding: 10px 36px 10px 14px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    background-color: var(--surface);
}

/* Filter panel (mobile slide-up) */
.filter-panel {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 200;
    background: var(--surface);
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 24px 20px 32px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -8px 32px rgba(0,0,0,0.15);
}
.filter-panel.active { transform: translateY(0); }
.filter-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}
.filter-panel-header h3 { font-size: 18px; }
.filter-overlay {
    position: fixed;
    inset: 0;
    z-index: 199;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.filter-overlay.active { opacity: 1; pointer-events: auto; }

@media (min-width: 769px) {
    .filter-panel {
        position: static;
        transform: none;
        border-radius: var(--radius-lg);
        box-shadow: var(--shadow-sm);
        max-height: none;
        border: 1px solid var(--surface-border);
    }
    .filter-overlay { display: none; }
}

/* ---------- Pagination ---------- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 32px;
    flex-wrap: wrap;
}
.pagination a, .pagination span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s;
}
.pagination a:hover { background: var(--surface-hover); color: var(--text); }
.pagination .active {
    background: var(--primary);
    color: var(--text-inverse);
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* ---------- Auth Pages ---------- */
.auth-page {
    min-height: calc(100vh - var(--header-height));
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
}
.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    box-shadow: var(--shadow-md);
}
.auth-card h1 {
    font-family: var(--font-display);
    font-size: 26px;
    text-align: center;
    margin-bottom: 8px;
}
.auth-card .auth-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 28px;
    font-size: 14px;
}
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}
.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 24px 0;
    color: var(--text-muted);
    font-size: 13px;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface-border);
}

/* ---------- Dashboard ---------- */
.dash-layout {
    display: flex;
    min-height: calc(100vh - var(--header-height));
}
.dash-sidebar {
    width: 260px;
    background: var(--surface);
    border-right: 1px solid var(--surface-border);
    padding: 20px 0;
    flex-shrink: 0;
}
.dash-sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s;
    text-decoration: none;
}
.dash-sidebar-nav a:hover { background: var(--surface-hover); color: var(--text); }
.dash-sidebar-nav a.active { color: var(--primary); background: var(--primary-bg); border-right: 3px solid var(--primary); }
.dash-sidebar-nav a svg { width: 20px; height: 20px; }
.dash-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

/* Mobile: sidebar hidden, use bottom nav */
@media (max-width: 768px) {
    .dash-sidebar { display: none; }
    .dash-content { padding: 16px; }
}

/* Dashboard stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
@media (min-width: 640px) {
    .stats-grid { grid-template-columns: repeat(3, 1fr); }
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    padding: 16px;
}
.stat-value {
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}
.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Dashboard listing table */
.dash-listings {
    background: var(--surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-border);
    overflow: hidden;
}
.dash-listing-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border);
    transition: background 0.15s;
}
.dash-listing-item:last-child { border-bottom: none; }
.dash-listing-item:hover { background: var(--surface-hover); }
.dash-listing-thumb {
    width: 60px;
    height: 45px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-hover);
    flex-shrink: 0;
}
.dash-listing-thumb img { width: 100%; height: 100%; object-fit: cover; }
.dash-listing-info { flex: 1; min-width: 0; }
.dash-listing-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-listing-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 12px;
}
.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}
.status-active { background: #edf7f0; color: var(--success); }
.status-draft { background: #f5f6f8; color: var(--text-muted); }
.status-sold { background: #e8f0fe; color: var(--info); }
.status-expired { background: #fff8e6; color: #856404; }
.dash-listing-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

/* ---------- Empty States ---------- */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}
.empty-state svg { width: 64px; height: 64px; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 18px; color: var(--text); margin-bottom: 8px; }
.empty-state p { margin-bottom: 20px; }

/* ---------- Country Selector ---------- */
.country-selector {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.country-option {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: 2px solid var(--surface-border);
    border-radius: var(--radius-md);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}
.country-option:hover { border-color: var(--primary); }
.country-option.selected { border-color: var(--primary); background: var(--primary-bg); }
.country-flag { font-size: 18px; }

/* ---------- Image Upload ---------- */
.image-upload-area {
    border: 2px dashed var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--surface-raised);
}
.image-upload-area:hover { border-color: var(--primary); background: var(--primary-bg); }
.image-upload-area svg { width: 40px; height: 40px; color: var(--text-muted); margin-bottom: 8px; }
.image-upload-area p { font-size: 14px; color: var(--text-muted); }
.image-upload-area .upload-hint { font-size: 12px; }

.image-preview-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
}
.image-preview {
    position: relative;
    aspect-ratio: 4/3;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.image-preview .remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

/* ---------- Tab Navigation ---------- */
.tab-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--surface-border);
    overflow-x: auto;
    scrollbar-width: none;
}
.tab-nav::-webkit-scrollbar { display: none; }
.tab-nav a {
    padding: 12px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.2s;
}
.tab-nav a:hover { color: var(--text); }
.tab-nav a.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--surface);
    border-top: 1px solid var(--surface-border);
    padding: 32px 0;
    margin-top: 48px;
    font-size: 13px;
    color: var(--text-muted);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}
@media (min-width: 640px) {
    .footer-grid { grid-template-columns: repeat(4, 1fr); }
}
.footer-col h4 {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}
.footer-col a {
    display: block;
    color: var(--text-muted);
    padding: 4px 0;
    text-decoration: none;
}
.footer-col a:hover { color: var(--primary); }
.footer-bottom {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--surface-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

/* ---------- Animations ---------- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.3s ease forwards; }
.listing-card { animation: fadeIn 0.3s ease forwards; }
.listing-card:nth-child(2) { animation-delay: 0.05s; }
.listing-card:nth-child(3) { animation-delay: 0.1s; }
.listing-card:nth-child(4) { animation-delay: 0.15s; }

/* ---------- Skeleton Loading ---------- */
.skeleton {
    background: linear-gradient(90deg, var(--surface-hover) 25%, #e8eaed 37%, var(--surface-hover) 63%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-sm);
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Listing Detail Page ---------- */
.detail-layout {
    display: grid;
    gap: 24px;
    margin-bottom: 32px;
}
@media (min-width: 768px) {
    .detail-layout { grid-template-columns: 1.4fr 1fr; }
}
.gallery-main {
    aspect-ratio: 4/3;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--surface-hover);
    position: relative;
}
.gallery-main img {
    width: 100%; height: 100%; object-fit: contain;
    background: var(--surface);
}
.gallery-sold-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
    color: white; font-size: 32px; font-weight: 700;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display);
}
.gallery-thumbs {
    display: flex; gap: 8px; margin-top: 8px; overflow-x: auto;
    scrollbar-width: none; padding: 4px 0;
}
.gallery-thumbs::-webkit-scrollbar { display: none; }
.gallery-thumb {
    width: 64px; height: 48px; border-radius: var(--radius-sm);
    overflow: hidden; border: 2px solid transparent; cursor: pointer;
    flex-shrink: 0; background: var(--surface-hover); padding: 0;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumb.active { border-color: var(--primary); }
.gallery-thumb:hover { border-color: var(--text-muted); }

.detail-info-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 24px; margin-bottom: 16px;
}
.detail-title {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 600;
    line-height: 1.3; margin-bottom: 12px;
}
.detail-price {
    margin-bottom: 12px;
}
.detail-price .price-amount {
    font-family: var(--font-display);
    font-size: 28px; font-weight: 700; color: var(--primary);
}
.detail-price .price-negotiable,
.detail-price .price-contact {
    font-size: 14px; color: var(--text-muted); margin-left: 4px;
}
.detail-price .price-free {
    font-family: var(--font-display); color: var(--success);
}
.detail-location {
    font-size: 14px; color: var(--text-secondary); margin-bottom: 12px;
}
.detail-meta-row {
    display: flex; gap: 16px; font-size: 13px;
    color: var(--text-muted); margin-bottom: 16px;
    padding-bottom: 16px; border-bottom: 1px solid var(--surface-border);
}
.detail-meta-row span {
    display: inline-flex; align-items: center; gap: 4px;
}
.detail-actions {
    display: flex; gap: 8px;
}
.detail-actions .btn { flex: 1; }

/* Seller card overrides for detail */
.listing-detail .seller-card {
    display: flex; align-items: center; gap: 14px;
    flex-wrap: wrap;
}
.listing-detail .seller-avatar {
    width: 48px; height: 48px;
}
.listing-detail .seller-info {
    flex: 1; min-width: 120px; display: flex; flex-direction: column;
    gap: 2px; margin-bottom: 0;
}
.avatar-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: var(--primary-bg); color: var(--primary);
    font-weight: 700; font-size: 18px; border-radius: 50%;
}

.detail-body { max-width: 800px; margin-bottom: 32px; }
.detail-section { margin-bottom: 32px; }
.detail-section h2 {
    font-family: var(--font-display);
    font-size: 18px; font-weight: 600;
    margin-bottom: 16px;
}
.detail-description {
    font-size: 15px; line-height: 1.7;
    color: var(--text-secondary); white-space: pre-line;
}
.specs-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 1px; background: var(--surface-border);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md); overflow: hidden;
}
.spec-item { background: var(--surface); padding: 12px 14px; }
.spec-label {
    display: block; font-size: 11px;
    text-transform: uppercase; letter-spacing: 0.5px;
    color: var(--text-muted); font-weight: 500; margin-bottom: 2px;
}
.spec-value { font-size: 14px; font-weight: 600; color: var(--text); }

/* ---------- Modal ---------- */
.modal {
    position: fixed; inset: 0; z-index: 1000;
    display: none; align-items: center; justify-content: center;
}
.modal.open { display: flex; }
.modal-backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.5);
}
.modal-content {
    position: relative; background: white;
    border-radius: var(--radius-lg); width: calc(100% - 32px);
    max-width: 480px; max-height: calc(100vh - 64px);
    overflow-y: auto; animation: fadeIn 0.2s ease;
}
.modal-header {
    display: flex; align-items: center;
    justify-content: space-between; padding: 16px 20px;
    border-bottom: 1px solid var(--surface-border);
}
.modal-header h3 { font-size: 16px; font-weight: 600; }
.modal-close {
    background: none; border: none; cursor: pointer;
    font-size: 20px; color: var(--text-muted); padding: 4px;
}
.modal-body { padding: 20px; }
.modal-body textarea {
    width: 100%; border: 1px solid var(--surface-border);
    border-radius: var(--radius-md); padding: 12px;
    font-size: 14px; resize: vertical; font-family: var(--font-body);
}
.modal-listing-ref {
    font-size: 13px; color: var(--text-muted);
    margin-bottom: 12px; font-style: italic;
}
.modal-footer {
    display: flex; gap: 8px; justify-content: flex-end;
    padding: 16px 20px; border-top: 1px solid var(--surface-border);
}

/* ---------- Dashboard Extended ---------- */
.dash-page-header {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.dash-page-header h1 {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 600;
}
.dash-welcome {
    display: flex; align-items: center;
    justify-content: space-between;
    margin-bottom: 24px; flex-wrap: wrap; gap: 12px;
}
.dash-welcome h1 {
    font-family: var(--font-display);
    font-size: 20px; font-weight: 600;
}
.stat-card {
    display: flex; align-items: center; gap: 14px;
}
.stat-icon {
    width: 44px; height: 44px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
.stat-icon svg { width: 22px; height: 22px; }
.stat-info { display: flex; flex-direction: column; }
.stat-number {
    font-family: var(--font-display);
    font-size: 22px; font-weight: 700;
}
.stat-label { font-size: 12px; color: var(--text-muted); }
.dash-counts {
    display: flex; gap: 8px; margin-bottom: 24px;
}
.dash-count-badge {
    font-size: 13px; color: var(--text-muted);
    background: var(--surface); padding: 4px 12px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
}

.dash-listing-list {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.dash-listing-row {
    display: flex; align-items: center;
    gap: 14px; padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border);
    transition: background 0.15s;
}
.dash-listing-row:last-child { border-bottom: none; }
.dash-listing-row:hover { background: var(--surface-hover); }
.dash-listing-title {
    font-weight: 500; font-size: 14px;
    text-decoration: none; color: var(--text);
    display: block; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis;
}
.dash-listing-title:hover { color: var(--primary); }
.thumb-placeholder {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text-muted);
}
.thumb-placeholder svg { width: 24px; height: 24px; opacity: 0.4; }

/* Status Tabs */
.status-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--surface-border);
    overflow-x: auto; scrollbar-width: none;
    margin-bottom: 20px;
}
.status-tabs::-webkit-scrollbar { display: none; }
.status-tab {
    padding: 10px 18px; font-size: 14px; font-weight: 500;
    color: var(--text-muted); text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px; white-space: nowrap;
    transition: all 0.2s;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.inline-form { display: inline; }
.btn-danger { color: #c62828 !important; }
.btn-danger:hover { background: #fce4ec !important; }

/* ---------- Conversations ---------- */
.conversation-list {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.conversation-row {
    display: flex; align-items: center;
    gap: 14px; padding: 14px 16px;
    border-bottom: 1px solid var(--surface-border);
    text-decoration: none; color: var(--text);
    transition: background 0.15s;
}
.conversation-row:last-child { border-bottom: none; }
.conversation-row:hover { background: var(--surface-hover); }
.conversation-row.unread { background: var(--primary-bg); }
.conv-thumb {
    width: 48px; height: 36px;
    border-radius: var(--radius-sm);
    overflow: hidden; flex-shrink: 0;
    background: var(--surface-hover);
}
.conv-thumb img { width: 100%; height: 100%; object-fit: cover; }
.conv-info { flex: 1; min-width: 0; }
.conv-header-row {
    display: flex; justify-content: space-between; align-items: baseline;
    margin-bottom: 2px;
}
.conv-name { font-size: 14px; }
.conv-time { font-size: 12px; color: var(--text-muted); flex-shrink: 0; }
.conv-listing-title {
    font-size: 13px; color: var(--text-muted);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.unread-badge {
    background: var(--primary); color: white;
    font-size: 11px; font-weight: 700;
    width: 22px; height: 22px;
    border-radius: 50%; display: flex;
    align-items: center; justify-content: center;
    flex-shrink: 0;
}

/* ---------- Listing Form ---------- */
.form-layout {
    display: grid; gap: 24px;
}
@media (min-width: 768px) {
    .form-layout { grid-template-columns: 1fr 320px; align-items: start; }
}
.form-card {
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 20px; margin-bottom: 16px;
}
.form-card-title {
    font-family: var(--font-display);
    font-size: 16px; font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--surface-border);
}
.form-row {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-actions-stack {
    display: flex; flex-direction: column; gap: 8px;
}
.form-help {
    font-size: 12px; color: var(--text-muted); margin-top: 4px;
}
.required { color: #c62828; }

/* File upload */
.file-upload-area {
    border: 2px dashed var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 32px; text-align: center;
    cursor: pointer; transition: all 0.2s;
    background: var(--surface-raised);
}
.file-upload-area:hover,
.file-upload-area.dragover {
    border-color: var(--primary);
    background: var(--primary-bg);
}
.file-upload-area svg {
    width: 36px; height: 36px;
    color: var(--text-muted); margin: 0 auto 8px;
    display: block;
}
.file-upload-area p { font-size: 14px; color: var(--text-muted); margin: 4px 0; }

.existing-images {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 8px; margin-bottom: 16px;
}
.existing-image {
    position: relative; aspect-ratio: 4/3;
    border-radius: var(--radius-sm); overflow: hidden;
}
.existing-image img { width: 100%; height: 100%; object-fit: cover; }
.image-primary-badge {
    position: absolute; bottom: 4px; left: 4px;
    background: var(--primary); color: white;
    font-size: 10px; font-weight: 600;
    padding: 2px 6px; border-radius: var(--radius-sm);
}
.image-remove {
    position: absolute; top: 4px; right: 4px;
    width: 24px; height: 24px;
    background: rgba(0,0,0,0.6); color: white;
    border: none; border-radius: 50%;
    cursor: pointer; font-size: 14px;
    display: flex; align-items: center; justify-content: center;
}
.preview-thumb {
    position: relative; aspect-ratio: 4/3;
    border-radius: var(--radius-sm); overflow: hidden;
}
.preview-thumb img { width: 100%; height: 100%; object-fit: cover; }
.preview-name {
    position: absolute; bottom: 0; left: 0; right: 0;
    background: rgba(0,0,0,0.5); color: white;
    font-size: 10px; padding: 2px 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Settings */
.settings-form .form-card { max-width: 640px; }

/* ---------- Utility ---------- */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mt-2 { margin-top: 16px; }
.btn-full { width: 100%; justify-content: center; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
