:root {
    color-scheme: dark;
    --bg: #08090b;
    --panel: #0d0e11;
    --panel-2: #111217;
    --panel-3: #17181d;
    --text: #f7f7fb;
    --muted: #aaa6ad;
    --muted-2: #767179;
    --red: #d51010;
    --red-dark: #941313;
    --line: rgba(213, 16, 16, 0.82);
    --line-soft: rgba(255, 255, 255, 0.1);
    --blue: #3e81ed;
    --green: #21c985;
    --yellow: #f6c945;
    --shadow: 0 18px 46px rgba(0, 0, 0, 0.45);
}

:root[data-theme="light"] {
    color-scheme: dark;
    --bg: #101114;
    --panel: #15161b;
    --panel-2: #181a20;
    --panel-3: #212229;
    --text: #ffffff;
    --muted: #bab6bd;
    --muted-2: #85818a;
    --red: #ef1f1f;
    --red-dark: #a51616;
    --line: rgba(239, 31, 31, 0.78);
    --line-soft: rgba(255, 255, 255, 0.12);
    --shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
}

* {
    box-sizing: border-box;
}

html {
    min-width: 320px;
    min-height: 100%;
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    margin: 0;
    padding-bottom: 112px;
    overflow-x: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, Arial, Helvetica, sans-serif;
    letter-spacing: 0;
}

body.modal-open {
    overflow: hidden;
}

button {
    border: 0;
    color: inherit;
    font: inherit;
    letter-spacing: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.48;
}

button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

h1,
h2,
h3,
p {
    margin: 0;
    overflow-wrap: anywhere;
}

.space-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    background: #08090b;
}

.particle-canvas {
    display: block;
    width: 100%;
    height: 100%;
}

.trust-top {
    position: sticky;
    top: 0;
    z-index: 30;
    display: grid;
    place-items: center;
    height: 30px;
    background: var(--red-dark);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.app {
    position: relative;
    z-index: 2;
    width: min(100%, 520px);
    margin: 0 auto;
    padding: 0 12px 0;
}

.topbar {
    position: sticky;
    top: 30px;
    z-index: 25;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 38px;
    grid-template-rows: auto auto;
    align-items: center;
    gap: 10px;
    min-height: 56px;
    margin: 0 -12px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--red-dark);
    background: rgba(13, 14, 17, 0.96);
    backdrop-filter: blur(16px);
}

.store-head {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
}

.store-logo {
    width: 33px;
    height: 33px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(213, 16, 16, 0.85);
    border-radius: 50%;
    background: linear-gradient(135deg, #111, #2a0505);
    box-shadow: 0 0 22px rgba(213, 16, 16, 0.3);
}

.store-logo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.eyebrow {
    margin: 0 0 3px;
    color: var(--muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    overflow: hidden;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
}

h2 {
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.15;
    letter-spacing: 0;
}

.top-actions {
    display: contents;
}

.icon-button {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    width: 38px;
    min-width: 38px;
    height: 34px;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: #090a0d;
    color: transparent;
    box-shadow: inset 0 0 0 1px rgba(255, 44, 44, 0.08);
}

.icon-button::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    margin: 8px auto 0;
    border: 2px solid #aaa6ad;
    border-radius: 50%;
    box-shadow: inset -4px -4px 0 rgba(255, 255, 255, 0.04);
}

.balance {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 9px;
    border-radius: 7px;
    background: rgba(111, 103, 103, 0.34);
    color: #fff;
    text-align: left;
}

.balance span {
    display: block;
    color: rgba(255, 255, 255, 0.76);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
}

.balance strong {
    display: block;
    margin-top: 0;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    justify-content: start;
    gap: 12px;
    padding: 16px 0 12px;
    border-bottom: 1px solid rgba(148, 19, 19, 0.72);
}

.hero > div {
    min-width: 0;
    flex: 1 1 230px;
}

.hero h2 {
    max-width: 290px;
    font-size: 17px;
}

.hero p:last-child {
    margin-top: 6px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

#supportButton {
    min-height: 42px;
    width: fit-content;
    max-width: 100%;
    padding: 0 15px;
    border-radius: 999px;
    background: #ff1717;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 14px 28px rgba(255, 23, 23, 0.24);
}

.filters {
    display: flex;
    gap: 9px;
    margin: 15px 0 14px;
    overflow-x: auto;
    padding-bottom: 2px;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter {
    min-height: 40px;
    flex: 0 0 auto;
    padding: 0 16px;
    border: 1px solid transparent;
    border-radius: 7px;
    background: #101116;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    text-transform: lowercase;
}

.filter.active {
    border-color: rgba(213, 16, 16, 0.8);
    background: #14151a;
    box-shadow: inset 0 0 0 1px rgba(213, 16, 16, 0.12);
}

.products {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    width: 100%;
    align-items: stretch;
    padding-bottom: 24px;
}

@media (max-width: 520px) {
    .products {
        grid-template-columns: repeat(2, minmax(0, calc((100vw - 36px) / 2)));
    }
}

.product {
    --brand: #3e81ed;
    --brand-2: #15345f;
    position: relative;
    display: grid;
    height: 208px;
    min-height: 208px;
    min-width: 0;
    align-self: stretch;
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: hidden;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: rgba(7, 8, 11, 0.98);
    box-shadow: var(--shadow);
}

.product::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        linear-gradient(120deg, transparent 0 46%, rgba(255, 255, 255, 0.04) 46% 47%, transparent 47%),
        radial-gradient(circle at 84% 15%, color-mix(in srgb, var(--brand) 54%, transparent), transparent 18%);
    opacity: 0.36;
}

.product > div {
    position: relative;
    z-index: 1;
}

.product-media {
    position: relative;
    display: grid;
    place-items: center start;
    height: 94px;
    padding: 11px;
    overflow: hidden;
    border-bottom: 1px solid var(--red);
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--brand) 75%, #071021), rgba(11, 12, 16, 0.58)),
        radial-gradient(circle at 84% 16%, color-mix(in srgb, var(--brand-2) 70%, transparent), transparent 32%),
        #111217;
}

.product-media::before,
.product-media::after {
    content: "";
    position: absolute;
    pointer-events: none;
}

.product-media::before {
    inset: 0;
    z-index: 2;
    background:
        linear-gradient(100deg, transparent 0 45%, rgba(255, 255, 255, 0.09) 45% 46%, transparent 46%),
        repeating-linear-gradient(170deg, transparent 0 28px, rgba(255, 255, 255, 0.04) 28px 30px);
    opacity: 0.48;
}

.product-media::after {
    z-index: 3;
    right: 14px;
    top: 12px;
    width: 14px;
    height: 14px;
    background: var(--brand);
    clip-path: polygon(50% 0, 61% 36%, 100% 36%, 69% 58%, 82% 100%, 50% 74%, 18% 100%, 31% 58%, 0 36%, 39% 36%);
    filter: drop-shadow(0 0 8px var(--brand));
    opacity: 0.82;
}

.product-cover {
    position: absolute;
    inset: 0;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.brand-logo {
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 4px solid rgba(8, 9, 11, 0.8);
    border-radius: 12px;
    background: color-mix(in srgb, var(--brand) 22%, #101116);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.24),
        0 0 0 1px color-mix(in srgb, var(--brand) 70%, transparent);
}

.brand-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-logo.custom-logo img {
    object-fit: cover;
}

.brand-fallback {
    display: none;
}

.brand-logo.logo-fallback span {
    display: block;
    color: #fff;
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
    text-transform: uppercase;
}

.product h3 {
    min-height: 36px;
    max-height: 36px;
    margin: 10px 10px 6px;
    overflow: hidden;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.25;
    text-align: left;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.stock {
    display: none;
}

.product-bottom {
    display: grid;
    gap: 8px;
    padding: 0 9px 9px;
}

.price {
    color: #fff;
    font-size: 18px;
    font-weight: 500;
    line-height: 1;
    text-align: left;
}

.actions {
    display: grid;
    grid-template-columns: 1fr 36px;
    gap: 7px;
}

.buy,
.cart {
    min-height: 31px;
    border-radius: 6px;
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

.buy {
    background: #6f6767;
}

.cart {
    display: grid;
    place-items: center;
    background: #6f6767;
}

.cart svg {
    width: 19px;
    height: 19px;
    stroke: currentColor;
    stroke-width: 2.4;
    fill: none;
}

.cart-bar {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: 0;
    z-index: 35;
    width: min(100%, 520px);
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--red-dark);
    background: rgba(13, 14, 17, 0.96);
    backdrop-filter: blur(16px);
    box-shadow: 0 -18px 36px rgba(0, 0, 0, 0.34);
}

.modal[hidden],
.cart-bar[hidden] {
    display: none;
}

.cart-items {
    max-height: 138px;
    display: grid;
    gap: 8px;
    overflow: auto;
}

.cart-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 34px;
    align-items: center;
    gap: 8px;
    padding: 8px 9px;
    border: 1px solid rgba(213, 16, 16, 0.48);
    border-radius: 7px;
    background: #090a0d;
}

.cart-item strong,
.cart-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item strong {
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.cart-item span {
    margin-top: 3px;
    color: #fff;
    font-size: 12px;
    font-weight: 500;
}

.remove-cart-item {
    width: 34px;
    height: 34px;
    border-radius: 7px;
    background: rgba(255, 23, 23, 0.18);
    color: #ff8c8c;
    font-size: 18px;
    font-weight: 900;
}

.cart-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.cart-bar span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.cart-bar strong {
    display: block;
    margin-top: 2px;
    color: #fff;
    font-size: 20px;
    font-weight: 500;
}

#checkoutButton {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 8px;
    background: #ff1717;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    box-shadow: 0 12px 28px rgba(255, 23, 23, 0.24);
}

.modal {
    position: fixed;
    inset: 0;
    z-index: 45;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.74);
    backdrop-filter: blur(10px);
}

.modal-panel {
    position: relative;
    width: min(100%, 430px);
    max-height: calc(100vh - 32px);
    overflow: auto;
    padding: 25px 18px 18px;
    border: 1px solid var(--red);
    border-radius: 8px;
    background: rgba(13, 14, 17, 0.99);
    text-align: left;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.modal-panel::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 98px;
    border-bottom: 1px solid var(--red);
    background:
        linear-gradient(120deg, color-mix(in srgb, var(--brand) 70%, #101116), rgba(13, 14, 17, 0.7)),
        #111217;
    pointer-events: none;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 7px;
    background: rgba(8, 9, 11, 0.82);
    color: #fff;
    font-size: 18px;
    font-weight: 500;
}

.modal-icon {
    position: relative;
    z-index: 1;
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    margin: 28px 0 18px;
}

.modal-icon .brand-logo {
    width: 66px;
    height: 66px;
    border-radius: 13px;
}

.modal-panel h2 {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 18px;
    line-height: 1.2;
}

.modal-description {
    margin: 13px 0 0;
    white-space: pre-line;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.modal-price {
    margin: 18px 0;
    color: #fff;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
}

.modal-actions {
    display: grid;
    gap: 9px;
}

.modal-actions button {
    min-height: 46px;
    border-radius: 7px;
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

#modalAddCart {
    background: #6f6767;
}

#modalCheckout {
    background: #ff1717;
}

.bonus-options {
    margin-top: 14px;
    text-align: left;
}

.bonus-options strong {
    display: block;
    margin-bottom: 8px;
    color: #fff;
    font-size: 13px;
}

.bonus-list {
    display: grid;
    gap: 8px;
}

.bonus-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px;
    border: 1px solid rgba(213, 16, 16, 0.48);
    border-radius: 7px;
    background: #090a0d;
    color: #fff;
}

.bonus-item input {
    accent-color: var(--red);
}

.bonus-item small {
    color: var(--muted);
}

.warning {
    margin: 0;
    color: var(--yellow);
    text-align: center;
}

.empty {
    position: relative;
    z-index: 1;
    margin: 34px 0 0;
    color: var(--muted);
    text-align: center;
}

@supports not (color: color-mix(in srgb, red, blue)) {
    .product::before {
        background: linear-gradient(120deg, transparent 0 46%, rgba(255, 255, 255, 0.04) 46% 47%, transparent 47%);
    }

    .product-media,
    .modal-panel::before {
        background: linear-gradient(120deg, var(--brand), #111217);
    }
}

@media (max-width: 390px) {
    .app,
    .cart-bar {
        width: 100%;
    }

    .app {
        padding-left: 10px;
        padding-right: 10px;
    }

    .topbar {
        margin-left: -10px;
        margin-right: -10px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .hero {
        align-items: flex-start;
    }

    .hero h2 {
        font-size: 16px;
    }

    .products {
        gap: 10px;
    }

    .product-media {
        height: 92px;
        padding: 10px;
    }

    .brand-logo {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 330px) {
    .products {
        grid-template-columns: 1fr;
    }
}
