/* ============================================
   CATEGORY PAGE
   ============================================ */

/* Remove container padding for full-width hero */
body:has(.category-hero) .container {
    padding: 0 !important;
    max-width: none !important;
}

/* Hero Section */
.category-hero {
    background: linear-gradient(rgba(10, 22, 53, 0.7), rgba(26, 43, 95, 0.7)),
                url('/images/background-img/background%20image%20marque.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 2rem 3rem;
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.category-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

.category-hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.category-hero-text h1 {
    font-size: 3rem;
    font-weight: 700;
    color: white;
    margin-bottom: 1rem;
    letter-spacing: 2px;
}

.category-description {
    color: white;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.category-description p {
    margin-bottom: 0.5rem;
}

.category-hero-image {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    height: 250px;
}

.category-hero-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Search Bar in Hero */
.category-search-container {
    max-width: 800px;
    position: relative;
    z-index: 100;
}

.category-search-form {
    position: relative;
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.category-search-form:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.category-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 1.2rem 2rem;
    font-size: 1rem;
    color: #0a1128;
    background: transparent;
}

.category-search-input::placeholder {
    color: rgba(10, 17, 40, 0.5);
    font-weight: 400;
}

.category-search-icon-btn {
    background: transparent;
    border: none;
    padding: 0.8rem 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
    flex-shrink: 0;
}

.category-search-icon-btn:hover {
    opacity: 0.7;
}

.category-search-icon-btn svg {
    width: 24px;
    height: 24px;
    color: #0a1128;
}

.category-search-submit {
    background: transparent;
    border: none;
    padding: 1.2rem 2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.category-search-submit:hover {
    background: rgba(10, 17, 40, 0.05);
}

.category-search-submit svg {
    width: 24px;
    height: 24px;
    color: #0a1128;
}

/* Suggestions */
#categorySearchSuggestions {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 9999;
}

#categorySearchSuggestions .suggestion-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s ease;
}

#categorySearchSuggestions .suggestion-item:last-child {
    border-bottom: none;
}

#categorySearchSuggestions .suggestion-item:hover {
    background: #f8f9fa;
}

#categorySearchSuggestions .suggestion-item.no-result {
    justify-content: center;
    color: #999;
}

#categorySearchSuggestions .suggestion-item.no-result:hover {
    background: transparent;
}

#categorySearchSuggestions .suggestion-image {
    width: 60px;
    height: 60px;
    object-fit: contain;
    margin-right: 1rem;
}

#categorySearchSuggestions .suggestion-no-image {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-right: 1rem;
}

#categorySearchSuggestions .suggestion-content {
    flex: 1;
}

#categorySearchSuggestions .suggestion-code {
    font-size: 0.85rem;
    color: rgba(5, 0, 82, 1);
    font-weight: 600;
}

#categorySearchSuggestions .suggestion-name {
    font-size: 0.95rem;
    color: #333;
    margin-top: 0.25rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .category-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .category-hero-text h1 {
        font-size: 3rem;
    }

    .category-hero-image {
        height: 250px;
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 768px) {
    .category-hero {
        padding: 2rem 1.5rem;
    }

    .category-hero-text h1 {
        font-size: 2rem;
    }

    .category-description {
        font-size: 0.95rem;
    }

    .category-search-container {
        max-width: calc(100% - 1rem);
        margin: 0;
    }

    .category-search-form {
        max-width: calc(100% - 1rem);
        margin: 0;
        padding: 0;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        background: white;
        border-radius: 50px;
        overflow: hidden;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    }

    .category-search-input {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        border: none;
        outline: none;
        padding: 1rem 1rem !important;
        font-size: 0.9rem !important;
        color: #0a1128;
        background: transparent;
    }

    .category-search-input::placeholder {
        color: rgba(10, 17, 40, 0.5);
        font-weight: 400;
    }

    .category-search-icon-btn {
        background: transparent;
        border: none;
        padding: 0.75rem 0.6rem !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: opacity 0.3s ease;
        flex-shrink: 0 !important;
    }

    .category-search-icon-btn:hover {
        opacity: 0.7;
    }

    .category-search-icon-btn svg {
        width: 20px !important;
        height: 20px !important;
        color: #0a1128;
        flex-shrink: 0;
    }

    .category-search-submit {
        background: transparent;
        border: none;
        padding: 0.75rem 1rem !important;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: background 0.3s ease;
        flex-shrink: 0 !important;
    }

    .category-search-submit:hover {
        background: rgba(10, 17, 40, 0.05);
    }

    .category-search-submit svg {
        width: 20px !important;
        height: 20px !important;
        color: #0a1128;
        flex-shrink: 0;
    }

    .products-header {
        flex-direction: column;
        gap: 1rem;
    }

    .products-pagination {
        flex-wrap: wrap;
    }
}

/* Pagination */
.products-pagination {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
}

.page-dots {
    color: rgba(5, 0, 82, 0.4);
    font-weight: 700;
    font-size: 1.2rem;
    padding: 0 0.5rem;
    user-select: none;
}

.page-btn {
    min-width: 45px;
    height: 45px;
    padding: 0.75rem 1.25rem;
    border: 2px solid rgba(5, 0, 82, 0.2);
    background: white;
    color: rgba(5, 0, 82, 0.9);
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(5, 0, 82, 0.05);
}

.page-btn:hover {
    background: rgba(5, 0, 82, 0.08);
    border-color: rgba(5, 0, 82, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(5, 0, 82, 0.1);
}

.page-btn.active {
    background: rgba(5, 0, 82, 1);
    color: white;
    border-color: rgba(5, 0, 82, 1);
    box-shadow: 0 4px 12px rgba(5, 0, 82, 0.3);
}

.page-btn.page-next {
    padding: 0.75rem 2rem;
    background: rgba(5, 0, 82, 1);
    color: white;
    border-color: rgba(5, 0, 82, 1);
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}

.page-btn.page-next:hover {
    background: rgba(5, 0, 82, 0.85);
    border-color: rgba(5, 0, 82, 0.85);
    transform: translateX(3px);
}

.products-footer {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(5, 0, 82, 0.1);
}

/* Placeholder image styling */
.product-image.no-image {
    position: relative;
    background: linear-gradient(135deg, #f0f0f5 0%, #e8e8f0 100%);
}

.product-image.no-image::before {
    content: '📦';
    position: absolute;
    font-size: 3rem;
    opacity: 0.2;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.product-image.no-image::after {
    content: 'Image non disponible';
    position: absolute;
    bottom: 0.75rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: rgba(5, 0, 82, 0.5);
    font-weight: 500;
    white-space: nowrap;
}

/* Products Grid - COMPACT */
.brand-products-section .products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.85rem;
}

.brand-products-section .product-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.brand-products-section .product-card:hover {
    border-color: #0a1635;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(10, 22, 53, 0.1);
}

.brand-products-section .product-image {
    width: 100%;
    height: 120px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
    position: relative;
}

.brand-products-section .product-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.brand-products-section .product-info {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.brand-products-section .product-info h3 {
    font-size: 0.85rem;
    font-weight: 600;
    color: #0a1635;
    margin: 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-products-section .product-code {
    font-size: 0.75rem;
    color: #666;
    margin: 0;
}

.brand-products-section .product-code strong {
    color: #0a1635;
    font-weight: 700;
}

/* ============================================
   SUBCATEGORIES PAGE
   ============================================ */

body:has(.subcategories-hero) .container {
    padding: 0 !important;
    max-width: none !important;
}

/* Hero Section */
.subcategories-hero {
    background: linear-gradient(rgba(10, 22, 53, 0.75), rgba(26, 43, 95, 0.75)),
                url('/images/background-img/background%20image%20marque.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 2rem 3rem;
    position: relative;
    width: 100vw;
    margin-left: calc(-50vw + 50%);
}

.subcategories-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(circle at 20% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 50%),
        radial-gradient(circle at 80% 50%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    pointer-events: none;
}

.subcategories-hero-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 3rem;
    align-items: center;
    position: relative;
    z-index: 1;
}

.subcategories-hero-text {
    color: white;
}

/* Breadcrumb */
.subcategories-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.subcategories-breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

.subcategories-breadcrumb a:hover {
    color: white;
}

.breadcrumb-separator {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb-separator svg {
    width: 0.75rem;
    height: 0.75rem;
}

.breadcrumb-current {
    color: white;
    font-weight: 500;
}

.subcategories-hero-text h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.subcategories-description {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.subcategories-hero-image {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    height: 200px;
}

.subcategories-hero-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

/* Grid Section */
.subcategories-grid-section {
    padding: 3rem 2rem 4rem;
    background: #f8f9fa;
    min-height: 400px;
}

.subcategories-container {
    max-width: 1400px;
    margin: 0 auto;
}

.subcategories-header {
    margin-bottom: 2rem;
}

.subcategories-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: rgba(5, 0, 82, 0.9);
    margin: 0;
}

/* Grid */
.subcategories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.subcategory-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(5, 0, 82, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.subcategory-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(5, 0, 82, 0.12);
    border-color: rgba(5, 0, 82, 0.15);
}

.subcategory-image {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: #fafafa;
    border-bottom: 1px solid rgba(5, 0, 82, 0.05);
}

.subcategory-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.subcategory-info {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.subcategory-info h3 {
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(5, 0, 82, 1);
    margin: 0;
    line-height: 1.3;
}

.subcategory-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: rgba(5, 0, 82, 0.05);
    border-radius: 50%;
    color: rgba(5, 0, 82, 0.6);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.subcategory-arrow svg {
    width: 1rem;
    height: 1rem;
}

.subcategory-card:hover .subcategory-arrow {
    background: rgba(5, 0, 82, 1);
    color: white;
}

/* Back button */
.subcategories-back {
    margin-top: 3rem;
    text-align: center;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: white;
    border: 2px solid rgba(5, 0, 82, 0.2);
    border-radius: 8px;
    color: rgba(5, 0, 82, 0.8);
    font-weight: 500;
    font-size: 0.95rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: rgba(5, 0, 82, 1);
    border-color: rgba(5, 0, 82, 1);
    color: white;
}

.btn-back svg {
    width: 1rem;
    height: 1rem;
}

.no-subcategories {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .subcategories-hero-content {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }

    .subcategories-breadcrumb {
        justify-content: center;
    }

    .subcategories-hero-image {
        height: 180px;
        max-width: 300px;
        margin: 0 auto;
    }

    .subcategories-hero-text h1 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .subcategories-hero {
        padding: 1.5rem;
    }

    .subcategories-hero-text h1 {
        font-size: 1.75rem;
    }

    .subcategories-grid-section {
        padding: 2rem 1rem 3rem;
    }

    .subcategories-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .subcategory-image {
        height: 140px;
        padding: 1rem;
    }

    .subcategory-info {
        padding: 1rem;
    }

    .subcategory-info h3 {
        font-size: 0.9rem;
    }
}

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

    .subcategory-card {
        flex-direction: row;
    }

    .subcategory-image {
        width: 100px;
        height: auto;
        min-height: 100px;
        border-bottom: none;
        border-right: 1px solid rgba(5, 0, 82, 0.05);
    }

    .subcategory-info {
        flex: 1;
    }
}
