/* Sana Motion Enhancements 1.2.0 — isolated visual layer only */
:root {
    --sana-motion-teal: #0fa7a5;
    --sana-motion-line: #d8e9e9;
}

/* HOME: remove only the stale Blocksy page-title gap. */
body.sana-motion-home .entry-header,
body.sana-motion-home .page-header,
body.sana-motion-home .hero-section[data-type="type-1"] {
    display: none !important;
}
body.sana-motion-home main,
body.sana-motion-home .site-main,
body.sana-motion-home .content-area {
    padding-top: 0 !important;
}

/* HOME: continuous ticker. Each group is deliberately much wider than viewport. */
.sana-motion-ticker {
    width: min(1180px, calc(100% - 32px));
    height: 50px;
    margin: 14px auto 14px;
    border: 1px solid var(--sana-motion-line);
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
}
.sana-motion-ticker__viewport {
    width: 100%;
    direction: ltr !important;
    height: 100%;
    overflow: hidden;
    display: flex;
    align-items: center;
}
.sana-motion-ticker__track {
    display: flex !important;
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    align-items: center;
    will-change: transform;
    animation: sana-motion-marquee 48s linear infinite;
    direction: ltr !important;
}
.sana-motion-ticker:hover .sana-motion-ticker__track {
    animation-play-state: paused;
}
.sana-motion-ticker__group {
    display: inline-flex !important;
    direction: ltr !important;
    flex: 0 0 auto;
    width: max-content;
    min-width: max-content;
    align-items: center;
    white-space: nowrap;
    margin: 0 !important;
    padding: 0 !important;
}
.sana-motion-ticker__item {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    min-height: 48px;
    padding: 0 7px;
    margin: 0;
    white-space: nowrap;
    color: #31565a;
    font-size: 14px;
    font-weight: 800;
    direction: rtl;
}
.sana-motion-ticker__item::after {
    content: "•";
    color: #94caca;
    margin-right: 9px;
    font-size: 13px;
}
.sana-motion-ticker__icon {
    color: var(--sana-motion-teal);
    margin-left: 6px;
    font-weight: 900;
}
@keyframes sana-motion-marquee {
    from { transform: translate3d(0,0,0); }
    to   { transform: translate3d(-50%,0,0); }
}

/* HOME: entrance + scroll reveals. */
html.sana-motion-js body.sana-motion-home .sana-hero__copy,
html.sana-motion-js body.sana-motion-home .sana-hero__visual,
html.sana-motion-js body.sana-motion-home .sana-sf-hero-copy,
html.sana-motion-js body.sana-motion-home .sana-sf-visual {
    opacity: 0;
    transform: translateY(14px);
}
html.sana-motion-ready body.sana-motion-home .sana-hero__copy,
html.sana-motion-ready body.sana-motion-home .sana-sf-hero-copy {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .62s ease, transform .62s cubic-bezier(.22,.61,.36,1);
}
html.sana-motion-ready body.sana-motion-home .sana-hero__visual,
html.sana-motion-ready body.sana-motion-home .sana-sf-visual {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .72s .08s ease, transform .72s .08s cubic-bezier(.22,.61,.36,1);
}
html.sana-motion-js body.sana-motion-home .sana-motion-reveal {
    opacity: 0;
    transform: translateY(18px);
}
html.sana-motion-ready body.sana-motion-home .sana-motion-reveal.sana-motion-visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity .68s ease, transform .68s cubic-bezier(.22,.61,.36,1);
}
body.sana-motion-home .sana-category-grid > a,
body.sana-motion-home .sana-home-product,
body.sana-motion-home .sana-sf-grid > a {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
body.sana-motion-home .sana-home-product img {
    transition: transform .32s ease;
}

/* SHOP: smaller dead space and a clearly visible staggered reveal. */
body.sana-motion-shop main,
body.sana-motion-shop .site-main {
    padding-top: 14px !important;
}
html.sana-motion-js body.sana-motion-shop ul.products > li.product {
    opacity: 0;
    transform: translateY(24px);
}
html.sana-motion-ready body.sana-motion-shop ul.products > li.product.sana-motion-visible {
    opacity: 1;
    transform: translateY(0);
    transition:
        opacity .92s ease var(--sana-motion-delay, 0ms),
        transform .92s cubic-bezier(.22,.61,.36,1) var(--sana-motion-delay, 0ms),
        box-shadow .25s ease,
        border-color .25s ease;
}
body.sana-motion-shop ul.products > li.product {
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
body.sana-motion-shop ul.products > li.product img {
    transition: transform .34s ease;
}
body.sana-motion-shop ul.products > li.product .add_to_cart_button,
body.sana-motion-shop ul.products > li.product a.button {
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

/* SEARCH COMPATIBILITY SHIELD:
   The shop stylesheet previously styled every .wp-element-button as an add-to-cart button.
   Blocksy uses .wp-element-button inside #search-modal, so constrain ONLY that search button. */
#search-modal .ct-search-form button.wp-element-button {
    width: 44px !important;
    min-width: 44px !important;
    max-width: 44px !important;
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
    flex: 0 0 44px !important;
    padding: 0 !important;
    margin: 0 !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: inherit !important;
    box-shadow: none !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
#search-modal .ct-search-form button.wp-element-button svg,
#search-modal .ct-search-form button.wp-element-button .ct-icon {
    width: 15px !important;
    height: 15px !important;
    min-width: 15px !important;
    min-height: 15px !important;
}

@media (hover:hover) and (pointer:fine) {
    body.sana-motion-home .sana-category-grid > a:hover,
    body.sana-motion-home .sana-home-product:hover,
    body.sana-motion-home .sana-sf-grid > a:hover,
    body.sana-motion-shop ul.products > li.product:hover {
        transform: translateY(-4px);
        box-shadow: 0 14px 32px rgba(12,86,90,.08);
    }
    body.sana-motion-home .sana-home-product:hover img,
    body.sana-motion-shop ul.products > li.product:hover img {
        transform: scale(1.035);
    }
    body.sana-motion-shop ul.products > li.product .add_to_cart_button:hover,
    body.sana-motion-shop ul.products > li.product a.button:hover {
        transform: translateY(-1px);
        box-shadow: 0 7px 16px rgba(15,167,165,.16);
    }
}

@media (max-width: 720px) {
    .sana-motion-ticker {
        width: calc(100% - 24px);
        height: 47px;
        margin: 10px auto 12px;
        border-radius: 12px;
    }
    .sana-motion-ticker__item {
        min-height: 45px;
        padding: 0 8px;
        font-size: 13px;
    }
    body.sana-motion-home .sana-home-products {
        display: flex !important;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px !important;
        padding-bottom: 8px;
        scrollbar-width: none;
    }
    body.sana-motion-home .sana-home-products::-webkit-scrollbar { display: none; }
    body.sana-motion-home .sana-home-product {
        flex: 0 0 min(78vw, 300px);
        scroll-snap-align: start;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sana-motion-ticker__track { animation: none !important; }
    html.sana-motion-js body.sana-motion-home .sana-hero__copy,
    html.sana-motion-js body.sana-motion-home .sana-hero__visual,
    html.sana-motion-js body.sana-motion-home .sana-sf-hero-copy,
    html.sana-motion-js body.sana-motion-home .sana-sf-visual,
    html.sana-motion-js body.sana-motion-home .sana-motion-reveal,
    html.sana-motion-js body.sana-motion-shop ul.products > li.product {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
