/* ============================================================
   CATALOGUE PAGE  —  catalogue.css
   ============================================================ */

/* ── RESET & TOKENS ──────────────────────────────────── */
:root {
    --c-bg:         #f4f6f9;
    --c-surface:    #ffffff;
    --c-border:     #e5e7eb;
    --c-text:       #111827;
    --c-muted:      #6b7280;
    --c-accent:     #2563eb;
    --c-accent-lt:  #eff6ff;
    --c-accent-2:   #16a34a;
    --c-header-h:   64px;
    --c-sidebar-w:  220px;
    --radius-card:  14px;
    --shadow-card:  0 1px 3px rgba(0,0,0,0.07), 0 6px 20px rgba(0,0,0,0.05);
    --shadow-header:0 1px 0 var(--c-border), 0 2px 8px rgba(0,0,0,0.04);
    --transition:   0.18s ease;
}

*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body.page-catalogue {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input  { font-family: inherit; }

/* ── HEADER ───────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--c-header-h);
    background: var(--c-surface);
    box-shadow: var(--shadow-header);
}

.header-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

/* Hamburger – only visible on mobile */
.btn-menu {
    display: none;
    align-items: center;
    justify-content: center;
    width: 38px; height: 38px;
    border-radius: 8px;
    border: 1px solid var(--c-border);
    background: var(--c-surface);
    color: var(--c-text);
    transition: background var(--transition);
}
.btn-menu:hover { background: var(--c-accent-lt); color: var(--c-accent); }

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

.logo-mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 8px;
    background: var(--c-accent);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

/* Search */
.search-form { flex: 1; min-width: 0; }

.search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--c-muted);
    pointer-events: none;
    flex-shrink: 0;
}

.search-input {
    width: 100%;
    padding: 9px 40px 9px 38px;
    border: 1px solid var(--c-border);
    border-radius: 9px;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 0.9rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.search-input::placeholder { color: var(--c-muted); }
.search-input:focus {
    border-color: var(--c-accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
    background: var(--c-surface);
}

.search-clear {
    position: absolute;
    right: 10px;
    font-size: 0.8rem;
    color: var(--c-muted);
    padding: 4px 6px;
    border-radius: 4px;
    transition: background var(--transition), color var(--transition);
}
.search-clear:hover { background: #fee2e2; color: #dc2626; }

.btn-login {
    flex-shrink: 0;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--c-accent);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    transition: background var(--transition);
    white-space: nowrap;
}
.btn-login:hover { background: #1d4ed8; }

/* ── CATALOGUE BODY ───────────────────────────────── */
.catalogue-body {
    max-width: 1400px;
    margin: 0 auto;
    padding: 24px 20px;
    display: grid;
    grid-template-columns: var(--c-sidebar-w) 1fr;
    gap: 24px;
    align-items: start;
}

/* ── DESKTOP SIDEBAR ──────────────────────────────── */
.cat-sidebar {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: 14px;
    padding: 16px;
    position: sticky;
    top: calc(var(--c-header-h) + 16px);
    box-shadow: var(--shadow-card);
}

.sidebar-label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-muted);
    padding: 0 8px;
    margin-bottom: 10px;
}

/* Shared nav styles (sidebar + drawer) */
.cat-nav { display: flex; flex-direction: column; gap: 2px; }

.cat-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: 9px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--c-muted);
    transition: background var(--transition), color var(--transition);
}
.cat-link:hover { background: var(--c-accent-lt); color: var(--c-accent); }
.cat-link.active {
    background: var(--c-accent-lt);
    color: var(--c-accent);
    font-weight: 600;
}

.cat-icon { font-size: 1rem; width: 22px; text-align: center; }

/* ── MAIN ─────────────────────────────────────────── */
.catalogue-main { min-width: 0; }

/* Results bar */
.results-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.results-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    color: var(--c-muted);
}
.results-info strong { color: var(--c-text); }

.results-count {
    display: inline-flex;
    padding: 2px 10px;
    border-radius: 999px;
    background: var(--c-accent-lt);
    color: var(--c-accent);
    font-size: 0.78rem;
    font-weight: 600;
}

.clear-filters {
    font-size: 0.85rem;
    color: var(--c-accent);
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background var(--transition);
}
.clear-filters:hover { background: var(--c-accent-lt); }

/* ── PRODUCT GRID ─────────────────────────────────── */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
}

/* ── PRODUCT CARD ─────────────────────────────────── */
.product-card {
    background: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition);
    outline: none;
}
.product-card:hover,
.product-card:focus-visible {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.1);
    border-color: rgba(37, 99, 235, 0.25);
}

/* Card image placeholder */
.card-image {
    position: relative;
    height: 150px;
    overflow: hidden;
}

.card-img-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
}

/* Category colour themes for placeholders */
.cat-stationery  { background: linear-gradient(135deg, #e0f2fe, #bfdbfe); }
.cat-office      { background: linear-gradient(135deg, #dcfce7, #bbf7d0); }
.cat-print       { background: linear-gradient(135deg, #fef9c3, #fde68a); }
.cat-tech        { background: linear-gradient(135deg, #ede9fe, #ddd6fe); }
.cat-furniture   { background: linear-gradient(135deg, #ffedd5, #fed7aa); }

.img-icon { filter: drop-shadow(0 2px 4px rgba(0,0,0,0.12)); }

/* Badge */
.badge {
    position: absolute;
    top: 10px; left: 10px;
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-green  { background: #dcfce7; color: #15803d; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-purple { background: #ede9fe; color: #7c3aed; }

/* Card body */
.card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.card-category {
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--c-accent);
}

.card-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--c-text);
    line-height: 1.35;
}

.card-desc {
    font-size: 0.82rem;
    color: var(--c-muted);
    line-height: 1.55;
    flex: 1;
}

.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--c-border);
}

.card-price {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-text);
}

.btn-enquire {
    padding: 6px 14px;
    border-radius: 7px;
    border: 1.5px solid var(--c-accent);
    background: transparent;
    color: var(--c-accent);
    font-size: 0.8rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.btn-enquire:hover { background: var(--c-accent); color: #fff; }

/* ── EMPTY STATE ──────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 80px 24px;
}
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; }
.empty-state h2 { font-size: 1.3rem; margin-bottom: 8px; }
.empty-state p  { color: var(--c-muted); margin-bottom: 24px; }
.btn-reset {
    display: inline-block;
    padding: 10px 22px;
    border-radius: 9px;
    background: var(--c-accent);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background var(--transition);
}
.btn-reset:hover { background: #1d4ed8; }

/* ── SITE FOOTER ──────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--c-muted);
    font-size: 0.82rem;
    border-top: 1px solid var(--c-border);
    margin-top: 32px;
}

/* ── MOBILE DRAWER ────────────────────────────────── */
.drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    z-index: 300;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}
.drawer-overlay.visible { 
    opacity: 1; 
    visibility: visible; 
    pointer-events: auto; 
}

.cat-drawer {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 260px;
    background: var(--c-surface);
    z-index: 400;
    transform: translateX(-100%);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 32px rgba(0,0,0,0.12);
    overflow-y: auto;
}
.cat-drawer.open { transform: translateX(0); }

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--c-border);
    position: sticky;
    top: 0;
    background: var(--c-surface);
    z-index: 1;
}
.drawer-title { font-weight: 700; font-size: 1rem; }
.drawer-close {
    width: 32px; height: 32px;
    border-radius: 7px;
    border: 1px solid var(--c-border);
    background: transparent;
    font-size: 0.85rem;
    color: var(--c-muted);
    display: flex; align-items: center; justify-content: center;
    transition: background var(--transition), color var(--transition);
}
.drawer-close:hover { background: #fee2e2; color: #dc2626; }

.cat-drawer .cat-nav { padding: 12px; }

/* ── RESPONSIVE ───────────────────────────────────── */
@media (max-width: 900px) {
    /* Hide desktop sidebar, show hamburger */
    .cat-sidebar { display: none; }
    .btn-menu    { display: flex; }
    .drawer-overlay { display: block; }

    .catalogue-body {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}

@media (max-width: 640px) {
    .header-inner { padding: 0 12px; gap: 10px; }

    .logo-text { display: none; }

    .search-input { font-size: 0.85rem; padding: 8px 36px 8px 34px; }

    .btn-login { padding: 7px 12px; font-size: 0.8rem; }

    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 12px;
    }

    .card-image { height: 120px; }

    .card-body { padding: 12px 12px 14px; }

    .card-title { font-size: 0.88rem; }

    .card-desc { display: none; }      /* hide desc on very small screens for compactness */

    .card-price { font-size: 0.95rem; }

    .btn-enquire { padding: 5px 10px; font-size: 0.75rem; }

    .catalogue-body { padding: 12px; }

    .results-bar { margin-bottom: 14px; }
}

@media (max-width: 380px) {
    .product-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}
