/* Фильтры и поиск */
.merch-filters {
    margin: 1.25rem 0;
    padding: 1rem 1rem 0.9rem;
    background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
    border-radius: 8px;
    border: 1px solid #44475a;
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    justify-content: space-between;
}

.filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    flex: 1 1 0;
}

.category-filter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1 1 220px;
    min-width: 220px;
}

.category-filter label {
    font-weight: 600;
    color: #f8f8f2;
    min-width: 80px;
    width: 80px;
}

.category-select {
    padding: 0.6rem 0.9rem;
    border: 1px solid #44475a;
    border-radius: 4px;
    background: #282a36;
    color: #f8f8f2;
    font-size: 0.95rem;
    cursor: pointer;
    min-width: 160px;
}

.category-select:hover,
.category-select:focus {
    border-color: #50fa7b;
    outline: none;
}

.clear-filters {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    min-width: 130px;
}

.btn.secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 0.95rem;
    font-size: 0.95rem;
    background: rgba(255, 255, 255, 0.08);
    color: #edf0ff;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 10px;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
    transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.btn.secondary:hover {
    background: rgba(255, 255, 255, 0.14);
    border-color: rgba(255, 255, 255, 0.28);
}

.clear-filters .btn {
    width: 100%;
    max-width: 180px;
    padding: 0.55rem 0.9rem;
    font-size: 0.95rem;
}

/* Паки (Наборы) */
.packs-section {
    margin: 3rem 0;
}

.packs-section h3 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    color: #ff79c6;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.packs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.pack-card {
    padding: 1.5rem;
    background: linear-gradient(135deg, #282a36 0%, #21222c 100%);
    border: 2px solid #44475a;
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.pack-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(80, 250, 123, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pack-card:hover {
    border-color: #ff79c6;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(255, 121, 198, 0.2);
}

.pack-card:hover::before {
    opacity: 1;
}

.pack-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.pack-header h4 {
    font-size: 1.3rem;
    color: #ff79c6;
    margin: 0;
    flex: 1;
}

.discount-badge {
    background: #ff79c6;
    color: #282a36;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    white-space: nowrap;
}

.pack-description {
    color: #a6acaf;
    font-size: 0.95rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.pack-items {
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

.pack-items p {
    margin: 0 0 0.5rem 0;
    color: #f8f8f2;
    font-size: 0.9rem;
}

.pack-items ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.pack-items li {
    color: #8be9fd;
    font-size: 0.85rem;
    padding: 0.25rem 0;
    padding-left: 1rem;
}

.pack-items li::before {
    content: '✓ ';
    color: #50fa7b;
    font-weight: bold;
    margin-left: -1rem;
    margin-right: 0.5rem;
}

.pack-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin: 1rem 0;
    position: relative;
    z-index: 1;
}

.old-price {
    color: #6272a4;
    font-size: 0.9rem;
    text-decoration: line-through;
}

.new-price,
.price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #50fa7b;
}

.pack-card .btn {
    width: 100%;
    margin-top: 1rem;
    position: relative;
    z-index: 1;
}

/* Товары */
.merch-section h3 {
    margin-bottom: 1.5rem;
    color: #8be9fd;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.merch-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1024px) {
    .merch-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.merch-card {
    background: linear-gradient(135deg, #282a36 0%, #21222c 100%);
    border: 1px solid #3b3f4f;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.merch-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}

.merch-image img {
    width: 100%;
    object-fit: cover;
    display: block;
}

.detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    padding: 0.85rem 1.2rem;
    border-radius: 8px;
}

.detail-images {
    display: flex;
    justify-content: center;
}

.image-frame {
    width: 100%;
    max-width: 700px;
    padding: 1rem;
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 16px;
    background: rgba(25, 26, 38, 0.8);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.04), 0 18px 45px rgba(0,0,0,0.18);
    position: relative;
}

.image-frame--placeholder {
    padding: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.slideshow {
    position: relative;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: pan-y;
}

.slide {
    max-width: 100%;
    max-height: 540px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: none;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.25);
    margin: 0 auto;
}

.slide-prev,
.slide-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 50%;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(139,233,253,0.95), rgba(255,121,198,0.95));
    box-shadow: 0 14px 28px rgba(0,0,0,0.24);
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.slideshow:hover .slide-prev,
.slideshow:hover .slide-next {
    opacity: 1;
    pointer-events: auto;
}

.slide-prev:hover,
.slide-next:hover {
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 18px 32px rgba(0,0,0,0.3);
}

.slide-prev {
    left: 1rem;
}

.slide-next {
    right: 1rem;
}

.image-preview-modal {
    position: fixed;
    z-index: 1700;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    pointer-events: none;
}

.image-preview-modal.is-open {
    display: flex;
    pointer-events: auto;
}

.preview-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(5, 8, 20, 0.86);
}

.preview-content {
    position: relative;
    max-width: min(95vw, 1100px);
    max-height: min(95vh, 900px);
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: 18px;
    background: rgba(15, 18, 33, 0.95);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.preview-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    border-radius: 12px;
    object-fit: contain;
}

.preview-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.preview-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

.detail-info h1 {
    margin-top: 0;
    font-size: 2rem;
    line-height: 1.1;
}

.detail-content {
    font-size: 1rem;
    line-height: 1.75;
    color: #d7d7de;
}

@media (max-width: 980px) {
    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-images {
        width: 100%;
    }

    .slide-prev,
    .slide-next {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

.merch-title {
    font-size: 0.95rem;
    margin: 0.35rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.merch-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #50fa7b;
    margin-top: 0.4rem;
}

.category-row {
    margin-bottom: 0.65rem;
}

.category-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    background: #3d4557;
    border-radius: 8px;
    font-size: 0.75rem;
    text-transform: uppercase;
    color: #d7e1ff;
    margin-bottom: 0;
}

.type-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.type-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.45rem 0.85rem;
    background: #1e293b;
    border: 1px solid #5673b1;
    border-radius: 8px;
    font-size: 0.73rem;
    color: #c8d8ff;
    margin: 0;
}

/* Нет результатов */
.no-results {
    text-align: center;
    padding: 2rem;
    color: #6272a4;
    font-size: 1.1rem;
}

/* Адаптивность */
@media (max-width: 980px) {
    .merch-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .detail-grid {
        grid-template-columns: 1fr;
    }

    .detail-images {
        width: 100%;
    }

    .slide-prev,
    .slide-next {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }
}

@media (max-width: 768px) {
    .merch-filters {
        padding: 0.9rem;
    }

    .filter-form,
    .filter-row {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }

    .category-filter {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
        flex: 1 1 auto;
        min-width: 0;
    }

    .category-filter label {
        width: auto;
        min-width: 0;
    }

    .category-select {
        width: 100%;
        min-width: unset;
    }

    .clear-filters {
        justify-content: flex-start;
        min-width: 0;
    }

    .clear-filters .btn {
        width: 100%;
        max-width: 220px;
    }

    .packs-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .pack-card {
        padding: 1.25rem;
    }

    .pack-description,
    .pack-items p,
    .pack-items li {
        font-size: 1rem;
    }

    .pack-items {
        padding: 0.9rem;
    }

    .pack-header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .discount-badge {
        align-self: flex-start;
    }

    .merch-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .merch-card {
        border-radius: 10px;
    }

    .merch-title {
        font-size: 1rem;
    }

    .merch-price {
        font-size: 1.15rem;
    }

    .detail-grid {
        gap: 1.25rem;
    }

    .back-link {
        display: block;
        width: fit-content;
        margin-bottom: 1.2rem;
    }

    .image-frame {
        padding: 0.85rem;
    }

    .slideshow {
        min-height: 320px;
    }

    .slide {
        max-height: 420px;
    }

    .slide-prev,
    .slide-next {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .detail-info h1 {
        font-size: 1.75rem;
    }

    .detail-content {
        font-size: 1.03rem;
        line-height: 1.7;
    }

    .category-row,
    .type-row {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .type-badge,
    .category-badge {
        font-size: 0.72rem;
        padding: 0.35rem 0.75rem;
    }

    .no-results {
        padding: 1.25rem;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .merch-filters {
        padding: 0.8rem;
    }

    .category-select,
    .clear-filters .btn {
        font-size: 0.95rem;
    }

    .pack-card {
        padding: 1rem;
    }

    .pack-header h4 {
        font-size: 1.15rem;
    }

    .merch-grid {
        gap: 0.9rem;
    }

    .slide-prev,
    .slide-next {
        width: 36px;
        height: 36px;
        font-size: 1.1rem;
    }

    .detail-info h1 {
        font-size: 1.5rem;
    }

    .detail-content {
        font-size: 1rem;
    }
}
