/* ==========================================================================
   Shop By Category
   Grid: 4-up desktop / 3-up tablet / 2-up mobile
   Category tiles: image on top, label + arrow below, red accent on hover/focus
   ========================================================================== */

/* Hero */

.category-hero {
    width: 100%;
    padding-bottom: 48px;
}

.category-hero__inner {
    display: flex;
    align-items: stretch;
    background: #3a3a3a;
    overflow: hidden;
    min-height: 121px;
}

.category-hero__text {
    flex: 1 1 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px clamp(20px, 4vw, 48px);
}

    .category-hero__text h1 {
        margin: 0;
        color: #ffffff;
        letter-spacing: 0.01em;
        font-family: Helvetica;
        font-size: 36px;
        font-weight: 700;
        line-height: 120%;
    }

    .category-hero__text p {
        margin: 8px 0 0;
        color: #d9d9d9;
        font-family: Helvetica;
        font-size: 17px;
        line-height: 130%;
    }

.category-hero__image {
    flex: 1 1;
    min-height: 160px;
}

    .category-hero__image img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
    }

/* Category grid */

.category-grid {
    box-sizing: border-box;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr)); /* desktop: 4 per row */
    gap: 24px 20px;
    list-style: none;
    margin: 0;
    padding: 0 0 64px;
    width: 100%;
}

.category-card {
    min-width: 0;
    display: flex;
}

.category-card__link {
    display: flex;
    flex-direction: column;
    width: 100%;
    text-decoration: none;
    color: inherit;
    background: #f7f7f7;
    border-radius: 5px;
    overflow: hidden;
    box-sizing: border-box;
    transition: box-shadow 180ms ease;
}

/* Figma card: 265 x 266 -> image 265 x 208 on top, 58px label strip below */
.category-card__frame {
    display: block;
    width: 100%;
    flex: 0 0 auto;
    aspect-ratio: 265 / 208;
    background: #f7f7f7;
    overflow: hidden;
}

.category-card__img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    transition: transform 240ms ease;
}

.category-card__label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    flex: 1 1 auto;
    min-height: 58px;
    padding: 10px 12px;
    box-sizing: border-box;
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
    overflow-wrap: anywhere;
    color: #262626;
    transition: color 180ms ease;
}

/* Long names: step the font down so up to ~65 characters fit in 3 lines */
.category-card__label--medium {
    font-size: 18px;
}

.category-card__label--long {
    font-size: 16px;
    line-height: 1.25;
}

.category-card__arrow {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
    transition: transform 180ms ease;
}

.category-card__link:hover,
.category-card__link:focus-visible {
    box-shadow: 0 0 0 1px #d81f26;
}

.category-card__link:hover .category-card__img,
.category-card__link:focus-visible .category-card__img {
    transform: scale(1.04);
}

.category-card__link:hover .category-card__label,
.category-card__link:focus-visible .category-card__label {
    color: #d81f26;
}

.category-card__link:hover .category-card__arrow,
.category-card__link:focus-visible .category-card__arrow {
    transform: translateX(3px);
}

.category-card__link:focus-visible {
    outline: none;
}

    .category-card__link:focus-visible {
        outline: 2px solid #d81f26;
        outline-offset: 2px;
    }

@media (prefers-reduced-motion: reduce) {
    .category-card__link,
    .category-card__img,
    .category-card__arrow {
        transition: none;
    }
}

/* Responsive: 4 desktop / 3 tablet / 2 mobile */

@media (max-width: 1023px) {
    .category-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .category-card__label {
        font-size: 18px;
    }

    .category-card__label--medium {
        font-size: 16px;
    }

    .category-card__label--long {
        font-size: 15px;
    }
}

@media (max-width: 599px) {
    .category-hero {
        padding-bottom: 32px;
    }

    .category-hero__text {
        padding: 24px 20px;
    }

    .category-hero__text h1 {
        font-size: 19px;
    }

    .category-hero__text p {
        font-size: 12px;
    }

    .category-hero__image {
        min-height: 120px;
    }

    .category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 12px;
    }

    .category-card__label {
        min-height: 44px;
        gap: 6px;
        padding: 8px;
        font-size: 14px;
    }

    .category-card__label--medium {
        font-size: 13px;
    }

    .category-card__label--long {
        font-size: 12px;
    }

    .category-card__arrow {
        width: 11px;
        height: 11px;
    }
}

/* SEO / FAQ content */
.category-faq {
    margin: 48px 0 32px;
    line-height: 1.6;
}

    .category-faq h2 {
        margin-bottom: 12px;
    }

    .category-faq h3 {
        margin: 28px 0 8px;
        font-size: 18px;
    }

    .category-faq ul {
        margin: 8px 0 12px 20px;
        list-style: disc;
    }

    .category-faq p {
        margin-bottom: 12px;
    }
