/* Styles du catalogue (liste + fiche article) — extraits des templates pour cache HTTP */

/* ===== Catalogue Page Styles ===== */
.catalogue-hero {
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    padding: 3rem 0;
    padding-bottom: 4rem; /* Extra space for search dropdown */
    text-align: center;
    position: relative;
    overflow: visible; /* Allow dropdown to overflow */
}

.catalogue-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none; /* Allow clicks through the pattern */
}

.catalogue-hero-content {
    position: relative;
    z-index: 1;
}

.catalogue-hero h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.catalogue-hero p {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Search Bar */
.search-container {
    max-width: 600px;
    margin: 1.5rem auto 0;
    position: relative;
    z-index: 100; /* Above other content for dropdown */
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    position: relative;
}

/* Category Badge inside search bar */
.search-category-badge {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    padding: 0.4rem 0.6rem 0.4rem 0.9rem;
    margin-left: 0.5rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    max-width: 180px;
    overflow: hidden;
}

.search-category-badge span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-category-badge .remove-category {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.search-category-badge .remove-category:hover {
    background: rgba(255, 255, 255, 0.4);
}

.search-category-badge .remove-category i {
    font-size: 0.65rem;
}

.search-box input {
    flex: 1;
    border: none;
    padding: 1rem 1.5rem;
    font-size: 1rem;
    outline: none;
    min-width: 0; /* Allow shrinking for category badge */
}

.search-box.has-category input {
    padding-left: 0.75rem;
}

.search-box button {
    background: linear-gradient(135deg, var(--im-accent) 0%, var(--im-accent-dark) 100%);
    border: none;
    padding: 1rem 1.5rem;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-box button:hover {
    background: linear-gradient(135deg, var(--im-accent-dark) 0%, #b45309 100%);
}

/* Live Search Results Dropdown */
.search-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: var(--im-radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    margin-top: 0.5rem;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
}

.search-results-dropdown.active {
    display: block;
}

.search-results-dropdown .search-loading {
    padding: 1.5rem;
    text-align: center;
    color: var(--im-text-muted);
}

.search-results-dropdown .search-loading i {
    font-size: 1.5rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.search-results-dropdown .no-results {
    padding: 1.5rem;
    text-align: center;
    color: var(--im-text-muted);
}

.search-results-dropdown .no-results i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--im-bg-alt);
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.search-result-item:hover {
    background: var(--im-bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-image {
    width: 50px;
    height: 50px;
    border-radius: var(--im-radius-sm);
    object-fit: cover;
    margin-right: 1rem;
    background: var(--im-bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--im-radius-sm);
}

.search-result-image i {
    color: var(--im-text-light);
    font-size: 1.2rem;
}

.search-result-info {
    flex: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 600;
    color: var(--im-text);
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-result-ref {
    font-size: 0.8rem;
    color: var(--im-text-muted);
}

.search-result-price {
    font-weight: 700;
    color: var(--im-primary);
    margin-left: 1rem;
    white-space: nowrap;
}

.search-result-stock {
    margin-left: 0.5rem;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
}

.search-result-stock.in-stock {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.search-result-stock.out-of-stock {
    background: var(--im-danger-bg);
    color: var(--im-danger-dark);
}

.search-see-all {
    display: block;
    padding: 1rem;
    text-align: center;
    background: var(--im-bg);
    color: var(--im-primary);
    font-weight: 600;
    text-decoration: none;
    border-radius: 0 0 16px 16px;
    transition: background 0.2s ease;
}

.search-see-all:hover {
    background: var(--im-border);
}

/* Main Layout */
.catalogue-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Sidebar Filters */
.catalogue-sidebar {
    background: white;
    border-radius: var(--im-radius-lg);
    padding: 1rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Mobile filter toggle button */
.mobile-filter-toggle {
    display: none;
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
    min-width: 48px;
}

.filter-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(20, 97, 181, 0.4);
}

.filter-toggle-btn i {
    font-size: 1rem;
}

.filter-count-badge {
    background: rgba(255, 255, 255, 0.25);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

/* Mobile sidebar overlay */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: transparent;
    z-index: 999;
}

/* Mobile sidebar close button */
.sidebar-close-btn {
    display: none;
}

/* Accordion filter sections */
.filter-accordion {
    margin-bottom: 1rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
    overflow: hidden;
    background: white;
}

.filter-accordion:last-child {
    margin-bottom: 0;
}

.accordion-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1rem;
    cursor: pointer;
    user-select: none;
    background: linear-gradient(135deg, var(--im-bg) 0%, var(--im-bg-alt) 100%);
    border-bottom: 1px solid var(--im-border);
    transition: all 0.2s ease;
    min-height: 48px;
}

.accordion-header:hover {
    background: linear-gradient(135deg, var(--im-info-bg) 0%, #f0f9ff 100%);
}

.accordion-header::-webkit-details-marker {
    display: none;
}

.accordion-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: var(--im-radius-sm);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.accordion-icon i {
    color: var(--im-primary);
    font-size: 0.85rem;
}

.accordion-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--im-text);
}

.accordion-toggle {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.accordion-toggle i {
    font-size: 0.65rem;
    color: var(--im-text-muted);
    transition: transform 0.3s ease;
}

details[open] .accordion-toggle i {
    transform: rotate(180deg);
}

.accordion-content {
    padding: 0.5rem;
    overflow-y: auto;
}

/* Ensure <details> elements collapse properly in flex layout */
.filter-accordion:not([open]) .accordion-content {
    display: none !important;
}

/* Groups take only the height of their content (no flex-grow stretching) */
.filter-accordion {
    flex: 0 0 auto;
}

/* Accordion content has max-height when open to prevent infinite growth.
   Applies to ALL filter groups (categories, brands, price, promo, delivery)
   on desktop AND mobile: group takes minimal height, scrolls if content overflows */
.filter-accordion[open] .accordion-content {
    max-height: 300px;
    overflow-y: auto;
}

/* Desktop: taller cap that adapts to viewport height */
@media (min-width: 993px) {
    .filter-accordion[open] .accordion-content {
        max-height: clamp(220px, 38vh, 420px);
    }

    .brands-list,
    .hidden-brands {
        max-height: clamp(180px, 30vh, 340px);
    }
}

/* Brands list has its own scroll within accordion (keeps search input visible).
   The extra `details` element selector wins the specificity tie against
   the mobile media-query rules on .filter-accordion[open] .accordion-content */
details.filter-accordion-brands[open] .accordion-content {
    max-height: none;
    overflow-y: visible;
}

.brands-list,
.hidden-brands {
    max-height: 300px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

/* Brand search */
.brand-search-container {
    position: relative;
    margin-bottom: 0.75rem;
}

.brand-search-input {
    width: 100%;
    padding: 0.6rem 0.75rem 0.6rem 2.25rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    font-size: 0.85rem;
    outline: none;
    transition: all 0.2s ease;
    min-height: 44px;
    background: white;
    color: var(--im-text);
}

.brand-search-input::placeholder {
    color: var(--im-text-light);
}

.brand-search-input:focus {
    border-color: var(--im-primary);
    box-shadow: 0 0 0 3px rgba(20, 97, 181, 0.1);
}

.brand-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--im-text-light);
    font-size: 0.85rem;
    pointer-events: none;
}

.load-more-btn {
    width: 100%;
    padding: 0.6rem;
    background: var(--im-bg);
    border: 1px dashed var(--im-border-strong);
    border-radius: var(--im-radius-sm);
    color: var(--im-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.load-more-btn:hover {
    background: var(--im-info-bg);
    border-color: var(--im-primary);
}

.hidden-brands {
    display: none;
}

.show-all .hidden-brands {
    display: block;
}

.show-all .load-more-brands {
    display: none;
}

.filter-section {
    margin-bottom: 1rem;
    min-height: 0;
}

/* Section catégories : prend plus d'espace (60%) quand ouverte */
.filter-section:first-of-type {
    min-height: 0;
}

/* Section marques : prend moins d'espace (40%) quand ouverte */
.filter-section.filter-accordion-brands {
    min-height: 0;
}

/* Ensure accordion-content scrolls within sidebar max-height */
.filter-accordion .accordion-content {
    overflow-y: auto;
}

.filter-section h3 {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid var(--im-border);
    flex-shrink: 0;
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.filter-list li {
    margin-bottom: 0.5rem;
}

.filter-list a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: var(--im-radius-sm);
    color: #475569;
    text-decoration: none;
    transition: all 0.2s ease;
}

.filter-list a:hover,
.filter-list a.active {
    background: var(--im-bg-alt);
    color: var(--im-primary);
}

.filter-list a.active {
    font-weight: 600;
}

.filter-count {
    background: var(--im-border);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.8rem;
    color: var(--im-text-muted);
}

/* ===== Price filter form (desktop + mobile) ===== */
.price-filter-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.25rem;
}

.price-inputs {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
}

.price-input-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.price-input-group label {
    font-size: 0.8rem;
    color: var(--im-text-muted);
    font-weight: 600;
}

.price-input {
    width: 100%;
    padding: 0.5rem 0.6rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    font-size: 0.9rem;
    background: white;
    color: var(--im-text);
    transition: border-color 0.2s ease;
    min-height: 40px;
}

.price-input:focus {
    outline: none;
    border-color: var(--im-primary);
    box-shadow: 0 0 0 3px rgba(20, 97, 181, 0.1);
}

.price-separator {
    color: var(--im-text-light);
    font-weight: 600;
    padding-bottom: 0.7rem;
    flex-shrink: 0;
}

.price-apply-btn {
    width: 100%;
    padding: 0.6rem;
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius-sm);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.price-apply-btn:hover {
    box-shadow: 0 4px 12px rgba(20, 97, 181, 0.35);
    transform: translateY(-1px);
}

/* ===== Delivery filter links (desktop + mobile) ===== */
.filter-accordion-delivery .filter-list li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.5rem;
}

.filter-accordion-delivery .filter-list li a i {
    width: 1.2rem;
    text-align: center;
    color: var(--im-primary);
    flex-shrink: 0;
}

/* ===== Scrollbar commune pour toutes les sections de filtres ===== */
.categories-accordion,
.filter-section.filter-accordion-brands .filter-list {
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 0.5rem;
    min-height: 0;
}

/* Scrollbar style - Webkit (Chrome, Safari, Edge) */
.accordion-content::-webkit-scrollbar,
.categories-accordion::-webkit-scrollbar,
.filter-section.filter-accordion-brands .filter-list::-webkit-scrollbar {
    width: 6px;
}

.accordion-content::-webkit-scrollbar-track,
.categories-accordion::-webkit-scrollbar-track,
.filter-section.filter-accordion-brands .filter-list::-webkit-scrollbar-track {
    background: var(--im-bg-alt);
    border-radius: 3px;
}

.accordion-content::-webkit-scrollbar-thumb,
.categories-accordion::-webkit-scrollbar-thumb,
.filter-section.filter-accordion-brands .filter-list::-webkit-scrollbar-thumb {
    background: var(--im-border-strong);
    border-radius: 3px;
}

.accordion-content::-webkit-scrollbar-thumb:hover,
.categories-accordion::-webkit-scrollbar-thumb:hover,
.filter-section.filter-accordion-brands .filter-list::-webkit-scrollbar-thumb:hover {
    background: var(--im-text-light);
}

/* Scrollbar style - Firefox */
.accordion-content,
.categories-accordion,
.filter-section.filter-accordion-brands .filter-list {
    scrollbar-width: thin;
    scrollbar-color: var(--im-border-strong) var(--im-bg-alt);
}

/* Brand items styling */
.filter-section.filter-accordion-brands .filter-list li a {
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
}

/* ===== Categories Accordion Style ===== */
.categories-accordion {
    border-radius: var(--im-radius);
}

.categories-accordion > li:first-child > a {
    border-bottom: 1px solid var(--im-border);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--im-primary);
}

.categories-accordion > li:first-child > a .filter-count {
    background: var(--im-primary);
    color: white;
}

.category-parent {
    margin-bottom: 0.35rem;
    border-radius: var(--im-radius-sm);
    overflow: hidden;
    background: linear-gradient(135deg, var(--im-bg) 0%, var(--im-bg-alt) 100%);
    border: 1px solid var(--im-border);
    transition: all 0.3s ease;
}

.category-parent:hover {
    border-color: var(--im-border-strong);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.category-parent.is-open {
    border-color: var(--im-primary);
    box-shadow: 0 2px 10px rgba(20, 97, 181, 0.1);
}

.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.65rem;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s ease;
    gap: 0.5rem;
}

.category-header:hover {
    background: linear-gradient(135deg, var(--im-info-bg) 0%, #f0f9ff 100%);
}

.category-icon {
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-icon i {
    font-size: 0.7rem;
    color: var(--im-text-muted);
    transition: all 0.3s ease;
}

.category-header:hover .category-icon {
    background: var(--im-primary);
    transform: scale(1.05);
}

.category-header:hover .category-icon i {
    color: white;
}

.category-name {
    flex: 1;
    font-weight: 600;
    color: #334155;
    font-size: 0.8rem;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.category-header:hover .category-name {
    color: var(--im-primary);
}

.category-count {
    background: var(--im-border);
    color: var(--im-text-muted);
    padding: 0.1rem 0.45rem;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 600;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.category-header:hover .category-count {
    background: var(--im-primary);
    color: white;
}

.category-toggle {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.category-toggle i {
    font-size: 0.55rem;
    color: var(--im-text-muted);
    transition: all 0.3s ease;
}

.category-header:hover .category-toggle {
    background: var(--im-primary);
    box-shadow: 0 4px 12px rgba(20, 97, 181, 0.3);
    transform: scale(1.1);
}

.category-header:hover .category-toggle i {
    color: white;
}

.subcategories {
    list-style: none;
    padding: 0;
    margin: 0;
    background: white;
    border-top: 1px solid var(--im-border);
    display: none;
}

.subcategories.show {
    display: block;
    padding: 0.35rem;
}

.subcategories li {
    margin: 0;
}

.subcategories a {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.6rem 0.45rem 0.8rem;
    font-size: 0.8rem;
    border-left: 2px solid transparent;
    border-radius: 0 6px 6px 0;
    margin-left: 0.4rem;
    transition: all 0.2s ease;
    color: #475569;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.subcategories a::before {
    content: '›';
    color: var(--im-text-light);
    font-weight: bold;
    transition: all 0.2s ease;
}

.subcategories a:hover {
    border-left-color: var(--im-primary);
    background: linear-gradient(90deg, #f0f9ff 0%, transparent 100%);
    padding-left: 1rem;
}

.subcategories a:hover::before {
    color: var(--im-primary);
}

.subcategories a.active {
    border-left-color: var(--im-primary);
    background: linear-gradient(90deg, #dbeafe 0%, #eff6ff 50%, transparent 100%);
    color: var(--im-primary);
    font-weight: 600;
}

.subcategories a.active::before {
    color: var(--im-primary);
}


/* Products Grid */
.catalogue-content {
    min-height: 500px;
    min-width: 0;
    overflow-x: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

/* ===== Chips des filtres actifs ===== */
.active-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--im-bg);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius);
}

.active-filters-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--im-text-muted);
    margin-right: 0.25rem;
}

.active-filters-label i {
    color: var(--im-primary);
    margin-right: 0.25rem;
}

.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    background: white;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--im-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    min-height: 32px;
}

.filter-chip i {
    font-size: 0.75rem;
}

.filter-chip:hover {
    background: #eff6ff;
    border-color: var(--im-primary);
    color: var(--im-primary-dark);
}

.filter-chip-remove {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1;
    color: var(--im-text-light);
}

.filter-chip:hover .filter-chip-remove {
    color: var(--im-danger);
}

.filter-chip-clear {
    background: #fef2f2;
    border-color: #fecaca;
    color: var(--im-danger);
}

.filter-chip-clear:hover {
    background: var(--im-danger-bg);
    border-color: var(--im-danger);
    color: #b91c1c;
}

/* Message d'erreur validation prix */
.price-error {
    display: none;
    color: var(--im-danger);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.25rem;
}

.price-error.visible {
    display: block;
}

.price-input.invalid {
    border-color: var(--im-danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.results-count {
    color: var(--im-text-muted);
    font-size: 0.95rem;
}

.results-count strong {
    color: var(--im-text);
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    font-size: 0.9rem;
    background: white;
    cursor: pointer;
}

/* Sort Controls */
.sort-controls {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.stock-filter-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--im-bg);
    border: 1px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    cursor: pointer;
}

.stock-filter-inline input {
    width: 18px;
    height: 18px;
    accent-color: var(--im-primary);
    cursor: pointer;
}

.stock-filter-inline label {
    cursor: pointer;
    font-size: 0.9rem;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    white-space: nowrap;
    line-height: 1;
    margin: 0;
}

.stock-filter-inline label i {
    color: var(--im-primary);
}

.stock-filter-inline:has(input:checked) {
    background: var(--im-info-bg);
    border-color: var(--im-primary);
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    overflow-x: hidden;
}

/* Product Card */
.product-card {
    background: white;
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
}

/* ===== Promotion Card Styles ===== */
.product-card-promo {
    border: 2px solid #f5576c;
    position: relative;
}

.product-card-promo::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
    z-index: 1;
}

.promotion-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    animation: pulse 2s infinite;
    z-index: 5;
}

.promo-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.promo-price .price-new {
    color: #48bb78;
    font-size: 1.3em;
    font-weight: 700;
}

.promo-price .price-old {
    color: #a0aec0;
    text-decoration: line-through;
    font-size: 0.9em;
}

.economie-badge {
    background: #edf2f7;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8em;
    color: #48bb78;
    font-weight: 600;
    display: inline-block;
    margin-top: 0.25rem;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    background: var(--im-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-image .no-image {
    color: var(--im-border-strong);
    font-size: 3rem;
}

/* Stock Badge - dans product-info, affichage inline */
.stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.stock-badge i {
    font-size: 0.75rem;
}

.stock-badge.in-stock {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.stock-badge.out-of-stock {
    background: var(--im-danger-bg);
    color: var(--im-danger-dark);
}

.stock-badge.low-stock {
    background: #fef3c7;
    color: #92400e;
}

/* Product Info */
.product-info {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-reference {
    font-size: 0.8rem;
    color: var(--im-text-light);
    margin-bottom: 0.25rem;
}

.product-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-family {
    font-size: 0.85rem;
    color: var(--im-text-muted);
    margin-bottom: 0.75rem;
}

.product-family i {
    margin-right: 0.25rem;
}

.product-price {
    margin-top: auto;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--im-primary);
}

.product-price.no-price {
    font-size: 1rem;
    color: var(--im-text-light);
    font-weight: 400;
}

.product-actions {
    padding: 0 1.25rem 1.25rem;
    display: flex;
    gap: 0.5rem;
}

.btn-voir-detail {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: var(--im-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.btn-voir-detail:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(20, 97, 181, 0.4);
    color: white;
    text-decoration: none;
}

.btn-card-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-width: 44px;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--im-accent) 0%, var(--im-accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius-sm);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.btn-card-cart:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(245, 158, 11, 0.4);
}

.btn-card-cart:active {
    transform: scale(0.95);
}

.btn-card-cart.added {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.btn-card-cart.added i::before {
    content: "\f00c";
}

/* Pagination */
.pagination-container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--im-radius-sm);
    background: white;
    color: #475569;
    text-decoration: none;
    border: 1px solid var(--im-border);
    transition: all 0.2s ease;
}

.pagination .page-item.active .page-link {
    background: var(--im-primary);
    color: white;
    border-color: var(--im-primary);
}

.pagination .page-item .page-link:hover:not(.disabled) {
    background: var(--im-bg-alt);
    border-color: var(--im-primary);
}

.pagination .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: var(--im-radius-lg);
}

.empty-state i {
    font-size: 4rem;
    color: var(--im-border-strong);
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #475569;
    margin-bottom: 0.5rem;
}

.empty-state p {
    color: var(--im-text-light);
}

/* ===== Categories Home Grid ===== */
.categories-home {
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

.categories-home-title {
    text-align: center;
    margin-bottom: 2rem;
}

.categories-home-title h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.5rem;
}

.categories-home-title p {
    color: var(--im-text-muted);
    font-size: 1rem;
}

/* Dans la vue avec sidebar */
.catalogue-content .categories-home-title {
    text-align: left;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--im-border);
}

.catalogue-content .categories-home-title h2 {
    font-size: 1.5rem;
}

.catalogue-content .categories-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.25rem;
}

.category-card {
    background: white;
    border-radius: var(--im-radius-lg);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 50px rgba(20, 97, 181, 0.2);
}

.category-card-image {
    position: relative;
    width: 100%;
    height: 150px;
    background: linear-gradient(135deg, #f0f9ff 0%, var(--im-info-bg) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.category-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.category-card:hover .category-card-image img {
    transform: scale(1.1);
}

.category-card-image .category-placeholder {
    font-size: 3rem;
    color: var(--im-primary);
    opacity: 0.3;
}

.category-card-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 100%);
    padding: 2rem 1rem 1rem;
    color: white;
}

.category-card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(20, 97, 181, 0.9);
    color: white;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.category-card-info {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.category-card-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.35rem;
}

.category-card-description {
    color: var(--im-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 0.75rem;
    border-top: 1px solid var(--im-border);
}

.category-card-stats {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--im-text-muted);
    font-size: 0.85rem;
}

.category-card-stats i {
    margin-right: 0.25rem;
    color: var(--im-primary);
}

.category-card-arrow {
    width: 30px;
    height: 30px;
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.category-card:hover .category-card-arrow {
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(20, 97, 181, 0.4);
}

/* ===== Inquiry CTA Button ===== */
.inquiry-cta {
    margin-top: 1rem;
    text-align: center;
}

.inquiry-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 50px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.inquiry-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.inquiry-btn i {
    font-size: 1.1rem;
}

.inquiry-btn strong {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ===== Inquiry Modal ===== */
.inquiry-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.inquiry-modal {
    background: white;
    border-radius: 20px;
    max-width: 680px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
    animation: inquiry-slide-in 0.3s ease;
}

@keyframes inquiry-slide-in {
    from { opacity: 0; transform: translateY(30px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.inquiry-modal-close {
    position: absolute;
    top: 1rem; right: 1rem;
    background: var(--im-bg-alt);
    border: none;
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--im-text-muted);
    font-size: 1rem;
    transition: all 0.2s ease;
}

.inquiry-modal-close:hover {
    background: var(--im-border);
    color: var(--im-text);
}

.inquiry-modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.inquiry-modal-header i {
    font-size: 2.5rem;
    color: var(--im-primary);
    margin-bottom: 0.5rem;
}

.inquiry-modal-header h2 {
    font-size: 1.5rem;
    color: var(--im-text);
    margin: 0.5rem 0 0.3rem;
}

.inquiry-modal-header p {
    color: var(--im-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    max-width: 500px;
    margin: 0 auto;
}

.inquiry-fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.inquiry-field {
    margin-bottom: 0.75rem;
}

.inquiry-field-full {
    grid-column: 1 / -1;
}

.inquiry-field label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.3rem;
}

.inquiry-field label i {
    color: var(--im-primary);
    width: 16px;
    text-align: center;
    margin-right: 0.2rem;
}

.inquiry-field label .optional {
    font-weight: 400;
    color: var(--im-text-light);
    font-size: 0.8rem;
}

.inquiry-field label .required {
    color: #ef4444;
}

.inquiry-input {
    width: 100%;
    border: 2px solid var(--im-border);
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    font-size: 0.9rem;
    transition: border-color 0.2s ease;
    outline: none;
    font-family: inherit;
    box-sizing: border-box;
}

.inquiry-input:focus {
    border-color: var(--im-primary);
    box-shadow: 0 0 0 3px rgba(20, 97, 181, 0.1);
}

.inquiry-textarea {
    resize: vertical;
    min-height: 100px;
}

.inquiry-input-file {
    width: 100%;
    border: 2px dashed var(--im-border-strong);
    border-radius: 10px;
    padding: 0.8rem;
    font-size: 0.85rem;
    cursor: pointer;
    transition: border-color 0.2s ease;
    background: var(--im-bg);
}

.inquiry-input-file:hover {
    border-color: var(--im-primary);
}

.inquiry-photo-preview {
    margin-top: 0.5rem;
    position: relative;
    display: inline-block;
}

.inquiry-photo-preview img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 10px;
    object-fit: cover;
    border: 2px solid var(--im-border);
}

.inquiry-photo-remove {
    position: absolute;
    top: -8px; right: -8px;
    background: #ef4444;
    color: white;
    border: none;
    width: 24px; height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
}

.inquiry-contact-section {
    border-top: 2px solid var(--im-bg-alt);
    margin-top: 0.5rem;
    padding-top: 1rem;
}

.inquiry-contact-section h3 {
    font-size: 1rem;
    color: var(--im-text);
    margin-bottom: 0.75rem;
}

.inquiry-contact-section h3 i {
    color: var(--im-primary);
    margin-right: 0.3rem;
}

.inquiry-submit-row {
    text-align: center;
    margin-top: 1rem;
}

.inquiry-submit-btn {
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.8rem 2.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.inquiry-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(20, 97, 181, 0.4);
}

/* Responsive */
@media (max-width: 992px) {
    .catalogue-layout {
        grid-template-columns: 1fr;
    }

    .catalogue-sidebar {
        position: fixed;
        top: 86px;
        right: -320px;
        width: 320px;
        height: calc(100vh - 86px);
        max-height: calc(100vh - 86px);
        border-radius: 0;
        z-index: 1040;
        transition: right 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        display: block;
    }

    .catalogue-sidebar.open {
        right: 0;
    }

    .sidebar-overlay.active {
        display: block;
    }

    .mobile-filter-toggle {
        display: flex;
        align-items: center;
        margin-bottom: 1rem;
        justify-content: center;
    }

    .filter-section {
        min-width: 0;
    }

    /* Mobile: each open filter group keeps its own max-height + scroll */
    .filter-accordion[open] .accordion-content {
        max-height: 300px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .filter-accordion {
        overflow-y: visible;
        max-height: none;
    }

    /* Overlay must not intercept clicks on sidebar content */
    /* Keep pointer-events: none always so touches reach the sidebar */
    .sidebar-overlay {
        pointer-events: none;
    }
    .sidebar-overlay.active {
        display: block;
        /* pointer-events stays none - clicks pass through to sidebar */
    }
    /* Sidebar receives all interactions when open */
    .catalogue-sidebar.open {
        pointer-events: auto;
        z-index: 1100;
    }

    /* Close button visible on mobile */
    .sidebar-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 44px;
        height: 44px;
        position: sticky;
        top: 0;
        float: right;
        margin: 0.5rem 0.5rem 0 0;
        background: #1a73e8;
        color: white;
        border: none;
        border-radius: 50%;
        font-size: 1.1rem;
        cursor: pointer;
        z-index: 1200;
        transition: background 0.2s ease;
    }

    .sidebar-close-btn:hover {
        background: #1557b0;
    }

}

@media (max-width: 768px) {
    /* Mobile filter toggle */
    .mobile-filter-toggle {
        display: flex;
        justify-content: center;
    }

    /* Touch targets 48px minimum */
    .filter-toggle-btn,
    .accordion-header,
    .filter-list a,
    .load-more-btn,
    .btn-voir-detail,
    .btn-card-cart {
        min-height: 48px;
    }

    .filter-list a {
        padding: 0.75rem 1rem;
    }

    .accordion-header {
        padding: 0.85rem 1rem;
    }

    /* Mobile: each open filter group scrolls independently (min height, scroll on overflow) */
    .filter-accordion {
        overflow: hidden;
        max-height: none;
    }
    .filter-accordion[open] .accordion-content {
        overflow-y: auto;
        max-height: 300px;
        -webkit-overflow-scrolling: touch;
    }

    /* Products grid mobile */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-card {
        min-width: 0;
    }

    .product-image {
        height: 150px;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.85rem;
    }

    .product-price {
        font-size: 1.1rem;
    }

    /* Stock badges mobile - adjusted positioning */
    .stock-badge {
        font-size: 0.7rem;
        padding: 0.25rem 0.6rem;
    }

    .stock-badge i {
        font-size: 0.65rem;
    }

    /* Touch targets for detail and cart buttons */
    .btn-voir-detail {
        padding: 0.75rem;
        min-height: 48px;
        font-size: 0.85rem;
    }

    .btn-card-cart {
        width: 48px;
        min-width: 48px;
        height: 48px;
        padding: 0.75rem;
        font-size: 1.1rem;
    }

    .product-actions {
        padding: 0 0.75rem 0.75rem;
        gap: 0.75rem;
    }

    /* Sidebar accordion mobile — chaque groupe garde sa hauteur max avec scroll interne */

    .brand-search-input {
        min-height: 48px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
}

@media (max-width: 576px) {
    .catalogue-hero h1 {
        font-size: 1.8rem;
    }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .product-image {
        height: 120px;
    }

    .product-info {
        padding: 0.5rem;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .product-price {
        font-size: 1rem;
    }

    .product-reference {
        font-size: 0.7rem;
    }

    .inquiry-fields-grid {
        grid-template-columns: 1fr;
    }

    .inquiry-modal {
        padding: 1.25rem;
        border-radius: var(--im-radius-lg);
    }

    .inquiry-modal-header h2 {
        font-size: 1.2rem;
    }

    .inquiry-btn span {
        font-size: 0.85rem;
    }
}

@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .product-image {
        height: 180px;
    }

    .product-info {
        padding: 0.75rem;
    }

    .product-name {
        font-size: 0.9rem;
    }
}

/* Responsive for category badge */
@media (max-width: 600px) {
    .search-category-badge {
        max-width: 120px;
        padding: 0.3rem 0.4rem 0.3rem 0.6rem;
        font-size: 0.75rem;
    }

    .search-category-badge .remove-category {
        width: 16px;
        height: 16px;
    }

    .search-box.has-category input {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}

/* ===== AJAX Loading Overlay ===== */
.catalogue-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.catalogue-loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.catalogue-loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.catalogue-loading-spinner i {
    font-size: 2.5rem;
    color: var(--im-primary);
    animation: spin 1s linear infinite;
}

.catalogue-loading-spinner span {
    font-size: 1rem;
    color: var(--im-text-muted);
    font-weight: 500;
}

/* Transition fluide pour le contenu */
#catalogue-content,
#catalogue-sidebar {
    transition: opacity 0.2s ease;
    will-change: opacity;
}

#catalogue-content.loading,
#catalogue-sidebar.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===== Fiche article (detail.html) ===== */

/* ===== Article Detail Styles ===== */
.article-detail {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Breadcrumb */
.breadcrumb-nav {
    margin-bottom: 2rem;
}

.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    font-size: 0.9rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--im-text-light);
}

.breadcrumb a {
    color: var(--im-text-muted);
    text-decoration: none;
}

.breadcrumb a:hover {
    color: var(--im-primary);
}

.breadcrumb li:last-child {
    color: var(--im-text);
    font-weight: 500;
}

/* Main Layout */
.article-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

/* Image Section */
.article-image-section {
    background: white;
    border-radius: var(--im-radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.main-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--im-bg);
    border-radius: var(--im-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.main-image .no-image {
    font-size: 6rem;
    color: var(--im-border);
}

/* Info Section */
.article-info-section {
    display: flex;
    flex-direction: column;
}

.article-reference {
    font-size: 0.9rem;
    color: var(--im-text-muted);
    margin-bottom: 0.5rem;
}

.article-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

.article-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--im-primary);
    margin-bottom: 1rem;
}

.article-brand i {
    font-size: 0.9rem;
}

.article-family {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--im-bg-alt);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #475569;
    margin-bottom: 1.5rem;
}

/* Stock Status */
.stock-status {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: var(--im-radius);
    margin-bottom: 1.5rem;
}

.stock-status.in-stock {
    background: var(--im-success-bg);
    color: var(--im-success);
}

.stock-status.out-of-stock {
    background: var(--im-danger-bg);
    color: var(--im-danger-dark);
}

.stock-status.low-stock {
    background: #fef3c7;
    color: #92400e;
}

.stock-status i {
    font-size: 1.25rem;
}

.stock-status span {
    font-weight: 600;
}

/* Price */
.article-price-box {
    background: linear-gradient(135deg, var(--im-primary) 0%, var(--im-primary-dark) 100%);
    border-radius: var(--im-radius-lg);
    padding: 1.5rem;
    color: white;
    margin-bottom: 1.5rem;
}

.price-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.25rem;
}

.price-value {
    font-size: 2.5rem;
    font-weight: 700;
}

.price-ht {
    font-size: 0.9rem;
    opacity: 0.8;
    margin-top: 0.25rem;
}

.price-on-request {
    background: var(--im-bg);
    border: 2px dashed var(--im-border);
    border-radius: var(--im-radius-lg);
    padding: 1.5rem;
    text-align: center;
    margin-bottom: 1.5rem;
}

.price-on-request i {
    font-size: 2rem;
    color: var(--im-text-light);
    margin-bottom: 0.5rem;
}

.price-on-request p {
    color: var(--im-text-muted);
    margin: 0;
}

/* Contact Button */
.btn-contact {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius);
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    margin-bottom: 1rem;
}

.btn-contact:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4);
    color: white;
    text-decoration: none;
}

.btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
}

.btn-whatsapp:hover {
    box-shadow: 0 10px 30px rgba(37, 211, 102, 0.4);
}

/* Specs */
.article-specs {
    background: white;
    border-radius: var(--im-radius-lg);
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-top: auto;
}

.article-specs h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--im-border);
}

.specs-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.spec-item {
    display: flex;
    flex-direction: column;
}

.spec-label {
    font-size: 0.8rem;
    color: var(--im-text-muted);
    margin-bottom: 0.15rem;
}

.spec-value {
    font-weight: 600;
    color: var(--im-text);
}

/* Description */
.article-description {
    background: white;
    border-radius: var(--im-radius-lg);
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

.article-description h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--im-text);
    margin-bottom: 1rem;
}

.article-description p {
    color: #475569;
    line-height: 1.8;
}

/* Similar Products */
.similar-products {
    margin-top: 3rem;
}

.similar-products h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--im-text);
    margin-bottom: 1.5rem;
}

.similar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

/* Similar Product Cards */
.product-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.similar-product-card {
    background: white;
    border-radius: var(--im-radius);
    border: 1px solid var(--im-border);
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.similar-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    border-color: var(--im-primary);
}

.similar-product-card .product-image {
    width: 100%;
    aspect-ratio: 1;
    background: var(--im-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.similar-product-card .product-image .no-image {
    font-size: 3rem;
    color: var(--im-border);
}

.similar-product-card .product-info {
    padding: 1rem;
}

.similar-product-card .product-reference {
    font-size: 0.75rem;
    color: var(--im-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

.similar-product-card .product-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--im-text);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.similar-product-card .product-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--im-primary);
}

.similar-product-card .click-hint {
    background: var(--im-bg-alt);
    padding: 0.75rem 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--im-text-muted);
    transition: all 0.3s ease;
}

.similar-product-card:hover .click-hint {
    background: var(--im-primary);
    color: white;
}

.similar-product-card .click-hint i {
    margin-right: 0.5rem;
    transition: transform 0.3s ease;
}

.similar-product-card:hover .click-hint i {
    transform: translateX(5px);
}

/* Responsive */
@media (max-width: 992px) {
    .article-main {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .similar-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .article-title {
        font-size: 1.5rem;
    }

    .price-value {
        font-size: 2rem;
    }

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

    .specs-list {
        grid-template-columns: 1fr;
    }
}

/* ===== Bloc ajout panier (fiche article) — extrait des styles inline ===== */

.add-to-cart-section {
    margin-bottom: 1.5rem;
}

.add-to-cart-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.add-to-cart-row label {
    font-weight: 600;
    color: var(--im-text);
    white-space: nowrap;
    margin-bottom: 0;
}

.cart-qty-input {
    width: 70px;
    padding: 0.5rem;
    border: 2px solid var(--im-border);
    border-radius: var(--im-radius-sm);
    text-align: center;
    font-size: 1rem;
}

.btn-add-to-cart {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, var(--im-accent) 0%, var(--im-accent-dark) 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius);
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--im-shadow-sm);
}

.btn-add-to-cart:hover {
    transform: translateY(-2px);
    box-shadow: var(--im-shadow);
}

.btn-request-quote {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 1.5rem;
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: var(--im-radius);
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-request-quote:hover {
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: var(--im-shadow);
}

.pickup-only-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #fef3c7;
    border: 1px solid #fbbf24;
    padding: 0.5rem 1rem;
    border-radius: var(--im-radius-sm);
    font-size: 0.85em;
    color: #92400e;
    margin-bottom: 1rem;
}
