/* Full-screen app flow (login, checkout wizard) — mobile-first like arava */

body.lw-app-flow {
    background: #f1f5f9;
    overflow-x: hidden;
}

body.lw-app-flow #site-header-wrap,
body.lw-app-flow #site-footer-wrap,
body.lw-app-flow #lw-bottom-nav,
body.lw-app-flow .lw-mobile-nav,
body.lw-app-flow .lw-rates {
    display: none !important;
}

body.lw-app-flow main {
    min-height: 100dvh;
    padding: 0 !important;
}

body.lw-app-flow.lw-has-bottom-nav {
    padding-bottom: 0 !important;
}

/* ── App shell ── */
.lw-app-shell {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(15, 23, 42, .06);
    --lw-ease: cubic-bezier(.22, 1, .36, 1);
    --lw-ease-soft: cubic-bezier(.4, 0, .2, 1);
    animation: lwShellIn .45s var(--lw-ease) both;
}

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

/* ── Checkout wizard: default mobile shell width ── */
.lw-checkout-wizard.lw-app-shell {
    max-width: 480px;
}

@media (min-width: 768px) {
    .lw-checkout-wizard.lw-app-shell {
        max-width: 720px;
    }
}

@media (min-width: 481px) {
    .lw-app-shell:not(.lw-checkout-wizard) {
        min-height: calc(100dvh - 2rem);
        margin: 1rem auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(15, 23, 42, .12);
    }

    .lw-checkout-wizard.lw-app-shell {
        min-height: calc(100dvh - 2rem);
        margin: 1rem auto;
        border-radius: 20px;
        overflow: hidden;
        box-shadow: 0 24px 64px rgba(15, 23, 42, .12);
    }
}

.lw-app-topbar {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .85rem 1rem;
    background: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.lw-app-topbar__back {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #f1f5f9;
    color: #64748b;
    text-decoration: none;
    border: none;
    flex-shrink: 0;
    transition: background .22s var(--lw-ease-soft), color .22s var(--lw-ease-soft), transform .18s var(--lw-ease-soft);
}

.lw-app-topbar__back:active {
    transform: scale(.92);
}

.lw-app-topbar__back:hover {
    background: var(--primary, #0d9488);
    color: #fff;
}

.lw-app-topbar__title {
    flex: 1;
    margin: 0;
    font-size: 1rem;
    font-weight: 900;
    color: #0f172a;
    transition: opacity .22s var(--lw-ease-soft), transform .22s var(--lw-ease-soft);
}

.lw-app-topbar__title.is-changing {
    opacity: 0;
    transform: translateY(4px);
}

.lw-app-topbar__step {
    font-size: .72rem;
    font-weight: 700;
    color: #64748b;
    white-space: nowrap;
}

.lw-app-topbar__end {
    display: flex;
    align-items: center;
    gap: .4rem;
    flex-shrink: 0;
}

.lw-app-topbar__end .lw-flow-support-btn {
    width: 34px;
    height: 34px;
    font-size: .9rem;
    border-radius: 10px;
}

.lw-app-body {
    flex: 1;
    padding: 1rem;
    padding-bottom: calc(100px + env(safe-area-inset-bottom));
    overflow-y: auto;
}

/* Step progress */
.lw-wizard-progress {
    display: flex;
    gap: 6px;
    padding: 0 1rem .85rem;
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.lw-wizard-progress__item {
    flex: 1;
    text-align: center;
    font-size: .68rem;
    font-weight: 700;
    color: #94a3b8;
    padding-top: .35rem;
    position: relative;
    transition: color .28s var(--lw-ease-soft);
}

.lw-wizard-progress__item::before {
    content: '';
    display: block;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    margin-bottom: 6px;
    transition: background .35s var(--lw-ease-soft), transform .35s var(--lw-ease-soft);
    transform-origin: right center;
}

.lw-wizard-progress__item.is-active::before {
    transform: scaleX(1.02);
}

.lw-wizard-progress__item.is-active {
    color: var(--primary, #0d9488);
}

.lw-wizard-progress__item.is-active::before,
.lw-wizard-progress__item.is-done::before {
    background: var(--primary, #0d9488);
}

.lw-wizard-progress__item.is-done {
    color: #64748b;
}

/* Wizard panels */
.lw-wizard-panel {
    display: none;
}

.lw-wizard-panel.is-active {
    display: block;
    animation: lwWizardInFwd .38s var(--lw-ease) both;
}

.lw-wizard-panel.is-active.is-backward {
    animation-name: lwWizardInBack;
}

@keyframes lwWizardInFwd {
    from {
        opacity: 0;
        transform: translateX(18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes lwWizardInBack {
    from {
        opacity: 0;
        transform: translateX(-18px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.lw-wizard-panel__lead {
    font-size: .88rem;
    color: #64748b;
    margin-bottom: 1rem;
    line-height: 1.55;
}

.lw-wizard-panel__lead strong {
    color: #0f172a;
}

/* Pickup shortcut */
.lw-pickup-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    background: #f8fafc;
    cursor: pointer;
    margin-bottom: 12px;
    transition: .2s ease;
}

.lw-pickup-card.is-selected {
    border-color: var(--primary, #0d9488);
    background: #f0fdfa;
}

.lw-pickup-card__icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--primary, #0d9488);
}

.lw-wizard-empty {
    text-align: center;
    padding: 2rem 1rem;
}

.lw-wizard-empty__icon {
    font-size: 3rem;
    color: #cbd5e1;
    margin-bottom: .75rem;
}

/* Fixed footer */
.lw-app-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: .85rem 1rem calc(.85rem + env(safe-area-inset-bottom));
    box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
    animation: lwFooterUp .42s var(--lw-ease) .1s both;
    transition: transform .3s var(--lw-ease-soft);
}

@keyframes lwFooterUp {
    from {
        opacity: 0;
        transform: translateY(100%);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.lw-app-footer__summary {
    max-width: 480px;
    margin: 0 auto .65rem;
    transition: opacity .28s var(--lw-ease-soft), transform .28s var(--lw-ease-soft), max-height .28s var(--lw-ease-soft);
}

.lw-app-footer__summary:not(.d-none) {
    animation: lwFlowFadeUp .32s var(--lw-ease) both;
}

@keyframes lwFlowFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

.lw-app-footer__inner {
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.lw-app-btn {
    flex: 1;
    border: none;
    border-radius: 14px;
    padding: .85rem 1rem;
    font-weight: 800;
    font-size: .92rem;
    font-family: inherit;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .4rem;
    cursor: pointer;
    transition: filter .22s var(--lw-ease-soft), transform .18s var(--lw-ease-soft), box-shadow .22s var(--lw-ease-soft), opacity .22s var(--lw-ease-soft);
}

.lw-app-btn:active:not(:disabled) {
    transform: scale(.97);
}

.lw-app-btn--primary {
    background: var(--primary, #0d9488);
    color: #fff;
    box-shadow: 0 8px 20px rgba(13, 148, 136, .28);
}

.lw-app-btn--ghost {
    background: #f1f5f9;
    color: #475569;
    flex: 0 0 auto;
    min-width: 88px;
}

.lw-app-btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Payment step compact summary */
.lw-pay-items {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 1rem;
    animation: lwFlowFadeUp .38s var(--lw-ease) .06s both;
}

.lw-pay-item {
    display: flex;
    justify-content: space-between;
    gap: .5rem;
    padding: .65rem .85rem;
    font-size: .82rem;
    border-bottom: 1px solid #f1f5f9;
    animation: lwFlowFadeUp .34s var(--lw-ease) both;
    animation-delay: calc(var(--pay-i, 0) * 45ms);
}

.lw-pay-item:last-child {
    border-bottom: 0;
}

/* Success */
.lw-success-screen {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem 1.5rem;
    background: linear-gradient(180deg, #f0fdfa 0%, #fff 45%);
}

.lw-success-screen__icon {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    background: #10b981;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 16px 40px rgba(16, 185, 129, .35);
    animation: lwSuccessPop .5s cubic-bezier(.22, 1, .36, 1);
}

@keyframes lwSuccessPop {
    0% { transform: scale(.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* Account orders */
.lw-order-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: .85rem 1rem;
    margin-bottom: .65rem;
    background: #fff;
}

.lw-order-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .5rem;
    margin-bottom: .35rem;
}

.lw-order-card__num {
    font-weight: 800;
    font-size: .85rem;
    color: #0f172a;
    direction: ltr;
}

.lw-order-card__badge {
    font-size: .68rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #64748b;
}

.lw-order-card__badge.is-confirmed { background: #dbeafe; color: #1d4ed8; }
.lw-order-card__badge.is-shipped { background: #d1fae5; color: #047857; }
.lw-order-card__badge.is-delivered { background: #bbf7d0; color: #166534; font-weight: 800; }
.lw-order-card__badge.is-cancelled { background: #fee2e2; color: #b91c1c; }

.lw-order-card__meta {
    font-size: .75rem;
    color: #64748b;
}

.lw-order-card__total {
    font-weight: 900;
    color: var(--primary, #0d9488);
    font-size: .9rem;
    margin-top: .35rem;
}

/* Fullscreen login — clean centered card */
body.lw-app-flow.lw-login-flow {
    background: #f8fafc;
    position: relative;
}

body.lw-app-flow.lw-login-flow::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(ellipse 80% 60% at 15% 10%, color-mix(in srgb, var(--lw-login-accent, var(--primary, #0d9488)) 14%, transparent), transparent 55%),
        radial-gradient(ellipse 70% 50% at 85% 90%, color-mix(in srgb, var(--lw-login-accent, var(--primary, #0d9488)) 10%, transparent), transparent 50%);
    animation: lwLoginBgPulse 10s ease-in-out infinite alternate;
}

@keyframes lwLoginBgPulse {
    from { opacity: .85; transform: scale(1); }
    to { opacity: 1; transform: scale(1.03); }
}

body.lw-app-flow.lw-login-flow main {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 1rem !important;
    position: relative;
    z-index: 1;
}

body.lw-app-flow.lw-login-flow .lw-customer-login-wrap {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

body.lw-app-flow.lw-login-flow .lw-login-shell {
    position: relative;
    width: 100%;
}

body.lw-app-flow.lw-login-flow .lw-login-back {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .06);
    transition: color .2s, border-color .2s;
}

body.lw-app-flow.lw-login-flow .lw-login-back:hover {
    color: var(--lw-login-accent, var(--primary, #0d9488));
    border-color: color-mix(in srgb, var(--lw-login-accent, #0d9488) 35%, #e2e8f0);
}

body.lw-app-flow.lw-login-flow .lw-login-card {
    position: relative;
    margin-top: 0;
}

body.lw-app-flow.lw-login-flow .lw-login-brand__title,
body.lw-app-flow.lw-login-flow .lw-login-brand__sub,
body.lw-app-flow.lw-login-flow .lw-login-label,
body.lw-app-flow.lw-login-flow .lw-login-hint {
    color: #334155;
}

body.lw-app-flow.lw-login-flow .lw-login-brand__title {
    color: #0f172a;
}

body.lw-app-flow.lw-login-flow .lw-login-brand__sub {
    color: #64748b;
}

body.lw-app-flow.lw-login-flow .lw-login-input {
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #0f172a;
}

body.lw-app-flow.lw-login-flow .lw-login-otp__cell {
    border-color: #e2e8f0;
    background: #fff;
    color: #0f172a;
}

body.lw-app-flow.lw-login-flow .lw-login-link {
    color: #64748b;
}

body.lw-app-flow.lw-login-flow a.lw-login-mode-switch,
body.lw-app-flow.lw-login-flow .lw-login-mode-switch {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: .65rem .5rem;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
    border-radius: 0;
    color: #64748b;
    font: inherit;
    font-size: .82rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: underline;
    text-underline-offset: .2em;
    text-decoration-color: rgba(100, 116, 139, .35);
    cursor: pointer;
}

body.lw-app-flow.lw-login-flow a.lw-login-mode-switch:hover,
body.lw-app-flow.lw-login-flow .lw-login-mode-switch:hover {
    color: var(--lw-login-accent, var(--primary, #0d9488));
    text-decoration-color: currentColor;
    background: transparent !important;
    border: 0 !important;
}

/* Clear visual cue when switching to wholesale mode */
.lw-customer-login-wrap.is-wholesale-mode .lw-login-brand__title {
    color: var(--lw-login-accent, #0d9488) !important;
}

.lw-customer-login-wrap.lw-login-mode-flash .lw-login-brand {
    animation: lwLoginModeFlash .55s ease;
}

@keyframes lwLoginModeFlash {
    0% { opacity: .25; transform: translateY(16px); }
    55% { opacity: 1; transform: translateY(-2px); }
    100% { opacity: 1; transform: none; }
}

/* Mobile app-like fullscreen login (edge to edge) */
@media (max-width: 720px) {
    body.lw-app-flow.lw-login-flow {
        background: #fff;
    }

    body.lw-app-flow.lw-login-flow::before {
        display: none;
    }

    body.lw-app-flow.lw-login-flow main {
        display: block !important;
        align-items: stretch !important;
        justify-content: flex-start !important;
        min-height: 100dvh !important;
        height: 100dvh !important;
        padding: 0 !important;
        overflow: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.lw-app-flow.lw-login-flow .lw-customer-login-wrap,
    body.lw-app-flow.lw-login-flow.lw-login-layout--v2 .lw-customer-login-wrap,
    body.lw-app-flow.lw-login-flow.lw-login-layout--v3 .lw-customer-login-wrap,
    body.lw-app-flow.lw-login-flow.lw-login-layout--v4 .lw-customer-login-wrap,
    body.lw-app-flow.lw-login-flow.lw-login-layout--v5 .lw-customer-login-wrap,
    body.lw-app-flow.lw-login-flow.lw-login-layout--v6 .lw-customer-login-wrap {
        max-width: none !important;
        width: 100% !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
    }

    body.lw-app-flow.lw-login-flow .lw-login-shell,
    body.lw-app-flow.lw-login-flow .lw-login-shell--glass,
    body.lw-app-flow.lw-login-flow .lw-login-shell--banner,
    body.lw-app-flow.lw-login-flow .lw-login-shell--minimal,
    body.lw-app-flow.lw-login-flow .lw-login-shell--terminal {
        width: 100% !important;
        max-width: none !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body.lw-app-flow.lw-login-flow .lw-login-card,
    body.lw-app-flow.lw-login-flow .lw-login-card--classic,
    body.lw-app-flow.lw-login-flow .lw-login-card--glass,
    body.lw-app-flow.lw-login-flow .lw-login-card--banner,
    body.lw-app-flow.lw-login-flow .lw-login-card--minimal,
    body.lw-app-flow.lw-login-flow .lw-login-card--terminal {
        width: 100% !important;
        max-width: none !important;
        min-height: 100dvh !important;
        margin: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        border: 0 !important;
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        padding: 1.75rem 1.25rem calc(1.75rem + env(safe-area-inset-bottom)) !important;
    }

    body.lw-app-flow.lw-login-flow .lw-login-back {
        top: max(.85rem, env(safe-area-inset-top));
        right: max(.85rem, env(safe-area-inset-right));
        background: #f8fafc;
    }
}

@media (min-width: 721px) {
    body.lw-app-flow.lw-login-flow main {
        padding: 2rem 1.25rem !important;
    }
}

@media (max-width: 480px) {
    body.lw-app-flow.lw-login-flow main {
        padding: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lw-app-shell,
    .lw-app-footer,
    .lw-app-footer__summary:not(.d-none),
    .lw-pay-items,
    .lw-pay-item,
    .lw-wizard-panel.is-active,
    .lw-success-screen__icon,
    body.lw-app-flow.lw-login-flow::before {
        animation: none !important;
    }

    .lw-app-topbar__title.is-changing {
        opacity: 1;
        transform: none;
    }
}

/* Per-layout max-width — defined in customer-login.css */
body.lw-app-flow.lw-login-flow.lw-login-layout--v2 .lw-customer-login-wrap { max-width: 500px; }
body.lw-app-flow.lw-login-flow.lw-login-layout--v3 .lw-customer-login-wrap,
body.lw-app-flow.lw-login-flow.lw-login-layout--v3 main { max-width: min(900px, 100%); }
body.lw-app-flow.lw-login-flow.lw-login-layout--v4 .lw-customer-login-wrap { max-width: 460px; }
body.lw-app-flow.lw-login-flow.lw-login-layout--v5 .lw-customer-login-wrap { max-width: 400px; }
body.lw-app-flow.lw-login-flow.lw-login-layout--v6 .lw-customer-login-wrap { max-width: 420px; }
