:root {
    /* APG brand palette (sourced from apackaginggroup.com/cdn/shop/t/71/assets/style.css) */
    --brand:        #007bff;   /* primary blue */
    --brand-hover:  #0062cc;   /* darker hover state */
    --brand-dark:   #074871;   /* navy / secondary */
    --brand-tint:   #e7f1ff;   /* pale blue backdrop */

    --bg: #f4f7fb;
    --card-bg: #ffffff;
    --fg: #1a2a3a;
    --muted: #6b7a8a;
    --border: #dfe6ee;
    --accent: var(--brand);
    --pill-bg: #ffffff;
    --pill-border: #c7d5e4;
    --shadow: 0 1px 2px rgba(7,72,113,0.05), 0 4px 12px rgba(7,72,113,0.06);
    --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--fg);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

/* =====================  HERO  ===================== */
.hero {
    position: relative;
    padding: 20px 24px 0;
    max-width: 1400px;
    margin: 0 auto;
}

.hero__grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    border-radius: 18px;
    overflow: hidden;
    height: 320px;
}

.hero__panel {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero__card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    padding: 28px 48px;
    border-radius: 6px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    text-align: left;
    z-index: 2;
}

.hero__card h1 {
    margin: 0;
    font-family: "Arial Black", "Helvetica Neue", Arial, sans-serif;
    font-size: 44px;
    font-weight: 900;
    line-height: 0.98;
    letter-spacing: -1px;
    color: var(--brand-dark);
}

.hero__card-sub {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    font-size: 12px;
    letter-spacing: 2px;
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.15s;
}
.hero__card-sub:hover { color: var(--brand-hover); }
.hero__card-sub-icon { flex-shrink: 0; }

/* =====================  LAYOUT  ===================== */
.layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 24px;
    max-width: 1400px;
    margin: 28px auto 0;
    padding: 0 24px 48px;
}

/* =====================  SIDEBAR  ===================== */
.sidebar__title {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 16px;
    color: var(--brand-dark);
}

.cats {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cat {
    font-family: inherit;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 12px 16px;
    background: var(--pill-bg);
    border: 1px solid var(--pill-border);
    border-radius: 999px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    color: var(--brand-dark);
}
.cat:hover {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}
.cat.is-active {
    background: var(--brand);
    color: #fff;
    border-color: var(--brand);
}

/* =====================  TOOLBAR + SEARCH  ===================== */
.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar__left {
    display: flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}

.content__heading {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--brand-dark);
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.toolbar__count {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.search {
    position: relative;
    width: 320px;
    max-width: 100%;
}
.search__icon {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: var(--brand);
    pointer-events: none;
}
.search input {
    width: 100%;
    padding: 12px 16px 12px 40px;
    border: 1px solid var(--pill-border);
    border-radius: 999px;
    background: #fff;
    font-family: inherit;
    font-size: 12px;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: var(--fg);
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.search input::placeholder {
    color: var(--muted);
    letter-spacing: 1.5px;
}
.search input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* =====================  PRODUCT GRID  ===================== */
.grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 12px 14px;
    display: flex;
    flex-direction: column;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}
.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    border-color: var(--brand);
}

.card__img {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}
.card__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.card__title {
    font-size: 12px;
    line-height: 1.35;
    color: var(--brand-dark);
    font-weight: 500;
    text-align: center;
    margin-bottom: 4px;
    min-height: 2.7em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card__sku {
    font-size: 10px;
    color: var(--muted);
    text-align: center;
    letter-spacing: 0.5px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
}

.card.is-hidden { display: none; }

.empty {
    padding: 48px 0;
    text-align: center;
    color: var(--muted);
}

/* =====================  PAGINATION  ===================== */
.pager {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 32px 0 8px;
    font-size: 12px;
}

.pager__info {
    color: var(--muted);
    letter-spacing: 0.3px;
}

.pager__controls {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.pager__step, .pager__num {
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 14px;
    min-width: 38px;
    border: 1px solid var(--pill-border);
    border-radius: 8px;
    background: #fff;
    color: var(--brand-dark);
    cursor: pointer;
    transition: all 0.15s ease;
}
.pager__step:hover:not(:disabled),
.pager__num:hover:not(.is-active) {
    background: var(--brand-tint);
    border-color: var(--brand);
    color: var(--brand);
}
.pager__step:disabled {
    opacity: 0.4;
    cursor: default;
}
.pager__num.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    cursor: default;
}

.pager__gap {
    padding: 8px 6px;
    color: var(--muted);
}

/* =====================  FOOTER  ===================== */
.footer {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 12px;
    border-top: 1px solid var(--border);
    background: #fff;
}
.footer a { color: var(--brand); font-weight: 600; }
.footer a:hover { color: var(--brand-hover); }

/* =====================  RESPONSIVE  ===================== */

/* Large tablet / small desktop — drop to 4 columns */
@media (max-width: 1200px) {
    .grid { grid-template-columns: repeat(4, 1fr); }
}

/* Tablet — sidebar turns into a horizontal pill bar above the grid,
   hero panels go 2x2 */
@media (max-width: 960px) {
    .hero { padding: 16px 20px 0; }
    .hero__grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: 1fr 1fr;
        height: 360px;
    }
    .hero__card { padding: 22px 36px; }
    .hero__card h1 { font-size: 36px; }

    .layout {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 20px;
        padding: 0 20px 40px;
    }
    .sidebar { position: sticky; top: 0; background: var(--bg); z-index: 3; padding-top: 8px; }
    .sidebar__title {
        font-size: 18px;
        margin: 0 0 10px;
    }
    .cats {
        flex-direction: row;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        gap: 8px;
        padding-bottom: 6px;
        margin: 0 -20px;
        padding-left: 20px;
        padding-right: 20px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }
    .cats::-webkit-scrollbar { height: 4px; }
    .cats::-webkit-scrollbar-thumb { background: var(--pill-border); border-radius: 2px; }
    .cat {
        white-space: nowrap;
        flex-shrink: 0;
        padding: 10px 14px;
    }

    .grid { grid-template-columns: repeat(3, 1fr); gap: 12px; }
}

/* Mobile (large phones / small tablets) */
@media (max-width: 640px) {
    .hero { padding: 12px 12px 0; }
    .hero__grid { height: 260px; gap: 6px; border-radius: 14px; }
    .hero__card {
        padding: 16px 22px;
        max-width: calc(100% - 32px);
    }
    .hero__card h1 {
        font-size: 26px;
        letter-spacing: -0.5px;
    }
    .hero__card-sub { font-size: 11px; letter-spacing: 1.5px; }

    .layout {
        padding: 0 14px 32px;
        gap: 12px;
        margin-top: 16px;
    }
    .cats { margin: 0 -14px; padding-left: 14px; padding-right: 14px; }

    .content__heading { font-size: 22px; }

    .toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 14px;
    }
    .toolbar__left { flex-wrap: wrap; }
    .search { width: 100%; }

    .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

    .card { padding: 10px 8px; }
    .card__title { font-size: 11px; min-height: 2.6em; }
    .card__sku { font-size: 9px; }

    .footer { padding: 18px; font-size: 11px; }
}

/* Small phones */
@media (max-width: 380px) {
    .hero__grid { height: 220px; }
    .hero__card { padding: 12px 18px; }
    .hero__card h1 { font-size: 22px; }
}
