/*
 * Neptune "cosy" look for the shopper pages (2026-11), the same system as
 * the app: a warm cream page, sand blocks, Jost, soft 20px cards without
 * frames, and 3ami Neptune where a page would otherwise be empty.
 * Opt-in through partials/cosy.html: store pages keep their own design.
 */
:root {
    --cosy-cream: #FBFAF7;
    --cosy-sand: #F3EFE7;
    --cosy-sand-deep: #E8E1D4;
    --cosy-navy: #05213D;
    --cosy-ink: #0F172A;
    --cosy-muted: #64748B;
    --mk-line: var(--cosy-sand-deep);
    --mk-ground: var(--cosy-sand);
    --paper-2: var(--cosy-cream);
    --paper: var(--cosy-cream);
}

html body {
    background: var(--cosy-cream) !important;
    font-family: 'Jost', 'Noto Sans Arabic', 'Helvetica Neue', Arial, sans-serif;
}

/* 3ami Neptune in empty states: steps in, then floats a little. Sized for
   the screen: a phone keeps room for the text and the button under him. */
.ami-pose {
    display: block;
    height: clamp(150px, 24vw, 220px);
    width: auto;
    margin: 0 auto 18px;
    animation: ami-in .62s cubic-bezier(.34, 1.45, .6, 1) both, ami-float 3.2s ease-in-out .62s infinite;
}

.ami-pose--small { height: clamp(96px, 14vw, 120px); }

.ami-pose--avatar {
    height: 100%;
    width: 100%;
    margin: 0;
    object-fit: cover;
    animation: none;
}

@keyframes ami-in {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
}

@keyframes ami-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* The header walk (static/js/ami.js): a sprite played one frame per 28 ms,
   on a lane clipped to the brand side of the bar, behind its content. */
.ami-walk-lane {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
    z-index: 0;
}

html body nav.navbar > .container { position: relative; z-index: 1; }

.ami-walk {
    position: absolute;
    left: 0;
    bottom: 0;
    background: 0 0 / auto 100% no-repeat;
    animation: ami-steps .56s steps(20) infinite;
}

/* 20 frames: the last stop is one frame past the end, 20/19 of the overflow. */
@keyframes ami-steps { to { background-position: 105.2632% 0; } }

.ami-peek-lane {
    position: fixed;
    z-index: 1040;
    right: 24px;
    bottom: 0;
    overflow: hidden;
    pointer-events: none;
}

.ami-peek-lane img { display: block; width: 100%; height: auto; }

/* Checkout: he dances, four poses as a flip book with a hop on each beat. */
.ami-dance {
    width: 89px;
    height: 140px;
    flex: none;
    background: 0 0 / auto 100% no-repeat;
    animation: ami-dance-poses .68s steps(4) infinite, ami-hop .34s ease-out infinite;
}

@keyframes ami-dance-poses { to { background-position: 133.3333% 0; } }
@keyframes ami-hop { 50% { transform: translateY(-5px); } }

.ami-dance--center { margin: 0 auto 8px; height: 120px; width: 76px; }

/* The universe tabs wear their 3ami bust instead of an icon. */
.universe-tab .ami-pose--tab {
    height: 34px;
    width: 34px;
    margin: 0;
    border-radius: 50%;
    background: var(--cosy-sand);
    animation: none;
}

/* An order's progress as a crossing, as in the app: the boat sails from
   the store to the door, one stretch of sea per status. */
.ami-voyage {
    position: relative;
    height: 74px;
    margin: 12px 16px 4px;
    border-radius: 16px;
    background: linear-gradient(180deg, #EEF2FA 0 58%, #D9E4F5 58% 100%);
    overflow: hidden;
}

.ami-voyage::before,
.ami-voyage::after {
    position: absolute;
    bottom: 10px;
    font-size: 18px;
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--cosy-navy);
}

.ami-voyage::before { content: "\f54e"; left: 14px; }
.ami-voyage::after { content: "\f015"; right: 14px; }

.ami-voyage .ami-pose {
    position: absolute;
    bottom: 6px;
    height: 58px;
    width: auto;
    margin: 0;
    transform: translateX(-50%);
    animation: ami-bob 2.4s ease-in-out infinite;
    transition: left .6s ease;
}

.ami-voyage[data-status="pending"] .ami-pose { left: 18%; }
.ami-voyage[data-status="processing"] .ami-pose { left: 40%; }
.ami-voyage[data-status="shipped"] .ami-pose { left: 64%; }
.ami-voyage[data-status="delivered"] .ami-pose { left: calc(100% - 64px); height: 64px; bottom: 4px; animation: none; }

@keyframes ami-bob {
    0%, 100% { transform: translateX(-50%) translateY(0) rotate(-2deg); }
    50% { transform: translateX(-50%) translateY(-3px) rotate(2deg); }
}

@media (prefers-reduced-motion: reduce) {
    .ami-pose, .ami-dance, .ami-voyage .ami-pose { animation: none; }
}

/* News strip: a soft sand ribbon, as in the app, instead of a navy bar. */
html body .news-marquee {
    background: var(--cosy-sand) !important;
    border-bottom: 1px solid var(--cosy-sand-deep);
    padding: 8px 0 !important;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}

html body .news-marquee .marquee-item {
    color: var(--cosy-ink) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    padding: 0 22px !important;
}

html body .news-marquee .marquee-item i { display: none !important; }

/* Read at walking pace, phone or desktop. */
html body .news-marquee .marquee-track { animation-duration: 60s !important; }

/* "All categories" ends the rail like a category: same pale block, a grid icon. */
html body .home-rail-all::before {
    background: #EEF2FA url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2305213D' stroke-width='1.8' stroke-linejoin='round'%3E%3Crect x='3' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='3' width='7' height='7' rx='1.5'/%3E%3Crect x='3' y='14' width='7' height='7' rx='1.5'/%3E%3Crect x='14' y='14' width='7' height='7' rx='1.5'/%3E%3C/svg%3E") center / 28px no-repeat !important;
}
html body .home-rail-all span { text-decoration: none !important; font-weight: 600; }

/* Error page: 3ami replaces the red warning disc. */
html body .error-icon:has(.ami-pose) { width: auto; height: auto; background: none; border-radius: 0; }

/* Page grounds that were hard-coded cool grey take the cream. */
html body .products-page,
html body .categories-page,
html body .stores-page,
html body .settings-container,
html body .checkout-page,
html body .search-header,
html body .contact-page {
    background: var(--cosy-cream) !important;
}

/* An empty page is 3ami on the cream, not a white box around him. */
html body .cart-empty,
html body .favorites-empty,
html body .orders-empty {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

/* Framed cards as in the app: 20px, no hairline, a soft shadow. */
html body .order-card,
html body .settings-card,
html body .checkout-page .card,
html body .checkout-page .checkout-card {
    border: 0 !important;
    border-radius: 20px !important;
    box-shadow: 0 4px 18px rgba(5, 33, 61, .06) !important;
}
