/* =========================================================
   PRODUCT CATEGORY ACCORDION
   ========================================================= */


/* ---------------------------------------------------------
   Accordion Wrapper
   --------------------------------------------------------- */

.product-category-accordion {
    display: flex;
    flex-direction: column;
    gap: 5px;
}


/* ---------------------------------------------------------
   Accordion Row
   Each row contains 4 category cards
   --------------------------------------------------------- */

.product-category-row {
    display: flex;
    width: 100%;
    gap: 5px;
}


/* ---------------------------------------------------------
   Category Card
   --------------------------------------------------------- */

.product-category-card {
    position: relative;
    display: block;

    flex: 1 1 0;
    min-width: 0;
    height: 550px;

    overflow: hidden;
    border-radius: 12px;

    text-decoration: none;

    transition: flex 0.5s ease;
}


/* ---------------------------------------------------------
   Accordion Hover
   Only affects cards within the hovered row
   --------------------------------------------------------- */

.product-category-row:hover .product-category-card {
    flex: 0.7 1 0;
}

.product-category-row .product-category-card:hover {
    flex: 1.9 1 0;
}


/* ---------------------------------------------------------
   Category Image
   --------------------------------------------------------- */

.product-category-card__image {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100% !important;

    object-fit: cover;
    object-position: center;

    transition: transform 0.5s ease;
}

.product-category-card:hover .product-category-card__image {
    transform: scale(1.03);
}


/* ---------------------------------------------------------
   Image Overlay
   --------------------------------------------------------- */

.product-category-card__overlay {
    position: absolute;
    inset: 0;

    background: linear-gradient(
        to bottom,
        rgba(0, 0, 0, 0) 50%,
        rgba(0, 0, 0, 0.55) 100%
    );

    z-index: 1;
    pointer-events: none;
}


/* ---------------------------------------------------------
   Card Content
   --------------------------------------------------------- */

.product-category-card__content {
    position: absolute;

    left: 20px;
    right: 20px;
    bottom: 20px;

    z-index: 2;
    pointer-events: none;
}


/* ---------------------------------------------------------
   Category Title
   --------------------------------------------------------- */

.product-category-card__title {
    margin: 0;

    color: #fff;
    font-size: 20px;
    line-height: 1.3;
    font-weight: 700;
}


/* ---------------------------------------------------------
   Desktop Read More
   Kept separate from the row flex rules so the existing
   row-specific accordion resizing remains unchanged.
   --------------------------------------------------------- */

@media only screen and (min-width: 960px) {

    .product-category-card__read-more {
        display: block;
        width: max-content;
        max-width: 100%;
        max-height: 0;
        margin-top: 0;

        overflow: clip;
        overflow-clip-margin: 5px;
        color: #fff;

        opacity: 0;
        transform: translateY(8px);
        pointer-events: none;

        transition:
            max-height 0.3s ease,
            margin-top 0.3s ease,
            opacity 0.3s ease,
            transform 0.3s ease;
    }

    .product-category-card:hover .product-category-card__read-more {
        max-height: 40px;
        margin-top: 10px;
        opacity: 1;
        transform: translateY(0);
    }

    .product-category-card__read-more-label {
        position: relative;
        isolation: isolate;

        display: inline-block;
        padding: 2px 5px;

        background-color: transparent;
        color: #fff;
        font-family: "Prompt", sans-serif;
        font-size: 16px;
        line-height: normal;
        font-weight: 500;
        letter-spacing: 0;
        text-align: left;
        white-space: nowrap;

        pointer-events: auto;

        transition: color 0.3s ease;
    }

    .product-category-card__read-more-label::before {
        content: "";
        position: absolute;
        right: 0;
        top: calc(50% + 3px);
        bottom: auto;
        left: 0;
        z-index: -1;

        height: 5px;
        background-color: #B38A05;

        transition:
            height 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            right 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            top 0.35s cubic-bezier(0.22, 1, 0.36, 1),
            left 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    }

    .product-category-card__read-more-label:hover::before {
        right: -5px;
        top: 0;
        left: -5px;
        height: 100%;
    }

    .product-category-card__read-more-label:hover {
        color: #fff;
    }

}


/* =========================================================
   TABLET
   ========================================================= */

@media only screen and (max-width: 959px) {

    .product-category-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* Disable accordion behaviour */
    .product-category-card,
    .product-category-row:hover .product-category-card,
    .product-category-row .product-category-card:hover {
        width: auto;
        flex: none;
    }

}


/* =========================================================
   MOBILE
   ========================================================= */

@media only screen and (max-width: 575px) {

    .product-category-row {
        grid-template-columns: 1fr;
    }

    .product-category-card {
        height: 320px;
    }

}
