
:root {
    --bg: #080d18;
    --panel: #101a2b;
    --panel-light: #16243a;
    --blue: #2787ff;
    --blue-light: #55b4ff;
    --text: #f5f8ff;
    --muted: #8b9bb3;
    --border: rgba(130, 170, 220, 0.13);
    --radius: 20px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

button, input {
    font: inherit;
}

button {
    color: inherit;
    cursor: pointer;
}

.app {
    width: 100%;
    max-width: 760px;
    min-height: 100vh;
    margin: 0 auto;
    padding: 0 18px 110px;
    overflow: hidden;
}

/* HEADER */

.header {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
}

.brand-icon {
    width: 43px;
    height: 43px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 25px;
    font-weight: 900;
    font-style: italic;
    background: linear-gradient(135deg, #51b8ff, #1264ed);
    box-shadow: 0 5px 25px rgba(39, 135, 255, .35);
}

.brand-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.brand-name {
    font-size: 21px;
    font-weight: 850;
    letter-spacing: -.8px;
}

.brand-slogan {
    color: var(--muted);
    font-size: 8px;
    letter-spacing: 1.2px;
}

.profile-button {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--blue-light);
    font-weight: 800;
    font-size: 17px;
}

/* PAGES */

.page {
    display: none;
    animation: appear .25s ease;
}

.page.active {
    display: block;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(7px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.eyebrow {
    color: var(--blue-light);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
}

/* HERO */

.welcome {
    min-height: 265px;
    position: relative;
    overflow: hidden;
    margin-top: 12px;
    padding: 27px 23px;
    border: 1px solid rgba(75, 151, 255, .23);
    border-radius: 25px;
    background:
        radial-gradient(ellipse at 85% 15%, rgba(32, 113, 255, .30), transparent 45%),
        linear-gradient(125deg, #132846, #0c1525 70%);
}

.welcome h1 {
    position: relative;
    z-index: 1;
    margin: 15px 0 9px;
    font-size: clamp(29px, 8vw, 39px);
    line-height: 1.08;
    letter-spacing: -1.6px;
}

.welcome h1 span {
    color: var(--blue-light);
}

.welcome p {
    position: relative;
    z-index: 1;
    color: #a9bad2;
    font-size: 13px;
    margin: 0 0 20px;
}

.primary-button {
    position: relative;
    z-index: 1;
    border: 0;
    border-radius: 12px;
    padding: 13px 17px;
    background: linear-gradient(110deg, #2694ff, #1765e8);
    box-shadow: 0 5px 22px rgba(30, 116, 255, .25);
    font-size: 12px;
    font-weight: 800;
}

.primary-button span {
    margin-left: 12px;
    font-size: 17px;
}

.hero-decoration {
    position: absolute;
    right: -15px;
    bottom: -43px;
    color: rgba(85, 180, 255, .08);
    font-size: 180px;
    font-weight: 950;
    font-style: italic;
    transform: rotate(-15deg);
    pointer-events: none;
}

/* SECTION HEADINGS */

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    margin: 30px 0 15px;
}

.section-heading h2,
.page-heading h1 {
    margin: 6px 0 0;
    font-size: 23px;
    letter-spacing: -.7px;
}

.text-button {
    border: 0;
    background: transparent;
    color: var(--blue-light);
    font-size: 11px;
    font-weight: 700;
}

/* CATEGORIES */

.category-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.category-card {
    min-height: 145px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    text-align: left;
}

.games-category {
    background: linear-gradient(145deg, #18385d, #101c31);
}

.cards-category {
    background: linear-gradient(145deg, #29335b, #151b32);
}

.category-symbol {
    font-size: 26px;
    margin-bottom: 12px;
}

.category-title {
    font-size: 13px;
    font-weight: 800;
}

.category-description {
    color: #9eacc2;
    font-size: 10px;
    margin-top: 5px;
}

/* CATALOG */

.page-heading {
    margin: 22px 0;
}

.page-heading p {
    color: var(--muted);
    font-size: 13px;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    height: 48px;
    padding: 0 14px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: var(--panel);
}

.search-box span {
    font-size: 23px;
    color: var(--blue-light);
}

.search-box input {
    flex: 1;
    width: 100%;
    border: 0;
    outline: none;
    background: transparent;
    color: white;
    font-size: 13px;
}

.filter-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 17px 0;
}

.filter {
    flex-shrink: 0;
    padding: 9px 16px;
    border: 1px solid var(--border);
    border-radius: 30px;
    background: var(--panel);
    color: var(--muted);
    font-size: 11px;
}

.filter.active {
    border-color: var(--blue);
    background: rgba(39, 135, 255, .16);
    color: var(--blue-light);
}

/* PRODUCT CARDS */

.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 13px;
}

.product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: var(--panel);
    cursor: pointer;
}

.product-image {
    width: 100%;
    aspect-ratio: 1.25;
    display: grid;
    place-items: center;
    overflow: hidden;
    background: linear-gradient(140deg, #1a3457, #101827);
    color: #70baff;
    font-size: 35px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    padding: 12px;
}

.product-category {
    color: var(--blue-light);
    font-size: 9px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-name {
    min-height: 34px;
    margin: 7px 0;
    font-size: 12px;
    font-weight: 750;
    line-height: 1.4;
}

.product-description {
    display: none;
}

.product-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
}

.product-price {
    font-size: 14px;
    font-weight: 850;
}

.add-button {
    width: 33px;
    height: 33px;
    border: 0;
    border-radius: 11px;
    background: var(--blue);
    font-size: 21px;
    font-weight: 700;
}

/* CART */

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--panel);
}

.cart-item-image {
    width: 62px;
    height: 62px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
    border-radius: 12px;
    background: var(--panel-light);
    font-size: 25px;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info strong {
    display: block;
    font-size: 12px;
}

.cart-item-info small {
    display: block;
    margin-top: 7px;
    color: var(--blue-light);
}

.remove-button {
    border: 0;
    background: transparent;
    color: #ff687d;
    font-size: 19px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    padding: 18px 2px;
    font-weight: 800;
}

.checkout-button {
    width: 100%;
    padding: 15px;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(110deg, #2694ff, #1765e8);
    font-weight: 800;
}

.empty-state {
    padding: 45px 15px;
    text-align: center;
    border: 1px dashed var(--border);
    border-radius: 18px;
    background: var(--panel);
}

.empty-state div {
    font-size: 43px;
}

.empty-state h3 {
    font-size: 17px;
}

.empty-state p {
    color: var(--muted);
    font-size: 12px;
}

/* PROFILE */

.profile-card {
    padding: 25px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(145deg, #162e4d, #101827);
    text-align: center;
}

.profile-avatar {
    width: 75px;
    height: 75px;
    display: grid;
    place-items: center;
    margin: auto;
    border-radius: 50%;
    background: linear-gradient(135deg, #51b8ff, #1264ed);
    font-size: 30px;
    font-weight: 900;
}

.profile-card h2 {
    margin-bottom: 5px;
    font-size: 18px;
}

.profile-card p {
    color: var(--muted);
    font-size: 12px;
}

.profile-status {
    display: inline-block;
    margin-top: 10px;
    color: #5fe0a2;
    font-size: 10px;
}

.profile-menu {
    margin-top: 16px;
}

.profile-menu button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 17px 13px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: transparent;
    text-align: left;
    font-size: 12px;
}

.profile-menu button span:last-child {
    margin-left: auto;
    color: var(--muted);
}

/* BOTTOM NAVIGATION */

.bottom-nav {
    position: fixed;
    z-index: 10;
    bottom: 0;
    left: 50%;
    width: 100%;
    max-width: 760px;
    display: flex;
    justify-content: space-around;
    padding: 10px 8px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: rgba(9, 15, 27, .96);
    backdrop-filter: blur(20px);
    transform: translateX(-50%);
}

.nav-item {
    position: relative;
    min-width: 65px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: var(--muted);
}

.nav-item > span {
    font-size: 22px;
}

.nav-item small {
    font-size: 9px;
}

.nav-item.active {
    color: var(--blue-light);
}

#cartBadge {
    position: absolute;
    top: -3px;
    right: 12px;
    min-width: 15px;
    height: 15px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #238aff;
    color: white;
    font-size: 9px;
}

/* MODAL */

.modal {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal.open {
    display: flex;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .72);
}

.modal-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 22px;
    border-radius: 25px 25px 0 0;
    border: 1px solid var(--border);
    background: #101a2b;
}

.modal-content img {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 15px;
}

.modal-content h2 {
    font-size: 20px;
}

.modal-content p {
    color: #a6b5ca;
    font-size: 13px;
    line-height: 1.6;
}

.modal-close {
    float: right;
    border: 0;
    background: transparent;
    color: white;
    font-size: 25px;
}

/* NOTIFICATIONS */

.toast {
    position: fixed;
    z-index: 50;
    left: 50%;
    bottom: 100px;
    max-width: calc(100% - 35px);
    padding: 13px 19px;
    border: 1px solid rgba(85, 180, 255, .3);
    border-radius: 13px;
    background: #162c49;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .3);
    color: white;
    font-size: 12px;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 10px);
    transition: .2s;
}

.toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

.loading {
    grid-column: 1 / -1;
    padding: 35px 10px;
    color: var(--muted);
    text-align: center;
    font-size: 12px;
}

/* DESKTOP */

@media (min-width: 600px) {
    .app {
        padding-left: 28px;
        padding-right: 28px;
    }

    .welcome {
        min-height: 300px;
        padding: 38px;
    }

    .product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
