/* ========================================
           CSS RESET & BASE STYLES
           ======================================== */
        *,
        ::before,
        ::after {
            box-sizing: border-box;
            border-width: 0;
            border-style: solid;
            border-color: #e5e7eb;
        }

        html {
            line-height: 1.5;
            -webkit-text-size-adjust: 100%;
            scroll-behavior: smooth;
        }

        img {
            display: block;
            max-width: 100%;
            height: auto;
        }

        /* ========================================
           BRAND COLORS
           ======================================== */
        :root {
            --brand-red: #d90429;
            --brand-red-dark: #b8032a;
            --brand-red-light: rgba(217, 4, 41, 0.1);
            --brand-dark: #1b1b1b;
            --brand-grey: #333333;
            --brand-grey-light: #6b7280;
            --grey-100: #f3f4f6;
            --grey-200: #e5e7eb;
            --grey-300: #d1d5db;
            --grey-400: #9ca3af;
            --grey-500: #6b7280;
            --grey-600: #4b5563;
            --grey-700: #374151;
            --grey-800: #1f2937;
            --grey-900: #111827;
            --white: #ffffff;
        }

        /* --- CARD STYLES (CRITICAL FOR BACKEND) --- */
        .product-card {
            transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
            transform-origin: center center;
            border: 1px solid transparent;
            width: 100%;
            max-width: 380px;
            margin: 0 auto;
        }

        /* Hover: Scale up, Shadow, Red Border */
        .product-card:hover {
            transform: scale(1.02);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
            border: 5px solid var(--brand-red);
            /* The 5px red frame */
            z-index: 10;
        }

        /* Button Inversion on Hover */
        .product-card:hover .action-btn {
            background-color: white;
            color: var(--brand-red);
            border-color: var(--brand-red);
        }

        /* Title Truncation: Forces text to max 2 lines, then adds "..." */
        .line-clamp-2 {
            display: -webkit-box;
            -webkit-line-clamp: 2;
            line-clamp: 2;
            -webkit-box-orient: vertical;
            overflow: hidden;
        }

        /* --- IMAGE FRAME (CRITICAL) --- */
        .img-frame {
            width: 95%;
            /* Small margin on sides */
            max-width: 360px;
            /* Max image width */
            height: 370px;
            /* FIXED HEIGHT: Must be exactly 370px */
            margin-left: auto;
            margin-right: auto;
        }

        /* ========================================
           LAYOUT
           ======================================== */
        .container {
            width: 100%;
            max-width: 1800px;
            margin-left: auto;
            margin-right: auto;
            padding-left: 1.5rem;
            padding-right: 1.5rem;
        }

        @media (min-width: 768px) {
            .container {
                padding-left: 3rem;
                padding-right: 3rem;
            }
        }

        @media (min-width: 1024px) {
            .container {
                padding-left: 4rem;
                padding-right: 4rem;
            }
        }

        /* Hero carousel styles moved to /css/produits-hero-carousel.css (ORIGINAL snapshot: produits-hero-carousel.ORIGINAL.css) */

        .section {
            padding-top: 2rem;
            padding-bottom: 3rem;
        }

        @media (min-width: 768px) {
            .section {
                padding-top: 3rem;
                padding-bottom: 4rem;
            }
        }

        /* ========================================
           BREADCRUMBS
           ======================================== */
        .breadcrumbs {
            display: flex;
            align-items: center;
            flex-wrap: wrap;
            gap: 0.5rem;
            padding: 1rem 0;
            font-size: 0.875rem;
            color: var(--grey-500);
        }

        .breadcrumbs a {
            color: var(--grey-600);
            transition: color 0.2s ease;
        }

        .breadcrumbs a:hover {
            color: var(--brand-red);
        }

        .breadcrumbs .separator {
            color: var(--grey-400);
        }

        .breadcrumbs .current {
            color: var(--brand-red);
            font-weight: 600;
        }

        /* ========================================
           PAGE HEADER
           ======================================== */
        .page-header {
            text-align: center;
            margin-bottom: 2.5rem;
        }

        .page-header h1 {
            margin: 0;
            font-size: 2rem;
            font-weight: 700;
            color: var(--brand-red);
            text-transform: uppercase;
            letter-spacing: 0.025em;
        }

        @media (min-width: 640px) {
            .page-header h1 {
                font-size: 2.5rem;
            }
        }

        .page-header p {
            margin: 0.75rem 0 0;
            color: var(--grey-600);
            font-size: 1rem;
        }

        /* Back Button */
        .back-btn {
            display: inline-flex;
            align-items: center;
            gap: 0.5rem;
            padding: 0.625rem 1.25rem;
            background-color: var(--white);
            color: var(--grey-700);
            border: 2px solid var(--grey-300);
            border-radius: 0.5rem;
            font-size: 0.875rem;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s ease;
            margin-bottom: 1.5rem;
        }

        .back-btn:hover {
            background-color: var(--brand-red);
            color: var(--white);
            border-color: var(--brand-red);
        }

        .back-btn svg {
            transition: transform 0.2s ease;
        }

        .back-btn:hover svg {
            transform: translateX(-3px);
        }

        /* ========================================
           CATEGORY GRID (Images)
           ======================================== */
        .category-grid {
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        @media (min-width: 640px) {
            .category-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (min-width: 768px) {
            .category-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }

        @media (min-width: 1024px) {
            .category-grid {
                grid-template-columns: repeat(5, minmax(0, 1fr));
            }
        }

        @media (min-width: 1280px) {
            .category-grid {
                grid-template-columns: repeat(5, minmax(0, 1fr));
                gap: 1.25rem;
            }
        }

        /* Category Card */
        .category-card {
            position: relative;
            aspect-ratio: 1 / 1;
            border-radius: 0.75rem;
            overflow: hidden;
            cursor: pointer;
            background-color: var(--grey-300);
        }

        .category-card-image {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: cover;
            object-position: center;
            transition: transform 0.4s ease;
        }

        /* Dark overlay - normal state */
        .category-card-overlay {
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.4) 50%, rgba(0, 0, 0, 0.2) 100%);
            transition: background 0.3s ease;
        }

        /* Red overlay - hover state */
        .category-card-overlay-red {
            position: absolute;
            inset: 0;
            background: rgba(217, 4, 41, 0.7);
            opacity: 0;
            transition: opacity 0.3s ease;
        }

        .category-card:hover .category-card-image {
            transform: scale(1.1);
        }

        .category-card:hover .category-card-overlay {
            background: rgba(0, 0, 0, 0.2);
        }

        .category-card:hover .category-card-overlay-red {
            opacity: 1;
        }

        /* Category Content */
        .category-card-content {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 1rem;
            text-align: center;
            z-index: 10;
        }

        .category-card-icon {
            color: var(--white);
            margin-bottom: 0.75rem;
            opacity: 0.9;
            transition: transform 0.3s ease;
        }

        .category-card:hover .category-card-icon {
            transform: scale(1.1);
        }

        .category-card-title {
            color: var(--white);
            font-size: 0.875rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            line-height: 1.3;
            text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        @media (min-width: 640px) {
            .category-card-title {
                font-size: 1rem;
            }
        }

        /* ========================================
           SUBCATEGORY GRID (Icons + Text)
           ======================================== */
        .subcategory-grid {
            display: grid;
            gap: 1.5rem;
            grid-template-columns: repeat(1, minmax(0, 1fr));
        }

        @media (min-width: 640px) {
            .subcategory-grid {
                grid-template-columns: repeat(2, minmax(0, 1fr));
            }
        }

        @media (min-width: 1024px) {
            .subcategory-grid {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (min-width: 1280px) {
            .subcategory-grid {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }

        /* Subcategory Card - Improved larger rectangular design */
        .subcategory-card {
            position: relative;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: flex-end;
            padding: 2.5rem 2rem;
            background: linear-gradient(135deg, var(--grey-800) 0%, var(--grey-900) 100%);
            border: 2px solid var(--grey-700);
            border-radius: 1.25rem;
            cursor: pointer;
            transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
            min-height: 320px;
            overflow: hidden;
        }

        .subcategory-card::before {
            content: '';
            position: absolute;
            inset: 0;
            background: linear-gradient(to top, rgba(0, 0, 0, 0.95) 0%, rgba(0, 0, 0, 0.7) 50%, rgba(0, 0, 0, 0.4) 100%);
            transition: all 0.4s ease;
            z-index: 2;
        }

        .subcategory-card::after {
            content: '';
            position: absolute;
            inset: -3px;
            border-radius: 1.25rem;
            background: linear-gradient(135deg, var(--brand-red) 0%, #FF1744 100%);
            opacity: 0;
            transition: opacity 0.4s ease;
            z-index: 0;
        }

        .subcategory-card:hover {
            border-color: transparent;
            transform: translateY(-12px) scale(1.02);
            box-shadow: 0 25px 50px rgba(217, 4, 41, 0.4), 0 10px 25px rgba(0, 0, 0, 0.5);
        }

        .subcategory-card:hover::before {
            background: linear-gradient(to top, rgba(217, 4, 41, 0.92) 0%, rgba(217, 4, 41, 0.6) 60%, rgba(217, 4, 41, 0.3) 100%);
        }

        .subcategory-card:hover::after {
            opacity: 1;
        }

        .subcategory-card-icon {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 1.25rem;
            overflow: hidden;
            z-index: 1;
        }

        .subcategory-card-icon img {
            width: 100%;
            height: 100%;
            object-fit: cover;
            transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .subcategory-card-icon svg {
            width: 110px;
            height: 110px;
            color: rgba(255, 255, 255, 0.9);
            z-index: 3;
            position: relative;
            filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.7));
            transition: all 0.4s ease;
        }

        .subcategory-card:hover .subcategory-card-icon img {
            transform: scale(1.15);
        }

        .subcategory-card:hover .subcategory-card-icon svg {
            color: rgba(255, 255, 255, 1);
            transform: scale(1.15) rotate(5deg);
            filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.8));
        }

        .subcategory-card-title {
            color: var(--white);
            font-size: 1.625rem;
            font-weight: 800;
            text-align: center;
            line-height: 1.3;
            margin-bottom: 1rem;
            position: relative;
            z-index: 3;
            text-shadow: 0 3px 8px rgba(0, 0, 0, 0.95), 0 1px 3px rgba(0, 0, 0, 1);
            transition: all 0.4s ease;
            text-transform: uppercase;
            letter-spacing: 0.05em;
            max-width: 90%;
        }

        .subcategory-card:hover .subcategory-card-title {
            color: var(--white);
            text-shadow: 0 4px 12px rgba(0, 0, 0, 1), 0 2px 6px rgba(217, 4, 41, 0.8);
            transform: translateY(-6px) scale(1.03);
        }

        .subcategory-card-count {
            color: rgba(255, 255, 255, 0.98);
            font-size: 1.125rem;
            font-weight: 700;
            text-align: center;
            position: relative;
            z-index: 3;
            text-shadow: 0 2px 6px rgba(0, 0, 0, 1);
            transition: all 0.4s ease;
            background: rgba(0, 0, 0, 0.6);
            padding: 0.5rem 1.25rem;
            border-radius: 9999px;
            border: 2px solid rgba(255, 255, 255, 0.2);
            backdrop-filter: blur(8px);
        }

        .subcategory-card:hover .subcategory-card-count {
            color: rgba(255, 255, 255, 1);
            background: rgba(217, 4, 41, 0.9);
            border-color: rgba(255, 255, 255, 0.4);
            text-shadow: 0 3px 8px rgba(0, 0, 0, 1);
            transform: translateY(-6px) scale(1.05);
        }

        /* ========================================
           PRODUCT GRID (Tailwind-like)
           ======================================== */
        /* We use Tailwind classes in HTML, so no custom grid CSS needed here */

        /* Product Card styles are already defined at the top of the file */


        @keyframes borderDraw {
            0% {
                clip-path: polygon(0 0, 0 0, 0 100%, 0 100%);
            }

            25% {
                clip-path: polygon(0 0, 100% 0, 100% 0, 0 0);
            }

            50% {
                clip-path: polygon(0 0, 100% 0, 100% 100%, 100% 100%);
            }

            75% {
                clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
            }

            100% {
                clip-path: polygon(0 0, 100% 0, 100% 100%, 0 100%);
            }
        }

        /* Product Image Container */
        /* Styles removed as they are now handled by product-card.php and Tailwind classes */


        /* ========================================
           EMPTY STATE
           ======================================== */
        .empty-state {
            text-align: center;
            padding: 4rem 1rem;
            background-color: var(--white);
            border-radius: 0.75rem;
            border: 2px dashed var(--grey-300);
        }

        .empty-state-icon {
            color: var(--grey-400);
            margin-bottom: 1rem;
        }

        .empty-state-title {
            font-size: 1.25rem;
            font-weight: 600;
            color: var(--grey-700);
            margin-bottom: 0.5rem;
        }

        .empty-state-text {
            color: var(--grey-500);
            font-size: 0.875rem;
        }

        /* ========================================
           LOADING ANIMATION
           ======================================== */
        .skeleton {
            background: linear-gradient(90deg, var(--grey-200) 25%, var(--grey-100) 50%, var(--grey-200) 75%);
            background-size: 200% 100%;
            animation: skeleton-loading 1.5s infinite;
        }

        @keyframes skeleton-loading {
            0% {
                background-position: 200% 0;
            }

            100% {
                background-position: -200% 0;
            }
        }

        /* ========================================
           RESULTS COUNT
           ======================================== */
        .results-header {
            display: flex;
            flex-wrap: wrap;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 1.5rem;
            gap: 1rem;
        }

        .results-count {
            display: flex;
            align-items: center;
            gap: 0.5rem;
            font-size: 0.875rem;
            color: var(--grey-600);
        }

        .results-count strong {
            color: var(--grey-900);
        }

        /* ========================================
           RELATED PRODUCTS SECTION
           ======================================== */
        .related-products-section {
            margin-top: 4rem;
            padding-top: 3rem;
            border-top: 2px solid var(--grey-200);
        }

        .related-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .related-title {
            display: inline-flex;
            align-items: center;
            gap: 0.75rem;
            font-size: 1.5rem;
            font-weight: 700;
            color: var(--grey-900);
            margin: 0 0 0.5rem 0;
        }

        .related-title svg {
            color: var(--brand-red);
        }

        .related-subtitle {
            font-size: 0.95rem;
            color: var(--grey-500);
            margin: 0;
        }

        .related-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1rem;
        }

        @media (min-width: 640px) {
            .related-grid {
                grid-template-columns: repeat(3, 1fr);
                gap: 1.25rem;
            }
        }

        @media (min-width: 1024px) {
            .related-grid {
                grid-template-columns: repeat(6, 1fr);
                gap: 1.5rem;
            }
        }

        .related-card {
            background: linear-gradient(145deg, #ffffff, #f8f9fa);
            border: 1px solid var(--grey-200);
        }

        .related-card:hover {
            border-color: var(--brand-red);
            box-shadow: 0 8px 25px rgba(217, 4, 41, 0.15);
        }

        .related-card .product-image-container {
            height: 140px;
        }

        @media (min-width: 1024px) {
            .related-card .product-image-container {
                height: 120px;
            }
        }

        .related-card .product-name {
            font-size: 0.875rem;
            -webkit-line-clamp: 2;
            line-clamp: 2;
        }

        .related-card .price {
            font-size: 1rem;
        }

        .related-card .view-button {
            padding: 0.375rem 0.75rem;
            font-size: 0.75rem;
        }

        /* ========================================
           EXPLORE CATEGORY SECTION
           ======================================== */
        .explore-category-section {
            margin-top: 4rem;
            padding-top: 3rem;
            border-top: 2px solid var(--grey-200);
        }

        .section-header {
            text-align: center;
            margin-bottom: 2rem;
        }

        .section-title {
            font-size: 1.75rem;
            font-weight: 700;
            color: var(--grey-900);
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 0.75rem;
            margin-bottom: 0.5rem;
        }

        .section-title svg {
            width: 28px;
            height: 28px;
            color: var(--brand-red);
        }

        .section-subtitle {
            font-size: 1rem;
            color: var(--grey-500);
        }

        @media (min-width: 768px) {
            .section-title {
                font-size: 2rem;
            }
        }

        /* ========================================
           DISCOVER SECTION (Lazy Loaded)
           ======================================== */
        .discover-section {
            margin-top: 4rem;
            padding-top: 3rem;
            border-top: 2px solid var(--grey-200);
        }

        .discover-loading {
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            padding: 4rem 2rem;
            color: var(--grey-500);
        }

        .loading-spinner {
            width: 48px;
            height: 48px;
            border: 4px solid var(--grey-200);
            border-top-color: var(--brand-red);
            border-radius: 50%;
            animation: spin 1s linear infinite;
            margin-bottom: 1rem;
        }

        @keyframes spin {
            to {
                transform: rotate(360deg);
            }
        }

        .discover-category-group {
            margin-bottom: 2.5rem;
        }

        .discover-category-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 1rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid var(--grey-200);
        }

        .discover-category-title {
            font-size: 1.125rem;
            font-weight: 600;
            color: var(--grey-800);
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }

        .discover-category-title a {
            cursor: pointer;
            transition: color 0.2s ease;
        }

        .discover-category-title a:hover {
            color: var(--brand-red);
        }

        .discover-category-title svg {
            width: 20px;
            height: 20px;
            color: var(--brand-red);
        }

        .discover-category-link {
            font-size: 0.875rem;
            color: var(--brand-red);
            font-weight: 500;
            text-decoration: none;
            display: flex;
            align-items: center;
            gap: 0.25rem;
            transition: color 0.2s ease;
        }

        .discover-category-link:hover {
            color: var(--brand-red-dark);
        }

        .discover-category-link svg {
            width: 16px;
            height: 16px;
        }

        .discover-products-row {
            display: grid;
            gap: 1rem;
            grid-template-columns: repeat(2, minmax(0, 1fr));
        }

        @media (min-width: 640px) {
            .discover-products-row {
                grid-template-columns: repeat(3, minmax(0, 1fr));
            }
        }

        @media (min-width: 768px) {
            .discover-products-row {
                grid-template-columns: repeat(4, minmax(0, 1fr));
            }
        }

        @media (min-width: 1024px) {
            .discover-products-row {
                grid-template-columns: repeat(5, minmax(0, 1fr));
            }
        }

        /* ========================================
           UTILITIES
           ======================================== */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }