/**
 * Home hero - scoped to .home-hero-refined only (index.php).
 * Uses existing palette; optional split layout when media file exists.
 */

.home-hero-refined {
    margin: 0;
    padding: clamp(1.72rem, 4.65vw, 2.88rem) 0 clamp(1.32rem, 3.55vw, 2.12rem);
    text-align: center;
}

/* Mobile-only polish: calm premium hero backdrop + cleaner typography/buttons */
@media (max-width: 768px) {
    body.home-index .home-hero-refined--bg-video {
        min-height: min(29svh, 220px) !important;
        padding: 0 !important;
        overflow: hidden;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__shell {
        min-height: min(29svh, 220px) !important;
        width: 100%;
        max-width: 100%;
        padding: 0.8rem 14px 0.55rem !important;
        display: grid;
        place-items: center;
        box-sizing: border-box;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__copy {
        width: min(90vw, 320px) !important;
        margin: 0 auto !important;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__inner {
        width: 100% !important;
        max-width: 100% !important;
        gap: 0.45rem !important;
        padding: 0 !important;
    }

    /* Keep lifestyle backdrop, but make it calm and subordinate to content */
    body.home-index .home-hero-refined--bg-video .home-hero-refined__bg-film {
        filter: saturate(0.7) contrast(0.86) brightness(1.03);
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__bg-still,
    body.home-index .home-hero-refined--bg-video .home-hero-refined__bg-video {
        transform: scale(1.08);
        object-position: center 38%;
        opacity: 0.62;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__bg-overlay {
        background:
            linear-gradient(
                180deg,
                rgba(250, 247, 245, 0.82) 0%,
                rgba(250, 247, 245, 0.74) 48%,
                rgba(250, 247, 245, 0.84) 100%
            ),
            radial-gradient(ellipse 90% 68% at 50% 38%, rgba(255, 255, 255, 0.36), transparent 72%);
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__title {
        font-size: clamp(1.12rem, 4.4vw, 1.32rem) !important;
        line-height: 1.22 !important;
        font-weight: 600 !important;
        letter-spacing: -0.01em !important;
        margin: 0 0 0.28rem !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__subtitle {
        font-size: 0.82rem !important;
        line-height: 1.42 !important;
        color: rgba(44, 44, 44, 0.78) !important;
        margin: 0 0 0.52rem !important;
        max-width: 30ch !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__actions {
        gap: 0.38rem !important;
        margin-top: 0 !important;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__cta {
        min-height: 2rem !important;
        padding: 0.34rem 0.9rem !important;
        font-size: 0.76rem !important;
        border-radius: 999px;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__cta--primary {
        min-width: 168px !important;
        box-shadow: 0 6px 16px rgba(184, 90, 58, 0.22) !important;
    }

    body.home-index .home-hero-refined--bg-video .home-hero-refined__cta--secondary {
        min-width: 148px !important;
        border: 1px solid rgba(61, 53, 46, 0.18) !important;
        background: rgba(255, 255, 255, 0.58) !important;
        color: rgba(61, 53, 46, 0.86) !important;
    }
}

/* FINAL mobile override: ensure collage is clearly visible (still soft) */
@media (max-width: 768px) {
    body.home-index .home-hero-refined::before {
        opacity: 0.46 !important;
        filter: blur(0.9px) saturate(0.9) contrast(0.92) !important;
        transform: scale(1.015) !important;
        background-size:
            36% 42%,
            31% 36%,
            34% 38%,
            31% 35%,
            28% 32% !important;
    }

    body.home-index .home-hero-refined::after {
        background:
            radial-gradient(ellipse 62% 48% at 50% 48%, rgba(248, 244, 239, 0.56), rgba(248, 244, 239, 0.5) 62%, rgba(248, 244, 239, 0.44) 100%),
            rgba(248, 244, 239, 0.46) !important;
    }
}

/* Mobile-only hero background replacement:
 * soft editorial collage (4-6 tiles) from selected image + light overlay.
 * Keeps existing content sizing/spacing/typography untouched.
 */
@media (max-width: 768px) {
    body.home-index .home-hero-refined {
        position: relative;
        isolation: isolate;
    }

    body.home-index .home-hero-refined::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 1;
        pointer-events: none;
        background-color: #f6f1ec;
        background-image:
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image);
        background-size:
            34% 40%,
            30% 34%,
            32% 36%,
            29% 33%,
            26% 30%;
        background-position:
            9% 12%,
            88% 14%,
            13% 82%,
            86% 80%,
            50% -3%;
        background-repeat: no-repeat;
        filter: blur(0.8px) saturate(0.84) contrast(0.9);
        transform: scale(1.02);
        transform-origin: center center;
        opacity: 0.32;
    }

    body.home-index .home-hero-refined::after {
        content: "";
        position: absolute;
        inset: 0;
        z-index: 2;
        pointer-events: none;
        background:
            radial-gradient(ellipse 62% 48% at 50% 48%, rgba(248, 244, 239, 0.72), rgba(248, 244, 239, 0.64) 62%, rgba(248, 244, 239, 0.56) 100%),
            rgba(248, 244, 239, 0.6);
    }

    body.home-index .home-hero-refined .home-hero-refined__bg,
    body.home-index .home-hero-refined .home-hero-refined__media {
        display: none !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__shell {
        position: relative;
        z-index: 3;
    }
}

/* ========================================================================== */
/* Mobile hero - explicit visual redesign (hero section only, no other areas) */
/* ========================================================================== */
@media (max-width: 768px) {
    body.home-index .home-hero-refined {
        padding-top: 28px !important;
        padding-bottom: 36px !important;
        min-height: 248px !important;
        text-align: center !important;
        position: relative !important;
        overflow: hidden !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__shell {
        position: relative !important;
        z-index: 4 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: 0 !important;
        margin: 0 auto !important;
        padding: 0 14px !important;
        display: grid !important;
        place-items: center !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__copy,
    body.home-index .home-hero-refined .home-hero-refined__inner {
        width: 100% !important;
        max-width: 320px !important;
        margin: 0 auto !important;
        text-align: center !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Calm backdrop layer above collage, below content */
    body.home-index .home-hero-refined::after {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 2 !important;
        pointer-events: none !important;
        background: rgba(248, 244, 239, 0.82) !important;
    }

    /* Background media strongly reduced in dominance */
    body.home-index .home-hero-refined .home-hero-refined__bg,
    body.home-index .home-hero-refined .home-hero-refined__media {
        z-index: 1 !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__bg-still,
    body.home-index .home-hero-refined .home-hero-refined__bg-video,
    body.home-index .home-hero-refined .home-hero-refined__media-el {
        opacity: 0.28 !important;
        filter: blur(1px) saturate(0.7) contrast(0.82) !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__bg-overlay {
        z-index: 2 !important;
        background: rgba(248, 244, 239, 0.82) !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__title {
        font-size: 28px !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        max-width: 300px !important;
        margin: 0 auto 14px auto !important;
        text-align: center !important;
        color: #2f2a27 !important;
        letter-spacing: normal !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__subtitle {
        font-size: 16px !important;
        line-height: 1.5 !important;
        font-weight: 400 !important;
        max-width: 290px !important;
        margin: 0 auto 22px auto !important;
        text-align: center !important;
        color: rgba(47, 42, 39, 0.72) !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__actions {
        width: 100% !important;
        gap: 0 !important;
        align-items: center !important;
        justify-content: center !important;
        flex-direction: column !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__cta--primary {
        height: 56px !important;
        min-height: 56px !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto 12px auto !important;
        border-radius: 999px !important;
        font-size: 18px !important;
        font-weight: 700 !important;
        box-shadow: 0 8px 18px rgba(184, 90, 58, 0.2) !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__cta--secondary {
        height: 52px !important;
        min-height: 52px !important;
        width: 100% !important;
        max-width: 300px !important;
        margin: 0 auto !important;
        border-radius: 999px !important;
        font-size: 17px !important;
        font-weight: 600 !important;
        background: rgba(255, 255, 255, 0.72) !important;
        border: 1px solid rgba(61, 53, 46, 0.18) !important;
        color: rgba(47, 42, 39, 0.88) !important;
        box-shadow: none !important;
    }
}

/* Mobile-only: when hero is in split mode, convert it to calm centered backdrop layout. */
@media (max-width: 768px) {
    body.home-index .home-hero-refined--split {
        position: relative !important;
        overflow: hidden !important;
        text-align: center !important;
        padding: 0 !important;
        min-height: min(29svh, 220px) !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__media {
        display: block !important;
        position: absolute !important;
        inset: 0 !important;
        width: 100% !important;
        max-width: none !important;
        margin: 0 !important;
        z-index: 0 !important;
        pointer-events: none !important;
        order: 0 !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__figure {
        width: 100% !important;
        height: 100% !important;
        margin: 0 !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        background: #ebe4de !important;
        aspect-ratio: auto !important;
        max-height: none !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__media-el {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center 38% !important;
        filter: saturate(0.68) contrast(0.84) brightness(1.03) !important;
        opacity: 0.58 !important;
        transform: scale(1.07) !important;
        transform-origin: center center !important;
    }

    body.home-index .home-hero-refined--split::before {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 1 !important;
        pointer-events: none !important;
        background:
            linear-gradient(
                180deg,
                rgba(250, 247, 245, 0.84) 0%,
                rgba(250, 247, 245, 0.74) 50%,
                rgba(250, 247, 245, 0.85) 100%
            ),
            radial-gradient(ellipse 90% 68% at 50% 38%, rgba(255, 255, 255, 0.38), transparent 72%);
    }

    body.home-index .home-hero-refined--split .home-hero-refined__shell {
        position: relative !important;
        z-index: 2 !important;
        display: grid !important;
        place-items: center !important;
        width: 100% !important;
        min-height: min(29svh, 220px) !important;
        max-width: 100% !important;
        padding: 0.8rem 14px 0.55rem !important;
        box-sizing: border-box !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__copy {
        width: min(90vw, 320px) !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__inner {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 !important;
        gap: 0.45rem !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__title {
        font-size: clamp(1.12rem, 4.4vw, 1.32rem) !important;
        line-height: 1.22 !important;
        margin: 0 0 0.28rem !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__subtitle {
        font-size: 0.82rem !important;
        line-height: 1.42 !important;
        color: rgba(44, 44, 44, 0.78) !important;
        margin: 0 0 0.52rem !important;
        max-width: 30ch !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__actions {
        justify-content: center !important;
        gap: 0.38rem !important;
        margin-top: 0 !important;
    }
}

.home-hero-refined__shell {
    max-width: 56rem;
    margin-inline: auto;
    padding-inline: clamp(0.35rem, 2vw, 0.5rem);
}

.home-hero-refined__copy {
    width: 100%;
}

.home-hero-refined__inner {
    max-width: 36rem;
    margin-inline: auto;
    padding-inline: clamp(0.25rem, 1.5vw, 0.35rem);
    padding-block: clamp(0.15rem, 0.9vw, 0.45rem);
}

/* Split: text + media side by side (desktop) */
.home-hero-refined--split {
    text-align: start;
    padding-inline: 0;
}

.home-hero-refined--split .home-hero-refined__shell {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(1.25rem, 3.5vw, 2rem);
    align-items: center;
    max-width: min(1040px, 100%);
}

.home-hero-refined--split .home-hero-refined__copy {
    text-align: start;
}

.home-hero-refined--split .home-hero-refined__inner {
    margin-inline: 0;
    max-width: 32rem;
}

.home-hero-refined--split .home-hero-refined__actions {
    justify-content: flex-start;
}

.home-hero-refined__media {
    width: 100%;
    max-width: 22rem;
    margin-inline: auto;
}

.home-hero-refined__figure {
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid rgba(61, 53, 46, 0.1);
    background: linear-gradient(145deg, rgba(255, 253, 251, 0.5) 0%, rgba(250, 247, 243, 0.85) 100%);
    box-shadow:
        0 1px 0 rgba(255, 255, 255, 0.5) inset,
        0 20px 48px rgba(61, 53, 46, 0.08);
    aspect-ratio: 4 / 3;
}

@media (hover: hover) and (pointer: fine) {
    .home-hero-refined__figure {
        transition:
            box-shadow 0.42s ease,
            transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
            border-color 0.32s ease;
    }

    .home-hero-refined__figure:hover {
        transform: translateY(-2px);
        border-color: rgba(61, 53, 46, 0.14);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.55) inset,
            0 26px 56px rgba(61, 53, 46, 0.1);
    }
}

.home-hero-refined__media-el {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.home-hero-refined__media-el--video {
    object-fit: cover;
    background: #2a2623;
}

@media (min-width: 768px) {
    .home-hero-refined--split .home-hero-refined__shell {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        gap: clamp(1.5rem, 4vw, 2.75rem);
    }

    .home-hero-refined--split .home-hero-refined__media {
        margin-inline: 0;
        max-width: none;
    }

    .home-hero-refined--split .home-hero-refined__figure {
        aspect-ratio: 5 / 4;
    }
}

@media (max-width: 767px) {
    .home-hero-refined--split .home-hero-refined__media {
        order: -1;
        max-width: min(20rem, 88vw);
    }

    .home-hero-refined--split .home-hero-refined__shell {
        display: flex;
        flex-direction: column;
    }
}

/* Split hero on mobile/tablet: always stack and center copy (prevents RTL right-stuck text). */
@media (max-width: 1024px) {
    body.home-index .home-hero-refined {
        text-align: center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__shell {
        width: 100%;
        margin-inline: auto !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__copy {
        width: 100% !important;
        text-align: center !important;
        margin-inline: auto !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__inner {
        width: min(92vw, 34rem) !important;
        margin-inline: auto !important;
        text-align: center !important;
        align-items: center !important;
        position: static !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        inset-inline-start: auto !important;
        inset-inline-end: auto !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__title,
    body.home-index .home-hero-refined .home-hero-refined__subtitle {
        width: 100%;
        text-align: center !important;
        margin-inline: auto !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__actions {
        justify-content: center !important;
    }

    body.home-index .home-hero-refined--split {
        text-align: center !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__shell {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        width: 100%;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__copy,
    body.home-index .home-hero-refined--split .home-hero-refined__inner,
    body.home-index .home-hero-refined--split .home-hero-refined__title,
    body.home-index .home-hero-refined--split .home-hero-refined__subtitle {
        text-align: center !important;
        margin-inline: auto !important;
    }

    body.home-index .home-hero-refined--split .home-hero-refined__actions {
        justify-content: center !important;
    }

    /* Final guard: ensure no RTL/right offset can move hero copy off-center. */
    body.home-index .home-hero-refined .home-hero-refined__copy {
        position: static !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        margin-inline: auto !important;
    }
}

.home-hero-refined__title {
    margin: 0 0 clamp(1.02rem, 2.65vw, 1.42rem);
    font-size: clamp(1.48rem, 4.35vw, 2.12rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.021em;
    color: #2c2c2c;
}

.home-hero-refined__subtitle {
    margin: 0 auto clamp(1.58rem, 3.75vw, 2.18rem);
    max-width: 32em;
    font-size: clamp(0.95rem, 2.15vw, 1.06rem);
    font-weight: 400;
    line-height: 1.56;
    color: #6b6b6b;
}

.home-hero-refined--split .home-hero-refined__subtitle {
    margin-inline: 0;
}

.home-hero-refined__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.78rem 0.92rem;
    justify-content: center;
    align-items: center;
}

.home-hero-refined__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.65rem;
    padding: 0.55rem 1.35rem;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition:
        background-color 0.22s ease,
        color 0.22s ease,
        border-color 0.22s ease,
        box-shadow 0.28s ease,
        transform 0.22s ease,
        filter 0.22s ease;
}

.home-hero-refined__cta:focus-visible {
    outline: 2px solid #b85a3a;
    outline-offset: 3px;
}

.home-hero-refined__cta--primary {
    background: #b85a3a;
    color: #fff;
    border: 1px solid transparent;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.home-hero-refined__cta--primary:hover {
    background: #9e4a2f;
    color: #fff;
}

@media (hover: hover) and (pointer: fine) {
    .home-hero-refined__cta--primary:hover {
        filter: brightness(1.04);
        box-shadow: 0 6px 20px rgba(184, 90, 58, 0.3);
        transform: translateY(-1px);
    }

    .home-hero-refined__cta--secondary:hover {
        border-color: rgba(184, 90, 58, 0.35);
        color: #3a3530;
        background: rgba(255, 255, 255, 0.45);
        transform: translateY(-1px);
    }
}

.home-hero-refined__cta--secondary {
    background: transparent;
    color: #5a5a5a;
    border: 1px solid rgba(61, 53, 46, 0.18);
}

.home-hero-refined__cta--secondary:hover {
    border-color: rgba(184, 90, 58, 0.35);
    color: #3a3530;
}

body.dark-mode .home-hero-refined__title,
html[data-theme="dark"] .home-hero-refined__title {
    color: #f2efe9;
}

body.dark-mode .home-hero-refined__subtitle,
html[data-theme="dark"] .home-hero-refined__subtitle {
    color: #b8b0a6;
}

body.dark-mode .home-hero-refined__figure,
html[data-theme="dark"] .home-hero-refined__figure {
    border-color: rgba(255, 255, 255, 0.08);
    background: linear-gradient(145deg, rgba(40, 38, 36, 0.9) 0%, rgba(28, 26, 24, 0.95) 100%);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

body.dark-mode .home-hero-refined__cta--secondary,
html[data-theme="dark"] .home-hero-refined__cta--secondary {
    color: #d4cdc4;
    border-color: rgba(255, 255, 255, 0.14);
}

body.dark-mode .home-hero-refined__cta--secondary:hover,
html[data-theme="dark"] .home-hero-refined__cta--secondary:hover {
    color: #fff;
    border-color: rgba(184, 90, 58, 0.45);
}

@media (max-width: 480px) {
    .home-hero-refined__actions {
        flex-direction: column;
        width: 100%;
    }

    .home-hero-refined__cta {
        width: 100%;
        max-width: 280px;
    }

    .home-hero-refined--split .home-hero-refined__actions {
        align-items: stretch;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-refined__cta {
        transition: none;
    }

    .home-hero-refined__figure {
        transition: none !important;
    }

    .home-hero-refined__figure:hover {
        transform: none !important;
    }
}

#home-premium-picks,
#home-deals,
#home-hot,
#home-latest,
#homeDiscoverBar {
    scroll-margin-top: 1rem;
}

/* ---- Optional full-bleed background video (uploads/branding/home_hero_bg.*) ---- */
.home-hero-refined--bg-video {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    text-align: center;
    padding: clamp(2.75rem, 7vw, 4.25rem) clamp(1.25rem, 4vw, 2rem) clamp(2.25rem, 5.5vw, 3.5rem);
    margin-inline: calc(50% - 50vw);
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
    min-height: min(48vh, 380px);
}

/* 100vw כולל רוחב פס גלילה בחלק מהדפדפנים → חריגה אופקית; small viewport מתאים יותר */
@supports (width: 100svw) {
    .home-hero-refined--bg-video {
        width: 100svw;
        max-width: 100svw;
        margin-inline: calc(50% - 50svw);
    }
}

.home-hero-refined--bg-video .home-hero-refined__shell {
    position: relative;
    z-index: 2;
    max-width: 56rem;
}

.home-hero-refined__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.home-hero-refined__bg-film {
    position: absolute;
    inset: 0;
    overflow: hidden;
    background: #ebe4de;
}

body.dark-mode .home-hero-refined__bg-film,
html[data-theme="dark"] .home-hero-refined__bg-film {
    background: #1c1c1c;
}

.home-hero-refined__bg-still,
.home-hero-refined__bg-video {
    position: absolute;
    left: 50%;
    top: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%) scale(1.03);
    object-fit: cover;
}

.home-hero-refined__bg-still {
    z-index: 0;
}

.home-hero-refined__bg-video {
    z-index: 1;
    border: 0;
    outline: none;
    appearance: none;
}

.home-hero-refined__bg-video::-webkit-media-controls {
    display: none !important;
}

.home-hero-refined__bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(
            180deg,
            rgba(250, 247, 245, 0.85) 0%,
            rgba(250, 247, 245, 0.62) 42%,
            rgba(250, 247, 245, 0.82) 100%
        ),
        radial-gradient(ellipse 90% 70% at 50% 38%, rgba(255, 255, 255, 0.4), transparent 70%);
    pointer-events: none;
}

body.dark-mode .home-hero-refined--bg-video .home-hero-refined__bg-overlay,
html[data-theme="dark"] .home-hero-refined--bg-video .home-hero-refined__bg-overlay {
    background:
        linear-gradient(
            180deg,
            rgba(22, 22, 22, 0.76) 0%,
            rgba(22, 22, 22, 0.55) 48%,
            rgba(22, 22, 22, 0.72) 100%
        ),
        radial-gradient(ellipse 85% 60% at 50% 32%, rgba(0, 0, 0, 0.24), transparent 68%);
}

.home-hero-refined--bg-video .home-hero-refined__title {
    text-shadow: 0 1px 0 rgba(255, 253, 251, 0.72);
}

.home-hero-refined--bg-video .home-hero-refined__subtitle {
    text-shadow: 0 1px 0 rgba(255, 253, 251, 0.55);
}

body.dark-mode .home-hero-refined--bg-video .home-hero-refined__title,
html[data-theme="dark"] .home-hero-refined--bg-video .home-hero-refined__title {
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

body.dark-mode .home-hero-refined--bg-video .home-hero-refined__subtitle,
html[data-theme="dark"] .home-hero-refined--bg-video .home-hero-refined__subtitle {
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

/* Mobile / tablet narrow: static frame when a poster/still asset exists (lighter, no decode churn) */
@media (max-width: 1024px) {
    .home-hero-refined--bg-video.home-hero-refined--bg-has-poster .home-hero-refined__bg-video {
        display: none;
    }

    /*
     * Full-bleed via 100vw + calc(50% - 50vw) tracks the *layout* viewport; on scroll the mobile
     * toolbar changes vw → the hero (and its image/video) “breathes” → visible flicker.
     * Break out using the same horizontal padding as .container (responsive.css) instead of vw.
     */
    /* Match effective main.container horizontal padding on mobile (accessibility-widget.css uses 14px !important ≤768px). */
    .home-hero-refined--bg-video {
        width: calc(100% + 28px);
        max-width: none;
        margin-inline: -14px;
        min-height: 300px;
    }

    /*
     * Centering with transform + scale(1.03) promotes a composited layer that often tears/flickers
     * while scrolling on iOS/Android; inset + cover keeps edges clean without subpixel nudging.
     */
    .home-hero-refined__bg-film {
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }

    .home-hero-refined__bg-still,
    .home-hero-refined__bg-video {
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        min-width: 0;
        min-height: 0;
        margin: auto;
        transform: none;
        object-fit: cover;
        object-position: center;
    }
}

@supports (min-height: 1svh) {
    @media (max-width: 1024px) {
        .home-hero-refined--bg-video {
            min-height: min(46svh, 360px);
        }
    }
}

/* Decode / source failure: still or film + overlay only */
.home-hero-refined--bg-video.home-hero-refined--bg-fallback .home-hero-refined__bg-video {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .home-hero-refined--bg-video .home-hero-refined__bg-video {
        display: none;
    }
}

/* Home hero mobile-only premium editorial tuning (no desktop impact) */
@media (max-width: 768px) {
    body.home-index .home-hero-refined {
        padding-top: 22px !important;
        padding-bottom: 28px !important;
        min-height: 228px !important;
        text-align: center !important;
        position: relative !important;
        overflow: hidden !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__shell {
        position: relative !important;
        z-index: 4 !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 14px !important;
        min-height: 0 !important;
        display: grid !important;
        place-items: center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__copy,
    body.home-index .home-hero-refined .home-hero-refined__inner {
        width: 100% !important;
        max-width: 290px !important;
        margin: 0 auto !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__inner {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
        padding: 0 !important;
    }

    /* soft luxury collage backdrop */
    body.home-index .home-hero-refined::before {
        content: "" !important;
        position: absolute !important;
        inset: 0 !important;
        z-index: 1 !important;
        pointer-events: none !important;
        background-color: #f6f1ec !important;
        background-image:
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image),
            var(--hero-mobile-bg-image) !important;
        background-repeat: no-repeat !important;
        background-size:
            36% 42%,
            30% 34%,
            34% 38%,
            30% 34%,
            28% 32% !important;
        background-position:
            8% 14%,
            86% 12%,
            13% 82%,
            84% 80%,
            50% -4% !important;
        opacity: 0.42 !important;
        filter: blur(0.9px) saturate(0.9) contrast(0.92) !important;
        transform: scale(1.015) !important;
        transform-origin: center center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__bg,
    body.home-index .home-hero-refined .home-hero-refined__media {
        display: none !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__bg-still,
    body.home-index .home-hero-refined .home-hero-refined__bg-video,
    body.home-index .home-hero-refined .home-hero-refined__media-el {
        opacity: 0 !important;
        filter: none !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__bg-overlay {
        background:
            radial-gradient(ellipse 62% 48% at 50% 48%, rgba(248, 244, 239, 0.58), rgba(248, 244, 239, 0.52) 62%, rgba(248, 244, 239, 0.46) 100%),
            rgba(248, 244, 239, 0.48) !important;
        z-index: 2 !important;
    }

    /* Hide extra collage tiles in split mode on mobile */
    body.home-index .home-hero-refined--split .home-hero-refined__media {
        opacity: 0.18 !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__title {
        font-size: 22px !important;
        line-height: 1.3 !important;
        font-weight: 700 !important;
        max-width: 280px !important;
        margin: 0 auto 12px auto !important;
        text-align: center !important;
        color: #2f2a27 !important;
        letter-spacing: normal !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__subtitle {
        font-size: 15px !important;
        line-height: 1.45 !important;
        max-width: 270px !important;
        color: rgba(47, 42, 39, 0.62) !important;
        margin: 0 auto 20px auto !important;
        text-align: center !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__actions {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0 !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__cta--primary {
        height: 48px !important;
        min-height: 48px !important;
        width: 100% !important;
        max-width: 240px !important;
        margin: 0 auto 10px auto !important;
        border-radius: 999px !important;
        font-size: 16px !important;
        font-weight: 700 !important;
        box-shadow: 0 8px 20px rgba(191, 100, 62, 0.16) !important;
    }

    body.home-index .home-hero-refined .home-hero-refined__cta--secondary {
        height: 44px !important;
        min-height: 44px !important;
        width: 100% !important;
        max-width: 230px !important;
        margin: 0 auto !important;
        border-radius: 999px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        background: rgba(255, 255, 255, 0.72) !important;
        border: 1px solid rgba(191, 181, 170, 0.55) !important;
        color: #3a342f !important;
        backdrop-filter: blur(6px);
        -webkit-backdrop-filter: blur(6px);
    }
}
