/**
 * HS Home Builder — section heading, carousels, product / category / post / review cards.
 * Author: Hesham Saad — https://heshamsaad.com
 */

.hs-home-template,
.hs-section {
    --hs-ink: var(--hshb-dark-color, #222);
    --hs-muted: #6e6964;
    --hs-line: #e4e0dc;
    --hs-media-bg: #f0edea; /* warm grey, same family as the category artwork */
    --hs-sale: #d63c31;
    --hs-new: #f3c34c;
    --hs-ok: #1b8a4e;
    --hs-star: #f2b01e;
    --hs-star-off: #dcd7d2;
}

/* Section heading - Start */
/* Title row, border and "View All" button come from home-builder-main.css (.hs-section-title-wrap). */
.hs-section-head .hs-section-head__text {
    min-width: 0;
    text-align: start;
}

.hs-section-subtitle {
    margin: 0.2rem 0 0;
    color: var(--hs-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

.hs-section-head__aside {
    display: flex;
    flex-shrink: 0;
    align-items: center;
    gap: 12px;
}

section.hs-section.hs-dark .hs-section-subtitle,
section.hs-section.hs-dark .hs-review-summary__label {
    color: rgba(255, 255, 255, 0.7);
}

section.hs-section.hs-dark .hs-review-summary__score {
    color: var(--hshb-light-color, #fff);
}

/* Section heading - End */

/* Carousel - Start */
.hs-carousel-nav {
    display: flex;
    flex-shrink: 0;
    gap: 10px;
}

.hs-section .hs-carousel-btn {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--hs-line);
    border-radius: 50%;
    background: #fff;
    color: var(--hs-ink);
    cursor: pointer;
    transition: border-color 200ms ease, opacity 200ms ease;
}

.hs-section .hs-carousel-btn:hover {
    border-color: var(--hs-ink);
}

.hs-section .hs-carousel-btn:focus-visible {
    outline: 2px solid var(--hs-ink);
    outline-offset: 2px;
}

.hs-section .hs-carousel-btn.swiper-button-disabled {
    border-color: transparent;
    background: rgba(0, 0, 0, 0.05);
    opacity: 0.45;
    cursor: default;
}

.hs-section .hs-carousel-btn.swiper-button-lock {
    display: none;
}

.hs-carousel-prev svg,
[dir="rtl"] .hs-carousel-next svg {
    transform: rotate(180deg);
}

[dir="rtl"] .hs-carousel-prev svg {
    transform: none;
}

.hs-carousel .swiper-slide {
    height: auto;
}

.hs-section .hs-carousel-scrollbar {
    position: relative;
    left: auto;
    bottom: auto;
    z-index: 1;
    width: 100%;
    height: 3px;
    margin-top: 1.5rem;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.09);
}

.hs-section .hs-carousel-scrollbar .swiper-scrollbar-drag {
    background: var(--hs-ink);
}

section.hs-section.hs-dark .hs-carousel-scrollbar {
    background: rgba(255, 255, 255, 0.2);
}

section.hs-section.hs-dark .hs-carousel-scrollbar .swiper-scrollbar-drag {
    background: #fff;
}

@media (max-width: 559px) {
    .hs-carousel-nav {
        display: none;
    }
}

/* Carousel - End */

/* Stars - Start */
.hs-stars {
    --hs-star-size: 15px;
    display: inline-block;
    flex-shrink: 0;
    width: calc(var(--hs-star-size) * 5.75);
    height: var(--hs-star-size);
    background: linear-gradient(90deg, var(--hs-star) calc(var(--hs-rating) / 5 * 100%), var(--hs-star-off) 0);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27.6 24'%3E%3Cpath d='M12 1.5l3.1 6.5 7 .9-5.1 4.9 1.3 7L12 17.4l-6.3 3.4 1.3-7L1.9 8.9l7-.9z'/%3E%3C/svg%3E") left center / calc(var(--hs-star-size) * 1.15) var(--hs-star-size) repeat-x;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 27.6 24'%3E%3Cpath d='M12 1.5l3.1 6.5 7 .9-5.1 4.9 1.3 7L12 17.4l-6.3 3.4 1.3-7L1.9 8.9l7-.9z'/%3E%3C/svg%3E") left center / calc(var(--hs-star-size) * 1.15) var(--hs-star-size) repeat-x;
}

[dir="rtl"] .hs-stars {
    background: linear-gradient(270deg, var(--hs-star) calc(var(--hs-rating) / 5 * 100%), var(--hs-star-off) 0);
}

/* Stars - End */

/* Product card styles moved to inc/css/hs-pcard.css (shared by every product loop). */

/* Category card - Start */
.hs-product-categories .hs-product-categories__wrap {
    display: grid;
    grid-template-columns: repeat(var(--columns-desktop, 4), minmax(0, 1fr));
    gap: 28px 24px;
}

.hs-cat-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
    color: var(--hs-ink);
    container-type: inline-size;
}

.hs-cat-card__media {
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    background: var(--hs-media-bg);
}

.hs-cat-card img.hs-cat-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

.hs-cat-card__text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hs-cat-card__title {
    color: inherit;
    font-size: clamp(0.75rem, 5cqi, 0.95rem);
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.hs-cat-card__desc {
    display: -webkit-box;
    overflow: hidden;
    text-align: center;
    color: var(--hs-muted);
    font-size: 0.85rem;
    line-height: 1.4;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

section.hs-section.hs-dark .hs-cat-card {
    color: #fff;
}

section.hs-section.hs-dark .hs-cat-card__desc {
    color: rgba(255, 255, 255, 0.7);
}

@container (max-width: 220px) {
    .hs-cat-card__desc {
        display: none;
    }
}

@media (hover: hover) {
    .hs-cat-card:hover img.hs-cat-card__image {
        transform: scale(1.04);
    }
}

.hs-cat-card:focus-visible {
    outline: 2px solid var(--hs-ink);
    outline-offset: 3px;
}

@media (max-width: 768px) {
    .hs-product-categories .hs-product-categories__wrap {
        grid-template-columns: repeat(var(--columns-mobile, 2), minmax(0, 1fr));
        gap: 24px 16px;
    }
}

/* Category card - End */

/* Blog posts - Start */

.hs-post-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hs-line);
    border-radius: 10px;
    background: #fff;
}

.hs-post-card__media {
    display: block;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: var(--hs-media-bg);
}

.hs-post-card__media img.hs-post-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms ease;
}

@media (hover: hover) {
    .hs-post-card:hover .hs-post-card__image {
        transform: scale(1.03);
    }
}

.hs-post-card__body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 8px;
    padding: 18px 20px 20px;
}

.hs-post-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0;
    color: var(--hs-muted);
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.hs-post-card .hs-post-card__title {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hs-post-card__title a {
    color: var(--hs-ink);
}

.hs-post-card__excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--hs-muted);
    font-size: 0.95rem;
    line-height: 1.55;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hs-section .hs-post-card__more {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: auto;
    padding-top: 6px;
    color: var(--hs-ink);
    font-size: 0.9rem;
    font-weight: 700;
}

.hs-post-card__more svg {
    transition: translate 200ms ease;
}

.hs-post-card__more:hover svg {
    translate: 3px 0;
}

[dir="rtl"] .hs-post-card__more:hover svg {
    translate: -3px 0;
}

/* Blog posts - End */

/* Store reviews - Start */
.hs-review-summary {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 10px;
    margin: 0.3rem 0 0;
}

.hs-review-summary__score {
    color: var(--hs-ink);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.hs-review-summary__label {
    color: var(--hs-muted);
    font-size: 0.9rem;
}

.hs-review-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
    margin: 0;
    padding: 20px 20px 18px;
    border: 1px solid var(--hs-line);
    border-radius: 12px;
    background: #fff;
}

.hs-review-card .hs-stars {
    --hs-star-size: 16px;
}

.hs-section .hs-review-card__text {
    flex: 1;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: var(--hs-ink);
    font-size: 1.05rem;
    font-style: normal;
    line-height: 1.55;
    text-align: start;
    quotes: none;
}

.hs-section .hs-review-card__text::before,
.hs-section .hs-review-card__text::after {
    content: none;
}

.hs-review-card__text p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.hs-review-card__by {
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--hs-line);
}

.hs-review-card__author {
    color: var(--hs-ink);
    font-size: 15px;
    font-weight: 700;
    text-align: start;
}

.hs-section .hs-review-card__product {
    overflow: hidden;
    color: var(--hs-muted);
    font-size: 13px;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.hs-review-card__product:hover {
    text-decoration: underline;
}

.hs-review-card__verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 4px;
    color: var(--hs-ok);
    font-size: 13px;
    font-weight: 600;
}

/* Store reviews - End */

/* Products List, phones: carousel runs edge to edge (cards centre-snap, neighbours peek in). */
@media (max-width: 559px) {
    .hs-products-list .hs-carousel,
    .hs-athletic-roster .hs-carousel,
    .hs-blog-posts .hs-carousel {
        margin-inline: calc(50% - 50vw);
    }

    .hs-products-list .hs-carousel-scrollbar,
    .hs-store-reviews .hs-carousel-scrollbar,
    .hs-athletic-roster .hs-carousel-scrollbar,
    .hs-blog-posts .hs-carousel-scrollbar {
        display: none;
    }
}

/* Carousel before Swiper starts: same slide widths as the script will set, so the page does not jump. */
.hs-carousel:not(.swiper-initialized) {
    --hs-gap: 12px;
    --hs-spv: var(--hs-spv-m, 1.2);
}

.hs-carousel:not(.swiper-initialized) .swiper-wrapper {
    flex-wrap: nowrap;
}

.hs-carousel:not(.swiper-initialized) .swiper-slide {
    flex-shrink: 0;
    width: calc((100% - var(--hs-gap) * (var(--hs-spv) - 1)) / var(--hs-spv));
    margin-inline-end: var(--hs-gap);
}

@media (min-width: 560px) {
    .hs-carousel:not(.swiper-initialized) {
        --hs-gap: 16px;
        --hs-spv: min(2.25, var(--hs-spv-d, 4));
    }
}

@media (min-width: 900px) {
    .hs-carousel:not(.swiper-initialized) {
        --hs-spv: var(--hs-spv-t, 3);
    }
}

@media (min-width: 1200px) {
    .hs-carousel:not(.swiper-initialized) {
        --hs-gap: 20px;
        --hs-spv: var(--hs-spv-d, 4);
    }
}

/* Phones: Products List and Store Reviews start centred (1.7 cards), matching the script. */
@media (max-width: 559px) {
    .hs-products-list .hs-carousel:not(.swiper-initialized),
    .hs-store-reviews .hs-carousel:not(.swiper-initialized),
    .hs-athletic-roster .hs-carousel:not(.swiper-initialized),
    .hs-blog-posts .hs-carousel:not(.swiper-initialized) {
        --hs-spv: 1.7;
    }

    .hs-products-list .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    .hs-store-reviews .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    .hs-athletic-roster .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    .hs-blog-posts .hs-carousel:not(.swiper-initialized) .swiper-wrapper {
        transform: translateX(calc((100% - (100% - var(--hs-gap) * 0.7) / 1.7) / 2));
    }

    [dir="rtl"] .hs-products-list .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    [dir="rtl"] .hs-store-reviews .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    [dir="rtl"] .hs-athletic-roster .hs-carousel:not(.swiper-initialized) .swiper-wrapper,
    .hs-blog-posts .hs-carousel:not(.swiper-initialized) .swiper-wrapper {
        transform: translateX(calc((100% - (100% - var(--hs-gap) * 0.7) / 1.7) / -2));
    }
}
