:root {
    --ait-blue: #1455d9;
    --ait-red: #ef2b2d;
    --ait-dark: #101828;
    --ait-mobile-max: 460px;
    --ait-mobile-glass: rgba(255, 255, 255, .88);
    --ait-mobile-border: rgba(255, 255, 255, .72);
}

.ait-ios-island-line,
.ios-island-line,
.ait-ios-notch-glow {
    display: none !important;
}

.ait-mobile-bottom-nav {
    display: none;
}

body.maw-story-mode .mobile-bottom-nav,
body.maw-story-mode .ait-mobile-bottom-nav {
    display: none !important;
}

body.maw-story-mode {
    height: 100%;
    overflow: hidden !important;
    overscroll-behavior: none;
}

@supports selector(:has(*)) {
    html:has(body.maw-story-mode) {
        height: 100%;
        overflow: hidden !important;
        overscroll-behavior: none;
    }
}

.ait-install-backdrop {
    position: fixed;
    inset: 0;
    z-index: 160;
    display: none;
    align-items: flex-end;
    padding: 16px;
    background: rgba(15, 23, 42, .34);
    backdrop-filter: blur(12px);
}

.ait-install-backdrop[data-visible="true"] {
    display: flex;
}

.ait-install-sheet {
    width: min(100%, 460px);
    margin: 0 auto;
    transform: translateY(24px) scale(.98);
    opacity: 0;
    border: 1px solid rgba(255, 255, 255, .74);
    border-radius: 30px;
    background: rgba(255, 255, 255, .92);
    padding: 18px;
    box-shadow: 0 28px 78px rgba(15, 23, 42, .3);
    transition: transform .36s cubic-bezier(.22, 1, .36, 1), opacity .24s ease;
    backdrop-filter: blur(24px);
}

.ait-install-backdrop[data-visible="true"] .ait-install-sheet {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.ait-install-icon {
    display: flex;
    height: 58px;
    width: 58px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(20, 85, 217, .12), rgba(239, 43, 45, .12));
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .76), 0 12px 30px rgba(20, 85, 217, .18);
}

.ait-install-icon img {
    height: 44px;
    width: 44px;
    object-fit: contain;
}

.ait-install-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    margin-top: 16px;
}

.ait-install-primary,
.ait-install-close {
    min-height: 46px;
    border: 0;
    border-radius: 17px;
    font-weight: 900;
}

.ait-install-primary {
    background: linear-gradient(135deg, var(--ait-blue), #0f3fb2);
    color: #fff;
    box-shadow: 0 16px 34px rgba(20, 85, 217, .26);
}

.ait-install-close {
    background: #eef2f7;
    color: #475569;
    padding: 0 16px;
}

@media (max-width: 767px) {
    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    html {
        background: #071122;
        scroll-behavior: smooth;
        overscroll-behavior-y: none;
    }

    body.ait-mobile-app {
        min-height: 100dvh;
        padding-bottom: calc(92px + env(safe-area-inset-bottom));
        background:
            radial-gradient(circle at 14% -8%, rgba(239, 43, 45, .22), transparent 36%),
            radial-gradient(circle at 86% 0%, rgba(20, 85, 217, .28), transparent 34%),
            linear-gradient(180deg, #eef4ff 0%, #f8fafc 26%, #eef2f7 100%);
        overflow-x: hidden;
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }

    body.ait-mobile-app.maw-story-mode {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100dvh;
        padding-bottom: 0 !important;
        background: #020617;
        overflow: hidden !important;
        overscroll-behavior: none;
    }

    body.ait-mobile-app.maw-story-mode::before,
    body.ait-mobile-app.maw-story-mode header,
    body.ait-mobile-app.maw-story-mode footer,
    body.ait-mobile-app.maw-story-mode .ait-install-backdrop {
        display: none !important;
    }

    body.ait-mobile-app *,
    body.ait-mobile-app *::before,
    body.ait-mobile-app *::after {
        box-sizing: border-box;
        min-width: 0;
    }

    body.ait-mobile-app img,
    body.ait-mobile-app video,
    body.ait-mobile-app canvas,
    body.ait-mobile-app svg,
    body.ait-mobile-app iframe {
        max-width: 100%;
    }

    body.ait-mobile-app p,
    body.ait-mobile-app span,
    body.ait-mobile-app h1,
    body.ait-mobile-app h2,
    body.ait-mobile-app h3,
    body.ait-mobile-app h4,
    body.ait-mobile-app h5,
    body.ait-mobile-app h6,
    body.ait-mobile-app a,
    body.ait-mobile-app button,
    body.ait-mobile-app label,
    body.ait-mobile-app small {
        overflow-wrap: anywhere;
    }

    body.ait-mobile-app [class*="w-\\["],
    body.ait-mobile-app [class*="max-w-\\["],
    body.ait-mobile-app [style*="width"] {
        max-width: 100% !important;
    }

    body.ait-mobile-app .overflow-x-auto,
    body.ait-mobile-app [class*="overflow-x-auto"],
    body.ait-mobile-app .ait-mobile-horizontal {
        max-width: 100%;
    }

    body.ait-mobile-app header,
    body.ait-mobile-app main,
    body.ait-mobile-app footer,
    body.ait-mobile-app section,
    body.ait-mobile-app article,
    body.ait-mobile-app aside,
    body.ait-mobile-app nav,
    body.ait-mobile-app form,
    body.ait-mobile-app fieldset,
    body.ait-mobile-app [role="dialog"],
    body.ait-mobile-app [class*="glass-card"],
    body.ait-mobile-app [class*="soft-tile"],
    body.ait-mobile-app [class*="rounded"],
    body.ait-mobile-app [class*="shadow"] {
        max-width: 100%;
    }

    body.ait-mobile-app [class*="grid-cols-"],
    body.ait-mobile-app [class*="flex"],
    body.ait-mobile-app [class*="inline-flex"] {
        min-width: 0;
    }

    body.ait-mobile-app table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    body.ait-mobile-app input,
    body.ait-mobile-app select,
    body.ait-mobile-app textarea {
        max-width: 100%;
    }

    body.ait-mobile-app [class*="-ml-"],
    body.ait-mobile-app [class*="-mr-"],
    body.ait-mobile-app [class*="-left-"],
    body.ait-mobile-app [class*="-right-"] {
        max-width: calc(100vw - 24px);
    }

    body.ait-mobile-app .phone-asset,
    body.ait-mobile-app img.max-w-none {
        max-width: none;
    }

    body.ait-mobile-app::before {
        content: "";
        position: fixed;
        inset: 0;
        z-index: -1;
        background:
            linear-gradient(135deg, rgba(255, 255, 255, .72), rgba(255, 255, 255, 0) 38%),
            radial-gradient(circle at 50% 18%, rgba(20, 85, 217, .12), transparent 42%);
        pointer-events: none;
    }

    body.ait-mobile-app header {
        position: sticky;
        top: 0;
        z-index: 50;
        border-bottom: 0;
        background: rgba(248, 250, 252, .82);
        box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
        backdrop-filter: blur(22px);
    }

    body.ait-mobile-app header > div:first-child {
        min-height: 0;
    }

    body.ait-mobile-app:not(.ait-page-login) header > div:first-child {
        display: none;
    }

    body.ait-mobile-app header > div:first-child {
        width: min(100% - 24px, var(--ait-mobile-max));
    }

    body.ait-mobile-app header > div:nth-child(2) {
        width: min(100% - 24px, var(--ait-mobile-max)) !important;
        gap: 10px !important;
        padding: calc(10px + env(safe-area-inset-top)) 0 10px !important;
    }

    body.ait-mobile-app header > div:nth-child(2) > a:first-child {
        display: flex;
        min-width: 54px;
        align-items: center;
    }

    body.ait-mobile-app header nav[aria-label="Actiuni rapide"],
    body.ait-mobile-app header nav[aria-label="Acțiuni rapide"] {
        display: none !important;
    }

    body.ait-mobile-app header img[alt="AIT Shop"],
    body.ait-mobile-app header img[alt="Academia de IT"] {
        max-height: 50px;
        object-fit: contain;
    }

    body.ait-mobile-app header form[method="get"] {
        order: 3;
        flex-basis: 100%;
        height: 46px;
        border-width: 0 !important;
        border-radius: 18px !important;
        background: rgba(255, 255, 255, .92) !important;
        box-shadow: 0 14px 32px rgba(20, 85, 217, .13);
    }

    body.ait-mobile-app header form[method="get"] input {
        min-width: 0;
        font-size: 14px;
    }

    body.ait-mobile-app header nav[aria-label="Meniu oferte"] {
        border-top: 0 !important;
    }

    body.ait-mobile-app header nav[aria-label="Meniu oferte"] > div {
        width: 100% !important;
        max-width: none !important;
        gap: 10px !important;
        padding: 2px 12px 12px !important;
        scroll-padding-left: 12px;
        scrollbar-width: none;
    }

    body.ait-mobile-app header nav[aria-label="Meniu oferte"] > div::-webkit-scrollbar {
        display: none;
    }

    body.ait-mobile-app header nav[aria-label="Meniu oferte"] a {
        border-radius: 999px;
        background: rgba(255, 255, 255, .78);
        padding: 8px 12px;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .84), 0 8px 22px rgba(15, 23, 42, .06);
    }

    body.ait-mobile-app main,
    body.ait-mobile-app section.fade {
        width: min(100% - 24px, var(--ait-mobile-max)) !important;
        margin-left: auto;
        margin-right: auto;
    }

    body.ait-mobile-app main {
        padding-top: 14px !important;
        animation: aitPageIn .34s cubic-bezier(.22, 1, .36, 1);
    }

    body.ait-mobile-app.maw-story-mode main {
        width: 100% !important;
        max-width: none !important;
        height: 100dvh;
        margin: 0;
        padding: 0 !important;
        animation: none;
        overflow: hidden;
    }

    body.ait-mobile-app.maw-story-mode .story-onboarding-shell,
    body.ait-mobile-app.maw-story-mode .story-onboarding-shell > div,
    body.ait-mobile-app.maw-story-mode .story-frame {
        width: 100% !important;
        max-width: none !important;
        height: 100dvh;
        height: calc(var(--maw-vh, 1vh) * 100);
        min-height: 100dvh;
        margin: 0 !important;
        border-radius: 0 !important;
        overflow: hidden;
    }

    body.ait-mobile-app.maw-story-mode form.story-pane {
        overflow-y: auto;
        overscroll-behavior: contain;
        -webkit-overflow-scrolling: touch;
    }

    body.ait-mobile-app main[class*="grid"] {
        display: block !important;
    }

    body.ait-mobile-app main > aside {
        display: none !important;
    }

    body.ait-mobile-app main > section,
    body.ait-mobile-app main > article,
    body.ait-mobile-app main > div {
        display: grid;
        gap: 14px !important;
    }

    body.ait-mobile-app main > section + section,
    body.ait-mobile-app main > article + article {
        margin-top: 14px;
    }

    body.ait-mobile-app .grid {
        gap: 14px;
    }

    body.ait-mobile-app #categorii {
        height: auto;
        max-height: none;
        border-radius: 24px;
        padding: 14px;
    }

    body.ait-mobile-app #menu-categorii {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 2px;
        scrollbar-width: none;
    }

    body.ait-mobile-app #menu-categorii::-webkit-scrollbar {
        display: none;
    }

    body.ait-mobile-app #menu-categorii a {
        min-width: 168px;
        border-radius: 18px;
        background: rgba(248, 250, 252, .82);
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, .82);
    }

    body.ait-mobile-app [data-hero-slider] {
        border-radius: 26px;
        box-shadow: 0 24px 54px rgba(20, 85, 217, .18);
    }

    body.ait-mobile-app [data-hero-slider] img {
        min-height: 188px;
        object-fit: cover;
    }

    body.ait-mobile-app main section[id^="cat-"] {
        border-radius: 24px;
        padding: 16px;
    }

    body.ait-mobile-app main section[id^="cat-"] > div:last-child {
        display: grid;
        grid-auto-flow: column;
        grid-auto-columns: minmax(238px, 74%);
        gap: 12px;
        overflow-x: auto;
        padding: 2px 2px 8px;
        scroll-snap-type: x mandatory;
        scrollbar-width: none;
    }

    body.ait-mobile-app main section[id^="cat-"] > div:last-child::-webkit-scrollbar {
        display: none;
    }

    body.ait-mobile-app main section[id^="cat-"] > div:last-child > a {
        min-height: 318px;
        scroll-snap-align: start;
        border-radius: 24px;
        box-shadow: 0 18px 42px rgba(15, 23, 42, .1);
    }

    body.ait-mobile-app.ait-page-index main > div,
    body.ait-mobile-app.ait-page-index [data-hero-slider],
    body.ait-mobile-app.ait-page-index [data-hero-track],
    body.ait-mobile-app.ait-page-index #categorii,
    body.ait-mobile-app.ait-page-index #produse,
    body.ait-mobile-app.ait-page-index section[id^="cat-"],
    body.ait-mobile-app.ait-page-index footer,
    body.ait-mobile-app.ait-page-index footer > div {
        max-width: 100%;
        min-width: 0;
    }

    body.ait-mobile-app.ait-page-index [data-hero-track] {
        width: 100%;
    }

    body.ait-mobile-app.ait-page-index [data-hero-track] > div {
        width: 25% !important;
        min-width: 25% !important;
        max-width: 25% !important;
    }

    body.ait-mobile-app.ait-page-index [data-search-panel],
    body.ait-mobile-app.ait-page-index [data-cookie-box],
    body.ait-mobile-app.ait-page-index [data-cookie-box-old] > div {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    body.ait-mobile-app.ait-page-index footer a,
    body.ait-mobile-app.ait-page-index footer p {
        white-space: normal;
        word-break: break-word;
    }

    body.ait-mobile-app main section[id^="cat-"] h3 {
        font-size: 20px;
        line-height: 1.15;
    }

    body.ait-mobile-app .glass-card,
    body.ait-mobile-app .soft-tile,
    body.ait-mobile-app .card,
    body.ait-mobile-app .wallet-card,
    body.ait-mobile-app article[class*="bg-white"],
    body.ait-mobile-app section[class*="glass-card"],
    body.ait-mobile-app main section[class*="bg-white"],
    body.ait-mobile-app main aside[class*="bg-white"],
    body.ait-mobile-app main a[class*="bg-white"] {
        border-color: var(--ait-mobile-border);
        background-color: var(--ait-mobile-glass);
        box-shadow: 0 18px 42px rgba(15, 23, 42, .1);
        backdrop-filter: blur(18px);
    }

    body.ait-mobile-app .glass-card,
    body.ait-mobile-app .soft-tile,
    body.ait-mobile-app main article,
    body.ait-mobile-app main section {
        border-radius: 24px;
    }

    body.ait-mobile-app .glass-card.p-6,
    body.ait-mobile-app .glass-card.p-5,
    body.ait-mobile-app .soft-tile.p-5,
    body.ait-mobile-app .card {
        padding: 18px;
    }

    body.ait-mobile-app .card {
        border-radius: 28px;
        padding: 24px;
    }

    body.ait-mobile-app h1 {
        font-size: clamp(26px, 8vw, 38px);
        line-height: 1.05;
    }

    body.ait-mobile-app h2 {
        font-size: clamp(21px, 6vw, 28px);
        line-height: 1.12;
    }

    body.ait-mobile-app p,
    body.ait-mobile-app a,
    body.ait-mobile-app button,
    body.ait-mobile-app input,
    body.ait-mobile-app select {
        letter-spacing: 0;
    }

    body.ait-mobile-app input,
    body.ait-mobile-app select,
    body.ait-mobile-app textarea {
        font-size: 16px;
    }

    body.ait-mobile-app button,
    body.ait-mobile-app a,
    body.ait-mobile-app label {
        touch-action: manipulation;
    }

    body.ait-mobile-app a:active,
    body.ait-mobile-app button:active {
        transform: scale(.98);
    }

    body.ait-mobile-app .ait-mobile-horizontal,
    body.ait-mobile-app [data-horizontal-wheel],
    body.ait-mobile-app .recommendation-rail {
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    body.ait-mobile-app .ait-mobile-horizontal::-webkit-scrollbar,
    body.ait-mobile-app [data-horizontal-wheel]::-webkit-scrollbar,
    body.ait-mobile-app .recommendation-rail::-webkit-scrollbar {
        display: none;
    }

    body.ait-mobile-app .mobile-bottom-nav {
        display: none !important;
    }

    body.ait-mobile-app.ait-page-login {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
    }

    body.ait-mobile-app.ait-page-login header {
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
    }

    body.ait-mobile-app.ait-page-login header img {
        max-height: 64px;
    }

    body.ait-mobile-app.ait-page-login section.fade {
        min-height: auto;
        align-items: start;
        padding: 8px 0 24px;
    }

    body.ait-mobile-app.ait-page-login .card {
        border: 1px solid rgba(255, 255, 255, .72);
        border-radius: 30px;
        background: rgba(255, 255, 255, .9);
        padding: 24px;
        box-shadow: 0 24px 60px rgba(15, 23, 42, .12);
        backdrop-filter: blur(20px);
    }

    body.ait-mobile-app footer {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin-top: 18px;
        padding-bottom: calc(120px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .86);
        backdrop-filter: blur(18px);
    }

    body.ait-mobile-app footer > div {
        width: min(100% - 24px, 460px);
        padding-top: 28px;
        padding-bottom: 28px;
    }

    body.ait-mobile-app footer nav {
        font-size: 13px;
    }

    body.ait-mobile-app footer img {
        max-width: 100%;
    }

    .ait-mobile-bottom-nav {
        display: grid;
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: calc(10px + env(safe-area-inset-bottom));
        z-index: 120;
        grid-template-columns: repeat(6, minmax(0, 1fr));
        gap: 4px;
        border: 1px solid rgba(255, 255, 255, .7);
        border-radius: 26px;
        background: rgba(255, 255, 255, .86);
        padding: 8px;
        box-shadow: 0 22px 60px rgba(15, 23, 42, .22);
        backdrop-filter: blur(24px);
    }

    .ait-mobile-bottom-nav a {
        display: flex;
        min-width: 0;
        height: 58px;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 3px;
        border-radius: 19px;
        color: #64748b;
        font-size: 9px;
        font-weight: 900;
        text-decoration: none;
        transition: transform .18s ease, color .18s ease, background .18s ease;
    }

    .ait-mobile-bottom-nav a:active {
        transform: scale(.94);
    }

    .ait-mobile-bottom-nav a[data-active="true"] {
        background: linear-gradient(135deg, rgba(20, 85, 217, .12), rgba(239, 43, 45, .1));
        color: var(--ait-blue);
    }

    .ait-mobile-bottom-nav i {
        font-size: 21px;
        line-height: 1;
    }

    .ait-mobile-toast {
        position: fixed;
        left: 16px;
        right: 16px;
        bottom: calc(92px + env(safe-area-inset-bottom));
        z-index: 180;
        transform: translateY(18px);
        border: 1px solid rgba(255, 255, 255, .7);
        border-radius: 22px;
        background: rgba(16, 24, 40, .9);
        padding: 13px 15px;
        color: #fff;
        font-size: 13px;
        font-weight: 800;
        opacity: 0;
        box-shadow: 0 20px 58px rgba(15, 23, 42, .34);
        transition: transform .28s cubic-bezier(.22, 1, .36, 1), opacity .22s ease;
        backdrop-filter: blur(18px);
    }

    .ait-mobile-toast[data-visible="true"] {
        transform: translateY(0);
        opacity: 1;
    }

    @keyframes aitPageIn {
        from {
            opacity: 0;
            transform: translateY(12px) scale(.992);
        }

        to {
            opacity: 1;
            transform: translateY(0) scale(1);
        }
    }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: .001ms !important;
        scroll-behavior: auto !important;
        transition-duration: .001ms !important;
    }
}
