/**
 * Product video carousel. Card geometry mirrors the reference layout:
 * a 240x440 portrait card with the product details overlaid on the lower strip.
 */

.hebd-videos {
    --hebd-green: #136532;
    --hebd-ink: #1c2b21;
    --hebd-muted: #6b7c71;
    --hebd-card-w: 240px;

    padding: var(--hebd-section-space, 44px) 0;
    /* Soft beige band separates this section from the product carousels around it. */
    background: var(--hebd-soft-tint, #F8F1E7);
    font-family: var(--hebd-font-body);
}

.hebd-videos__heading {
    margin: 0 0 24px;
    font-family: var(--hebd-font-heading);
    font-size: 30px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--hebd-ink);
    text-align: center;
}

.hebd-videos__viewport {
    position: relative;
}

.hebd-videos__swiper {
    overflow: hidden;
    padding: 4px 0;
}

/* ------------------------------------------------------------------ */
/* Card                                                                */
/* ------------------------------------------------------------------ */

.hebd-videos .swiper-slide.hebd-video-card {
    width: var(--hebd-card-w);
    height: auto;
    flex-shrink: 0;
}

.hebd-video-card__link {
    display: block;
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #e9ecea;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(16, 40, 26, .06), 0 14px 28px -20px rgba(16, 40, 26, .5);
    transition: transform .22s ease, box-shadow .22s ease;
}

.hebd-video-card__link:hover,
.hebd-video-card__link:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 2px 4px rgba(16, 40, 26, .08), 0 22px 36px -20px rgba(16, 40, 26, .6);
}

.hebd-video-card__link:focus-visible {
    outline: 3px solid rgba(19, 101, 50, .35);
    outline-offset: 2px;
}

.hebd-video-card__media {
    position: relative;
    /* Portrait, matching the 9:16 clips these carousels are built around. */
    aspect-ratio: 240 / 440;
    background: #dfe4e1;
}

.hebd-video-card__video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    background: #dfe4e1;
}

/* YouTube clips: a plain cover in the card's colour hides the player until
   the clip is playing with YouTube's own overlays gone (product-videos.js),
   then the player shows, cropped to fill the card like the uploaded clips.
   A regular video is 16:9 and loses its sides; a Short is 9:16 and fits. */
.hebd-video-card__youtube {
    position: absolute;
    inset: 0;
    /* Keeps the player's layers inside this box, under the product strip. */
    z-index: 0;
    overflow: hidden;
    background: #dfe4e1;
    container-type: size;
}

.hebd-video-card__youtube::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 2;
    background: #dfe4e1;
    transition: opacity .45s ease;
}

.hebd-video-card__youtube.is-ready::after {
    opacity: 0;
}

/* Element selector because YouTube creates the iframe; the card class in
   front outranks Elementor's ".elementor iframe { width: 100% }". */
.hebd-video-card .hebd-video-card__youtube iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 1;
    width: max(100cqw, 100cqh * 16 / 9);
    height: max(100cqh, 100cqw * 9 / 16);
    /* Wider than the card on purpose (the card clips it). */
    max-width: none;
    max-height: none;
    border: 0;
    transform: translate(-50%, -50%);
    /* The whole card stays a link to the product. */
    pointer-events: none;
}

.hebd-video-card .hebd-video-card__youtube.is-vertical iframe {
    width: max(100cqw, 100cqh * 9 / 16);
    height: max(100cqh, 100cqw * 16 / 9);
}

/* ------------------------------------------------------------------ */
/* Product strip                                                       */
/* ------------------------------------------------------------------ */

.hebd-video-card__info {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    /* Extra top padding gives the scrim room to fade out. */
    padding: 26px 10px 10px;
    /* Same height on every card regardless of thumbnail or price length. */
    min-height: 71px;
    /* No solid panel: the video shows through, with just enough of a gradient
       behind the text to keep it readable over a bright frame. */
    background: linear-gradient(to top,
            rgba(12, 24, 16, .82) 0%,
            rgba(12, 24, 16, .62) 45%,
            rgba(12, 24, 16, 0) 100%);
}

.hebd-video-card__thumb {
    flex: 0 0 auto;
    /* Fixed square: some product images are tall portraits, and a generic
       `img { height: auto }` rule otherwise stretches the strip taller. */
    width: 35px !important;
    height: 35px !important;
    object-fit: cover;
    border-radius: 4px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .35);
}

.hebd-video-card__text {
    min-width: 0;
    flex: 1 1 auto;
}

.hebd-video-card__title {
    margin: 0 0 2px;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hebd-video-card__price {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .45);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hebd-video-card__price del {
    margin-left: 5px;
    font-weight: 500;
    color: rgba(255, 255, 255, .75);
}

.hebd-video-card__price ins {
    text-decoration: none;
}

/* WooCommerce appends screen-reader copy to price markup. */
.hebd-video-card__price .screen-reader-text {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(1px, 1px, 1px, 1px);
    white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Navigation                                                          */
/* ------------------------------------------------------------------ */

.hebd-videos__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid #e2e8e4;
    border-radius: 50%;
    background: #fff;
    color: var(--hebd-green);
    cursor: pointer;
    box-shadow: 0 2px 10px -4px rgba(16, 40, 26, .45);
    transition: background-color .18s ease, color .18s ease, opacity .18s ease;
}

.hebd-videos__nav:hover {
    background: var(--hebd-green);
    color: #fff;
}

.hebd-videos__nav--prev {
    left: -6px;
}

.hebd-videos__nav--next {
    right: -6px;
}

.hebd-videos__nav.swiper-button-disabled,
.hebd-videos__nav.swiper-button-lock {
    opacity: 0;
    pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Footer button                                                       */
/* ------------------------------------------------------------------ */

.hebd-videos__footer {
    display: flex;
    justify-content: center;
    margin-top: 32px;
}

.hebd-videos__button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 38px;
    border-radius: 8px;
    background: var(--hebd-green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background-color .18s ease;
}

.hebd-videos__button:hover {
    background: #0e4d26;
    color: #fff;
}

.hebd-videos-empty {
    padding: 24px;
    text-align: center;
    color: #6b7c71;
    border: 1px dashed #e2e8e4;
    border-radius: 10px;
}

/* ------------------------------------------------------------------ */
/* Responsive                                                          */
/* ------------------------------------------------------------------ */

@media (max-width: 991.98px) {
    .hebd-videos {
        --hebd-card-w: 200px;
    }

    .hebd-videos__heading {
        font-size: 25px;
    }
}

@media (max-width: 575.98px) {
    .hebd-videos {
        --hebd-card-w: 160px;
        padding: 32px 0;
    }

    .hebd-videos__heading {
        font-size: 21px;
        margin-bottom: 18px;
    }

    .hebd-videos__nav {
        width: 34px;
        height: 34px;
    }

    .hebd-videos__nav--prev {
        left: 0;
    }

    .hebd-videos__nav--next {
        right: 0;
    }
}
