/* =============================================================
   HOME CATEGORIES SECTION
   Matches reference: light blue bg, natural banner, left-aligned
   cards with description + Explore link.
   Package: Clena Child Theme
============================================================= */


/* ─────────────────────────────────────────────────────────────
   SECTION WRAPPER
───────────────────────────────────────────────────────────── */
.home-categories {
    padding: 80px 24px 90px;
    background: #ffffff;
    /* light lavender-blue matching reference */
    position: relative;
}


/* ─────────────────────────────────────────────────────────────
   SECTION HEADER
───────────────────────────────────────────────────────────── */
.categories-section-header {
    text-align: center;
    margin-bottom: 36px;
}

.categories-title {
    color: var(--primary);
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.categories-subtitle {
    color: #555d7a;
    font-size: 15px;
    line-height: 1.6;
    max-width: 520px;
    margin: 0 auto;
}


/* ─────────────────────────────────────────────────────────────
   PROMOTIONAL BANNER
   Natural height — no crop, no fixed px — exactly like reference
───────────────────────────────────────────────────────────── */
.categories-banner {
    margin: 0 auto 48px;
    max-width: 800px;
    /* constrained width */
    border-radius: 14px;
    overflow: hidden;

    line-height: 0;
}

.categories-banner__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 2.4 / 1;
    /* fixed reduced height */
    object-fit: cover;
    object-position: center;
    border-radius: 14px;
    transition: transform 0.5s ease;
}

.categories-banner:hover .categories-banner__image {
    transform: scale(1.015);
}


/* ─────────────────────────────────────────────────────────────
   CATEGORY CARDS GRID
   Desktop:  3 columns  (descriptions need width — matches ref)
   Tablet:   2 columns
   Mobile:   1 column
───────────────────────────────────────────────────────────── */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 48px;
    list-style: none;
    padding: 0;
    margin-left: 0;
}

/* Centre the lone last card when it falls on its own row (e.g. 7 items in 3 cols) */
.categories-grid > .category-card:last-child:nth-child(3n - 2) {
    grid-column: 2 / 3;
}


/* ─────────────────────────────────────────────────────────────
   INDIVIDUAL CARD
───────────────────────────────────────────────────────────── */
.category-card {
    display: flex;
}

/* The anchor IS the card surface */
.category-card__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0;
    padding: 0; /* remove padding for full-bleed image */
    background: #ffffff;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    width: 100%;
    position: relative;
    overflow: visible; /* show overflowing icon overlay */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card__inner:hover,
.category-card__inner:focus-visible {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.08);
    outline: none;
}

.category-card__inner:active {
    transform: translateY(-2px);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.05);
}

/* Category Image Wrapper */
.category-card__image-wrapper {
    width: 100%;
    height: 220px;
    overflow: hidden;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
    position: relative;
    background: #f7f9fc;
}

.category-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.category-card__inner:hover .category-card__image {
    transform: scale(1.04);
}

/* Icon Overlay - centered on the image bottom border */
.category-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: var(--primary); /* fallback */
    border: 3px solid #ffffff;
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    position: absolute;
    top: 220px; /* aligns directly on image bottom edge */
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.3s ease;
}

.category-card__inner:hover .category-card__icon {
    transform: translate(-50%, -50%) scale(1.08);
}

.category-card__icon svg {
    width: 32px;
    height: 32px;
    display: block;
    color: #ffffff !important; /* white icons like reference */
    transition: transform 0.3s ease;
}

/* Details area */
.category-card__details {
    padding: 48px 24px 32px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    flex-grow: 1;
}

/* Category Name */
.category-card__name {
    color: var(--primary); /* fallback */
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0 0 10px;
    transition: color 0.3s ease;
}

/* Description Text */
.category-card__desc {
    color: #4a5275;
    font-size: 14px;
    line-height: 1.6;
    margin: 0 0 20px;
    flex-grow: 1;
}

/* Explore Link */
.category-card__cta {
    display: inline-flex;
    align-items: center;
    color: var(--primary); /* fallback */
    font-size: 14px;
    font-weight: 700;
    gap: 6px;
    transition: color 0.3s ease, gap 0.2s ease;
}

.category-card__inner:hover .category-card__cta {
    gap: 10px;
}

/* 1. Home Care (Forest Green matching reference) */
.category-card--home-care .category-card__icon {
    background: #1C5235;
}
.category-card--home-care .category-card__name,
.category-card--home-care .category-card__cta {
    color: #1C5235;
}

/* 2. Car Care (Deep Royal Blue) */
.category-card--car-care .category-card__icon {
    background: #102A43;
}
.category-card--car-care .category-card__name,
.category-card--car-care .category-card__cta {
    color: #102A43;
}

/* 3. Bathroom Care (Ocean Teal) */
.category-card--bathroom-care .category-card__icon {
    background: #007791;
}
.category-card--bathroom-care .category-card__name,
.category-card--bathroom-care .category-card__cta {
    color: #007791;
}

/* 4. Kitchen Care (Ember Orange/Red) */
.category-card--kitchen-care .category-card__icon {
    background: #A61A11;
}
.category-card--kitchen-care .category-card__name,
.category-card--kitchen-care .category-card__cta {
    color: #A61A11;
}

/* 5. Laundry Care (Lilac Blue) */
.category-card--laundry-care .category-card__icon {
    background: #4B30C2;
}
.category-card--laundry-care .category-card__name,
.category-card--laundry-care .category-card__cta {
    color: #4B30C2;
}

/* 6. Bedroom Care (Warm Gold/Amber) */
.category-card--bedroom-care .category-card__icon {
    background: #8F5B00;
}
.category-card--bedroom-care .category-card__name,
.category-card--bedroom-care .category-card__cta {
    color: #8F5B00;
}

/* 7. Special Products (Charcoal Gray) */
.category-card--special-products .category-card__icon {
    background: #334E68;
}
.category-card--special-products .category-card__name,
.category-card--special-products .category-card__cta {
    color: #334E68;
}


/* ─────────────────────────────────────────────────────────────
   VIEW ALL PRODUCTS BUTTON
───────────────────────────────────────────────────────────── */
.categories-cta {
    text-align: center;
}

.categories-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-decoration: none;
    padding: 16px 48px;
    border-radius: 6px;
    cursor: pointer;
    transition:
        background 0.26s ease,
        border-color 0.26s ease,
        box-shadow 0.26s ease,
        transform 0.22s ease;
}

.categories-cta__btn:hover,
.categories-cta__btn:focus-visible {
    background: var(--secondary);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.30);
    transform: translateY(-2px);
    outline: none;
    color: #ffffff;
}

.categories-cta__btn:active {
    transform: translateY(0);
}


/* =============================================================
   RESPONSIVE
============================================================= */

/* ── Large tablet: ≤1024px ── */
@media (max-width: 1024px) {

    .home-categories {
        padding: 64px 20px 72px;
    }

    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

/* ── Tablet: ≤768px → 2 columns ── */
@media (max-width: 768px) {

    .home-categories {
        padding: 52px 16px 60px;
    }

    .categories-section-header {
        margin-bottom: 28px;
    }

    .categories-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
        margin-bottom: 36px;
    }

    /* Reset desktop column centering rules */
    .categories-grid > .category-card:last-child:nth-child(3n - 2) {
        grid-column: auto;
    }

    /* Center lone card on a 2-column layout */
    .categories-grid > .category-card:last-child:nth-child(2n - 1) {
        grid-column: 1 / 3;
    }

    .category-card__inner {
        padding: 22px 20px 20px;
    }

    .category-card__name {
        font-size: 16px;
    }

    .category-card__desc {
        font-size: 12.5px;
    }

    .categories-banner {
        margin-bottom: 36px;
        border-radius: 10px;
    }

    .categories-banner__image {
        border-radius: 10px;
    }

    .categories-cta__btn {
        padding: 14px 36px;
        font-size: 14px;
    }
}

/* ── Mobile: ≤480px → 1 column ── */
@media (max-width: 480px) {

    .home-categories {
        padding: 40px 12px 48px;
    }

    .categories-title {
        font-size: 24px;
    }

    .categories-subtitle {
        font-size: 14px;
    }

    .categories-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 28px;
    }

    /* Reset all centering rules on single column layout */
    .categories-grid > .category-card:last-child:nth-child(3n - 2),
    .categories-grid > .category-card:last-child:nth-child(2n - 1) {
        grid-column: auto;
    }

    .category-card__inner {
        padding: 24px 20px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0;
    }

    .category-card__icon {
        margin-bottom: 16px;
        margin-right: 0;
        align-self: center;
        flex-shrink: 0;
    }

    .category-card__name {
        font-size: 16px;
        margin-bottom: 8px;
        width: 100%;
    }

    .category-card__desc {
        width: 100%;
        margin-top: 0;
        font-size: 13px;
        margin-bottom: 16px;
    }

    .category-card__cta {
        width: auto;
        margin-top: 0;
    }

    .categories-banner {
        border-radius: 8px;
        margin-bottom: 24px;
    }

    .categories-banner__image {
        border-radius: 8px;
        aspect-ratio: 2.2 / 1;
    }

    .categories-cta__btn {
        width: 100%;
        justify-content: center;
        padding: 15px 24px;
    }
}