:root {
    --bg: var(--tg-theme-bg-color, #0e0e13);
    --surface: #1a1a22;
    --surface-2: #232330;
    --text: var(--tg-theme-text-color, #f2f2f5);
    --muted: #9a9aa5;
    --accent: #fc21a3;
    --border: #2c2c38;
    --radius: 14px;
    --radius-sm: 8px;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    padding-bottom: calc(100px + var(--safe-bottom));
}

header {
    padding: calc(14px + var(--safe-top)) 16px 10px;
    border-bottom: 1px solid var(--border);
}

header h1 {
    font-size: 19px;
    margin: 0;
}

main { padding: 16px; }

.card {
    display: flex;
    flex-direction: column;
}

.image-coins {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    margin-bottom: 14px;
}

.card-photo {
    width: 100%;
    max-height: 60vh;
    object-fit: cover;
    display: block;
    cursor: zoom-in;
}

.cards-wrapper { margin-bottom: 10px; }

.cards-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.card-similar { flex-shrink: 0; }

.card-flavor-similar {
    display: block;
    padding: 8px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 13px;
    white-space: nowrap;
}

.card-price,
.card-price-container {
    font-size: 22px;
    font-weight: 800;
    margin: 4px 0 10px;
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.card-price-old {
    font-size: 15px;
    color: var(--muted);
    text-decoration: line-through;
    font-weight: 400;
}

.card-price-new { color: var(--accent); }

.card h3 {
    font-size: 14px;
    color: var(--muted);
    margin: 14px 0 4px;
    font-weight: 600;
}

.card-about {
    font-size: 14.5px;
    line-height: 1.5;
    margin: 0;
}

/* Плавающие кнопки корзины/количества внизу экрана */
.button-footer2 {
    position: fixed;
    left: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 16px;
}

.button-footer-button {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: var(--accent);
    color: #fff;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.button-text {
    min-width: 18px;
    text-align: center;
    font-weight: 700;
    margin: 0;
}

.button-footer,
#add-to-cart-button-1 .button-footer,
[id^="add-to-cart-button-"] .button-footer {
    position: fixed;
    left: 16px;
    right: 90px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 20;
    display: block;
    text-align: center;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 15px;
    padding: 15px;
    border-radius: var(--radius);
    border: none;
    box-shadow: 0 8px 24px rgba(252, 33, 163, 0.35);
}

.preorder-btn { background: var(--surface-2); color: var(--text); }

.buttoncart {
    position: fixed;
    right: 16px;
    bottom: calc(16px + var(--safe-bottom));
    z-index: 21;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-button {
    width: 24px;
    height: 24px;
}

/* Модалка полноэкранного просмотра фото */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.92);
}

.modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 92vw;
    max-height: 85vh;
    border-radius: var(--radius-sm);
}

.close {
    position: absolute;
    top: calc(16px + var(--safe-top));
    right: 16px;
    z-index: 51;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal {
    width: 16px;
    height: 16px;
}
