/* ==========================================================================
   New design (Carrot, Oct 2026): header and bottom bar
   Values from the delivered prototype (06_Prototype_Source_Code/app.css, the final
   "V5 client revisions" and native mobile rules). Classes are prefixed "s2-" so they
   never clash with the current site. Loaded only for Preview users.
   ========================================================================== */

/* ---------- Header: white, 60px, logo 30px high, light "+" ---------- */
.s2-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: var(--s2-header-h);
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    border-bottom: 1px solid var(--s2-line);
    box-sizing: border-box;
    z-index: 999;
}
.s2-header * {
    box-sizing: border-box;
    border-radius: 0;
}

.s2-header-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}
.s2-header-logo-svg {
    display: block;
    height: 30px;
    width: auto;
    overflow: hidden;
}

.s2-header-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    outline: none;
    background: transparent;
    color: var(--s2-indigo);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.55s var(--s2-ease-spring);
}
.s2-header-btn svg {
    width: 22px;
    height: 22px;
    display: block;
}
.s2-header-btn:active {
    transform: scale(0.9);
}

/* Inner pages: back button on the left, logo in the middle, "+" stays on the right */
.s2-header.is-inner .s2-header-logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}
.s2-header.is-inner #menuToggle {
    margin-left: auto;
}
.s2-header-back {
    position: absolute;
    left: 10px;
    bottom: 14px;
    text-decoration: none;
}

/* Thin brand line under the header that grows as the page scrolls */
.s2-scroll-progress {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    background: var(--s2-indigo);
    transition: width 0.08s ease-out;
}

/* Logo ident: now and then (only while the user is idle) the monogram's threads
   pull out and weave back in place */
.s2-hl-thread {
    stroke-dasharray: 1;
    stroke-dashoffset: 0;
}
.s2-header-logo-svg.is-weaving .s2-hl-thread {
    animation: s2Reweave 1.5s var(--s2-ease-in-out) both;
}
.s2-header-logo-svg.is-weaving .s2-hl-t-d1 { animation-delay: 0s; }
.s2-header-logo-svg.is-weaving .s2-hl-t-d2 { animation-delay: 0.07s; }
.s2-header-logo-svg.is-weaving .s2-hl-t-a  { animation-delay: 0.14s; }
.s2-header-logo-svg.is-weaving .s2-hl-t-b  { animation-delay: 0.21s; }
.s2-header-logo-svg.is-weaving .s2-hl-t-h1 { animation-delay: 0.32s; }
.s2-header-logo-svg.is-weaving .s2-hl-t-h2 { animation-delay: 0.39s; }
@keyframes s2Reweave {
    0%      { stroke-dashoffset: 0; }
    42%     { stroke-dashoffset: -1; }
    42.01%  { stroke-dashoffset: 1; }
    100%    { stroke-dashoffset: 0; }
}

/* Pages start right under the 60px header (the old header needed 70px) */
body:has(.s2-header) .main-content,
body:has(.s2-header) .inner-page {
    margin-top: var(--s2-header-h);
}

/* Room under the page for the bottom bar: 58px + 6px, like the prototype
   (replaces the 70px/80px that Main.blade.php gives the old bar) */
body:has(.s2-bottom-nav) {
    padding-bottom: calc(var(--s2-bottom-nav-h) + 6px);
}

/* ---------- Bottom bar: brand blue, 58px, 5 icons ---------- */
.s2-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: var(--s2-bottom-nav-h);
    padding: 6px 0 0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    background: var(--s2-indigo);
    box-sizing: border-box;
    z-index: 998;
}

.s2-nav-item {
    position: relative;
    width: 60px;
    height: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--s2-nav-idle);
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease, color 0.2s ease;
}
.s2-nav-item:active {
    transform: scale(0.9);
}
.s2-nav-item.is-active {
    color: #fff;
}

.s2-nav-icon {
    position: relative;
    display: block;
    width: 20px;
    height: 20px;
}
.s2-nav-icon svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* Small white dot under the current tab */
.s2-nav-dot {
    position: absolute;
    bottom: 2px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    background: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.s2-nav-item.is-active .s2-nav-dot {
    opacity: 1;
    transform: scale(1);
}

/* Count badges (old class names, so the pages' scripts keep updating them) */
.s2-bottom-nav .wishlist-badge,
.s2-bottom-nav .cart-badge {
    position: absolute;
    top: -10px;
    right: -8px;
    width: 16px;
    height: 16px;
    border: 2px solid var(--s2-indigo);
    border-radius: 50%;
    background: #fff;
    color: var(--s2-indigo);
    font-family: var(--s2-font);
    font-size: 9px;
    font-weight: 800;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: content-box;
}

@media (prefers-reduced-motion: reduce) {
    .s2-header-logo-svg.is-weaving .s2-hl-thread { animation: none; }
    .s2-nav-item, .s2-nav-dot, .s2-header-btn, .s2-scroll-progress { transition: none; }
}

/* While the keyboard is up, the bottom bar steps aside (ui.js) */
body.s2-typing .s2-bottom-nav {
    display: none;
}
