:root {
    --brand-red: #f21f2b;
    --brand-red-soft: rgba(242, 31, 43, 0.09);

    --black: #050505;

    --bg: var(
        --tg-theme-secondary-bg-color,
        #f3f3f5
    );

    --card: var(
        --tg-theme-bg-color,
        #ffffff
    );

    --text: var(
        --tg-theme-text-color,
        #111111
    );

    --hint: var(
        --tg-theme-hint-color,
        #6f6f74
    );

    --border: rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Arial,
        sans-serif;

    background: var(--bg);
    color: var(--text);
}

button,
input,
select {
    font: inherit;
}

.container {
    width: min(100%, 760px);

    margin: 0 auto;

    padding:
        max(18px, env(safe-area-inset-top))
        16px
        max(30px, env(safe-area-inset-bottom));
}

.header {
    background: var(--card);

    border-radius: 24px;

    padding: 20px;

    margin-bottom: 14px;
}

.top-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    display: inline-flex;
    align-items: baseline;

    font-size: 44px;
    line-height: 1;

    font-weight: 950;

    letter-spacing: -4px;

    margin-bottom: 18px;
}

.logo-black {
    color: var(--black);
}

.logo-red {
    color: var(--brand-red);
}

.back-button {
    width: 40px;
    height: 40px;

    margin-bottom: 18px;

    border: 0;
    border-radius: 14px;

    background: var(--bg);
    color: var(--text);

    font-size: 24px;
    font-weight: 700;

    cursor: pointer;
}

.hidden {
    display: none !important;
}

.header h1 {
    margin: 0 0 6px;

    font-size: 30px;
    line-height: 1.1;

    font-weight: 800;
}

.header p {
    margin: 0;

    color: var(--hint);

    font-size: 15px;
    line-height: 1.45;
}

.promo-list {
    display: grid;
    gap: 12px;
}

.promo-card,
.detail-card,
.product-card,
.search-card {
    background: var(--card);

    border-radius: 22px;

    padding: 18px;

    box-shadow:
        0 1px 0
        rgba(0, 0, 0, 0.03);
}

.promo-card {
    cursor: pointer;

    transition:
        transform 0.12s ease,
        opacity 0.12s ease;
}

.promo-card:active {
    transform: scale(0.985);
    opacity: 0.92;
}

.promo-top {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 15px;
}

.promo-icon {
    font-size: 27px;
}

.period {
    background: var(--brand-red-soft);
    color: var(--brand-red);

    padding: 7px 10px;

    border-radius: 999px;

    font-size: 12px;
    font-weight: 800;

    white-space: nowrap;
}

.promo-card h2,
.detail-card h2 {
    margin: 0 0 8px;

    font-size: 19px;
    line-height: 1.25;
}

.promo-card p,
.detail-card p,
.product-card p {
    margin: 0;

    color: var(--hint);

    font-size: 14px;
    line-height: 1.5;
}

.tag {
    display: inline-flex;

    margin-top: 16px;

    padding: 7px 11px;

    color: #ffffff;
    background: var(--brand-red);

    border-radius: 10px;

    font-size: 12px;
    font-weight: 800;
}

.detail-stack,
.products-list {
    display: grid;
    gap: 12px;
}

.detail-section {
    margin-top: 18px;
}

.detail-label {
    margin-bottom: 7px;

    color: var(--hint);

    font-size: 12px;
    font-weight: 700;

    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-text {
    white-space: pre-line;

    line-height: 1.55;
}

.promo-code {
    display: inline-flex;

    margin-top: 10px;

    padding: 10px 14px;

    border: 1px dashed var(--brand-red);
    border-radius: 12px;

    color: var(--brand-red);

    font-weight: 900;
    letter-spacing: 0.08em;
}

.search-card {
    display: grid;
    gap: 10px;

    margin-bottom: 12px;
}

.search-input,
.category-select {
    width: 100%;

    border: 1px solid var(--border);
    border-radius: 14px;

    padding: 13px 14px;

    outline: none;

    background: var(--bg);
    color: var(--text);
}

.search-input:focus,
.category-select:focus {
    border-color: var(--brand-red);
}

.result-count {
    color: var(--hint);

    font-size: 13px;
}

.product-card {
    display: grid;
    gap: 8px;
}

.product-sku {
    color: var(--hint);

    font-size: 12px;
    font-weight: 700;
}

.product-name {
    color: var(--text);

    font-size: 15px;
    line-height: 1.4;

    font-weight: 700;
}

.product-category {
    color: var(--hint);

    font-size: 12px;
}

.price-line {
    display: flex;
    align-items: baseline;

    gap: 9px;

    flex-wrap: wrap;
}

.sale-price {
    color: var(--brand-red);

    font-size: 20px;
    font-weight: 900;
}

.old-price {
    color: var(--hint);

    font-size: 14px;

    text-decoration: line-through;
}

.normal-price {
    color: var(--text);

    font-size: 18px;
    font-weight: 900;
}

.cashback-badge {
    display: inline-flex;

    width: fit-content;

    padding: 7px 10px;

    background: var(--brand-red-soft);
    color: var(--brand-red);

    border-radius: 10px;

    font-size: 13px;
    font-weight: 900;
}

.load-more {
    width: 100%;

    margin-top: 12px;

    padding: 14px;

    border: 0;
    border-radius: 15px;

    background: var(--card);
    color: var(--brand-red);

    font-weight: 800;

    cursor: pointer;
}

.empty {
    text-align: center;

    color: var(--hint);
}

footer {
    padding: 22px 4px 5px;

    text-align: center;

    color: var(--hint);

    font-size: 12px;
}
