/* ======== БАЗОВЫЕ СТИЛИ ======== */
:root {
    --bg-color: rgb(18, 18, 18);
    --card-bg: #1e1e1e;
    --text-color: #f1f1f1;
    --accent-color: #db0c0c;
    --border-radius: 15px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    scroll-behavior: smooth;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-color);
    color: white;
    line-height: 1.5;
}

/* ======== БАННЕР МАГАЗИНА ======== */
#shop-banner {
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius);
    background-color: #2a2a2a;
    aspect-ratio: 17/10;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    cursor: pointer;
    display: block;
}

#banner-logo {
    position: absolute;
    bottom: 5%;
    left: 50%;
    transform: translateX(-50%);
    max-width: 60%;
    max-height: 30%;
    z-index: 2;
    pointer-events: none;
    transition: all 0.3s ease;
}

#shop-banner video,
#shop-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: var(--border-radius);
}

#shop {
    height: calc(100%);
    overflow: hidden;
    padding: 20px;
    padding-top: 98px;
    max-width: 1200px;
    margin: 0 auto;
}

/* ======== ЗАГРУЗОЧНЫЕ ПЛЕЙСХОЛДЕРЫ ======== */
.loading-placeholder {
    position: relative;
    overflow: hidden;
}

    .loading-placeholder::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0) 100%);
        animation: shimmer 1.5s infinite;
    }

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

#shop-banner.loading-placeholder {
    min-height: 200px;
}

.product-image-container.loading-placeholder {
    height: 140px;
}

/* ======== СЕТКА ТОВАРОВ ======== */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

/* ======== КАРТОЧКИ ТОВАРОВ ======== */
.product {
    border: 1px solid #333;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
    will-change: transform, opacity;
    color: var(--text-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
    overflow: hidden;
}

    .product.visible {
        opacity: 1;
        transform: translateY(0);
    }

    .product h3 {
        font-size: 16px;
        font-weight: bold;
        color: #ffffff;
        line-height: 1.3;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin: 10px 10px 3px 10px;
    }

    .product img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.product-image-container {
    height: 140px;
    min-height: 140px;
    max-height: 140px;
    width: 100%;
    position: relative;
}

.image-placeholder {
    height: 100%;
    width: 100%;
    background-color: #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .image-placeholder svg {
        width: 48px;
        height: 48px;
        fill: #555;
    }

.product p {
    font-size: 12px;
    line-height: 0.4;
    font-weight: bold;
    margin: 10px;
    padding-left: 1px;
    margin-bottom: 17px;
    color: #ffffff;
}

/* Легендарные товары */
.product.legendary {
    position: relative;
}

    .product.legendary::before {
        content: '';
        position: absolute;
        top: 8px;
        right: 8px;
        width: 21px;
        height: 21px;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M9 7L10 0H8L2 7V9H7L6 16H8L14 9L14 7H9Z' fill='%23FFD700'/%3E%3C/svg%3E");
        background-size: contain;
        background-repeat: no-repeat;
        background-position: center;
        z-index: 1;
        filter: drop-shadow(0 1px 0px rgba(255, 215, 0, 0.8)) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.4)) drop-shadow(0 3px 1px rgba(0, 0, 0, 0.2));
        pointer-events: none;
        transform: translateZ(0);
    }

/* ======== ЦЕНЫ И СКИДКИ ======== */
.price-container {
    display: flex;
    align-items: center;
    gap: 3.5px;
    margin: 0 10px 9px 10px;
    flex-wrap: wrap;
}

.price-label {
    font-size: 12px;
    margin: 10px 10px 5px 10px;
    color: #aaa;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 13px;
}

.regular-price {
    font-weight: 550;
    font-size: 13px;
    color: var(--text-color);
}

.discounted-price {
    color: red;
    font-weight: bold;
    font-size: 13px;
}

.discount-badge {
    background: var(--accent-color);
    color: white;
    padding: 2px 6px;
    line-height: 1.3;
    border-radius: 10px;
    font-size: 10px;
    font-weight: bold;
}

.product.legendary .discount-badge {
    background: linear-gradient(to right, #FFD700, #FFA500);
    color: #1a1a1a;
}

.price-text {
    font-weight: 550;
    font-size: 13px;
    color: #aaa;
}

/* ======== ФИЛЬТРЫ И СОРТИРОВКА ======== */
.filters-container {
    margin: 20px 0;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.filters-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.category-filters {
    display: flex;
    gap: 10px;
    flex: 1;
}

.sort-controls {
    position: relative;
    flex-shrink: 0;
}

.sort-select {
    background-color: var(--card-bg);
    color: var(--text-color);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 8px 15px;
    padding-right: 35px;
    font-size: 14px;
    cursor: pointer;
    appearance: none;
    transition: var(--transition);
}

    .sort-select:focus,
    .buy-button:focus {
        outline: none;
        box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5);
    }

    .sort-select:hover {
        border-color: var(--accent-color);
    }

.sort-controls::after {
    content: "";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 13px;
    height: 13px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M1 1H15V4L10 10V16H6V10L1 4V1Z' fill='white'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    pointer-events: none;
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filters-row {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .category-filters {
        justify-content: center;
        flex: initial;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .filter-tab {
        height: 44px;
        width: 44px;
    }

    .filter-circle {
        width: 44px;
        height: 44px;
    }

        .filter-circle img {
            width: 22px;
            height: 22px;
        }

    .filter-title {
        font-size: 13px;
    }

    .filter-description {
        font-size: 11px;
    }
}

.sort-select:focus,
.buy-button:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.5);
}

.sort-select:hover {
    border-color: var(--accent-color);
}

/* ======== КНОПКИ ======== */
.buy-button {
    background-color: var(--accent-color);
    border: 2px solid var(--accent-color);
    color: white;
    padding: 5.5px;
    border-radius: 13px;
    cursor: pointer;
    font-weight: bold;
    transition: var(--transition);
    margin: 0 10px 12px;
    position: relative;
    overflow: hidden;
    width: calc(100% - 20px);
}

    .buy-button.added {
        background-color: var(--bg-color);
        border: 2px solid #333;
        cursor: default;
    }

.product.legendary .buy-button.added {
    background: var(--bg-color);
    border: 2px solid #333;
}

.product.legendary .buy-button {
    background: linear-gradient(to right,var(--accent-color), #ffae00) padding-box, linear-gradient(to right, var(--accent-color), #ffae00) border-box;
    border: 2px solid transparent;
    box-sizing: border-box;
    transition: all 0.3s ease;
}

.buy-button.adding {
    position: relative;
    overflow: hidden;
}

    .buy-button.adding::after {
        content: '';
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100%;
        background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.5) 50%, rgba(255, 255, 255, 0) 100%);
        animation: shine 0.7s ease-out;
    }

@keyframes shine {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* ======== ВКЛАДКИ ФИЛЬТРОВ ======== */
.filter-tab {
    position: relative;
    background: var(--card-bg);
    border: none;
    border-radius: 50px;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    height: 50px;
    width: 50px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: width;
}

.filter-circle {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.1);
}

    .filter-circle img {
        width: 24px;
        height: 24px;
        object-fit: contain;
        transition: transform 0.3s ease;
    }

.filter-content {
    opacity: 0.7;
    width: auto;
    padding: 0 15px 0 10px;
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
    text-align: left;
    margin-left: 0;
    flex: 1;
}

.filter-title {
    font-weight: bold;
    font-size: 14px;
    color: white;
    margin-bottom: 2px;
}

.filter-description {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.filter-tab.active {
    width: 200px;
}

    .filter-tab.active .filter-content {
        opacity: 1;
    }

    .filter-tab.active .filter-circle img {
        transform: scale(1.1);
    }

    .filter-tab.active .filter-description {
        opacity: 1;
    }

.filter-tab:not(.active):hover .filter-circle {
    background: rgba(255, 255, 255, 0.15);
}

    .filter-tab:not(.active):hover .filter-circle img {
        transform: scale(1.05);
    }

.filter-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

    .filter-icon img {
        width: 24px;
        height: 24px;
    }

.search-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 74px;
    background-color: rgba(18, 18, 18, 0.85);
    backdrop-filter: blur(15px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 20px;
    z-index: 100;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), background-color 0.3s ease;
    will-change: transform;
}

    .search-container.search-hidden {
        transform: translateY(-100%);
        box-shadow: none;
    }

    .search-container input {
        border: 1px solid rgba(255, 255, 255, 0.08);
        width: 100%;
        max-width: 390px;
        height: 44px;
        border-radius: 22px; 
        padding: 0 45px 0 50px;
        font-size: 15px;
        font-weight: 500;
        outline: none;
        background-color: rgba(30, 30, 30, 0.6);
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='rgba(255,255,255,0.6)'%3E%3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M11.1922 12.6064C10.0236 13.4816 8.57234 14 7 14C3.13401 14 0 10.866 0 7C0 3.13401 3.13401 0 7 0C10.866 0 14 3.13401 14 7C14 8.57234 13.4816 10.0236 12.6064 11.1922L15.7071 14.2929L14.2929 15.7071L11.1922 12.6064ZM5.58579 8.41421L4.17157 9.82843C2.60948 8.26633 2.60948 5.73367 4.17157 4.17157C5.73367 2.60948 8.26633 2.60948 9.82843 4.17157L8.41421 5.58579C7.63316 4.80474 6.36683 4.80474 5.58579 5.58579C4.80474 6.36684 4.80474 7.63316 5.58579 8.41421Z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: 18px center;
        background-size: 17px;
        transition: all 0.3s ease;
        color: rgba(255, 255, 255, 0.95);
        box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    }

        .search-container input::placeholder {
            color: rgba(255, 255, 255, 0.5);
            font-weight: 400;
        }

        .search-container input:focus {
            background-color: rgba(45, 45, 45, 0.9);
            border-color: rgba(255, 255, 255, 0.2);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 1px 2px rgba(0,0,0,0.1);
            transform: translateY(-1px);
        }

.cart-icon {
    width: 50px;
    height: 50px;
    position: fixed;
    bottom: 100px;
    right: 30px;
    cursor: pointer;
    z-index: 90;
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    background-color: var(--accent-color);
    font-size: 24px;
    transition: opacity 0.3s ease, transform 0.3s ease;
    color: white;
    border: 2px solid var(--accent-color);
    box-shadow: none;
    opacity: 1;
    transform: scale(1);
}

    .cart-icon svg {
        filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.3));
        margin-top: 2px;
    }

.cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #ffcc00;
    color: #1e1e1e;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 12px;
    font-weight: 800;
    text-shadow: none;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    border: 2px solid var(--bg-color);
    line-height: 1;
}

.cart-icon.visible {
    display: flex;
    opacity: 1;
    transform: scale(1.1);
}

.cart-icon.hidden {
    display: none;
}

.cart-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .cart-modal.show {
        display: flex;
        opacity: 1;
    }

.cart-content {
    width: 100%;
    height: 89%;
    background-color: var(--card-bg);
    border-radius: 24px 24px 0 0;
    color: white;
    position: relative;
    overflow: hidden;
    cursor: grab;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

    .cart-content.open {
        transform: translateY(0);
    }

.drag-header {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 5px;
    background-color: #ccc;
    border-radius: 3px;
    cursor: grab;
}

#cartIframe {
    width: 100%;
    height: 100%;
    border: none;
}

.body-no-scroll {
    overflow: hidden;
    width: 100%;
    height: 100%;
}

@media (min-width: 992px) {
    .cart-modal {
        align-items: center;
        background: rgba(0, 0, 0, 0.7);
        backdrop-filter: blur(5px);
    }

    .cart-content.desktop {
        width: 70%;
        max-width: 900px;
        height: 80%;
        max-height: 800px;
        border-radius: 20px;
        transform: scale(0.95);
        transition: transform 0.3s ease, opacity 0.3s ease;
    }

        .cart-content.desktop.open {
            transform: scale(1);
        }

    .drag-header {
        display: none;
    }
}

.notification {
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(-30px);
    background-color: rgba(30, 30, 30, 0.95);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-width: 80%;
    width: fit-content;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

    .notification.show {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }

.notification-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-right: 10px;
    flex-shrink: 0;
}

    .notification-icon svg {
        width: 100%;
        height: 100%;
    }

.notification-text {
    flex: 1;
}

.notification-close {
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-size: 16px;
    margin-left: 8px;
    pointer-events: auto;
}

.notification.error {
    background-color: rgba(255, 59, 48, 0.9);
    border: 1px solid rgba(255, 59, 48, 0.3);
}

.notification.warning {
    background-color: rgba(255, 149, 0, 0.9);
    border: 1px solid rgba(255, 149, 0, 0.3);
}

.notification.success {
    background-color: rgba(52, 199, 89, 0.9);
    border: 1px solid rgba(52, 199, 89, 0.3);
}

    .notification.error .notification-icon,
    .notification.warning .notification-icon,
    .notification.success .notification-icon {
        color: white;
    }

@media (min-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    #banner-logo {
        max-width: 60%;
        top: 70%;
    }
}

@media (min-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .product-image-container {
        height: 175px;
        min-height: 175px;
        max-height: 175px;
    }
}

@media (max-width: 768px) {
    .filters-container {
        flex-direction: column;
        align-items: stretch;
    }

    .category-filters {
        justify-content: center;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    #shop-banner {
        aspect-ratio: 16/10;
    }

    .search-container input {
        max-width: 255px;
    }

    .filter-tab {
        height: 44px;
        width: 44px;
    }

    .filter-circle {
        width: 44px;
        height: 44px;
    }

        .filter-circle img {
            width: 22px;
            height: 22px;
        }

    .filter-title {
        font-size: 13px;
    }

    .filter-description {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .filter-tab {
        height: 44px;
        width: 44px;
    }

    .filter-circle {
        width: 44px;
        height: 44px;
    }

    .filter-tab.active {
        width: 185px;
    }

    #shop-banner {
        max-height: 300px;
    }

    #banner-logo {
        max-width: 70%;
        top: 70%;
    }
}

@media (max-width: 360px) {
    .filter-description {
        display: none;
    }

    .filter-tab.active {
        width: 130px;
    }
}

@media (max-width: 600px) {
    .product img {
        max-height: 140px;
        object-fit: cover;
    }

    .product h3 {
        margin: 8px 10px 3px 10px;
        font-size: 16px;
    }

    .product p {
        font-size: 12px;
    }

    .product-image-container {
        height: 140px;
    }
}

.loading-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    position: relative;
    z-index: 1; 
}

.skeleton-products {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    min-height: 200px;
}

.loading-circle {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(219, 12, 12, 0.3);
    border-top: 6px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

@media (max-width: 768px) {
    .loading-circle {
        width: 60px;
        height: 60px;
        border-width: 5px;
    }
}

@media (max-width: 480px) {
    .skeleton-products {
        min-height: 150px;
    }
}

.skeleton-image {
    height: 140px;
    background: #2a2a2a;
    border-radius: 10px;
}

.skeleton-title {
    height: 20px;
    background: #2a2a2a;
    border-radius: 5px;
    width: 80%;
}

.skeleton-price {
    height: 16px;
    background: #2a2a2a;
    border-radius: 5px;
    width: 60%;
}

.skeleton-button {
    height: 35px;
    background: #2a2a2a;
    border-radius: 13px;
    margin-top: 10px;
}

#contact-info {
    background-color: var(--card-bg);
    padding: 20px;
    margin-top: 45px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

    #contact-info .info-card {
        background-color: rgba(30, 30, 30, 0.7);
        border-radius: 15px;
        padding: 20px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
    }

        #contact-info .info-card > div {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            gap: 20px;
        }

        #contact-info .info-card h3 {
            color: white;
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 15px;
            display: flex;
            align-items: center;
        }

        #contact-info .info-card ul {
            list-style-type: none;
            padding: 0;
            margin: 0;
        }

        #contact-info .info-card a {
            color: inherit;
            text-decoration: none;
        }

        #contact-info .info-card svg {
            margin-right: 10px;
        }

        #contact-info .info-card .links {
            display: flex;
            flex-direction: column;
            gap: 10px;
            justify-content: center;
        }

            #contact-info .info-card .links a {
                display: inline-block;
                background-color: rgba(40, 40, 40, 0.8);
                color: white;
                padding: 10px 15px;
                border-radius: 15px;
                text-decoration: none;
                font-size: 14px;
                text-align: center;
                transition: background-color 0.3s;
                -webkit-tap-highlight-color: transparent;
            }

                #contact-info .info-card .links a:hover {
                    background-color: rgba(60, 60, 60, 0.8);
                }

    #contact-info p {
        text-align: center;
        font-size: 12px;
        color: #aaa;
        margin: 0 0 75px 0;
    }

@media (min-width: 768px) {
    #contact-info .info-card > div {
        flex-direction: row;
        align-items: center;
    }

    #contact-info .info-card ul {
        margin-bottom: 0;
    }

    #contact-info p {
        margin-bottom: 0 !important;
    }
}

@media (max-width: 768px) {
    #contact-info .info-card > div {
        flex-direction: column;
        align-items: stretch;
    }
}