/* =====================================================================
   Sprint P0 #1, release R-A ("header_v3", Saad's r7 picks 2026-10-14).
   Loaded only while that switch is on; every rule is scoped to
   body.tw-header-v3. Markup: master.blade.php (search button, search
   icon, header cart) and partials/tweaks/float-cart.blade.php.
   ===================================================================== */

body.tw-header-v3 {
    --hv3-pink: #E0004A;
    --hv3-pink-2: #F23A72;
    --hv3-ring: #FFE0EA;
    --hv3-ink: #17191E;
}

/* ---------- the round search button (phone header, and the search field's own button) ---------- */
body.tw-header-v3 .tw-hv3-sbtn,
body.tw-header-v3 .header-search .search-submit {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 50%;
    background: linear-gradient(140deg, var(--hv3-pink-2), var(--hv3-pink));
    color: #fff;
    box-shadow: 0 0 0 3px var(--hv3-ring), 0 6px 14px rgba(224, 0, 74, .26);
    transition: transform .15s ease, box-shadow .15s ease;
}

body.tw-header-v3 .tw-hv3-sbtn:hover,
body.tw-header-v3 .header-search .search-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 0 3px #FFD0DF, 0 8px 18px rgba(224, 0, 74, .32);
}

body.tw-header-v3 .tw-hv3-sbtn:active,
body.tw-header-v3 .header-search .search-submit:active {
    transform: scale(.96);
}

body.tw-header-v3 .tw-hv3-sbtn:focus-visible,
body.tw-header-v3 .header-search .search-submit:focus-visible {
    outline: 2px solid var(--hv3-ink);
    outline-offset: 3px;
}

body.tw-header-v3 .tw-hv3-search-i {
    position: relative;
    width: 21px;
    height: 21px;
}

/* The light that passes over the button (motion B); still unless motion is welcome. */
body.tw-header-v3 .tw-hv3-sweep {
    position: absolute;
    top: -20%;
    bottom: -20%;
    left: 0;
    width: 45%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .55), rgba(255, 255, 255, 0));
    opacity: 0;
    pointer-events: none;
}

/* ---------- phone: menu | logo | search button; the cart floats ---------- */
@media (max-width: 900px) {
    body.tw-header-v3 .header-inner {
        grid-template-columns: 44px 1fr 44px;
    }

    body.tw-header-v3 .header-actions {
        display: none;
    }

    body.tw-header-v3 .tw-hv3-sbtn {
        grid-area: actions;
        justify-self: end;
        width: 44px;
        height: 44px;
    }

    body.tw-header-v3 .site-header:not(.hv3-search-open) .mobile-search {
        display: none;
    }

    /* No empty second row while the search field is closed. */
    body.tw-header-v3 .site-header:not(.hv3-search-open) .header-inner {
        row-gap: 0;
    }

    body.tw-header-v3 .site-header.hv3-search-open .tw-hv3-sbtn {
        background: var(--hv3-ink);
        box-shadow: 0 0 0 3px #E6E7EC;
    }

    body.tw-header-v3 .mobile-search {
        border-radius: 999px;
        height: 44px;
        padding: 0 4px 0 16px;
    }

    body.tw-header-v3 .mobile-search .search-submit {
        width: 36px;
        height: 36px;
        box-shadow: none;
    }

    body.tw-header-v3 .mobile-search .tw-hv3-search-i {
        width: 18px;
        height: 18px;
    }
}

/* ---------- computer: the big search field and the cart in the header ---------- */
@media (min-width: 901px) {
    body.tw-header-v3 .tw-hv3-sbtn {
        display: none;
    }

    body.tw-header-v3 .header-search {
        height: 52px;
        border-radius: 999px;
        padding: 0 6px 0 22px;
        border: 1.5px solid #F4C2D3;
        background: #fff;
    }

    body.tw-header-v3 .header-search:focus-within {
        border-color: var(--hv3-pink);
        box-shadow: 0 0 0 4px rgba(224, 0, 74, .1);
    }

    body.tw-header-v3 .header-search .search-submit {
        width: 42px;
        height: 42px;
        flex: none;
    }

    body.tw-header-v3 .cart-btn {
        position: relative;
        width: 46px;
        height: 46px;
        padding: 0;
        justify-content: center;
        border-radius: 14px;
        background: #fff;
        border: 1px solid #ECECF2;
        color: var(--hv3-pink);
        font-size: 22px;
    }

    body.tw-header-v3 .cart-btn:hover {
        border-color: #F4C2D3;
        background: #FFF5F8;
    }

    body.tw-header-v3 .cart-btn .cart-amount {
        display: none;
    }

    body.tw-header-v3 .cart-btn .sb-cart-i {
        margin: 0;
    }

    body.tw-header-v3 .cart-btn .cart-count {
        position: absolute;
        top: -7px;
        right: -7px;
        min-width: 21px;
        height: 21px;
        padding: 0 5px;
        border-radius: 999px;
        border: 2px solid #fff;
        background: var(--hv3-pink);
        color: #fff;
        font: 700 11.5px/17px Roboto, system-ui, sans-serif;
        text-align: center;
    }
}

/* ---------- the floating cart on the screen edge ---------- */
body.tw-header-v3 .tw-fcart {
    position: fixed;
    right: 0;
    top: 50%;
    /* Over the sticky buy bar and the bottom bar (299/300), under the menu overlay (340),
       the drawer (350), the side cart and the pop-ups. */
    z-index: 310;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 62px;
    padding: 10px 8px 8px 10px;
    border-radius: 18px 0 0 18px;
    background: linear-gradient(160deg, var(--hv3-pink-2), var(--hv3-pink));
    color: #fff;
    text-decoration: none;
    box-shadow: -4px 8px 22px rgba(224, 0, 74, .3);
    transform: translateY(-50%);
    /* R-A2: slower transform for the slide away after scrolling (tweaks.css). */
    transition: transform .34s cubic-bezier(.2, .7, .2, 1), box-shadow .15s ease;
}

body.tw-header-v3 .tw-fcart:hover {
    color: #fff;
    transform: translate(-2px, -50%);
    box-shadow: -6px 10px 26px rgba(224, 0, 74, .36);
}

body.tw-header-v3 .tw-fcart:focus-visible {
    outline: 2px solid var(--hv3-ink);
    outline-offset: 2px;
}

body.tw-header-v3 .tw-fcart .sb-cart-i {
    font-size: 23px;
}

body.tw-header-v3 .tw-fcart-badge {
    position: absolute;
    top: -9px;
    left: -9px;
    min-width: 23px;
    height: 23px;
    padding: 0 5px;
    border-radius: 999px;
    border: 2px solid var(--hv3-pink);
    background: #fff;
    color: var(--hv3-pink);
    font: normal 700 12px/19px Roboto, system-ui, sans-serif;
    text-align: center;
}

body.tw-header-v3 .tw-fcart-badge[hidden] {
    display: none;
}

body.tw-header-v3 .tw-fcart-amt {
    font: 700 13px/1.2 Roboto, system-ui, sans-serif;
    letter-spacing: -.01em;
}

body.tw-header-v3 .tw-fcart-label {
    font-size: 11.5px;
    line-height: 1.1;
    opacity: .92;
}

@media print {
    body.tw-header-v3 .tw-fcart {
        display: none;
    }
}

/* ---------- motion B: a light passes every 4 s and the glass tilts; transform and opacity only ---------- */
@media (prefers-reduced-motion: no-preference) {
    body.tw-header-v3 .tw-hv3-sweep {
        animation: hv3-sweep 4s ease-in-out 1.2s infinite;
    }

    body.tw-header-v3 .tw-hv3-search-i {
        animation: hv3-tilt 4s ease-in-out 1.2s infinite;
    }

    @keyframes hv3-sweep {
        0%, 60% { transform: translateX(-130%) skewX(-20deg); opacity: 0; }
        64% { opacity: 1; }
        80% { transform: translateX(260%) skewX(-20deg); opacity: 0; }
        100% { transform: translateX(260%) skewX(-20deg); opacity: 0; }
    }

    @keyframes hv3-tilt {
        0%, 62% { transform: rotate(0); }
        70% { transform: rotate(-14deg); }
        80%, 100% { transform: rotate(0); }
    }
}
