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

/* ============================================================
   All Categories directory - image-led tiles grouped by department
   ============================================================ */
.cats-page {
    --c-ink: #0F172A;
    --c-accent: #1504B2;
    --c-accent-hover: #086AC9;
    --c-red: #DC2626;
    --c-border: #E2E8F0;
    --c-tint: #F0F9FF;
    --c-muted: #475569;

    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    color: var(--c-ink);
    background: #fff;
    padding: 22px 0 72px;
    min-height: 60vh;
}
.cats-page *, .cats-page *::before, .cats-page *::after { box-sizing: border-box; }

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

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

/* ---------- Head ---------- */
.cats-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--c-border);
}
.cats-head h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.cats-head p { margin: 5px 0 0; font-size: 0.92rem; color: var(--c-muted); }

.cats-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    list-style: none;
    margin: 0;
    padding: 0;
}
.cats-stats li {
    padding: 8px 13px;
    background: var(--c-tint);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-size: 0.78rem;
    color: var(--c-muted);
    white-space: nowrap;
}
.cats-stats strong {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--c-ink);
    font-variant-numeric: tabular-nums;
}

/* ---------- Jump bar ---------- */
.cats-jump {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    padding: 16px 0 4px;
}
.cats-jump-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--c-ink);
    text-decoration: none;
    transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.cats-jump-link iconify-icon { color: var(--c-accent); }
.cats-jump-link:hover {
    background: var(--c-tint);
    border-color: var(--c-accent);
    color: var(--c-accent);
}

/* ---------- Department block ---------- */
.cats-dept { padding-top: 30px; scroll-margin-top: 130px; }

.cats-dept-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding-bottom: 12px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--c-border);
}
.cats-dept-head h2 {
    display: flex;
    align-items: center;
    gap: 11px;
    margin: 0;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--c-ink);
}
.cats-dept-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    flex-shrink: 0;
    background: var(--c-tint);
    border: 1px solid var(--c-border);
    border-radius: 4px;
    color: var(--c-accent);
}
.cats-dept-count {
    padding: 3px 8px;
    background: var(--c-tint);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}
/* Red action, matching the header search button and cart badge */
.cats-dept-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    border: 1px solid var(--c-red);
    border-radius: 4px;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--c-red);
    text-decoration: none;
    transition: background-color 150ms ease, color 150ms ease;
}
.cats-dept-link:hover { background: var(--c-red); color: #fff; }

/* ---------- Tiles ---------- */
/* 8 tiles per row on desktop: at a 1280 container that is ~145px per tile,
   which still fits a square image plus a two-line name. */
.cats-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 10px;
}
.cats-tile {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    overflow: hidden;
    text-decoration: none;
    transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}
.cats-tile:hover {
    border-color: #CBD5E1;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

/* Media: square, product-on-white, contained */
.cats-tile-media {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    padding: 12px;
    background: #fff;
    border-bottom: 1px solid var(--c-border);
}
.cats-tile-media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* "Image unavailable" state: shown only when there is nothing to show */
.cats-tile-noimg {
    position: absolute;
    inset: 0;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px;
    background: var(--c-tint);
    text-align: center;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.35;
    color: var(--c-muted);
}
.cats-tile-noimg iconify-icon { color: #94A3B8; }
.cats-tile-media.is-empty img { display: none; }
.cats-tile-media.is-empty .cats-tile-noimg { display: flex; }

.cats-tile-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 13px 14px;
}
.cats-tile-name {
    font-size: 0.86rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--c-ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cats-tile:hover .cats-tile-name { color: var(--c-accent-hover); }
.cats-tile-count {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--c-muted);
    font-variant-numeric: tabular-nums;
}

/* ---------- Responsive ---------- */
@media (max-width: 1280px) {
    .cats-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .cats-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
    .cats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cats-dept { scroll-margin-top: 96px; }
}

@media (max-width: 700px) {
    .cats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
    .cats-page { padding: 16px 0 56px; }
    .cats-container { padding: 0 14px; }
    .cats-head h1 { font-size: 1.4rem; }
    .cats-dept { padding-top: 24px; }
    .cats-dept-head { margin-bottom: 12px; }
    .cats-tile-media { padding: 8px; }
    .cats-tile-body { padding: 10px 10px 12px; }
    .cats-tile-name { font-size: 0.8rem; }
}

@media (max-width: 420px) {
    .cats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    .cats-page * { transition: none !important; }
    .cats-tile:hover { transform: none; }
}
