/* shop-layout.css - ОПТИМИЗИРОВАННАЯ ВЕРСИЯ */

/* Основные стили шапки магазина */
.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.shop-summary {
    font-size: 1rem;
    color: #2d3748;
    font-weight: 500;
}

.shop-summary .text-muted {
    font-size: 0.9rem;
    font-weight: 400;
}

/* Стили сортировки */
.sorting-options {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.sort-select {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    background-color: #fff;
    font-size: 0.9rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.75rem center;
    background-repeat: no-repeat;
    background-size: 16px 12px;
    appearance: none;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

/* Стили пагинации */
.pagination-section {
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

.pagination-container {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.pagination {
    margin-bottom: 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    border: 1px solid #e2e8f0;
    color: var(--primary-green);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-link:hover {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.page-item.active .page-link {
    background: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.page-item.disabled .page-link {
    color: #6c757d;
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Стили мобильных фильтров */
.mobile-filters-header {
    margin-bottom: 1.5rem;
    padding: 0 10px;
    animation: slideInUp 0.6s ease-out;
}

.modern-filters-toggle {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 16px;
    padding: 1.25rem 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.25), 0 4px 12px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.modern-filters-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.modern-filters-toggle:hover::before {
    left: 100%;
}

.modern-filters-toggle:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.35), 0 6px 18px rgba(0, 0, 0, 0.15);
}

.modern-filters-toggle:active {
    transform: translateY(-1px);
}

.toggle-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    position: relative;
    z-index: 2;
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 12px;
    position: relative;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toggle-icon i {
    font-size: 1.4rem;
    color: white;
}

.toggle-text {
    flex: 1;
    text-align: left;
    margin: 0 1.5rem;
}

.toggle-title {
    display: block;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
    letter-spacing: -0.2px;
}

.toggle-subtitle {
    display: block;
    font-size: 0.85rem;
    opacity: 0.9;
    font-weight: 400;
    letter-spacing: -0.1px;
}

.toggle-arrow i {
    font-size: 1.1rem;
    opacity: 0.8;
    transition: transform 0.3s ease;
}

.modern-filters-toggle:hover .toggle-arrow i {
    transform: translateX(3px);
}

/* Бейдж счетчика фильтров */
.filters-count-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    animation: pulse 2s infinite;
}

/* Overlay для мобильных фильтров */
.filters-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    backdrop-filter: blur(4px);
}

.filters-overlay.active {
    display: block;
}

/* Анимации */
@keyframes pulse {
    0% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(255, 107, 107, 0.6);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Адаптивность */
@media (max-width: 992px) {
    .mobile-filters-toggle {
        position: fixed;
        top: 100px;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1055;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0.75rem;
        background: var(--primary-green);
        color: white;
        padding: 1rem 1.5rem;
        border: none;
        border-radius: 10px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        margin-bottom: 1.5rem;
        width: calc(100% - 20px);
        max-width: calc(100% - 20px);
        margin: 0 10px;
        box-sizing: border-box;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .mobile-filters-toggle:hover {
        background: var(--dark-green);
        transform: translateX(-50%) translateY(-2px);
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    }

    .shop-page .container-fluid {
        padding-top: 10px;
    }

    .filters-overlay,
    .shop-filters-sidebar {
        z-index: 1060;
    }
}

@media (max-width: 768px) {
    .main-content-wrapper {
        padding: 1rem;
        border-radius: 8px;
    }

    .shop-header {
        margin-bottom: 1.5rem;
    }

    .sorting-options {
        flex-direction: column;
        align-items: stretch;
        gap: 1rem;
    }

    .pagination-section {
        margin-top: 1.5rem;
        padding-top: 1rem;
    }

    .pagination-container {
        padding-top: 1rem;
    }

    .page-link {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
    }

    .page-item {
        margin: 0 0.1rem;
    }
}

@media (max-width: 480px) {
    .mobile-filters-toggle {
        top: 90px;
        width: calc(100% - 16px);
        max-width: calc(100% - 16px);
        margin: 0 8px;
        padding: 0.875rem 1rem;
    }

    .mobile-filters-header {
        padding: 0 8px;
        margin-bottom: 1rem;
    }

    .modern-filters-toggle {
        padding: 1rem 1.25rem;
        border-radius: 14px;
    }

    .toggle-icon {
        width: 44px;
        height: 44px;
    }

    .toggle-icon i {
        font-size: 1.2rem;
    }

    .toggle-text {
        margin: 0 1rem;
    }

    .toggle-title {
        font-size: 1rem;
    }

    .toggle-subtitle {
        font-size: 0.8rem;
    }
}

@media (max-width: 360px) {
    .toggle-subtitle {
        display: none;
    }

    .toggle-title {
        font-size: 0.95rem;
        margin-bottom: 0;
    }

    .modern-filters-toggle {
        padding: 0.875rem 1rem;
    }
}

@media (min-width: 993px) {
    .mobile-filters-toggle {
        display: none !important;
    }
}

/* Темная тема поддержка */
@media (prefers-color-scheme: dark) {
    .modern-filters-toggle {
        background: linear-gradient(135deg, #4f46e5, #7c3aed);
        box-shadow: 0 8px 25px rgba(79, 70, 229, 0.3), 0 4px 12px rgba(0, 0, 0, 0.2);
    }
}