/* ========================================
   Catalog Page Styles - Modern Enhanced Design
   ======================================== */
.btn-check:checked+.btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check)+.btn:active {
    color: inherit;
}

.filter-toggle.btn-check:checked+.btn,
.filter-toggle.btn.active,
.filter-toggle.btn.show,
.filter-toggle.btn:first-child:active,
:not(.btn-check)+.filter-toggle.btn:active {
    color: white;
}

/* ====== Catalog Container ====== */
.catalog {
    background: linear-gradient(to bottom, #f8f9fa 0%, rgb(244 243 240) 100%);
    padding: 0;
    min-height: 100vh;
}

.catalog .pagination-container {
    margin-top: var(--space-8);
    margin-bottom: var(--space-8);
}

.catalog-title {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin: 0 0 var(--space-4) 0;
    text-align: center;
    position: relative;
}

/* ====== Hero Section ====== */
.catalog-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    padding: var(--space-12) 0 var(--space-10);
    position: relative;
    overflow: hidden;
}

.catalog-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23pattern)"/></svg>');
    opacity: 0.4;
}

.catalog-hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: white;
}

.catalog-hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: var(--font-weight-bold);
    margin-bottom: var(--space-4);
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.2);
    line-height: 1.2;
}

.catalog-hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    margin-bottom: var(--space-6);
    opacity: 0.95;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.15);
}

.catalog-hero-stats {
    display: flex;
    gap: var(--space-8);
    justify-content: center;
    flex-wrap: wrap;
    margin-top: var(--space-6);
}

.catalog-hero-stat {
    text-align: center;
}

.catalog-hero-stat-value {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    display: block;
    margin-bottom: var(--space-1);
}

.catalog-hero-stat-label {
    font-size: var(--text-sm);
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 768px) {
    .catalog-hero {
        padding: var(--space-8) 0 var(--space-6);
    }

    .catalog-hero-stats {
        gap: var(--space-4);
    }

    .catalog-hero-stat-value {
        font-size: var(--text-2xl);
    }
}

/* ====== Breadcrumb Navigation ====== */
.breadcrumb-container {
    padding: var(--space-4) var(--space-4);
    margin-bottom: var(--space-6);
    font-size: var(--text-sm);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(249, 250, 251, 0.95) 100%);
    backdrop-filter: blur(8px);
    border-bottom: 2px solid rgba(102, 126, 234, 0.08);
}

.breadcrumb {
    background: transparent;
    margin: 0;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: all var(--transition-duration) ease;
}

.breadcrumb-item+.breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
    font-weight: var(--font-weight-medium);
    margin: 0 var(--space-2);
}

.breadcrumb-item a {
    color: var(--primary-600);
    text-decoration: none;
    font-weight: var(--font-weight-medium);
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-md);
    transition: all var(--transition-duration) ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-700);
    background: var(--primary-50);
    transform: translateY(-1px);
}

.breadcrumb-item.active {
    color: var(--text-color);
    font-weight: var(--font-weight-semibold);
}

.breadcrumb-item i {
    font-size: 0.875rem;
}

/* Responsive breadcrumb */
@media (max-width: 768px) {
    .breadcrumb-container {
        padding: var(--space-3) 0;
    }

    .breadcrumb {
        font-size: var(--text-xs);
        padding: var(--space-2) var(--space-3);
    }

    .breadcrumb-item a {
        padding: var(--space-1);
        gap: 2px;
    }
}

/* ====== Action Buttons ====== */
.action-buttons-container {
    display: flex;
    justify-content: center;
    gap: var(--space-4);
    flex-wrap: wrap;
}

.category-toggle,
.filter-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    border-radius: var(--radius-lg);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-all);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.category-toggle {
    background: linear-gradient(135deg, var(--neutral-100), var(--neutral-50));
    color: var(--neutral-700);
    border-color: var(--neutral-200);
}

.category-toggle:hover {
    background: linear-gradient(135deg, var(--neutral-200), var(--neutral-100));
    color: var(--neutral-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.filter-toggle {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--white);
    border-color: var(--primary-400);
}

.filter-toggle:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.filter-count {
    background: var(--accent-amber);
    color: var(--white);
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    min-width: 1.5rem;
    text-align: center;
    margin-left: var(--space-1);
    animation: pulse-filter 2s infinite;
}

@keyframes pulse-filter {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ====== Products Section Title ====== */
.products-section-header {
    text-align: center;
    margin-bottom: var(--space-8);
    padding: var(--space-6) 0;
}

.products-section-title {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--space-3);
    position: relative;
    display: inline-block;
}

.products-section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 2px;
}

.products-section-subtitle {
    color: var(--text-secondary);
    font-size: var(--text-base);
    margin-top: var(--space-4);
}

/* ====== Product Grid ====== */

/* Grid container used on catalogue pages */
.products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-5);
    justify-content: flex-start;
    align-items: stretch;
}

.products-grid .product-card {
    flex: 1 1 280px;
    min-width: 280px;
    max-width: 380px;
    animation: fadeInUp 0.6s ease-out backwards;
}

.products-grid .product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.products-grid .product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.products-grid .product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.products-grid .product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.products-grid .product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.products-grid .product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.products-grid .product-card:nth-child(n+7) {
    animation-delay: 0.35s;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 575px) {
    .products-grid {
        justify-content: center;
    }

    .products-grid .product-card {
        flex: 1 1 100%;
        min-width: 0;
        max-width: 100%;
    }
}

/* Ensure anchor covers the entire card */
.product-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

.product-card {
    background: var(--surface-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    transform-origin: center center;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12), 0 8px 16px rgba(0, 0, 0, 0.08);
    border-color: rgba(102, 126, 234, 0.3);
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.03) 0%, rgba(118, 75, 162, 0.03) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

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

.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.product-card:hover::after {
    opacity: 1;
}

/* Loading shimmer for image placeholders */
.product-card.loading .product-image-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.05), transparent);
    animation: shimmer 1.5s ease-in-out infinite;
    z-index: 1;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }

    100% {
        transform: translateX(100%);
    }
}

/* ====== Product Image ====== */
.product-image-container {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

/* On catalogue listing, use 4/5 aspect ratio for elegance */
.catalog .product-image-container {
    aspect-ratio: 4/5;
}

.product-image-container::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0) 0%,
            rgba(0, 0, 0, 0.02) 50%,
            rgba(0, 0, 0, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 1;
}

.product-card:hover .product-image-container::after {
    opacity: 1;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    transform: scale(1.1);
}

.product-image.loaded {
    opacity: 1;
    transform: scale(1);
}

.product-card:hover .product-image {
    transform: scale(1.08) rotate(0.5deg);
}

/* ====== Discount Badge ====== */
.discount-badge {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: var(--white);
    padding: var(--space-2) var(--space-4);
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-bold);
    z-index: 3;
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
    transform: translateY(0);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(4px);
}

.discount-badge[data-discount-high="true"] {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    animation: pulse-glow 2s infinite;
    box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
}

@keyframes pulse-glow {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 4px 16px rgba(245, 87, 108, 0.5);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 6px 20px rgba(245, 87, 108, 0.6);
    }
}

.product-card:hover .discount-badge {
    transform: scale(1.1) rotate(-2deg);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.5);
}

/* Shared absolute container for stacked badges */
.badge-stack {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    align-items: flex-end;
    z-index: 2;
}

/* Neutralize absolute positioning when inside the stack */
.badge-stack .discount-badge,
.badge-stack .stock-indicator {
    position: static;
    top: auto;
    right: auto;
}

/* Ensure stock-indicator appearance matches in stack */
.badge-stack .stock-indicator {
    background: var(--white);
    border-radius: var(--radius-md);
    padding: var(--space-1) var(--space-2);
    border: 1px solid var(--border-light);
}

/* ====== Stock Indicators ====== */
.stock-indicator {
    position: absolute;
    top: calc(var(--space-3) + 50px);
    right: var(--space-3);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-semibold);
    color: var(--text-muted);
    border-radius: var(--radius-lg);
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.stock-indicator.out-of-stock {
    background: linear-gradient(135deg, #fc5c7d 0%, #6a82fb 100%);
    color: var(--white);
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(252, 92, 125, 0.4);
}

.stock-indicator.low-stock {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(253, 203, 110, 0.4);
}

.product-card:hover .stock-indicator {
    transform: scale(1.05);
}

/* ====== Product Info ====== */
.product-info {
    padding: var(--space-6);
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    z-index: 2;
}

.product-title {
    font-size: var(--text-lg);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--space-3);
    line-height: var(--leading-tight);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
}

.product-card:hover .product-title {
    color: #667eea;
}

/* Price row at bottom of card */
.price-row {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: var(--space-4);
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.product-price {
    font-size: var(--text-2xl);
    font-weight: var(--font-weight-bold);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-original {
    font-size: var(--text-base);
    color: var(--text-muted);
    text-decoration: line-through;
    opacity: 0.7;
}

.product-badge {
    position: absolute;
    top: var(--space-4);
    right: var(--space-4);
    background: linear-gradient(135deg, var(--accent-emerald), var(--success-600));
    color: var(--white);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-size: var(--text-xs);
    font-weight: var(--font-weight-bold);
    z-index: 2;
}

/* ====== Rating and Stats ====== */
.rating-section {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-bottom: var(--space-3);
    flex-wrap: wrap;
}

.star-rating {
    display: flex;
    align-items: center;
    gap: 3px;
}

.star-rating i {
    color: #fbbf24;
    font-size: 1.1rem;
    filter: drop-shadow(0 1px 2px rgba(251, 191, 36, 0.3));
    transition: transform 0.2s ease;
}

.product-card:hover .star-rating i {
    transform: scale(1.1);
}

.rating-count {
    color: var(--text-secondary);
    font-size: var(--text-sm);
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    font-weight: var(--font-weight-medium);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.view-stats {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    color: #6366f1;
    font-size: var(--text-sm);
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.08) 100%);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-full);
    margin-bottom: var(--space-3);
    font-weight: var(--font-weight-medium);
    border: 1px solid rgba(99, 102, 241, 0.1);
    transition: all 0.3s ease;
}

.product-card:hover .view-stats {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.12) 0%, rgba(139, 92, 246, 0.12) 100%);
    border-color: rgba(99, 102, 241, 0.2);
}

.view-stats i {
    color: #6366f1;
    font-size: 1.1rem;
}

/* ====== No Image Placeholder ====== */
.no-image-placeholder {
    color: var(--text-muted);
    font-size: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

/* ====== No Results Section Wrapper ====== */
.no-results-section {
    padding: var(--space-16) 0;
    text-align: center;
}

/* ====== Pagination Container ====== */
.catalog {
    padding-bottom: var(--space-6);
}

/* ====== No Results Section ====== */
.no-results {
    text-align: center;
    padding: var(--space-16);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.98) 0%, rgba(249, 250, 251, 0.98) 100%);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08), 0 4px 12px rgba(0, 0, 0, 0.04);
    border: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.no-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

.no-results i {
    font-size: 5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-6);
    display: block;
    filter: drop-shadow(0 4px 8px rgba(102, 126, 234, 0.2));
}

.no-results h3 {
    font-size: var(--text-3xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin-bottom: var(--space-4);
}

.no-results p {
    color: var(--text-secondary);
    font-size: var(--text-lg);
    line-height: var(--leading-relaxed);
    max-width: 500px;
    margin: 0 auto;
}

/* ====== Modal Styles ====== */
.filters-modal .modal-dialog {
    max-width: 600px;
}

.filters-modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
}

.filters-header {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--white);
    border-bottom: none;
    padding: var(--space-6);
}

.filters-header .modal-title {
    font-weight: var(--font-weight-semibold);
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.filters-content {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.filters-scroll-container {
    padding: var(--space-6);
}

/* Mobile full-screen modals */
@media (max-width: 768px) {
    .filters-modal .modal-dialog {
        max-width: 100%;
        margin: 0;
        height: 100vh;
        max-height: none;
    }

    .filters-modal-content {
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .filters-header {
        padding: var(--space-4) var(--space-5);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .filters-content {
        flex: 1;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filters-scroll-container {
        padding: var(--space-4);
        min-height: 100%;
    }
}

/* Category Modal Styles */
.modal-category .modal-dialog {
    max-width: 1000px;
    margin: var(--space-4) auto;
}

.category-modal-content {
    border: none;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    overflow: hidden;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.category-modal-header {
    background: linear-gradient(135deg, var(--neutral-800), var(--neutral-900));
    color: var(--white);
    border-bottom: none;
    padding: var(--space-6) var(--space-8);
    position: relative;
    overflow: hidden;
}

.category-modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.1), rgba(var(--accent-emerald-rgb), 0.1));
    z-index: 1;
}

.category-modal-title {
    font-weight: var(--font-weight-bold);
    font-size: var(--text-2xl);
    display: flex;
    align-items: center;
    gap: var(--space-3);
    position: relative;
    z-index: 2;
    margin: 0;
}

.category-modal-title i {
    font-size: var(--text-3xl);
    color: var(--primary-300);
}

.category-modal-body {
    padding: var(--space-8);
    background: linear-gradient(135deg, var(--background-color), var(--neutral-50));
    min-height: 60vh;
    max-height: 70vh;
    overflow-y: auto;
}

/* Mobile full-screen category modal */
@media (max-width: 768px) {
    .modal-category .modal-dialog {
        max-width: 100%;
        margin: 0;
        height: 100vh;
        max-height: none;
    }

    .category-modal-content {
        height: 100vh;
        border-radius: 0;
        display: flex;
        flex-direction: column;
    }

    .category-modal-header {
        padding: var(--space-4) var(--space-5);
        flex-shrink: 0;
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .category-modal-title {
        font-size: var(--text-xl);
        gap: var(--space-2);
    }

    .category-modal-title i {
        font-size: var(--text-2xl);
    }

    .category-modal-body {
        flex: 1;
        padding: var(--space-4);
        min-height: auto;
        max-height: none;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-6);
    padding: var(--space-4) 0;
}

.category-card {
    background: var(--surface-color);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-base);
    border: 2px solid var(--border-light);
    overflow: hidden;
    transition: var(--transition-all);
    position: relative;
    transform-origin: center center;
}

.category-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-300);
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(var(--primary-rgb), 0.08));
    opacity: 0;
    transition: var(--transition-opacity);
    pointer-events: none;
}

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

.category-card-link {
    display: block;
    padding: var(--space-6);
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 2;
}

.category-card-link.active {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-color: var(--primary-500);
}

.category-card-link.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border: 2px solid var(--primary-500);
    border-radius: var(--radius-xl);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.2);
}

.category-card-content {
    display: flex;
    align-items: flex-start;
    gap: var(--space-4);
    position: relative;
}

.category-card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--primary-100), var(--primary-200));
    border-radius: var(--radius-xl);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-600);
    font-size: var(--text-2xl);
    transition: var(--transition-all);
    box-shadow: var(--shadow-sm);
    flex-shrink: 0;
}

.category-card:hover .category-card-icon {
    background: linear-gradient(135deg, var(--primary-200), var(--primary-300));
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.category-card-info {
    flex: 1;
    min-width: 0;
}

.category-card-title {
    font-size: var(--text-xl);
    font-weight: var(--font-weight-bold);
    color: var(--text-color);
    margin: 0 0 var(--space-2) 0;
    line-height: var(--leading-tight);
}

.category-card-count {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    font-weight: var(--font-weight-medium);
    background: var(--neutral-100);
    padding: var(--space-1) var(--space-3);
    border-radius: var(--radius-full);
    display: inline-block;
}

.category-card-active {
    position: absolute;
    top: var(--space-3);
    right: var(--space-3);
    color: var(--success-600);
    font-size: var(--text-2xl);
    background: var(--success-100);
    border-radius: var(--radius-full);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.category-children-grid {
    margin-top: var(--space-5);
    padding: var(--space-4);
    border-top: 2px solid var(--border-light);
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-3);
}

.category-child-link {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    background: linear-gradient(135deg, var(--neutral-100), var(--neutral-50));
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-lg);
    font-size: var(--text-sm);
    font-weight: var(--font-weight-medium);
    transition: var(--transition-all);
    border: 1px solid var(--border-light);
    position: relative;
    overflow: hidden;
}

.category-child-link:hover {
    background: linear-gradient(135deg, var(--primary-100), var(--primary-50));
    color: var(--primary-700);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-200);
}

.category-child-link:hover::before {
    transform: scaleY(1);
}

.category-child-link.active {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: var(--white);
    font-weight: var(--font-weight-semibold);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-400);
}

.category-child-link.active::before {
    background: var(--white);
    transform: scaleY(1);
}

.category-child-name {
    flex: 1;
}

.category-child-link i {
    font-size: var(--text-xs);
    opacity: 0.7;
}

/* ====== Responsive Design ====== */

@media (max-width: 768px) {
    .catalog-title {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-3);
    }

    .action-buttons-container {
        gap: var(--space-2);
    }

    .category-toggle,
    .filter-toggle {
        padding: var(--space-2) var(--space-4);
        font-size: var(--text-sm);
    }

    .product-info {
        padding: var(--space-4);
    }

    .category-grid {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .category-card-content {
        gap: var(--space-3);
    }

    .category-card-icon {
        width: 48px;
        height: 48px;
        font-size: var(--text-xl);
    }

    .category-card-title {
        font-size: var(--text-lg);
    }

    .category-children-grid {
        gap: var(--space-2);
    }

    .category-child-link {
        padding: var(--space-2) var(--space-3);
        font-size: var(--text-xs);
    }
}

@media (max-width: 576px) {
    .product-card:hover {
        transform: translateY(-4px) scale(1.01);
    }

    .action-buttons-container {
        flex-direction: column;
        align-items: center;
    }

    .category-toggle,
    .filter-toggle {
        max-width: 280px;
        justify-content: center;
    }
}

/* ====== Performance Optimizations ====== */
.product-card,
.category-card,
.filter-toggle,
.category-toggle {
    will-change: transform;
}

.product-card a {
    text-decoration: none;
}

/* ====== Accessibility Improvements ====== */
.product-card:focus-within,
.category-card:focus-within {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {

    .product-card,
    .category-card,
    .filter-toggle,
    .category-toggle,
    .product-image,
    .products-grid .product-card {
        transition: none;
        transform: none !important;
        animation: none;
    }

    .filter-count,
    .discount-badge,
    .pulse-glow {
        animation: none;
    }
}

/* ====== Print Styles ====== */
@media print {

    .filters-modal,
    .category-modal,
    .action-buttons-container,
    .catalog-hero {
        display: none;
    }

    .product-card {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
}