/* Homepage polish: hero scroll cue, centred mobile CTAs, card buttons, section spacing,
   and the 3D coverflow card carousels (JS: assets/js/card-coverflow.js). Loaded last. */

/* ---------- Hero: centred animated scroll cue ---------- */
.hero-scroll-cue {
    position: absolute;
    left: 50%;
    bottom: max(18px, 3.5vh);
    z-index: 6;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 8px;
    color: var(--s3-emerald, var(--primary, #154b34));
    text-decoration: none;
    opacity: 0;
    animation: hscIn .8s ease 1.2s forwards;
}
.hero-scroll-cue:hover,
.hero-scroll-cue:focus-visible { color: var(--s3-emerald, var(--primary, #154b34)); }
.hero-scroll-cue:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 16px; }
.hsc-mouse {
    position: relative;
    width: 26px;
    height: 40px;
    border: 2px solid currentColor;
    border-radius: 14px;
    box-shadow: 0 6px 18px -8px rgba(0, 0, 0, .35);
}
.hsc-wheel {
    position: absolute;
    left: 50%;
    top: 7px;
    width: 4px;
    height: 8px;
    margin-left: -2px;
    border-radius: 2px;
    background: #c9a24e;
    animation: hscWheel 1.6s cubic-bezier(.6, 0, .4, 1) infinite;
}
.hsc-chevrons { display: flex; flex-direction: column; align-items: center; }
.hsc-chevrons i {
    display: block;
    width: 10px;
    height: 10px;
    margin-top: -4px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    opacity: 0;
    animation: hscChev 1.6s ease-in-out infinite;
}
.hsc-chevrons i:nth-child(2) { animation-delay: .2s; }
@keyframes hscIn { to { opacity: 1; } }
@keyframes hscWheel {
    0% { opacity: 0; transform: translateY(0); }
    20% { opacity: 1; }
    70% { opacity: 0; transform: translateY(12px); }
    100% { opacity: 0; transform: translateY(12px); }
}
@keyframes hscChev {
    0%, 100% { opacity: 0; transform: rotate(45deg) translate(-3px, -3px); }
    50% { opacity: 1; transform: rotate(45deg) translate(0, 0); }
}
.hero-dive { display: none !important; }

/* ---------- Hero CTAs centred on mobile ---------- */
@media (max-width: 767.98px) {
    #home .hero-btns,
    body.ui-scene-3d #home .hero-btns {
        display: flex;
        width: 100%;
        justify-content: center !important;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        margin-inline: auto;
    }
    #home .hero-btns .hero-cta { flex: 0 1 auto; min-width: 140px; justify-content: center; text-align: center; }
    body.ui-scene-3d #home .hero-layout { padding-bottom: 17vh !important; }
}

/* ---------- Service card "Book appointment": one clean filled pill ---------- */
html .h-card-service .service-book-btn,
html .service-book-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 40px;
    padding: 9px 14px;
    border: 0 !important;
    border-radius: 999px !important;
    background: var(--s3-emerald, var(--primary, #154b34)) !important;
    color: #fff !important;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 8px 18px -10px rgba(11, 61, 42, .7) !important;
    transform: none;
}
html .service-book-btn:hover,
html .service-book-btn:focus-visible {
    background: var(--primary-dark, #0b3d2a) !important;
    color: #fff !important;
    transform: translateY(-1px);
}
html .service-book-btn:active { transform: translateY(1px); }
html .service-book-btn i { color: inherit !important; }

/* ---------- A little more breathing room in sections ---------- */
#appShell > .app-section:not(.hero-section) {
    padding-top: clamp(44px, 7vw, 84px) !important;
    padding-bottom: clamp(44px, 7vw, 84px) !important;
}
#appShell > .app-section:not(.hero-section) > .container,
#appShell > .app-section:not(.hero-section) > .container-fluid {
    padding-left: max(20px, env(safe-area-inset-left));
    padding-right: max(20px, env(safe-area-inset-right));
}
#appShell .app-section .section-head,
#appShell .app-section .section-title { margin-bottom: 1.25rem; }

/* ---------- 3D coverflow card carousels ---------- */
.ne-cf.ne-cf {
    --cf-w: clamp(220px, 64vw, 300px);
    --cf-gap: 22px;
    position: relative;
    /* full-bleed so the blurred neighbours peek in from the screen edges */
    width: 100vw !important;
    max-width: 100vw !important;
    margin-left: calc(50% - 50vw) !important;
    margin-right: calc(50% - 50vw) !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: var(--cf-gap) !important;
    overflow-x: auto;
    overflow-y: visible;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 18px calc(50% - var(--cf-w) / 2) 28px !important;
    justify-content: flex-start !important;
}
.ne-cf.ne-cf::-webkit-scrollbar { display: none; }
.ne-cf.ne-cf > * {
    flex: 0 0 var(--cf-w) !important;
    width: var(--cf-w) !important;
    max-width: none !important;
    min-width: 0 !important;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    transform:
        perspective(1000px)
        translateX(calc(var(--cf-d, 0) * -8%))
        translateZ(calc(var(--cf-a, 0) * -90px))
        rotateY(calc(var(--cf-d, 0) * -32deg))
        scale(calc(1 - var(--cf-a, 0) * .1));
    filter: blur(calc(var(--cf-a, 0) * 2.6px)) saturate(calc(1 - var(--cf-a, 0) * .25));
    opacity: calc(1 - var(--cf-a, 0) * .3);
    transition: transform .25s ease-out, filter .25s ease-out, opacity .25s ease-out;
    will-change: transform;
}
.ne-cf.ne-cf > .is-cf-center { z-index: 2; }
.ne-cf.ne-cf > :not(.is-cf-center) { cursor: pointer; }
.ne-cf.ne-cf > :not(.is-cf-center) * { pointer-events: none; }
/* Wider screens: same carousel, cards a touch narrower than a phone screen */
@media (min-width: 768px) {
    .ne-cf.ne-cf { --cf-w: 300px; --cf-gap: 30px; }
}
@media (prefers-reduced-motion: reduce) {
    .hero-scroll-cue, .hsc-wheel, .hsc-chevrons i { animation: none !important; opacity: 1 !important; }
    .ne-cf.ne-cf > * { transition: none; }
}

/* ---------- Swipe parallax: images slide inside their card as it moves across ---------- */
.ne-cf.ne-cf > * { overflow: hidden; }
.ne-cf.ne-cf > * > img.service-thumb,
.ne-cf.ne-cf > .h-card-blog > img,
.ne-cf.ne-cf .review-media img {
    transform: translateX(calc(var(--cf-d, 0) * -9%)) scale(1.2);
    transform-origin: center;
    transition: none;
    will-change: transform;
}
.ne-cf.ne-cf .review-media { overflow: hidden; }
.ne-cf.ne-cf .osc-header {
    background-position: calc(50% + var(--cf-d, 0) * 40%) center !important;
}
.ne-cf.ne-cf > .h-card-why > :first-child {
    transform: translateX(calc(var(--cf-d, 0) * -18px));
}
.ne-cf.ne-cf > .is-previewing { visibility: hidden; }

/* ---------- Card zoom preview ---------- */
.ne-card-preview {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    display: grid;
    place-items: center;
    padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
    overflow-y: auto;
    background: rgba(5, 33, 22, 0);
    -webkit-backdrop-filter: blur(0);
    backdrop-filter: blur(0);
    transition: background .35s ease, backdrop-filter .35s ease, -webkit-backdrop-filter .35s ease;
    cursor: zoom-out;
}
.ne-card-preview.is-open {
    background: rgba(5, 33, 22, .42);
    -webkit-backdrop-filter: blur(16px) saturate(1.2);
    backdrop-filter: blur(16px) saturate(1.2);
}
.ne-card-preview-stage { position: relative; width: min(88vw, 420px); }
.ne-card-preview-card {
    width: 100% !important;
    max-width: none !important;
    max-height: calc(100dvh - 60px);
    overflow: auto !important;
    margin: 0 !important;
    transform: none;
    filter: none !important;
    opacity: 1 !important;
    cursor: auto;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .65), 0 0 0 1px rgba(255, 255, 255, .6) !important;
    transform-origin: center;
}
.ne-card-preview-card img.service-thumb,
.ne-card-preview-card > img { width: 100%; max-height: 46vh; object-fit: cover; }
.ne-card-preview-card .text-truncate,
.ne-card-preview-card [class*="desc"] { -webkit-line-clamp: unset !important; line-clamp: unset !important; white-space: normal !important; overflow: visible !important; }
.ne-card-preview-close {
    position: absolute;
    top: -14px;
    right: -10px;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255, 255, 255, .6);
    border-radius: 50%;
    background: rgba(255, 255, 255, .85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #0b3d2a;
    font-size: 24px;
    line-height: 1;
    box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .5);
    opacity: 0;
    transform: scale(.6);
    transition: opacity .25s ease .2s, transform .25s ease .2s;
    cursor: pointer;
}
.ne-card-preview.is-open .ne-card-preview-close { opacity: 1; transform: none; }
html.ne-card-preview-open, html.ne-card-preview-open body { overflow: hidden; }
@media (prefers-reduced-motion: reduce) {
    .ne-card-preview, .ne-card-preview-close { transition: none; }
    .ne-cf.ne-cf > * > img.service-thumb,
    .ne-cf.ne-cf > .h-card-blog > img,
    .ne-cf.ne-cf .review-media img { transform: none; }
}

/* ---------- Offers overlay: same 3D coverflow, sized to the popup instead of full-bleed ---------- */
body.app-body .offers-popup { padding-left: 0 !important; padding-right: 0 !important; }
.offers-popup .offers-popup-panel { width: min(760px, 100%) !important; }
.offers-popup .offers-popup-close { right: 14px !important; }
.offers-popup .offers-carousel.ne-cf {
    --cf-w: min(66vw, 340px);
    --cf-gap: 22px;
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding: 18px calc(50% - var(--cf-w) / 2) 24px !important;
}
.offers-popup .offers-carousel.ne-cf > .offers-carousel-slide {
    min-width: 0 !important;
    height: auto;
}
.offers-popup .offers-carousel.ne-cf > .offers-carousel-slide .offer-summary-card { max-height: min(74vh, 660px); }
