/* ==========================================================================
   Shop By Category
   Figma: 1920 × 1272px, bg #f2f2f2
   Grid starts at x=140px, 4 columns, cards ~379px wide, gap ~34px
   ========================================================================== */
.shop-by-category {
    padding: 103px 0 98px;
    background-color: #f2f2f2;
}

/* Figma: 38px Bold #272727, letter-spacing 1.9px */
.shop-by-category .section-title {
    font-size: 38px;
    letter-spacing: 1.9px;
    margin-bottom: 28px;
}

.shop-by-category .container {
    max-width: 1620px;
}

/* Figma: 4 cols, gap ~34px between cards, ~46px between rows */
.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    column-gap: 34px;
    row-gap: 46px;
}

/* Figma: image ~379 × 345px, some have border 0.835px #707070 */
.category-card__image {
    aspect-ratio: 378.877 / 344.661;
}

.category-card__image img {
    transition: transform 0.3s;
}

/* Fix sofa image white borders from source export */
.category-card:first-child .category-card__image img {
    transform: scale(1.15);
}

/* Hidden "load more" cards — shown when .shop-by-category is .expanded */
.category-card--more[hidden] {
    display: none;
}

/* Figma: 0.835px #707070 stroke — applied on hover */
.category-card__image {
    border: 0.835px solid transparent;
    transition: border-color 0.3s;
}

.category-card:hover .category-card__image {
    border-color: #707070;
}

.category-card:hover .category-card__image img {
    transform: scale(1.05);
}

/* Figma: 25.505px Medium #707070, centered */
.category-card__name {
    font-size: 25.505px;
    color: #707070;
    margin-top: 16px;
}

.shop-by-category__cta-wrap {
    margin-top: 72px;
}

/* Figma CTA: 423.376 × 85.015px, border 0.85px #707070, radius 56.11px, transparent bg */
.shop-by-category__cta {
    width: 423.376px;
    height: 85.015px;
    color: #707070;
    font-size: 23.804px;
    border: 0.85px solid #707070;
    transition: all 0.3s;
    cursor: pointer;
    font-family: inherit;
    letter-spacing: inherit;
}

.shop-by-category__cta:hover {
    background-color: var(--gray-900);
    color: var(--white);
    border-color: var(--gray-900);
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1439px) {
    .shop-by-category {
        padding: 70px 0 60px;
    }
    .category-card__name {
        font-size: 20px;
    }
    .shop-by-category__cta {
        width: 360px;
        height: 72px;
        font-size: 20px;
    }
}

@media (max-width: 1199px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
        column-gap: 25px;
        row-gap: 35px;
    }
    .shop-by-category .section-title {
        font-size: 30px;
    }
}

@media (max-width: 991px) {
    .shop-by-category {
        padding: 50px 0 50px;
    }
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
        column-gap: 20px;
        row-gap: 25px;
    }
    .shop-by-category .section-title {
        margin-bottom: 30px;
    }
    .category-card__name {
        font-size: 18px;
    }
    .shop-by-category__cta {
        width: 300px;
        height: 60px;
        font-size: 18px;
    }
}

@media (max-width: 767px) {
    .shop-by-category {
        padding: 35px 0 37px;
    }
    .shop-by-category .section-title {
        margin-bottom: 23px;
    }
    .category-grid {
        display: flex;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 18px;
        padding-left: 16px;
        padding-right: 16px;
        scroll-snap-type: x mandatory;
    }
    .category-card {
        flex: 0 0 162px;
        scroll-snap-align: start;
    }
    .category-card__image {
        aspect-ratio: 162 / 147;
    }
    .category-card__name {
        font-size: 18px;
        margin-top: 15px;
    }
    .shop-by-category__cta-wrap {
        display: none;
    }
}
