/* ==========================================================================
   Home page category section: themed background, title, subcategory tiles
   Colours come from the theme class (themes.css).
   ========================================================================== */

.category-section {
    background: var(--theme-bg);
}

.category-section__inner {
    padding: var(--space-5) var(--page-gutter) 18px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.category-section__head {
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-section__icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    background: #FFFFFF;
    box-shadow: 0 3px 10px rgba(28, 21, 48, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-section__icon .category-icon {
    width: 34px;
    height: 34px;
}

.category-section__titles {
    flex: 1 1 auto;
    min-width: 0;
}

.category-section__title {
    font-family: var(--font-display);
    font-size: 27px;
    font-weight: 800;
    line-height: 1.05;
    color: var(--theme-title);
}

.category-section__count {
    font-size: 13px;
    font-weight: 500;
    color: var(--theme-subtitle);
}

.category-section__more {
    flex-shrink: 0;
    height: 32px;
    padding: 0 10px 0 12px;
    border-radius: var(--radius-pill);
    background: var(--theme-btn-bg);
    color: var(--theme-btn-text);
    font-size: 13px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.category-section__more .icon {
    width: 14px;
    height: 14px;
    stroke-width: 2.4;
}

.category-section__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--space-3) var(--space-2);
}

/* Subcategory tile */
.category-tile {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: var(--theme-label);
}

.category-tile__media {
    aspect-ratio: 1 / 1;
    border-radius: 16px;
    background: var(--theme-tile);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.category-tile__img {
    width: 82%;
    height: 82%;
    object-fit: contain;
    mix-blend-mode: multiply;
}

.category-tile__name {
    max-width: 100%;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    /* A long word ("Aromatherapy") on a narrow phone: split at a syllable with a hyphen, never wider than the tile */
    overflow-wrap: break-word;
    hyphens: auto;
}

@media (max-width: 340px) {
    .category-tile__name {
        font-size: 11px;
    }
}

.category-tile:hover .category-tile__media {
    transform: translateY(-2px);
}

@media (min-width: 768px) {
    .category-section {
        margin: 0 var(--page-gutter);
        border-radius: var(--radius-xl);
    }

    .category-section__grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .category-tile__name {
        font-size: 13px;
    }
}

@media (min-width: 1024px) {
    .category-section__grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}
