/* ============================================================
   侨聚通 LOSEVI - 主样式表
   Mobile-First B2B Platform
   ============================================================ */

/* ---- CSS Variables ---- */
:root {
    --primary: #D4380D;
    --primary-dark: #AD2E0A;
    --primary-light: #FF6B3D;
    --secondary: #1A1A2E;
    --accent: #E8A317;
    --success: #28A745;
    --warning: #FFC107;
    --danger: #DC3545;
    --info: #17A2B8;

    --bg-body: #F5F5F5;
    --bg-white: #FFFFFF;
    --bg-card: #FFFFFF;
    --bg-dark: #1A1A2E;

    --text-primary: #333333;
    --text-secondary: #666666;
    --text-muted: #999999;
    --text-white: #FFFFFF;

    --border-color: #E0E0E0;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-zh: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

    --header-height: 60px;
    --container-max: 1200px;
}

/* ---- Reset & Base ---- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background-color: var(--bg-body);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--primary-dark);
}

/* ---- Layout ---- */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

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

/* ---- Header ---- */
.site-header {
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    gap: 16px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary);
    white-space: nowrap;
}

.logo img {
    height: 36px;
    width: auto;
}

.logo-sub {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-weight: 400;
    display: block;
}

/* ---- Search Bar ---- */
.search-bar {
    flex: 1;
    max-width: 500px;
    position: relative;
}

.search-bar input {
    width: 100%;
    padding: 8px 40px 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.search-bar input:focus {
    border-color: var(--primary);
}

.search-bar button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

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

/* ---- Navigation ---- */
.nav-links {
    display: flex;
    gap: 4px;
    list-style: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s;
    white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
    background: rgba(212, 56, 13, 0.08);
    color: var(--primary);
}

/* Mobile menu button */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    color: var(--text-primary);
}

/* ---- Category Bar ---- */
.category-bar {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
    display: none;
}

.category-list {
    display: flex;
    gap: 0;
    list-style: none;
    padding: 0;
    white-space: nowrap;
}

.category-list a {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.category-list a:hover,
.category-list a.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.category-list i {
    font-size: 1rem;
}

/* ---- Cards ---- */
.card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.card-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #f0f0f0;
}

.card-body {
    padding: 12px;
}

.card-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    margin-bottom: 6px;
}

.card-merchant {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
}

.card-price {
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-top: 6px;
}

.card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: var(--primary);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

/* ---- Product Grid ---- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

@media (min-width: 576px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* ---- Merchant Card ---- */
.merchant-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.2s;
}

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

.merchant-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    background: #f0f0f0;
    flex-shrink: 0;
}

.merchant-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.merchant-info p {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.verified-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: var(--success);
    font-size: 0.75rem;
}

/* ---- Home Layout (Sidebar + Main) ---- */
.home-layout {
    position: relative;
}

.home-main {
    width: 100%;
}

/* Sidebar: hidden by default (mobile) */
.home-sidebar {
    display: none;
}

/* Mobile: merchants section visible */
.home-merchants-mobile {
    display: block;
}

/* PC: sidebar visible, merchants section hidden */
@media (min-width: 1480px) {
    .home-sidebar {
        display: block;
        position: absolute;
        right: calc(100% + 20px);
        top: 0;
        width: 280px;
    }

    .home-sidebar__inner {
        position: sticky;
        top: calc(var(--header-height) + 20px);
        max-height: calc(100vh - var(--header-height) - 40px);
        overflow-y: auto;
        background: var(--bg-white);
        border-radius: var(--border-radius-lg);
        box-shadow: var(--shadow-sm);
        padding: 0;
    }

    /* Hide scrollbar but keep functionality */
    .home-sidebar__inner::-webkit-scrollbar {
        width: 3px;
    }
    .home-sidebar__inner::-webkit-scrollbar-thumb {
        background: rgba(0,0,0,0.1);
        border-radius: 3px;
    }

    .home-sidebar__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 16px;
        border-bottom: 2px solid var(--primary);
        position: sticky;
        top: 0;
        background: var(--bg-white);
        z-index: 1;
        border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    }

    .home-sidebar__header h3 {
        font-size: 0.95rem;
        font-weight: 700;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 6px;
        margin: 0;
    }

    .home-sidebar__header h3 i {
        color: var(--primary);
    }

    .home-sidebar__header a {
        font-size: 0.75rem;
        color: var(--text-muted);
        text-decoration: none;
    }

    .home-sidebar__header a:hover {
        color: var(--primary);
    }

    .home-sidebar__list {
        padding: 8px;
    }

    .sidebar-merchant-card {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px;
        border-radius: var(--border-radius);
        text-decoration: none;
        color: inherit;
        transition: background 0.15s;
    }

    .sidebar-merchant-card:hover {
        background: rgba(0,0,0,0.03);
    }

    .sidebar-merchant-card img {
        width: 42px;
        height: 42px;
        border-radius: 50%;
        object-fit: cover;
        background: #f0f0f0;
        flex-shrink: 0;
    }

    .sidebar-merchant-info {
        min-width: 0;
        flex: 1;
    }

    .sidebar-merchant-info strong {
        display: block;
        font-size: 0.85rem;
        font-weight: 600;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .sidebar-merchant-info .sidebar-cert-badge {
        display: inline-flex;
        align-items: center;
        gap: 2px;
        font-size: 0.7rem;
        font-weight: 500;
        color: var(--success);
        line-height: 1;
        margin-top: 1px;
        white-space: nowrap;
        overflow: visible;
    }

    .sidebar-merchant-info .sidebar-cert-badge i {
        font-size: 0.72rem;
        color: var(--success);
    }

    .sidebar-merchant-info span {
        display: block;
        font-size: 0.73rem;
        color: var(--text-muted);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .home-sidebar__more {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
        padding: 12px;
        font-size: 0.8rem;
        color: var(--primary);
        text-decoration: none;
        border-top: 1px solid var(--border-color);
        transition: background 0.15s;
    }

    .home-sidebar__more:hover {
        background: rgba(212,56,13,0.04);
    }

    .home-merchants-mobile {
        display: none;
    }
}

/* ---- Banner/Swiper ---- */
.banner-section {
    border-radius: var(--border-radius-lg);
    overflow: hidden;
    margin-bottom: 20px;
}

.banner-section img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
}

/* Banner Grid Layout */
.banner-grid {
    border-radius: var(--border-radius-lg);
}

.banner-grid-slot {
    background: linear-gradient(135deg, #f5f5f5 0%, #ebebeb 100%);
    transition: transform 0.2s, box-shadow 0.2s;
}

.banner-grid-slot a {
    display: block;
    width: 100%;
    height: 100%;
}

.banner-grid-slot:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1;
}

/* Mobile: banner grid keeps same ratio as desktop */
@media (max-width: 768px) {
    .banner-grid .banner-grid-slot {
        border-radius: 2px;
    }
}

/* ---- Section Headers ---- */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary);
}

.section-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

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

.section-more {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}
.btn-primary:hover {
    background: var(--primary-dark);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}
.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.btn-whatsapp {
    background: #25D366;
    color: white;
}
.btn-whatsapp:hover {
    background: #1DA851;
    color: white;
}

.btn-wechat {
    background: #07C160;
    color: white;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 12px 32px;
    font-size: 1rem;
}

.btn-block {
    display: flex;
    width: 100%;
}

/* ---- Contact Buttons ---- */
.contact-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* ---- Footer ---- */
.site-footer {
    background: var(--bg-dark);
    color: var(--text-white);
    padding: 40px 0 20px;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-bottom: 24px;
}

.footer-col h4 {
    font-size: 0.95rem;
    margin-bottom: 12px;
    color: var(--accent);
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 6px;
}

.footer-col a {
    color: rgba(255,255,255,0.7);
    font-size: 0.85rem;
}

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

.footer-bottom {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
}

.footer-disclaimer {
    background: rgba(255,255,255,0.05);
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 16px;
    line-height: 1.5;
}

/* ---- Tags ---- */
.tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 0.75rem;
    border-radius: 4px;
    background: rgba(212, 56, 13, 0.08);
    color: var(--primary);
}

.tag-new {
    background: var(--accent);
    color: white;
}

/* ---- Empty State ---- */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 16px;
    display: block;
}

/* ---- Loading ---- */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: 4px;
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
    :root {
        --header-height: 56px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--bg-white);
        flex-direction: column;
        padding: 16px;
        z-index: 999;
        gap: 4px;
    }

    .nav-links.open {
        display: flex;
    }

    .nav-links a {
        padding: 12px 16px;
        font-size: 1rem;
    }

    .search-bar {
        display: none;
    }

    .search-bar.mobile-open {
        display: block;
        position: absolute;
        top: var(--header-height);
        left: 0;
        right: 0;
        padding: 8px 16px;
        background: var(--bg-white);
        box-shadow: var(--shadow-sm);
        max-width: 100%;
        z-index: 998;
    }

    .logo span:not(.logo-sub) {
        font-size: 1rem;
    }
}

@media (min-width: 769px) {
    .search-bar {
        display: block !important;
    }
}

/* ---- Detail Page ---- */
.detail-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.detail-main-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: #f8f8f8;
    border-radius: var(--border-radius);
}

.detail-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.detail-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 2px solid transparent;
    flex-shrink: 0;
    transition: border-color 0.2s;
}

.detail-thumb.active,
.detail-thumb:hover {
    border-color: var(--primary);
}

.detail-info {
    padding: 20px 0;
}

.detail-title {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 12px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 16px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.detail-specs {
    margin-top: 20px;
}

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

.detail-specs td {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.85rem;
}

.detail-specs td:first-child {
    color: var(--text-muted);
    width: 120px;
}

@media (min-width: 768px) {
    .detail-layout {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 32px;
    }
}

/* ---- Report Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-box {
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-box h3 {
    margin-bottom: 16px;
}

/* ---- Forms ---- */
.form-group {
    margin-bottom: 16px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-primary);
}

.form-control {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(212, 56, 13, 0.1);
}

.form-control.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    font-size: 0.8rem;
    color: var(--danger);
    margin-top: 2px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ═══════════════════════════════════════════════════════
   Merchant Page Tabs & Catalog Display
   ═══════════════════════════════════════════════════════ */
.merchant-tabs {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color, #eee);
    margin-bottom: 20px;
}
.merchant-tab {
    padding: 10px 20px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.merchant-tab:hover { color: var(--primary); }
.merchant-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    font-weight: 600;
}
.tab-count {
    background: var(--bg-light, #f5f5f5);
    color: var(--text-muted);
    font-size: 0.7rem;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 500;
}
.merchant-tab.active .tab-count {
    background: rgba(212, 56, 13, 0.1);
    color: var(--primary);
}

/* Catalog file cards */
.catalog-file-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.catalog-file-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: var(--border-radius-lg, 10px);
    transition: box-shadow 0.2s;
}
.catalog-file-card:hover {
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
}
.catalog-file-cover {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    background: var(--bg-light, #f5f5f5);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.catalog-file-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.catalog-file-info {
    flex: 1;
    min-width: 0;
}
.catalog-file-info h5 {
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.catalog-file-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.tag-pdf { background: rgba(220,53,69,0.1); color: #DC3545; }
.tag-link { background: rgba(21,101,192,0.1); color: #1565C0; }
.tag-excel { background: rgba(40,167,69,0.1); color: #28A745; }
.catalog-file-action {
    flex-shrink: 0;
    padding: 6px 14px;
    border-radius: 6px;
    font-size: 0.8rem;
    text-decoration: none;
    color: var(--primary);
    background: rgba(212, 56, 13, 0.08);
    transition: background 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}
.catalog-file-action:hover {
    background: rgba(212, 56, 13, 0.15);
}

/* Catalog layout (sidebar + main) */
.catalog-layout {
    display: flex;
    gap: 20px;
}
.catalog-sidebar {
    width: 180px;
    flex-shrink: 0;
    position: sticky;
    top: 80px;
    align-self: flex-start;
    background: var(--bg-white, #fff);
    border-radius: var(--border-radius-lg, 10px);
    padding: 12px;
    border: 1px solid var(--border-color, #eee);
}
.catalog-cat-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.catalog-cat-list > li {
    margin-bottom: 8px;
}
.catalog-cat-list > li > strong {
    display: block;
    font-size: 0.85rem;
    padding: 4px 0;
    color: var(--text-primary);
}
.catalog-cat-list ul {
    list-style: none;
    padding-left: 12px;
    margin: 0;
}
.catalog-cat-list ul li a {
    display: block;
    padding: 3px 0;
    font-size: 0.8rem;
    color: var(--text-muted);
    text-decoration: none;
}
.catalog-cat-list ul li a:hover {
    color: var(--primary);
}
.catalog-cat-list ul li a.cat-empty {
    color: #ccc;
    cursor: pointer;
}
.catalog-cat-list ul li a.cat-empty:hover {
    color: #999;
}
/* Catalog toast */
.catalog-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(0,0,0,0.75);
    color: #fff;
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 0.85rem;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s, transform 0.3s;
    z-index: 9999;
    white-space: nowrap;
}
.catalog-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* PDF Viewer */
.pdf-viewer-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    margin-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #eee);
}
.pdf-pages-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px 0;
}
.pdf-page {
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    background: #fff;
    line-height: 0;
}
.pdf-page img {
    display: block;
    max-width: 100%;
    height: auto;
}
@media (max-width: 768px) {
    .pdf-viewer-header {
        flex-wrap: wrap;
        gap: 8px;
    }
    .pdf-viewer-header > span {
        order: -1;
        width: 100%;
        flex: unset;
    }
}
.catalog-main {
    flex: 1;
    min-width: 0;
}
.catalog-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color, #eee);
    margin-bottom: 12px;
}
.catalog-subsection-title {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    padding-left: 4px;
}

/* Catalog item grid */
.catalog-item-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}
.catalog-item-card {
    background: var(--bg-white, #fff);
    border: 1px solid var(--border-color, #eee);
    border-radius: var(--border-radius, 8px);
    overflow: hidden;
    transition: box-shadow 0.2s;
}
.catalog-item-card:hover {
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0,0,0,0.06));
}
.catalog-item-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--bg-light, #f5f5f5);
}
.catalog-item-noimage {
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-light, #f5f5f5);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ddd;
    font-size: 2rem;
}
.catalog-item-info {
    padding: 8px 10px;
}
.catalog-item-info h6 {
    font-size: 0.8rem;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.catalog-item-code {
    font-size: 0.7rem;
    color: var(--text-muted);
}
.catalog-item-specs {
    margin-top: 4px;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}
.catalog-item-specs span {
    font-size: 0.65rem;
    color: var(--text-muted);
    background: var(--bg-light, #f5f5f5);
    padding: 1px 6px;
    border-radius: 3px;
}

/* Mobile */
@media (max-width: 768px) {
    .catalog-file-grid {
        grid-template-columns: 1fr;
    }
    .catalog-layout {
        flex-direction: column;
    }
    .catalog-sidebar {
        width: 100%;
        position: static;
    }
    .catalog-cat-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px 12px;
    }
    .catalog-cat-list > li {
        margin-bottom: 0;
    }
    .catalog-item-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .merchant-tab {
        padding: 8px 14px;
        font-size: 0.85rem;
    }
}
