/* Base layout for the reusable modern homepage product components. Theme colors
 * are supplied by home_modern.css through --home-* variables. */
.home-featured-products {
    display: grid;
    grid-template-columns: minmax(0, 2.25fr) minmax(260px, .75fr);
    align-items: stretch;
    gap: 16px;
}

/* When only one of the featured panels is rendered, do not leave the second
 * desktop grid track empty. This commonly happens when all recent products
 * are discounted and therefore the optional "latest" panel has no items. */
@media (min-width: 992px) {
    .home-featured-products__spotlight:only-child,
    .home-featured-products__latest:only-child {
        grid-column: 1 / -1;
        width: 100%;
    }

    .home-featured-products__spotlight:only-child .home-featured-slide {
        grid-template-columns: minmax(320px, .92fr) minmax(0, 1.08fr);
        gap: clamp(34px, 4.5vw, 72px);
        padding-right: clamp(52px, 6vw, 86px);
        padding-left: clamp(52px, 6vw, 86px);
    }

    .home-featured-products__spotlight:only-child .home-featured-slide__image-wrap {
        min-height: clamp(300px, 26vw, 350px);
    }

    .home-featured-products__spotlight:only-child .home-featured-slide__image-wrap img {
        width: min(100%, 430px);
        height: clamp(300px, 26vw, 350px);
    }

    .home-featured-products__spotlight:only-child .home-featured-slide__content {
        width: 100%;
        max-width: 620px;
    }
}

.home-featured-products__spotlight,
.home-featured-products__latest,
.home-product-showcase {
    position: relative;
    min-width: 0;
}

.home-featured-carousel {
    position: relative;
    min-height: 360px;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

.home-featured-carousel:active {
    cursor: grabbing;
}

.home-featured-carousel .owl-stage {
    display: flex;
}

.home-featured-carousel .owl-item {
    display: flex;
    align-items: stretch;
}

.home-featured-carousel__item {
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 360px;
    flex: 1 1 100%;
}

.home-featured-slide {
    display: grid;
    width: 100%;
    min-width: 0;
    min-height: 360px;
    box-sizing: border-box;
    grid-template-columns: minmax(260px, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: clamp(18px, 3vw, 42px);
    padding: 24px 48px 34px;
}

.home-featured-slide__image-wrap {
    position: relative;
    display: flex;
    min-height: 285px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 20px;
}

.home-featured-slide__image-wrap img {
    display: block;
    width: 100%;
    height: 285px;
    padding: 14px;
    object-fit: contain;
}

.home-featured-slide__content {
    min-width: 0;
}

.home-featured-slide__title {
    margin: 0 0 18px;
    font-size: clamp(18px, 2vw, 26px);
    font-weight: 900;
    line-height: 1.9;
}

.home-featured-slide__title a,
.home-latest-product__title a,
.home-product-card__title a {
    color: inherit;
}

.home-featured-slide__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.home-featured-slide__meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 1px solid;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
}

.home-featured-slide__price {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    margin-bottom: 18px;
}

.home-featured-slide__price del,
.home-product-card__price del {
    color: var(--home-muted, #777);
    font-size: 11px;
}

.home-featured-slide__price .current_price {
    font-size: 22px;
    font-weight: 900;
}

.home-featured-slide__price small,
.home-product-card__price small,
.home-latest-product__price small {
    margin-right: 4px;
    font-size: 10px;
    font-weight: 700;
}

.home-featured-slide__actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.home-featured-slide__action {
    display: inline-flex;
    min-height: 43px;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border: 1px solid;
    border-radius: 13px;
    font-size: 12px;
    font-weight: 800;
}

.home-featured-slide__cart {
    display: inline-flex;
    width: 43px;
    height: 43px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    background: var(--home-primary, #ef394e);
    color: var(--home-primary-contrast, #fff);
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease;
}

.home-featured-slide__cart:hover:not(:disabled) {
    box-shadow: 0 8px 20px var(--home-primary-medium, rgba(239,57,78,.22));
    transform: translateY(-2px);
}

.home-featured-carousel .owl-nav {
    margin: 0;
}

.home-featured-carousel .owl-nav .owl-prev,
.home-featured-carousel .owl-nav .owl-next {
    position: absolute;
    z-index: 4;
    top: 50%;
    display: inline-flex;
    width: 38px;
    height: 38px;
    align-items: center;
    justify-content: center;
    margin: 0;
    border: 1px solid var(--home-border, #e8ecf1) !important;
    border-radius: 50% !important;
    background: var(--home-surface-raised, #fff) !important;
    color: var(--home-text, #20242b) !important;
    opacity: .94;
    transform: translateY(-50%);
    transition: opacity .2s ease, transform .2s ease, box-shadow .2s ease;
}

.home-featured-carousel .owl-nav .owl-prev {
    right: 10px;
}

.home-featured-carousel .owl-nav .owl-next {
    left: 10px;
}

.home-featured-carousel .owl-nav .owl-prev:hover,
.home-featured-carousel .owl-nav .owl-next:hover {
    opacity: 1;
    box-shadow: 0 8px 20px rgba(24, 32, 44, .10);
}

.home-featured-carousel .owl-dots {
    position: absolute;
    z-index: 4;
    right: 50%;
    bottom: 10px;
    display: flex;
    width: auto;
    align-items: center;
    gap: 5px;
    margin: 0;
    transform: translateX(50%);
}

.home-featured-carousel .owl-dots .owl-dot span {
    display: block;
    width: 18px;
    height: 4px;
    margin: 0;
    border-radius: 99px;
    background: var(--home-border, #e8ecf1);
    transition: width .2s ease, background .2s ease;
}

.home-featured-carousel .owl-dots .owl-dot.active span {
    width: 32px;
    background: var(--home-primary, #ef394e);
}

.home-featured-progress {
    height: 3px;
    margin: 0 22px 14px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--home-border, #e8ecf1);
}

.home-featured-progress__bar {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--home-primary, #ef394e);
    transform: scaleX(0);
    transform-origin: right center;
}

.home-featured-progress__bar.is-running {
    animation: homeFeaturedProgress var(--home-featured-progress-duration, 6500ms) linear forwards;
}

.home-featured-products__spotlight:hover .home-featured-progress__bar.is-running {
    animation-play-state: paused;
}

@keyframes homeFeaturedProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

.home-featured-products__latest {
    display: flex;
    flex-direction: column;
}

.home-latest-carousel {
    flex: 1;
    padding: 0 16px 14px;
}

.home-latest-product {
    text-align: center;
}

.home-latest-product__image-wrap {
    position: relative;
    display: flex;
    height: 245px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
}

.home-latest-product__image-wrap img {
    width: 100%;
    height: 100%;
    padding: 12px;
    object-fit: contain;
}

.home-latest-product__title {
    min-height: 52px;
    margin: 12px 0 7px;
    overflow: hidden;
    font-size: 12px;
    font-weight: 900;
    line-height: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-latest-product__price {
    font-size: 15px;
    font-weight: 900;
}

.home-latest-progress {
    height: 3px;
    margin: auto 16px 16px;
    overflow: hidden;
    border-radius: 99px;
}

.home-latest-progress .slide-progress {
    width: 0;
    height: 100%;
}

.home-product-carousel .owl-stage {
    display: flex;
}

.home-product-carousel .owl-item {
    display: flex;
    padding: 2px 0 12px;
}

.home-product-card {
    position: relative;
    display: flex;
    width: 100%;
    min-width: 0;
    min-height: 360px;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.home-product-card__image-wrap {
    position: relative;
    display: flex;
    height: 220px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px 18px 0 0;
}

.home-product-card__image-wrap > img {
    display: block;
    width: 100%;
    height: 100%;
    padding: 14px;
    object-fit: contain;
    transition: transform .3s ease;
}

.home-product-card:hover .home-product-card__image-wrap > img {
    transform: scale(1.035);
}

.home-product-card__badge {
    position: absolute;
    z-index: 2;
    top: 10px;
    display: inline-flex;
    min-height: 26px;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 9px;
    font-size: 10px;
    font-weight: 900;
}

.home-product-card__badge--discount {
    right: 10px;
}

.home-product-card__badge--stock {
    left: 10px;
}

.home-product-card__body {
    display: flex;
    min-width: 0;
    flex: 1;
    flex-direction: column;
    padding: 13px 13px 14px;
}

.home-product-card__title {
    min-height: 48px;
    margin: 0 0 14px;
    overflow: hidden;
    font-size: 11.5px;
    font-weight: 900;
    line-height: 2;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.home-product-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.home-product-card__price {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.home-product-card__price .current_price {
    font-size: 14px;
    font-weight: 900;
    white-space: nowrap;
}

.home-product-card__cart {
    display: inline-flex !important;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.home-product-card__cart:hover:not(:disabled) {
    transform: translateY(-2px);
}

@media (max-width: 991.98px) {
    .home-featured-products {
        grid-template-columns: minmax(0, 1fr);
    }

    .home-featured-products__latest {
        min-height: 380px;
    }

    .home-latest-product__image-wrap {
        height: 250px;
    }
}

@media (max-width: 767.98px) {
    /* On phones the featured product becomes a stacked card. Do not keep the
     * desktop carousel minimum heights here: they make short slides stretch to
     * the tallest item and leave a large empty area around the product. */
    .home-featured-carousel,
    .home-featured-carousel__item,
    .home-featured-slide {
        min-height: 0;
    }

    .home-featured-carousel .owl-stage {
        align-items: flex-start;
    }

    .home-featured-carousel .owl-item {
        align-items: flex-start;
    }

    .home-featured-slide {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto;
        align-items: start;
        align-content: start;
        gap: 10px;
        padding: 12px 42px 24px;
    }

    .home-featured-slide__image-wrap {
        width: 100%;
        min-height: 0;
        height: clamp(175px, 52vw, 220px);
    }

    .home-featured-slide__image-wrap img {
        width: 100%;
        height: 100%;
        padding: 8px;
    }

    .home-featured-slide__content {
        width: 100%;
        text-align: center;
    }

    .home-featured-slide__title {
        margin-bottom: 9px;
        font-size: 15px;
        text-align: center;
    }

    .home-featured-slide__meta {
        justify-content: center;
        margin-bottom: 10px;
    }

    .home-featured-slide__price {
        align-items: center;
        margin-bottom: 10px;
        text-align: center;
    }

    .home-featured-slide__actions {
        justify-content: center;
    }

    .home-featured-slide__price .current_price {
        font-size: 17px;
    }

    .home-featured-slide__action {
        min-height: 39px;
        font-size: 10px;
    }

    .home-featured-slide__cart {
        width: 39px;
        height: 39px;
    }

    .home-product-card {
        min-height: 310px;
    }

    .home-product-card__image-wrap {
        height: 176px;
    }
}

@media (max-width: 575.98px) {
    .home-product-card {
        min-height: 294px;
    }

    .home-product-card__image-wrap {
        height: 158px;
    }

    .home-product-card__price .current_price {
        font-size: 12px;
    }

    .home-product-card__cart {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-featured-progress__bar.is-running {
        animation-duration: 1ms;
    }
}
