/* =========================================================
   ANWAR & SONS
   MAIN PRODUCTS PAGE — PARENT + CHILD CATEGORY CATALOG
========================================================= */


/* =========================================================
   ROOT WRAPPER
========================================================= */

.anwar-product-catalog {
    width: 100%;
    max-width: 1600px;

    margin: 0 auto;
    padding: 0;

    display: flex;
    flex-direction: column;

    gap: 24px;
}


/* =========================================================
   EMPTY STATES
========================================================= */

.anwar-product-catalog-empty,
.anwar-product-children-empty {
    width: 100%;

    padding: 22px;

    border: 1px solid #dce4ef;
    border-radius: 10px;

    background: #ffffff;

    color: #5d6674;

    font-size: 15px;
    line-height: 1.5;
}


/* =========================================================
   MAIN PARENT FAMILY BOX
========================================================= */

.anwar-product-family {
    position: relative;

    width: 100%;
    min-width: 0;

    display: grid;

    grid-template-columns:
        minmax(320px, 38%)
        minmax(0, 62%);

    overflow: hidden;

    border: 1px solid #dce4ef;
    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 8px 24px rgba(20, 48, 95, 0.06);
}


/* =========================================================
   PARENT CATEGORY
========================================================= */

.anwar-product-parent {
    position: relative;

    min-height: 290px;

    overflow: hidden;

    background:
        linear-gradient(
            135deg,
            #f5f8ff 0%,
            #eef4ff 100%
        );

    isolation: isolate;
}


/* =========================================================
   PARENT IMAGE
========================================================= */

.anwar-product-parent-media {
    position: absolute;

    inset: 0;

    z-index: 0;

    overflow: hidden;
}


.anwar-product-parent-media img {
    width: 100%;
    height: 100%;

    display: block;

    object-fit: cover;
    object-position: center;

    transform: scale(1.01);
}


/* =========================================================
   PARENT PLACEHOLDER
========================================================= */

.anwar-product-parent-media--placeholder {
    display: flex;

    align-items: center;
    justify-content: flex-end;

    padding-right: 34px;
}


.anwar-product-parent-media--placeholder svg {
    width: 150px;
    height: 150px;

    fill: none;

    stroke: rgba(38, 84, 177, 0.16);

    stroke-width: 2;
}


/* =========================================================
   PARENT IMAGE OVERLAY
========================================================= */

.anwar-product-parent-overlay {
    position: absolute;

    inset: 0;

    z-index: 1;

    background:
        linear-gradient(
            90deg,
            rgba(245, 248, 255, 0.98) 0%,
            rgba(245, 248, 255, 0.94) 36%,
            rgba(245, 248, 255, 0.62) 64%,
            rgba(245, 248, 255, 0.16) 100%
        );
}


/* =========================================================
   PARENT CONTENT
========================================================= */

.anwar-product-parent-content {
    position: relative;

    z-index: 2;

    width: min(72%, 430px);

    min-height: 290px;

    padding: 34px 30px;

    display: flex;

    flex-direction: column;

    justify-content: center;

    align-items: flex-start;
}


.anwar-product-parent-kicker {
    margin: 0 0 10px;

    color: #2654b1;

    font-size: 12px;
    font-weight: 700;

    line-height: 1.25;

    letter-spacing: 0.13em;

    text-transform: uppercase;
}


.anwar-product-parent-title {
    margin: 0;

    color: #111111;

    font-size:
        clamp(28px, 2.15vw, 38px);

    font-weight: 700;

    line-height: 1.08;

    letter-spacing: -0.025em;
}


.anwar-product-parent-title::after {
    content: "";

    width: 42px;
    height: 2px;

    margin-top: 16px;

    display: block;

    background: #2654b1;
}


.anwar-product-parent-description {
    max-width: 420px;

    margin: 16px 0 0;

    color: #465267;

    font-size: 15px;

    line-height: 1.55;
}


/* =========================================================
   CHILD CATEGORIES AREA
========================================================= */

.anwar-product-children {
    min-width: 0;

    padding: 18px;

    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 12px;

    align-content: center;

    background: #ffffff;
}


/* =========================================================
   CHILD CATEGORY CARD
========================================================= */

.anwar-child-category {
    position: relative;

    min-width: 0;
    min-height: 122px;

    padding:
        14px 48px 14px 118px;

    display: flex;

    align-items: center;

    overflow: hidden;

    border: 1px solid #dce4ef;

    border-radius: 9px;

    background: #ffffff;

    color: #111111 !important;

    text-decoration: none !important;

    box-shadow:
        0 2px 8px rgba(20, 48, 95, 0.025);

    isolation: isolate;

    transition:
        border-color .3s ease,
        box-shadow .35s ease,
        transform .35s cubic-bezier(.22, 1, .36, 1);
}


/* =========================================================
   CHILD HOVER IMAGE DARKENING LAYER

   No hard solid color.
   Image remains visible behind title.
========================================================= */

.anwar-child-category::after {
    content: "";

    position: absolute;

    inset: 0;

    z-index: 2;

    pointer-events: none;

    background:
        linear-gradient(
            90deg,
            rgba(8, 24, 52, 0.48) 0%,
            rgba(18, 45, 82, 0.38) 50%,
            rgba(38, 84, 177, 0.26) 100%
        );

    opacity: 0;

    transition:
        opacity .32s ease;
}


/* =========================================================
   CHILD CATEGORY MEDIA WRAPPER
========================================================= */

.anwar-child-category-media {
    position: absolute;

    inset: 0;

    z-index: 1;

    overflow: hidden;

    border-radius: inherit;

    pointer-events: none;
}


/* =========================================================
   CHILD CATEGORY IMAGE

   NORMAL:
   Large circular image

   HOVER:
   Expands behind whole card
========================================================= */

.anwar-child-category-media img {
    position: absolute;

    top: 50%;
    left: 14px;

    width: 88px;
    height: 88px;

    display: block;

    padding: 4px;

    object-fit: contain;
    object-position: center;

    border: 1px solid #e1e8f3;

    border-radius: 50%;

    background: #f5f8ff;

    box-shadow:
        0 5px 16px rgba(20, 48, 95, 0.10);

    transform:
        translateY(-50%)
        scale(1);

    transition:
        width .42s cubic-bezier(.22, 1, .36, 1),
        height .42s cubic-bezier(.22, 1, .36, 1),
        top .42s cubic-bezier(.22, 1, .36, 1),
        left .42s cubic-bezier(.22, 1, .36, 1),
        transform .46s cubic-bezier(.22, 1, .36, 1),
        border-radius .35s ease,
        padding .3s ease,
        filter .35s ease,
        opacity .3s ease;
}


/* =========================================================
   CHILD PLACEHOLDER
========================================================= */

.anwar-child-category-placeholder {
    position: absolute;

    top: 50%;
    left: 14px;

    width: 88px;
    height: 88px;

    padding: 23px;

    border: 1px solid #e1e8f3;

    border-radius: 50%;

    background: #f5f8ff;

    fill: none;

    stroke: #2654b1;

    stroke-width: 1.7;

    box-shadow:
        0 5px 16px rgba(20, 48, 95, 0.07);

    transform:
        translateY(-50%)
        scale(1);

    transition:
        opacity .25s ease,
        transform .35s ease;
}


/* =========================================================
   NORMAL CHILD CATEGORY TITLE
========================================================= */

.anwar-child-category-name {
    position: relative;

    z-index: 2;

    min-width: 0;

    color: #111111;

    font-size: 14px;

    font-weight: 600;

    line-height: 1.3;

    opacity: 1;

    transform:
        translateX(0);

    transition:
        opacity .22s ease,
        transform .32s ease;
}


/* =========================================================
   CHILD CATEGORY ARROW
========================================================= */

.anwar-child-category-arrow {
    position: absolute;

    top: 50%;
    right: 14px;

    z-index: 4;

    width: 22px;
    height: 22px;

    display: flex;

    align-items: center;
    justify-content: center;

    color: #2654b1;

    transform:
        translateY(-50%);

    transition:
        color .3s ease,
        transform .35s cubic-bezier(.22, 1, .36, 1);
}


.anwar-child-category-arrow svg {
    width: 18px;
    height: 18px;

    display: block;

    fill: none;

    stroke: currentColor;

    stroke-width: 1.8;

    stroke-linecap: round;
    stroke-linejoin: round;
}


/* =========================================================
   CHILD HOVER TITLE

   Transparent background so actual image
   remains visible behind title.
========================================================= */

.anwar-child-category-hover-title {
    position: absolute;

    inset: 0;

    z-index: 3;

    padding:
        16px 48px 16px 18px;

    display: flex;

    align-items: center;
    justify-content: center;

    text-align: center;

    background: transparent;

    color: #ffffff;

    font-size: 15px;

    font-weight: 700;

    line-height: 1.3;

    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.50),
        0 4px 14px rgba(0, 0, 0, 0.22);

    opacity: 0;

    transform:
        translateY(5px)
        scale(.985);

    pointer-events: none;

    transition:
        opacity .3s ease,
        transform .38s cubic-bezier(.22, 1, .36, 1);
}


/* =========================================================
   CHILD CARD DESKTOP HOVER
========================================================= */

@media (hover: hover) and (pointer: fine) {

    .anwar-child-category:hover {
        border-color:
            rgba(38, 84, 177, 0.22);

        box-shadow:
            0 14px 30px rgba(20, 48, 95, 0.16);

        transform:
            translateY(-2px);
    }


    /* Image becomes complete card background */

    .anwar-child-category:hover
    .anwar-child-category-media img {
        top: 0;
        left: 0;

        width: 100%;
        height: 100%;

        padding: 0;

        border: 0;

        border-radius: 9px;

        object-fit: cover;

        transform:
            translateY(0)
            scale(1.06);

        filter:
            brightness(.88)
            saturate(.92)
            contrast(.96);
    }


    /* Soft transparent overlay */

    .anwar-child-category:hover::after {
        opacity: 1;
    }


    /* Hide original normal title */

    .anwar-child-category:hover
    .anwar-child-category-name {
        opacity: 0;

        transform:
            translateX(7px);
    }


    /* If image doesn't exist,
       gently hide placeholder */

    .anwar-child-category:hover
    .anwar-child-category-placeholder {
        opacity: 0;

        transform:
            translateY(-50%)
            scale(.84);
    }


    /* Show hover title */

    .anwar-child-category:hover
    .anwar-child-category-hover-title {
        opacity: 1;

        transform:
            translateY(0)
            scale(1);
    }


    /* Arrow */

    .anwar-child-category:hover
    .anwar-child-category-arrow {
        color: #ffffff;

        transform:
            translateY(-50%)
            translateX(3px);
    }
}


/* =========================================================
   KEYBOARD ACCESSIBILITY
========================================================= */

.anwar-child-category:focus-visible {
    outline:
        2px solid #2654b1;

    outline-offset: 3px;

    border-color: #2654b1;

    box-shadow:
        0 14px 28px rgba(38, 84, 177, 0.16);
}


.anwar-child-category:focus-visible::after {
    opacity: 1;
}


.anwar-child-category:focus-visible
.anwar-child-category-name {
    opacity: 0;
}


.anwar-child-category:focus-visible
.anwar-child-category-hover-title {
    opacity: 1;

    transform:
        translateY(0)
        scale(1);
}


.anwar-child-category:focus-visible
.anwar-child-category-arrow {
    color: #ffffff;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 1100px) {

    .anwar-product-family {
        grid-template-columns:
            minmax(290px, 40%)
            minmax(0, 60%);
    }


    .anwar-product-children {
        grid-template-columns:
            repeat(2, minmax(0, 1fr));
    }


    .anwar-product-parent,
    .anwar-product-parent-content {
        min-height: 320px;
    }


    .anwar-product-parent-content {
        width:
            min(80%, 390px);

        padding:
            30px 26px;
    }


    .anwar-child-category {
        min-height: 120px;

        padding:
            14px 46px 14px 116px;
    }


    .anwar-child-category-media img {
        width: 86px;
        height: 86px;
    }


    .anwar-child-category-placeholder {
        width: 86px;
        height: 86px;

        padding: 22px;
    }
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 767px) {

    .anwar-product-catalog {
        gap: 18px;
    }


    .anwar-product-family {
        grid-template-columns: 1fr;

        border-radius: 9px;
    }


    /* =========================================
       PARENT
    ========================================= */

    .anwar-product-parent {
        min-height: 220px;
    }


    .anwar-product-parent-content {
        width:
            min(82%, 440px);

        min-height: 220px;

        padding:
            28px 22px;
    }


    .anwar-product-parent-overlay {
        background:
            linear-gradient(
                90deg,
                rgba(245, 248, 255, 0.98) 0%,
                rgba(245, 248, 255, 0.90) 48%,
                rgba(245, 248, 255, 0.28) 100%
            );
    }


    .anwar-product-parent-title {
        font-size:
            clamp(26px, 8vw, 34px);
    }


    .anwar-product-parent-description {
        max-width: 330px;

        font-size: 14px;
    }


    /* =========================================
       CHILDREN
    ========================================= */

    .anwar-product-children {
        padding: 14px;

        grid-template-columns: 1fr;

        gap: 10px;
    }


    .anwar-child-category {
        min-height: 100px;

        padding:
            10px 42px 10px 92px;
    }


    .anwar-child-category-media img {
        left: 10px;

        width: 68px;
        height: 68px;

        padding: 3px;
    }


    .anwar-child-category-placeholder {
        left: 10px;

        width: 68px;
        height: 68px;

        padding: 17px;
    }


    .anwar-child-category-name {
        font-size: 14px;
    }


    .anwar-child-category-hover-title {
        font-size: 14px;
    }
}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 420px) {

    .anwar-product-parent {
        min-height: 205px;
    }


    .anwar-product-parent-content {
        width: 88%;

        min-height: 205px;

        padding:
            24px 18px;
    }


    .anwar-product-parent-kicker {
        font-size: 11px;
    }


    .anwar-product-parent-description {
        line-height: 1.45;
    }


    .anwar-product-children {
        padding: 10px;
    }


    .anwar-child-category {
        min-height: 92px;

        padding:
            9px 40px 9px 84px;
    }


    .anwar-child-category-media img {
        left: 9px;

        width: 62px;
        height: 62px;

        padding: 3px;
    }


    .anwar-child-category-placeholder {
        left: 9px;

        width: 62px;
        height: 62px;

        padding: 15px;
    }
}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .anwar-child-category,
    .anwar-child-category::after,
    .anwar-child-category-media img,
    .anwar-child-category-placeholder,
    .anwar-child-category-name,
    .anwar-child-category-arrow,
    .anwar-child-category-hover-title {
        transition: none !important;
    }
}