@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Catalog listing (category + brand) - high-density enterprise
   ============================================================ */
.catalog {
    --c-primary: #0F172A;
    --c-secondary: #1E293B;
    --c-accent: #1A0ACB;
    --c-accent-dark: #150891;
    --c-danger: #DC2626;
    --c-bg: #FFFFFF;
    --c-surface: #F1F5F9;
    --c-border: #E2E8F0;
    --c-muted: #475569;

    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    color: var(--c-primary);
    background: #FAFAFC;
    padding: 24px 0 80px;
    min-height: 60vh;
}
.catalog *, .catalog *::before, .catalog *::after { box-sizing: border-box; }

.catalog .ct-container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 24px; }

/* Breadcrumbs */
.catalog .ct-crumbs ol {
    display: flex; flex-wrap: wrap; align-items: center; list-style: none; padding: 0; margin: 0 0 14px;
    font-size: 0.82rem; color: var(--c-muted);
}
.catalog .ct-crumbs li:not(:last-child)::after { content: "/"; margin: 0 8px; color: var(--c-border); }
.catalog .ct-crumbs a { color: var(--c-muted); text-decoration: none; }
.catalog .ct-crumbs a:hover { color: var(--c-accent); }
.catalog .ct-crumbs li[aria-current] { color: var(--c-primary); font-weight: 600; }

/* Head */
.catalog .ct-head { margin-bottom: 0; }
.catalog .ct-head h1 { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; }
.catalog .ct-head p { color: var(--c-muted); font-size: 0.9rem; margin-top: 4px; }

/* Full-width banner image below the page title */
.catalog .ct-head-banner {
    width: 100%;
    aspect-ratio: 16 / 4;
    max-height: 220px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--c-surface);
    margin: 16px 0 18px;
}
.catalog .ct-head-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Layout */
.catalog .ct-layout {
    display: grid;
    grid-template-columns: 258px 1fr;
    gap: 20px;
    align-items: start;
}
.catalog .ct-scrim { display: none; }

/* Filters sidebar */
.catalog .ct-filters {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    position: sticky;
    top: 88px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.catalog .ct-filters-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--c-border);
}
.catalog .ct-filters-head h2 { font-size: 1rem; font-weight: 700; }
.catalog .ct-clear { font-size: 0.8rem; color: var(--c-danger); text-decoration: none; font-weight: 700; }
.catalog .ct-clear:hover { text-decoration: underline; }
.catalog .ct-filters-close { display: none; background: none; border: none; color: var(--c-muted); cursor: pointer; }

.catalog .ct-filters-scroll { padding: 4px 16px; }

.catalog .ct-fgroup { padding: 16px 0; border-bottom: 1px solid var(--c-border); }
.catalog .ct-fgroup:last-child { border-bottom: none; }
.catalog .ct-fgroup h3 {
    font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
    color: var(--c-secondary); margin-bottom: 12px;
}
.catalog .ct-check {
    display: flex; align-items: center; gap: 10px; padding: 5px 0; cursor: pointer;
    font-size: 0.88rem; color: var(--c-secondary);
}
.catalog .ct-check input { width: 16px; height: 16px; accent-color: var(--c-accent); cursor: pointer; flex-shrink: 0; }
.catalog .ct-check-label { flex: 1; }
.catalog .ct-count { font-size: 0.76rem; color: var(--c-muted); background: var(--c-surface); border-radius: 4px; padding: 1px 7px; }

/* Price range slider (dual thumb) */
.catalog .ct-price-slider { padding-top: 4px; }
.catalog .ct-price-track {
    position: relative;
    height: 4px;
    background: var(--c-border);
    border-radius: 2px;
    margin: 10px 2px 20px;
}
.catalog .ct-price-track-fill {
    position: absolute;
    top: 0; bottom: 0;
    background: var(--c-accent);
    border-radius: 2px;
}
.catalog .ct-price-range {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    margin: 0;
    height: 4px;
    background: transparent;
    pointer-events: none;
    -webkit-appearance: none;
    appearance: none;
    transform: translateY(-50%);
}
.catalog .ct-price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    pointer-events: auto;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--c-accent);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}
.catalog .ct-price-range::-moz-range-thumb {
    pointer-events: auto;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid var(--c-accent);
    cursor: pointer;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .25);
}
.catalog .ct-price-range::-webkit-slider-runnable-track { background: transparent; }
.catalog .ct-price-range::-moz-range-track { background: transparent; }

.catalog .ct-price-row { display: flex; align-items: center; gap: 8px; }
.catalog .ct-price-field { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.catalog .ct-price-field span { font-size: 0.72rem; color: var(--c-muted); font-weight: 600; }
.catalog .ct-price-input {
    width: 100%; min-width: 0; padding: 9px 10px;
    font-family: inherit; font-size: 0.88rem;
    font-variant-numeric: tabular-nums;
    border: 1px solid var(--c-border); border-radius: 4px;
}
.catalog .ct-price-input:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(0,112,192,.15); }
.catalog .ct-price-sep { color: var(--c-muted); margin-top: 18px; }

.catalog .ct-filters-foot {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 16px 16px;
}
.catalog .ct-apply,
.catalog .ct-clear-all {
    flex: 1 1 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 42px;
    padding: 0 12px;
    font-family: inherit; font-size: 0.86rem; font-weight: 700;
    border-radius: 4px; cursor: pointer;
    text-decoration: none; text-align: center;
    white-space: nowrap;
    transition: background-color 150ms ease, color 150ms ease;
}
.catalog .ct-apply {
    color: #fff; background: var(--c-accent);
    border: none;
}
.catalog .ct-apply:hover { background: var(--c-accent-dark); }
.catalog .ct-clear-all {
    color: var(--c-danger); background: #fff;
    border: 1px solid var(--c-danger);
}
.catalog .ct-clear-all:hover { background: var(--c-danger); color: #fff; }

/* Toolbar */
.catalog .ct-toolbar {
    display: flex; align-items: center; gap: 12px;
    padding: 10px 14px;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    margin-bottom: 18px;
}
.catalog .ct-filter-btn {
    display: none;
    align-items: center; gap: 7px;
    padding: 8px 14px;
    background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
    font-family: inherit; font-size: 0.85rem; font-weight: 700; color: var(--c-primary);
    cursor: pointer;
}
.catalog .ct-filter-btn iconify-icon { color: var(--c-accent); }
.catalog .ct-result { font-size: 0.88rem; color: var(--c-secondary); font-weight: 600; margin-right: auto; white-space: nowrap; }

.catalog .ct-show { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.catalog .ct-show label { font-size: 0.85rem; color: var(--c-muted); font-weight: 600; white-space: nowrap; }
.catalog .ct-show-select { width: auto; min-width: 130px; padding: 7px 10px; font-size: 0.85rem; }

/* Sidebar sort select */
.catalog .ct-select {
    width: 100%;
    padding: 9px 12px;
    font-family: inherit;
    font-size: 0.88rem;
    color: var(--c-primary);
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    cursor: pointer;
}
.catalog .ct-select:focus { outline: none; border-color: var(--c-accent); box-shadow: 0 0 0 3px rgba(0,112,192,.15); }

/* Grid / list view toggle */
.catalog .ct-view { display: inline-flex; border: 1px solid var(--c-border); border-radius: 4px; overflow: hidden; }
.catalog .ct-view-btn {
    width: 36px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #fff; border: none; color: var(--c-muted); cursor: pointer;
    transition: background-color 150ms ease, color 150ms ease;
}
.catalog .ct-view-btn + .ct-view-btn { border-left: 1px solid var(--c-border); }
.catalog .ct-view-btn.is-active { background: var(--c-accent); color: #fff; }

/* List layout */
.catalog .product-list { display: flex; flex-direction: column; gap: 12px; }
.catalog .product-list .product-card { flex-direction: row; align-items: stretch; }
.catalog .product-list .pc-link { flex-direction: row; flex: 1; min-width: 0; }
.catalog .product-list .pc-media {
    width: 150px; flex-shrink: 0; aspect-ratio: 1 / 1;
    border-bottom: none; border-right: 1px solid #F1F5F9;
}
.catalog .product-list .pc-body { flex: 1; justify-content: center; }
.catalog .product-list .pc-cta { display: none; }
.catalog .product-list .pc-actions {
    width: 210px; flex-shrink: 0;
    display: flex; align-items: center;
    padding: 14px; border-left: 1px solid var(--c-border);
}
.catalog .product-list .pc-buy { width: 100%; }

/* Product grid - 4 per row */
.catalog .product-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}
@media (max-width: 1100px) { .catalog .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px)  { .catalog .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }

/* Pagination */
.catalog .ct-pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px; margin-top: 28px; }
.catalog .ct-page {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 38px; height: 38px; padding: 0 10px;
    border: 1px solid var(--c-border); border-radius: 4px;
    background: #fff; color: var(--c-primary); text-decoration: none;
    font-size: 0.9rem; font-weight: 600; font-variant-numeric: tabular-nums;
    transition: border-color 150ms ease, color 150ms ease, background-color 150ms ease;
}
.catalog .ct-page:hover { border-color: var(--c-accent); color: var(--c-accent); }
.catalog .ct-page.is-active { background: var(--c-accent); border-color: var(--c-accent); color: #fff; }
.catalog .ct-page-nav { color: var(--c-muted); }
.catalog .ct-page-gap {
    border-color: transparent; background: none; color: var(--c-muted);
    min-width: 22px; padding: 0; cursor: default; letter-spacing: 1px;
}
.catalog .ct-page-gap:hover { border-color: transparent; color: var(--c-muted); }

/* Empty */
.catalog .ct-empty {
    text-align: center; padding: 64px 24px;
    background: #fff; border: 1px solid var(--c-border); border-radius: 4px;
    color: var(--c-muted);
}
.catalog .ct-empty iconify-icon { color: #CBD5E1; margin-bottom: 12px; }
.catalog .ct-empty h2 { font-size: 1.1rem; color: var(--c-primary); margin-bottom: 12px; }
.catalog .ct-reset { color: var(--c-accent); font-weight: 600; text-decoration: none; }
.catalog .ct-reset:hover { text-decoration: underline; }

/* ---------- Skeleton loading ---------- */
.catalog .ct-skel {
    position: relative;
    overflow: hidden;
    background: #E9EEF3;
    border-radius: 4px;
}
.catalog .ct-skel::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .65), transparent);
    animation: ct-shimmer 1.2s infinite;
}
@keyframes ct-shimmer { 100% { transform: translateX(100%); } }

.catalog .ct-skel-panel {
    display: block;
    padding: 20px 16px;
}
.catalog .ct-skel-line { height: 14px; margin-bottom: 14px; width: 100%; }
.catalog .ct-skel-toolbar { height: 44px; margin-bottom: 18px; }
.catalog .ct-skel-card {
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    padding: 12px;
}
.catalog .ct-skel-card .ct-skel-img { aspect-ratio: 1 / 1; margin-bottom: 12px; }
.catalog .ct-skel-card .ct-skel-line { height: 12px; margin-bottom: 10px; }

.catalog .ct-load-error { padding: 48px 16px; text-align: center; color: var(--c-muted); }
.catalog .ct-load-error a { color: var(--c-accent); font-weight: 600; }

/* ---------- Mobile: filters become an off-canvas drawer ---------- */
@media (max-width: 860px) {
    .catalog { padding-top: 16px; }
    .catalog .ct-layout { grid-template-columns: 1fr; }
    .catalog .ct-filter-btn { display: inline-flex; }
    .catalog .ct-head-banner { aspect-ratio: 16 / 6; margin: 12px 0 16px; }

    .catalog .ct-scrim {
        display: block;
        position: fixed; inset: 0;
        background: rgba(15, 23, 42, .5);
        z-index: 190;
    }

    .catalog .ct-filters {
        position: fixed;
        top: 0; left: 0; bottom: 0;
        width: 86%; max-width: 340px;
        border-radius: 0;
        border: none;
        z-index: 200;
        transform: translateX(-100%);
        transition: transform 240ms ease;
    }
    .catalog .ct-filters.is-open { transform: translateX(0); }
    .catalog .ct-filters-close { display: inline-flex; }
    .catalog .ct-filters-scroll { flex: 1; overflow-y: auto; }
    .catalog .ct-filters-foot { margin: 12px 16px calc(16px + env(safe-area-inset-bottom)); }
    .catalog .ct-toolbar { flex-wrap: wrap; }
    .catalog .ct-show { order: 3; margin-left: auto; }
}

@media (max-width: 600px) {
    /* Edge-to-edge on mobile: no left/right gap */
    .catalog .ct-container { padding: 0; }
    .catalog .ct-crumbs,
    .catalog .ct-head { padding-left: 12px; padding-right: 12px; }
    .catalog .ct-head-banner { width: calc(100% - 24px); margin: 12px 12px 16px; aspect-ratio: 16 / 8; }
    .catalog .ct-toolbar {
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
    .catalog .ct-result { margin-right: 0; width: 100%; order: 1; }
    .catalog .ct-show { order: 2; }
    .catalog .ct-pagination { padding: 0 12px; }
    .catalog .product-grid { gap: 10px; }
    .catalog .ct-head { padding-top: 4px; }
    .catalog .ct-head h1 { font-size: 1.3rem; }
    .catalog .ct-head p { font-size: 0.85rem; }

    /* List view on mobile: image + info row, actions full-width below */
    .catalog .product-list { gap: 10px; }
    .catalog .product-list .product-card { flex-wrap: wrap; }
    .catalog .product-list .pc-link { flex-basis: 100%; }
    .catalog .product-list .pc-media { width: 110px; }
    .catalog .product-list .pc-actions {
        width: 100%;
        border-left: none;
        border-top: 1px solid var(--c-border);
    }
}

@media (max-width: 420px) {
    .catalog .ct-sort-label { display: none; }
}
