/* RuTube shorts carousel — homepage block ----------------------------------- */

.rutube-shorts {
    max-width: 1470px;
    margin: 40px auto;
    padding: 28px 24px 36px;
    border-radius: 24px;
    background:
        radial-gradient(ellipse at top left, rgba(168, 217, 154, 0.35) 0%, rgba(168, 217, 154, 0) 55%),
        radial-gradient(ellipse at bottom right, rgba(49, 169, 0, 0.18) 0%, rgba(49, 169, 0, 0) 60%),
        linear-gradient(135deg, rgba(231, 245, 222, 0.65) 0%, rgba(255, 255, 255, 0.55) 50%, rgba(199, 232, 176, 0.45) 100%);
    border: 1px solid rgba(255, 255, 255, 0.7);
    box-shadow: 0 8px 32px rgba(49, 169, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    overflow: hidden;
}
.rutube-shorts {
    position: relative;
}
.rutube-shorts__title {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
    margin: 0 0 20px;
    line-height: 1.2;
}
.rutube-shorts__title-text {
    font-size: 28px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    /* Clean orange-to-coral gradient. Brand green sits on the section
       background, so warm orange tones pop without clashing. */
    background: linear-gradient(95deg, #ff8a3d 0%, #ff6b35 50%, #ff5773 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
    /* Subtle drop shadow for depth — sits behind the gradient, not affected by clip */
    filter: drop-shadow(0 2px 4px rgba(255, 107, 53, 0.18));
}
.rutube-shorts__title-link {
    margin-left: auto;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}
.rutube-shorts__title-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    /* Min-height 44px = WCAG 2.5.5 tap target — also makes it easy to thumb on mobile */
    min-height: 44px;
    padding: 8px 18px;
    color: #31a900;
    text-decoration: none;
    background: rgba(255, 255, 255, 0.7);
    -webkit-backdrop-filter: blur(12px) saturate(1.2);
    backdrop-filter: blur(12px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    box-shadow:
        0 4px 14px rgba(49, 169, 0, 0.1),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition:
        color .2s ease,
        background .2s ease,
        border-color .2s ease,
        transform .2s ease,
        box-shadow .2s ease;
}
.rutube-shorts__title-link a::after {
    content: '→';
    font-size: 1.1em;
    line-height: 1;
    transition: transform .2s ease;
}
.rutube-shorts__title-link a:hover,
.rutube-shorts__title-link a:focus-visible {
    color: #257d00;
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(49, 169, 0, 0.4);
    box-shadow:
        0 8px 22px rgba(49, 169, 0, 0.18),
        0 2px 6px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    transform: translateY(-1px);
    outline: none;
}
.rutube-shorts__title-link a:hover::after,
.rutube-shorts__title-link a:focus-visible::after {
    transform: translateX(3px);
}
.rutube-shorts__title-link a:active {
    transform: translateY(0);
    box-shadow:
        0 2px 8px rgba(49, 169, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}
.rutube-shorts__slick {
    margin: 0 -8px;
}
/* Slick's default .slick-list overflow:hidden clips the card hover shadow.
   Unset it — off-screen slides are still clipped by the panel's own
   overflow:hidden, and shadows can now extend freely. */
.rutube-shorts__slick .slick-list {
    overflow: visible;
}
.rutube-shorts__slick.slick-initialized .slick-track {
    display: flex;
    align-items: stretch;
}
.rutube-shorts__slick.slick-initialized .slick-slide {
    height: auto;
}
.rutube-shorts__slick.slick-initialized .slick-slide > div {
    height: 100%;
}
.rutube-shorts__slide {
    padding: 0 8px;
    box-sizing: border-box;
}

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

.rutube-short-card {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.65);
    -webkit-backdrop-filter: blur(14px) saturate(1.2);
    backdrop-filter: blur(14px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 18px;
    box-shadow:
        0 6px 20px rgba(49, 169, 0, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    cursor: pointer;
    text-align: left;
    font: inherit;
    color: inherit;
    user-select: none;
    -webkit-user-select: none;
    transition:
        transform .3s cubic-bezier(.2, .7, .25, 1),
        box-shadow .3s ease,
        border-color .3s ease,
        background-color .3s ease;
}
.rutube-short-card:hover,
.rutube-short-card:focus-visible {
    transform: translateY(-4px);
    border-color: rgba(49, 169, 0, 0.45);
    background: rgba(255, 255, 255, 0.82);
    box-shadow:
        0 16px 40px rgba(49, 169, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
    outline: none;
}

/* Thumbnail ---------------------------------------------------------------- */

.rutube-short-card__thumb {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 9 / 16;
    border-radius: 12px;
    overflow: hidden;
    background: linear-gradient(135deg, rgba(168, 217, 154, 0.25), rgba(49, 169, 0, 0.15));
}
/* Fallback for browsers without aspect-ratio */
@supports not (aspect-ratio: 9 / 16) {
    .rutube-short-card__thumb::before {
        content: '';
        display: block;
        padding-top: 177.78%;
    }
    .rutube-short-card__thumb > * {
        position: absolute;
        inset: 0;
    }
}
.rutube-short-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .5s cubic-bezier(.2, .7, .25, 1), filter .35s ease;
}

/* Play icon ---------------------------------------------------------------- */

.rutube-short-card__play {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 56px;
    height: 56px;
    margin: -28px 0 0 -28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #31a900;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.7) inset;
    transition: opacity .3s ease, transform .3s ease;
    pointer-events: none;
}
.rutube-short-card__play svg {
    margin-left: 3px; /* optical centering of triangle */
    width: 26px;
    height: 26px;
}

/* Duration pill ------------------------------------------------------------ */

.rutube-short-card__duration {
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 3px 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 8px;
    transition: opacity .3s ease;
    pointer-events: none;
}

/* Hover overlay ------------------------------------------------------------ */

.rutube-short-card__overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15) 0%, rgba(0, 0, 0, 0.55) 60%, rgba(0, 0, 0, 0.7) 100%);
    opacity: 0;
    transition: opacity .35s cubic-bezier(.2, .7, .25, 1);
    pointer-events: none;
}
.rutube-short-card__thumb-title {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    line-height: 1.35;
    text-align: center;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transform: translateY(8px) scale(0.96);
    opacity: 0;
    transition:
        transform .4s cubic-bezier(.2, .7, .25, 1) .05s,
        opacity .35s cubic-bezier(.2, .7, .25, 1) .05s;
}

.rutube-short-card:hover .rutube-short-card__thumb img,
.rutube-short-card:focus-visible .rutube-short-card__thumb img {
    transform: scale(1.06);
    filter: brightness(0.55) saturate(1.05);
}
.rutube-short-card:hover .rutube-short-card__overlay,
.rutube-short-card:focus-visible .rutube-short-card__overlay {
    opacity: 1;
}
.rutube-short-card:hover .rutube-short-card__thumb-title,
.rutube-short-card:focus-visible .rutube-short-card__thumb-title {
    transform: translateY(0) scale(1);
    opacity: 1;
}
.rutube-short-card:hover .rutube-short-card__play,
.rutube-short-card:focus-visible .rutube-short-card__play {
    opacity: 0;
    transform: scale(0.85);
}
.rutube-short-card:hover .rutube-short-card__duration,
.rutube-short-card:focus-visible .rutube-short-card__duration {
    opacity: 0.4;
}

/* Disable hover effect on touch devices (the state would stick after tap) */
@media (hover: none) {
    .rutube-short-card:hover .rutube-short-card__overlay,
    .rutube-short-card:focus-visible .rutube-short-card__overlay {
        opacity: 0;
    }
    .rutube-short-card:hover .rutube-short-card__thumb img,
    .rutube-short-card:focus-visible .rutube-short-card__thumb img {
        transform: none;
        filter: none;
    }
    .rutube-short-card:hover .rutube-short-card__play,
    .rutube-short-card:focus-visible .rutube-short-card__play {
        opacity: 1;
        transform: none;
    }
    .rutube-short-card:hover .rutube-short-card__duration,
    .rutube-short-card:focus-visible .rutube-short-card__duration {
        opacity: 1;
    }
    .rutube-short-card:hover,
    .rutube-short-card:focus-visible {
        transform: none;
    }
}

/* Slick arrows + dots scoping ---------------------------------------------- */

.rutube-shorts .slick-prev,
.rutube-shorts .slick-next {
    position: absolute;
    top: 50%;
    z-index: 5;
    width: 44px;
    height: 44px;
    padding: 0;
    font-size: 0;
    line-height: 0;
    color: #31a900;
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    box-shadow: 0 6px 16px rgba(49, 169, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.06);
    cursor: pointer;
    /* translateY(-50%) centers vertically; scale(1) is a no-op on base so the
       hover transition between (translateY, scale 1) → (translateY, scale 1.08)
       is on the same property and the element doesn't jump. */
    transform: translateY(-50%) scale(1);
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}
.rutube-shorts .slick-prev:hover,
.rutube-shorts .slick-next:hover {
    background: #fff;
    transform: translateY(-50%) scale(1.08);
    box-shadow: 0 10px 24px rgba(49, 169, 0, 0.22), 0 2px 6px rgba(0, 0, 0, 0.08);
}
.rutube-shorts .slick-prev { left: -8px; }
.rutube-shorts .slick-next { right: -8px; }
/* Replace slick's default text/triangle pseudo-elements with inline SVG
   chevrons. Using SVG (not rotated CSS borders) avoids the rotation/origin
   ambiguity that flipped the arrows in earlier iterations. */
.rutube-shorts .slick-prev::before,
.rutube-shorts .slick-next::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    margin: 0 auto;
    background-color: currentColor;
    -webkit-mask: center / contain no-repeat;
            mask: center / contain no-repeat;
    opacity: 1;
}
.rutube-shorts .slick-prev::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z'/></svg>");
}
.rutube-shorts .slick-next::before {
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'><path d='M8.59 16.59L13.17 12 8.59 7.41 10 6l6 6-6 6z'/></svg>");
}
.rutube-shorts .slick-prev.slick-disabled,
.rutube-shorts .slick-next.slick-disabled {
    opacity: 0.4;
    cursor: default;
}
.rutube-shorts .slick-prev.slick-disabled:hover,
.rutube-shorts .slick-next.slick-disabled:hover {
    transform: translateY(-50%) scale(1);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 6px 16px rgba(49, 169, 0, 0.15), 0 1px 3px rgba(0, 0, 0, 0.06);
}
.rutube-shorts .slick-dots {
    position: relative;
    display: flex !important;
    justify-content: center;
    gap: 8px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
    bottom: auto;
}
.rutube-shorts .slick-dots li {
    width: auto;
    height: auto;
    margin: 0;
}
.rutube-shorts .slick-dots li button {
    width: 8px;
    height: 8px;
    padding: 0;
    font-size: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(49, 169, 0, 0.25);
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, width .2s ease;
}
.rutube-shorts .slick-dots li button::before {
    content: none;
}
.rutube-shorts .slick-dots li.slick-active button {
    width: 24px;
    border-radius: 4px;
    background: #31a900;
}
.rutube-shorts .slick-dots li:not(.slick-active) button:hover {
    background: rgba(49, 169, 0, 0.5);
    transform: scale(1.2);
}

/* Modal -------------------------------------------------------------------- */

.rutube-shorts-modal {
    position: fixed;
    inset: 0;
    z-index: 100000010; /* must beat mobile-v4 .tabbar-v4 (10000000) */
    display: none;
    align-items: center;
    justify-content: center;
}
.rutube-shorts-modal.is-open {
    display: flex;
    animation: rsm-fadein .25s ease;
}
@keyframes rsm-fadein {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.rutube-shorts-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(20, 40, 15, 0.55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}
.rutube-shorts-modal__dialog {
    position: relative;
    width: min(420px, 92vw);
    max-height: 92vh;
    aspect-ratio: 9 / 16;
    border-radius: 24px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
    animation: rsm-pop .35s cubic-bezier(.2, .7, .25, 1);
}
@keyframes rsm-pop {
    from { opacity: 0; transform: translateY(12px) scale(0.96); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
.rutube-shorts-modal__frame {
    width: 100%;
    height: 100%;
}
.rutube-shorts-modal__frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.rutube-shorts-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #31a900;
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    padding: 0;
    transition: background .2s ease, transform .2s ease;
}
.rutube-shorts-modal__close:hover,
.rutube-shorts-modal__close:focus-visible {
    background: #fff;
    transform: scale(1.05);
    outline: none;
}

/* Responsive width — mirror the existing .home-page__carousel breakpoints
   from /css/custom.css + /css/media_3.0.css so this panel aligns with the
   neighbour product carousels. */

@media (max-width: 1600px) {
    .rutube-shorts {
        max-width: 1200px;
    }
}
@media (max-width: 1300px) {
    .rutube-shorts {
        max-width: 80%;
    }
}
@media (max-width: 1080px) {
    .rutube-shorts {
        max-width: none;
        margin-left: 40px;
        margin-right: 40px;
    }
}
@media (max-width: 992px) {
    .rutube-shorts {
        padding: 22px 16px 28px;
        border-radius: 20px;
    }
    .rutube-shorts__title { margin-bottom: 16px; }
    .rutube-shorts__title-text { font-size: 22px; }
    .rutube-shorts .slick-prev { left: 0; }
    .rutube-shorts .slick-next { right: 0; }
}
@media (max-width: 896px) {
    .rutube-shorts {
        margin: 20px;
    }
}
@media (max-width: 480px) {
    .rutube-shorts {
        margin: 16px;
        padding: 16px 12px 22px;
        border-radius: 16px;
    }
    .rutube-shorts__title { gap: 8px; flex-wrap: nowrap; }
    .rutube-shorts__title-text {
        font-size: 16px;
        letter-spacing: 0.03em;
        white-space: nowrap;
    }
    .rutube-shorts__title-link { font-size: 12px; }
    .rutube-shorts__title-link a {
        min-height: 40px;
        padding: 6px 14px;
        gap: 4px;
    }
    .rutube-shorts__title-link a::after { content: ''; } /* drop arrow on phone — too cramped */
    .rutube-short-card { padding: 8px; border-radius: 14px; }
    .rutube-short-card__thumb-title { font-size: 14px; -webkit-line-clamp: 5; }
    .rutube-short-card__play { width: 48px; height: 48px; margin: -24px 0 0 -24px; }
    .rutube-short-card__play svg { width: 22px; height: 22px; }
    .rutube-shorts-modal__dialog { border-radius: 18px; }
    /* On phones the 9:16 card at full slide-width is taller than the
       viewport between the search header and bottom tab bar. Cap the card
       width and center it inside the slide. Slick wraps each slide in
       <div class="slick-slide">, so we must reach into that wrapper too,
       not just our own .rutube-shorts__slide. */
    .rutube-shorts__slick.slick-initialized .slick-slide,
    .rutube-shorts__slick.slick-initialized .slick-slide > div,
    .rutube-shorts__slide {
        display: flex;
        justify-content: center;
    }
    .rutube-short-card {
        width: 100%;
        max-width: 220px;
        margin: 0 auto;
    }
}
