/* Магазин — поверх style.css (общие токены и шапка). Классы используются в shop.js. */

.shop-hero-row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px 32px;
}
.shop-hero-row .section-lead { max-width: 560px; }

.shop-featured, .shop-grid { display: grid; gap: 14px; }
@media (min-width: 760px) {
    .shop-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
    .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1024px) { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.shop-product {
    --product-accent: var(--accent);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 0;
    padding: 20px;
    border-radius: var(--radius-lg);
    background: var(--surface);
    border: 1px solid var(--border);
    transition: border-color .2s var(--ease);
}
.shop-product:hover { border-color: color-mix(in srgb, var(--product-accent) 50%, var(--border)); }
.shop-product.premium { --product-accent: var(--violet); background: linear-gradient(140deg, rgba(167, 139, 250, .18), var(--surface) 65%); }
.shop-product.coins { --product-accent: var(--green); background: linear-gradient(140deg, rgba(74, 222, 128, .13), var(--surface) 65%); }
.shop-product.neizzir_blue { --product-accent: #8b8cff; }
.shop-product.neizzir_azure { --product-accent: #67d7ff; }
.shop-product.neizzir_gray { --product-accent: #b6c5d3; }
.shop-product.neizzir_fiol { --product-accent: #d8a3f5; }
.shop-product.course_forever { --product-accent: var(--amber); }
.shop-product:not(.premium):not(.coins) { border-top: 3px solid var(--product-accent); }

.shop-product-icon {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: 14px;
    color: var(--product-accent);
    background: color-mix(in srgb, var(--product-accent) 16%, transparent);
}
.shop-product-icon .icon { width: 24px; height: 24px; }
.shop-product h2 { font-size: clamp(22px, 4vw, 28px); }
.shop-product h3 { font-size: 18px; letter-spacing: -.01em; }
.shop-product > p { margin-top: 8px; color: var(--muted); font-size: 14.5px; }
.shop-perks { --tone: var(--violet); margin-top: 14px; }

.shop-product-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    align-self: stretch;
    gap: 12px;
    margin-top: auto;
    padding-top: 20px;
}
.shop-product-actions strong {
    color: var(--product-accent);
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -.02em;
    font-variant-numeric: tabular-nums;
}

.shop-collection { margin-top: 40px; }
.shop-collection > h2 { margin-bottom: 16px; font-size: clamp(22px, 5vw, 30px); }

.shop-how {
    list-style: none;
    margin: 40px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
    counter-reset: how;
}
@media (min-width: 760px) { .shop-how { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
.shop-how li {
    counter-increment: how;
    display: grid;
    gap: 4px;
    padding: 18px 18px 18px 64px;
    position: relative;
    border-radius: var(--radius-lg);
    border: 1px dashed var(--border-strong);
}
.shop-how li::before {
    content: counter(how);
    position: absolute;
    left: 18px;
    top: 18px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 900;
}
.shop-how span { color: var(--muted); font-size: 14px; }

/* кнопки, которые создаёт shop.js */
.shop-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    background: var(--accent);
    color: var(--on-accent);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .18s var(--ease), border-color .18s var(--ease), transform .12s var(--ease);
}
.shop-button:hover { background: var(--accent-hover); color: var(--on-accent); }
.shop-button:active { transform: scale(.98); }
.shop-button.secondary { background: var(--surface-2); border-color: var(--border-strong); color: var(--text); }
.shop-button.secondary:hover { border-color: var(--accent); background: var(--surface-3); color: var(--text); }
.shop-button:disabled { cursor: wait; opacity: .55; }
.quiet { color: var(--subtle); }

/* диалог оформления */
#shop-dialog {
    width: min(540px, 100% - 24px);
    max-height: min(92dvh, 920px);
    padding: 20px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-xl);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    overscroll-behavior: contain;
}
#shop-dialog[open] { animation: dialog-in .22s var(--ease); }
.shop-dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.shop-dialog-heading h2 { font-size: 21px; }
.shop-dialog-heading form { margin: 0; }
.shop-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
}
.shop-close:hover { border-color: var(--accent); }

#shop-dialog-body > :first-child { margin-top: 0; }
#shop-dialog-body p { margin: 0 0 10px; color: var(--muted); }
#shop-dialog-body > a.shop-button { margin-top: 12px; background: var(--surface-2); color: var(--text); border-color: var(--border-strong); }

.shop-fields { display: grid; gap: 14px; }
.shop-fields label { display: grid; gap: 6px; font-weight: 600; font-size: 14.5px; }
.shop-fields input, .shop-fields select {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    background: var(--bg);
    color: var(--text);
    font-size: 16px;
    outline: none;
}
.shop-fields input:focus, .shop-fields select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

.shop-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 16px; }
.shop-actions .shop-button { flex: 1 1 auto; }
.shop-facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 10px 14px; margin: 14px 0; font-size: 14.5px; }
.shop-facts dt { color: var(--subtle); }
.shop-facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.shop-total { display: block; font-weight: 900; font-size: 34px; color: var(--accent); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }

#shop-status { margin: 0 0 14px; padding: 12px 14px; border: 1px solid var(--border-strong); border-radius: 12px; color: var(--muted); background: var(--surface-2); }
#shop-status.error { color: #ffb6bb; border-color: #874450; background: rgba(255, 107, 120, .08); }

.shop-order { padding: 14px 0; border-bottom: 1px solid var(--border); }
.shop-order:last-child { border-bottom: 0; }
.shop-order p { margin: 4px 0; }
.shop-order-heading { color: var(--text); font-size: 16px; font-weight: 700; margin-bottom: 0; }
.shop-access { overflow-wrap: anywhere; }

@media (max-width: 559px) {
    #shop-dialog {
        width: 100%;
        max-width: 100%;
        margin: auto auto 0;
        padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
        border-bottom: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    }
    #shop-dialog[open] { animation-name: sheet-in; }
    .shop-product { padding: 18px; }
    .shop-hero-row .btn { width: 100%; }
}
