﻿/* =========================================
   STORE CSS (Магазин MINEDEV)
   ========================================= */

.store-hero {
    padding: 8rem 0 2rem;
    text-align: center;
}

.store-content {
    display: flex;
    max-width: 1120px;
    margin: 0 auto;
    padding: 2rem;
    gap: 2rem;
    position: relative;
    z-index: 2;
}

/* Sidebar */
.store-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
}

.store-sidebar h3 {
    font-family: var(--font-display);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
}

.category-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.category-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 0.55rem 1rem;
    border-radius: 10px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.category-btn:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
}

.category-btn.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.25);
}

body.light-theme .category-btn {
    border-color: rgba(0, 0, 0, 0.1);
    color: var(--text-muted);
}
body.light-theme .category-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: var(--text-color);
}
body.light-theme .category-btn.active {
    background: rgba(0, 0, 0, 0.08);
    color: #111;
    border-color: rgba(0, 0, 0, 0.2);
}

/* === Поисковая строка === */
.store-search-container {
    position: relative;
    width: 300px;
}

.store-search-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.8rem 1.2rem 0.8rem 2.8rem;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
}

.store-search-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
}

.store-search-container svg {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: #999;
    pointer-events: none;
    z-index: 2;
}

body.light-theme .store-search-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}
body.light-theme .store-search-input:focus {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.2);
}

/* === Фильтр по цене === */
.price-filter-widget.price-filter-widget h3 {
    font-family: var(--font-display);
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: #ffffff;
    font-weight: bold;
}

.range-slider-container {
    position: relative;
    width: 100%;
    height: 16px; /* Height of the thumb to prevent overflow issues */
    margin: 30px 0 30px 0; /* Lowered a bit */
    background: transparent;
}

.range-slider-track-bg {
    position: absolute;
    height: 4px;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    pointer-events: none;
}

.range-slider-track {
    position: absolute;
    height: 4px;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    background: #ffffff;
    border-radius: 2px;
    pointer-events: none;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.5);
}

.range-slider {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 4px;
    transform: translateY(-50%);
    -webkit-appearance: none;
    appearance: none;
    background: transparent;
    pointer-events: none;
    margin: 0;
    outline: none;
}

.range-slider::-webkit-slider-runnable-track {
    width: 100%;
    height: 4px;
    cursor: pointer;
    background: transparent;
    border: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    margin-top: -6px;
    transition: transform 0.2s ease;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

.range-slider::-moz-range-thumb {
    height: 16px;
    width: 16px;
    border-radius: 50%;
    background: #ffffff;
    border: none;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 2px 4px rgba(0,0,0,0.5);
    transition: transform 0.2s ease;
}

.range-slider::-moz-range-thumb:hover {
    transform: scale(1.15);
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.price-input-group {
    display: flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.55rem 1rem;
    flex: 1;
    transition: border-color 0.3s ease;
}

.price-input-group:focus-within {
    border-color: rgba(255, 255, 255, 0.3);
}

.price-input-group input {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-color);
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
}

.price-input-group input::placeholder {
    color: var(--text-muted);
}

.price-input-separator {
    color: var(--text-muted);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    font-weight: 500;
}

.price-input-group input::-webkit-outer-spin-button,
.price-input-group input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

body.light-theme .price-input-group {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

/* === Кастомный Select (Сортировка) === */
.custom-select-wrapper {
    position: relative;
    user-select: none;
    width: 220px;
    z-index: 100;
}

.custom-select-trigger {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-color);
    padding: 0.7rem 1.2rem;
    border-radius: 12px;
    font-family: var(--font-display);
    font-size: 0.9rem;
    cursor: pointer;
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.custom-select-trigger:hover {
    background: rgba(255, 255, 255, 0.1);
}

.custom-select-wrapper.open .custom-select-trigger {
    border-color: rgba(255, 255, 255, 0.3);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.custom-select-wrapper.open .custom-select-trigger svg {
    transform: rotate(180deg);
}

.custom-select-trigger svg {
    transition: transform 0.3s ease;
}

.custom-select-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: none;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    backdrop-filter: blur(15px);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    overflow: hidden;
}

.custom-select-wrapper.open .custom-select-options {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.custom-option {
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.custom-option:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-color);
}

.custom-option.selected {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

body.light-theme .custom-select-trigger {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.05);
}
body.light-theme .custom-select-options {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(0, 0, 0, 0.05);
}
body.light-theme .custom-option.selected {
    background: rgba(0, 0, 0, 0.05);
    color: #000;
}
body.light-theme .custom-option:hover {
    background: rgba(0, 0, 0, 0.03);
    color: #000;
}

/* === Тулбар и Контролы === */
.store-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.store-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.store-main {
    flex-grow: 1;
    min-width: 0;
}

/* === Сетка товаров === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.35rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.product-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.product-media {
    position: relative;
    overflow: hidden;
}

.product-mc-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin: 0.15rem 0 0;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    line-height: 1.2;
    color: #111;
    background: #8cff00;
}

body.light-theme .product-mc-badge {
    color: #111;
    background: #8cff00;
}

.product-title {
    padding: 0;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
}

.product-desc {
    padding: 0;
    margin: 0;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.86rem;
    font-weight: 500;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-img-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    border: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    background: rgba(255, 255, 255, 0.04);
}

.product-img-placeholder span {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.3);
    letter-spacing: 2px;
}

body.light-theme .product-img-placeholder {
    border-color: rgba(0, 0, 0, 0.15);
    background: rgba(0, 0, 0, 0.02);
}

body.light-theme .product-img-placeholder span {
    color: rgba(0, 0, 0, 0.3);
}

.product-meta {
    padding: 0.5rem 1rem;
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
}

.product-footer {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.product-footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
}

.product-price {
    font-family: var(--font-body);
    font-size: 1.2rem;
    font-weight: 700;
}

.price-paid {
    color: var(--primary-color);
}

.price-free {
    color: #10b981;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 700;
}

.product-btn {
    padding: 0.5rem 1.2rem !important;
    font-size: 0.85rem !important;
    cursor: pointer;
}

body.light-theme .product-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}
body.light-theme .product-card:hover {
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}
body.light-theme .product-footer {
    border-color: rgba(0, 0, 0, 0.05);
}

/* === Пагинация === */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.page-btn.active {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
}

/* === Корзина === */
.store-cart-trigger {
    position: relative;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.store-cart-trigger:hover {
    color: var(--text-muted);
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1;
    background: #fff;
    color: #111;
    border: 1px solid rgba(255, 255, 255, 0.25);
}

body.light-theme .cart-badge {
    background: #fff;
    color: #111;
    border: 1px solid rgba(0, 0, 0, 0.18);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* === Product Modal === */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 9000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    box-sizing: border-box;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: var(--nav-bg);
    border: 1px solid var(--nav-border);
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: min(90vh, 920px);
    padding: 1.5rem;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transform: translateY(12px);
    transition: transform 0.25s ease;
    box-sizing: border-box;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    z-index: 2;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--text-color);
}

/* Подробнее — компактная карточка в экран */
.product-overview-modal {
    max-width: 720px !important;
    padding: 1.25rem 1.35rem 1.25rem !important;
}
.product-overview-layout {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1.15rem;
    min-height: 0;
    max-height: calc(90vh - 2.5rem);
    align-items: stretch;
}
.product-overview-media {
    min-width: 0;
}
.product-overview-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 14px;
    display: block;
    background: rgba(255, 255, 255, 0.04);
}
.product-overview-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    padding-right: 1.5rem;
}
.product-overview-title {
    margin: 0 0 0.55rem !important;
    font-size: 1.25rem !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    padding-right: 1rem;
}
.product-overview-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    scrollbar-width: thin;
    margin: 0.35rem 0 0.85rem;
    padding-right: 4px;
}
.product-overview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.9rem;
    margin-top: auto;
    flex-shrink: 0;
}
.product-overview-footer .product-btn,
.product-overview-footer a.product-btn {
    min-height: 2.6rem;
    padding: 0.65rem 1.1rem;
    white-space: nowrap;
}

@media (max-width: 720px) {
    .product-overview-layout {
        grid-template-columns: 1fr;
        max-height: calc(92vh - 2rem);
    }
    .product-overview-media {
        max-width: 160px;
    }
    .product-overview-main {
        padding-right: 0.5rem;
    }
}

/* === Корзина и Оформление (Cart & Checkout) === */
.cart-overlay, .checkout-overlay, .auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.checkout-overlay {
    background: transparent;
}

.cart-overlay.active, .checkout-overlay.active, .auth-overlay.active {
    display: flex;
}

.cart-modal, .checkout-modal, .auth-modal {
    background: var(--bg-color);
    border: 1px solid var(--nav-border);
    border-radius: 20px;
    width: 92%;
    max-width: 440px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    transform: translateY(16px);
    transition: transform 0.25s ease;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.cart-overlay.active .cart-modal, .checkout-overlay.active .checkout-modal, .auth-overlay.active .auth-modal {
    transform: translateY(0);
}

.cart-header, .checkout-header, .auth-header {
    padding: 1.25rem 1.35rem 1rem;
    border-bottom: 1px solid var(--nav-border);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.cart-header h2, .checkout-header h2, .auth-header h2 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin: 0;
}

.cart-header-sub {
    margin: 0.25rem 0 0;
    font-family: var(--font-body);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.close-cart, .close-checkout, .close-auth {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

body.light-theme .close-cart,
body.light-theme .close-checkout,
body.light-theme .close-auth {
    background: rgba(0, 0, 0, 0.04);
    border-color: rgba(0, 0, 0, 0.08);
}

.close-cart:hover, .close-checkout:hover, .close-auth:hover {
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.1);
}

.cart-items {
    padding: 1rem 1.15rem;
    overflow-y: auto;
    flex-grow: 1;
}

.cart-empty {
    text-align: center;
    color: var(--text-muted);
    padding: 2.5rem 1rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    line-height: 1.5;
}

.cart-empty span {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.8rem;
    opacity: 0.8;
}

.cart-item {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    border: 1px solid var(--nav-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.03);
}

body.light-theme .cart-item {
    background: rgba(0, 0, 0, 0.02);
}

.cart-item-img {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
}

.cart-item-info {
    flex-grow: 1;
    min-width: 0;
}

.cart-item-title {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-mc {
    font-family: var(--font-body);
    font-size: 0.72rem;
    font-weight: 600;
    color: #ca8a04;
    margin-bottom: 0.15rem;
}

body.light-theme .cart-item-mc {
    color: #a16207;
}

.cart-item-price {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--text-muted);
}

.remove-item {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #ef4444;
    cursor: pointer;
    padding: 0.35rem 0.65rem;
    border-radius: 8px;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    flex-shrink: 0;
    transition: background 0.2s ease;
}

.remove-item:hover {
    background: rgba(239, 68, 68, 0.1);
}

.cart-footer {
    padding: 1rem 1.25rem 1.25rem;
    border-top: 1px solid var(--nav-border);
}

.promo-section {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.promo-input {
    flex-grow: 1;
    min-width: 0;
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--nav-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    color: var(--text-color);
    font-family: var(--font-body);
    font-size: 0.9rem;
}

body.light-theme .promo-input {
    background: #fff;
}

.promo-apply-btn {
    padding: 0.65rem 0.9rem;
    border: 1px solid var(--nav-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-color);
    cursor: pointer;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 0.85rem;
    white-space: nowrap;
}

body.light-theme .promo-apply-btn {
    background: rgba(0, 0, 0, 0.04);
}

.promo-msg {
    font-size: 0.8rem;
    margin-bottom: 0.65rem;
    text-align: center;
    font-family: var(--font-body);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-family: var(--font-body);
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.checkout-btn {
    width: 100%;
    border-radius: 12px !important;
    padding: 0.85rem 1rem !important;
}

.checkout-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Checkout & Auth Modal */
.checkout-body, .auth-body {
    padding: 1.5rem;
    overflow-y: auto;
}

.checkout-desc {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}

@media (max-width: 480px) {
    .modal-content { padding: 1.5rem; margin: 10px; width: calc(100% - 20px); }
    .product-details { grid-template-columns: 1fr; }
    .cart-item { align-items: center; }
}

/* === Анимации промокода === */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
    20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.shake {
    animation: shake 0.5s cubic-bezier(.36,.07,.19,.97) both;
    border-color: #ef4444 !important;
}

#promo-input:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.5);
}

.promo-success-glow {
    border-color: #10b981 !important;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.4) !important;
    transition: all 0.3s ease;
}

/* === Плавающий бейдж активного промокода === */
.active-promo-badge {
    position: fixed;
    bottom: 30px;
    left: 30px;
    background: var(--accent);
    color: white;
    padding: 0.8rem 1.2rem;
    border-radius: 12px;
    font-weight: 600;
    font-family: var(--font-display);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    transform: translateY(150%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    pointer-events: none;
}

.active-promo-badge.visible {
    transform: translateY(0);
    opacity: 1;
}

.active-promo-badge svg {
    width: 20px;
    height: 20px;
    animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
    0% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.5)); transform: scale(1); }
    50% { filter: drop-shadow(0 0 8px rgba(255,255,255,0.8)); transform: scale(1.1); }
    100% { filter: drop-shadow(0 0 2px rgba(255,255,255,0.5)); transform: scale(1); }
}

@media (max-width: 768px) {
    .active-promo-badge {
        bottom: 20px;
        left: 50%;
        transform: translate(-50%, 150%);
        width: max-content;
    }
    .active-promo-badge.visible {
        transform: translate(-50%, 0);
    }
}

.payment-methods {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.payment-method {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 1.5rem;
}

.payment-method.payment-method-primary {
    border-color: rgba(99, 102, 241, 0.45);
    background: rgba(99, 102, 241, 0.12);
}

.payment-method.payment-method-primary:hover:not(.disabled) {
    border-color: rgba(99, 102, 241, 0.75);
    background: rgba(99, 102, 241, 0.2);
}

.payment-method.payment-method-primary .payment-icon {
    background: rgba(99, 102, 241, 0.35);
}

.checkout-actions-simple {
    gap: 0.85rem;
}

.payment-method.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(100%);
}

.payment-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-info {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.payment-info h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0;
}

.payment-info span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

body.light-theme .payment-method {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .payment-method:hover:not(.disabled) {
    background: rgba(0, 0, 0, 0.08);
}

body.light-theme .payment-icon {
    background: rgba(0, 0, 0, 0.05);
}

.checkout-method {
    cursor: pointer;
}
.checkout-method input {
    display: none;
}
.method-content {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.3s ease;
}
body.light-theme .method-content {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
}
.checkout-method input:checked + .method-content {
    border-color: var(--primary-color);
    background: rgba(139, 92, 246, 0.1);
}
.checkout-method input:checked + .method-content svg {
    color: var(--primary-color);
}

.payment-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.05);
    border-radius: 8px;
}

body.light-theme .payment-icon {
    background: rgba(0,0,0,0.05);
}

.payment-info h4 {
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.payment-info span {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* === Результаты === */
.store-results-info {
    margin-bottom: 1.5rem;
}

.store-results {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Скрываем старый селект */
.sort-select {
    display: none !important;
}

/* === MOBILE STORE ADAPTATION === */
@media (max-width: 900px) {
    .store-content {
        flex-direction: column;
    }

    .store-sidebar {
        position: static;
        width: 100%;
        height: auto;
        padding-bottom: 1rem;
        margin-bottom: 1rem;
        border-right: none;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }

    body.light-theme .store-sidebar {
        border-bottom: 1px solid rgba(0,0,0,0.1);
    }

    .store-toolbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .store-search-container, .custom-select-wrapper, .price-filter-widget {
        width: 100%;
    }

    .store-controls {
        width: 100%;
        flex-direction: column;
        gap: 1rem;
    }

    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .cart-modal, .checkout-modal, .auth-modal {
        width: 100%;
        height: 100%;
        margin: 0;
        max-height: 100vh;
        border-radius: 0;
    }

    .category-btn {
        white-space: nowrap;
    }
}

/* Tiers Modal */
.tier-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}
.tier-card:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.tier-card.selected {
    border-color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.8), 0 8px 30px rgba(0, 0, 0, 0.3);
}
.tier-card.selected::after {
    content: 'Выбран';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #000;
    background: #fff;
    padding: 2px 8px;
    border-radius: 4px;
}
.tier-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.25rem;
}
.tier-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #fff;
}
.tier-card.selected .tier-name {
    padding-right: 4rem; /* space for 'Выбран' badge */
}
.tier-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
}
.tier-desc {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    line-height: 1.5;
}


.checkout-info-banner { display: flex; gap: 12px; align-items: center; background: rgba(59, 130, 246, 0.1); border: 1px solid rgba(59, 130, 246, 0.2); border-radius: 8px; padding: 12px 16px; margin-bottom: 16px; }
.checkout-info-banner svg { flex-shrink: 0; }
.checkout-info-banner span { font-size: 0.85rem; color: var(--text-muted); line-height: 1.4; }
.checkout-info-banner b { color: var(--text-color); }

/* ── Payment Loader Overlay ──────────────────────────────── */
.pay-loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.pay-loader-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.pay-loader-box {
    background: var(--nav-bg, #141414);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 20px;
    padding: 40px 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 280px;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 24px 64px rgba(0,0,0,0.6);
    transform: translateY(0);
    animation: payBoxIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes payBoxIn {
    from { transform: translateY(24px) scale(0.94); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.pay-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.08);
    margin-bottom: 6px;
}

.pay-loader-title {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-color, #fff);
    letter-spacing: -0.01em;
}

.pay-loader-sub {
    font-size: 0.9rem;
    color: var(--text-muted, rgba(255,255,255,0.5));
    line-height: 1.5;
}

/* Loading dots animation */
.pay-loader-sub::after {
    content: '';
    display: inline-block;
    width: 1.5em;
    animation: loadingDots 1.4s infinite;
    text-align: left;
}
@keyframes loadingDots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.pay-error-box {
    border-color: rgba(239, 68, 68, 0.25);
    background: linear-gradient(135deg, var(--nav-bg, #141414) 60%, rgba(239,68,68,0.05));
}

.pay-error-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.1);
    margin-bottom: 6px;
}

.pay-dismiss-btn {
    margin-top: 10px;
    padding: 10px 28px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: var(--text-color, #fff);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.pay-dismiss-btn:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.2);
}



/* Версия / описание / обзор товара */
.product-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.4rem;
    padding: 1rem 1rem 0.45rem;
}
.product-title {
    padding: 0;
    margin: 0;
    width: 100%;
    line-height: 1.25;
}
.product-mc {
    display: none;
}
.product-overview-btn {
    margin: 0;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 600;
    font-family: var(--font-body);
    color: var(--text-color);
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.product-modal-empty a,
.product-modal-section a,
.shop-preview-empty a {
    color: var(--text-color) !important;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.product-modal-empty a:visited,
.product-modal-section a:visited,
.shop-preview-empty a:visited {
    color: var(--text-color) !important;
}
.product-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.product-modal-chip {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.6rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.05);
    color: var(--text-muted);
}
.product-modal-section {
    margin-bottom: 1.1rem;
}
.product-modal-section h3 {
    font-family: var(--font-display);
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0 0 0.45rem;
}
.product-modal-section p,
.product-modal-section .product-modal-body {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.6;
    white-space: pre-wrap;
    margin: 0;
}
.product-modal-empty {
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
    padding: 0.75rem 0.9rem;
    border-radius: 10px;
    border: 1px dashed rgba(255,255,255,0.14);
    background: rgba(255,255,255,0.03);
}
.product-modal-reviews {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    max-height: 180px;
    overflow-y: auto;
}
.product-modal-review {
    padding: 0.7rem 0.8rem;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
}
.product-modal-review strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}
.product-modal-review p {
    margin: 0;
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.45;
}
body.light-theme .product-overview-btn,
body.light-theme .product-modal-chip,
body.light-theme .product-modal-empty,
body.light-theme .product-modal-review {
    border-color: rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.03);
}
