﻿    /* ─── Reset / base ─── */
    .catalog-page

{
    background: #F4F1EC;
    font-family: 'Segoe UI', system-ui, sans-serif;
    min-height: 100vh;
}

.catalog-serif {
    font-family: Georgia, 'Times New Roman', serif;
}

/* ─── Title bar ─── */
.cat-title-bar {
    background: #fff;
    border-bottom: 1px solid #E2DDD6;
    padding: 20px 20px 18px;
}

.cat-breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: #7A7268;
    margin-bottom: 8px;
}

    .cat-breadcrumb a {
        color: #7A7268;
        text-decoration: none;
    }

        .cat-breadcrumb a:hover {
            color: #2D5A27;
        }

    .cat-breadcrumb .sep {
        font-size: 7px;
    }

    .cat-breadcrumb .current {
        color: #1E3A1E;
        font-weight: 600;
    }

.cat-title-bar h1 {
    font-family: Georgia, serif;
    font-size: 26px;
    font-weight: 700;
    color: #1A1A1A;
    line-height: 1.2;
    margin: 0 0 4px;
}

.cat-stats {
    font-size: 13px;
    color: #5A5651;
    margin: 0;
}

    .cat-stats strong {
        color: #1E3A1E;
        font-weight: 600;
    }

.short-cat-stats {
    font-size: 13px;
    color: #5A5651;
    margin: 0;
}

    .short-cat-stats strong {
        color: #1E3A1E;
        font-weight: 600;
    }


/* ─── Sticky toolbar ─── */
.cat-toolbar {
    background: #FAFAF7;
    border-bottom: 1px solid #E2DDD6;
    padding: 14px 20px;
    position: sticky;
    top: 0;
    z-index: 30;
}

.cat-search {
    position: relative;
    margin-bottom: 12px;
}

.cat-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9A9388;
    font-size: 13px;
    pointer-events: none;
}

.cat-search input[type="text"] {
    width: 100%;
    background: #fff;
    border: 1px solid #E2DDD6;
    border-radius: 999px;
    padding: 11px 16px 11px 40px;
    font-size: 14px;
    color: #1A1A1A;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

    .cat-search input[type="text"]::placeholder {
        color: #9A9388;
    }

    .cat-search input[type="text"]:focus {
        border-color: #2D5A27;
    }

.cat-toolbar-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-toolbar-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cat-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #E2DDD6;
    border-radius: 999px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    color: #1E3A1E;
    transition: background 0.15s;
}

    .cat-btn:hover {
        background: #F4F1EC;
    }

    .cat-btn .cat-badge-count {
        background: #C9A84C;
        color: #3A2E08;
        font-size: 10px;
        font-weight: 700;
        padding: 1px 5px;
        border-radius: 999px;
    }

.cat-btn-sort {
    color: #5A5651;
}

.cat-view-toggle {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #E2DDD6;
    border-radius: 999px;
    padding: 4px;
    gap: 0;
}

.cat-view-btn {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: none;
    background: transparent;
    color: #7A7268;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

    .cat-view-btn.active {
        background: #1E3A1E;
        color: #fff;
    }

.cat-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

    .cat-chips::-webkit-scrollbar {
        display: none;
    }

.cat-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #F0D9A0;
    color: #5A4615;
    font-size: 12px;
    font-weight: 500;
    padding: 5px 10px;
    border-radius: 999px;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

    .cat-chip i {
        font-size: 9px;
    }

/* ─── Section headings ─── */
.cat-section-heading {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

    .cat-section-heading h2 {
        font-family: Georgia, serif;
        font-size: 16px;
        font-weight: 700;
        color: #1E3A1E;
        margin: 0;
    }

/* ─── Featured strip ─── */
.cat-featured {
    padding: 20px 20px 4px;
}

.cat-featured-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

    .cat-featured-scroll::-webkit-scrollbar {
        display: none;
    }

.cat-feat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 14px;
    flex-shrink: 0;
    width: 280px;
    text-decoration: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

    .cat-feat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
    }

    .cat-feat-card:active {
        transform: scale(0.97);
    }

    .cat-feat-card.primary {
        background: #1E3A1E;
    }

    .cat-feat-card.secondary {
        background: #fff;
        border: 1px solid #E2DDD6;
    }

.cat-feat-thumb {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f3efe8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

    .cat-feat-thumb img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

.cat-feat-name {
    font-family: Georgia, serif;
    font-size: 14px;
    font-weight: 700;
}

.cat-feat-card.primary .cat-feat-name {
    color: #fff;
}

.cat-feat-card.secondary .cat-feat-name {
    color: #1A1A1A;
}

.cat-feat-meta {
    font-size: 11px;
    font-weight: 600;
    margin-top: 1px;
}

.cat-feat-card.primary .cat-feat-meta {
    color: #C9A84C;
}

.cat-feat-card.secondary .cat-feat-meta {
    color: #1E3A1E;
}

/* ─── Main grid ─── */
.cat-main {
    padding: 20px;
}

.cat-count-line {
    font-size: 13px;
    color: #7A7268;
    margin-bottom: 16px;
}

    .cat-count-line strong {
        color: #1A1A1A;
        font-weight: 600;
    }

.cat-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* ─── Family card ─── */
.cat-card {
    background: #fff;
    border: 1px solid #E2DDD6;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    display: block;
    transition: transform 0.15s, box-shadow 0.15s;
}

    .cat-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 20px rgba(0,0,0,0.10);
    }

    .cat-card:active {
        transform: scale(0.97);
    }

.cat-card-img-frame {
    background: radial-gradient(circle at 50% 40%, #ffffff 0%, #f3efe8 100%);
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    position: relative;
    overflow: hidden;
}

    .cat-card-img-frame img {
        max-height: 100%;
        max-width: 100%;
        object-fit: contain;
    }

.cat-card-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
}

    .cat-card-badge.major {
        background: #1E3A1E;
        color: #fff;
        display: none;
    }

    .cat-card-badge.minor {
        background: #C9A84C;
        color: #3A2E08;
        display: none;
    }

.cat-card-body {
    padding: 10px 12px 12px;
    border-top: 1px solid #F0EDE6;
}

    .cat-card-body span {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        font-size: 12px;
        color: #7A7268;
    }

.cat-card-family-name {
    font-family: Georgia, serif;
    font-size: 13px;
    font-weight: 700;
    color: #1A1A1A;
    margin: 0 0 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cat-card-common {
    font-size: 11px;
    color: #7A7268;
    margin: 0 0 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
}

/* ─── Load more ─── */
.cat-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 28px;
}

.cat-load-more {
    background: #fff;
    border: 1px solid #1E3A1E;
    color: #1E3A1E;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 28px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s;
}

    .cat-load-more:hover {
        background: #F4F1EC;
    }

/* ─── Region section ─── */
.cat-region-section {
    padding: 4px 20px 28px;
}

.cat-region-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.cat-region-item {
    text-decoration: none;
    display: block;
}

.cat-region-card {
    background: #fff;
    border-radius: 12px;
    height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.07);
    transition: transform 0.15s, box-shadow 0.15s;
}

    .cat-region-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 8px 18px rgba(0,0,0,0.12);
    }

    .cat-region-card img {
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
    }

.cat-region-label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #5A5651;
    text-align: center;
    font-weight: 500;
}

/* ─── Alert ─── */
.cat-alert {
    margin: 0 20px 16px;
    padding: 10px 14px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    font-size: 13px;
    color: #856404;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cat-alert-close {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    color: #856404;
    padding: 0 4px;
}

/* ─── Tablet optimisations (768–1199px) ─── */
@media (min-width: 768px) and (max-width: 1199px) {
    .cat-title-bar {
        padding: 22px 24px 20px;
    }

        .cat-title-bar h1 {
            font-size: 28px;
        }

    .cat-toolbar {
        padding: 14px 24px;
    }

    .cat-featured {
        padding: 20px 24px 4px;
    }

    .cat-main {
        padding: 20px 24px;
    }

    .cat-region-section {
        padding: 4px 24px 32px;
    }

    .cat-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .cat-card-img-frame {
        height: 130px;
    }

    .cat-card-family-name {
        font-size: 14px;
    }

    .cat-region-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .cat-feat-card {
        width: 230px;
    }
    /* Most Popular Families: wrap to a 2-up grid so all are visible on tablet */
    #popularSection .cat-featured-scroll {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    #popularSection .cat-feat-card {
        width: calc(50% - 6px);
    }

    .cat-stats {
        display: none !important;
    }

    .cat-sidebar-card {
        margin: 10px 700px 24px 24px !important;
    }
}

/* ─── Desktop (1200px+) ─── */
@media (min-width: 1200px) {
    .cat-title-bar {
        padding: 24px 32px 20px;
    }

    .cat-toolbar {
        padding: 16px 32px;
    }

    .cat-featured {
        padding: 24px 32px 8px;
    }

    .cat-main {
        padding: 24px 32px;
    }

    .cat-region-section {
        padding: 8px 32px 40px;
    }

    .cat-grid {
        grid-template-columns: repeat(6, 1fr);
        gap: 20px;
    }

    .cat-card-img-frame {
        height: 140px;
    }

    .cat-region-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .short-cat-stats {
        display: none;
    }
}

/* ─── Mobile (<768px) ─── */
@media (max-width: 767px) {
    .cat-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .cat-card-img-frame {
        height: 100px;
    }

    .cat-region-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .cat-toolbar-row {
        flex-wrap: wrap;
        gap: 8px;
    }

    .cat-stats {
        display: none !important
    }
    /* Most Popular Families: stack the cards full-width so every popular
           family is visible. The fixed 280px horizontal scroller (with the
           scrollbar hidden) showed only one card on phones and read as broken. */
    #popularSection .cat-featured-scroll {
        flex-wrap: wrap;
        overflow-x: visible;
    }

    #popularSection .cat-feat-card {
        width: 100%;
    }
}
