/* Catalog : sidebar, recherche, filtres, cartes produit — chargé sur products, product, landing pages */

/* Layout principal */
.main-container {
    display: flex;
    gap: 20px;
}

/* Sidebar */
.sidebar {
    width: 280px;
    min-width: 280px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 24px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 100px;
    box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.sidebar .category-menu {
    overflow-y: auto;
    overscroll-behavior: contain;
    flex: 1;
}

.sidebar h3 {
    margin-bottom: 24px;
    color: #1e293b;
    font-size: 1.4em;
    font-weight: 700;
    border-bottom: 3px solid #808080;
    padding-bottom: 12px;
    background: linear-gradient(135deg, #606060, #808080);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

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

.category-item {
    margin-bottom: 10px;
}

.category-link {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    text-align: left;
    padding: 14px 18px;
    background: linear-gradient(135deg, #606060, #808080);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 600;
    font-size: 0.95em;
    cursor: pointer;
    font-family: inherit;
}

.category-link .cat-arrow {
    margin-left: auto;
    font-size: 0.75em;
    transition: transform 0.3s ease;
}

.category-item.active .category-link .cat-arrow {
    transform: rotate(90deg);
}

.category-link:hover {
    background: linear-gradient(135deg, #505050, #606060);
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(128, 128, 128, 0.25);
}

.category-link.active {
    background: linear-gradient(135deg, #3f8ec1, #3f8ec1);
    box-shadow: 0 6px 20px rgba(63, 142, 193, 0.3);
}

.subcategory-menu {
    list-style: none;
    padding: 0;
    margin: 12px 0 0 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-item.active .subcategory-menu {
    max-height: 600px;
}

.subcategory-link {
    display: block;
    padding: 10px 16px;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    color: #475569;
    text-decoration: none;
    border-radius: 8px;
    margin-bottom: 6px;
    transition: all 0.3s ease;
    font-size: 0.9em;
    font-weight: 500;
}

.subcategory-link:hover {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    color: #334155;
    text-decoration: none;
    transform: translateX(8px);
}

.subcategory-link.active {
    background: linear-gradient(135deg, #3f8ec1, #3f8ec1);
    color: white;
}

/* Zone de contenu */
.content-area {
    flex: 1;
}

/* Section de recherche */
.search-section {
    background: linear-gradient(135deg, #ffffff, #f8fafc);
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.search-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.filters-toggle {
    background: linear-gradient(135deg, #808080, #606060) !important;
    color: white !important;
    border: none !important;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9em;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filters-toggle:hover {
    background: linear-gradient(135deg, #606060, #505050) !important;
    transform: translateY(-1px);
}

.search-row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.search-input {
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 1.1em;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 250px;
    background: linear-gradient(135deg, #ffffff, #f8fafc);
}

.search-input:focus {
    border-color: #808080;
    box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.1);
    outline: none;
    background: #ffffff;
}

/* Panneau de filtres */
.filters-panel {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e2e8f0;
    display: none;
}

.filters-panel.active {
    display: block;
}

.filter-group {
    margin-bottom: 20px;
}

.filter-label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

.filter-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    background: #f8fafc;
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-checkbox:hover {
    background: #e2e8f0;
    border-color: #808080;
}

.filter-checkbox input[type="checkbox"] {
    margin-right: 8px;
}

.clear-filters {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.clear-filters:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    transform: translateY(-1px);
}

/* Cartes produits */
.product-card {
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    background: #ffffff;
    margin-bottom: 8px;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #808080;
}

.product-card .card-body {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-card .card-title {
    color: #1e293b;
    font-size: 1.2em;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

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

.product-card .description {
    color: #64748b;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
}

.card-subcategory-text {
    color: #64748b;
    font-style: italic;
    font-size: 0.85em;
    margin: 4px 0 0 0;
    font-weight: 500;
}

.price-section {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    margin-left: 20px;
}

.price-tag {
    background: linear-gradient(135deg, #3f8ec1, #3f8ec1);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.3em;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(63, 142, 193, 0.3);
    white-space: nowrap;
}

.category-section-title {
    background: linear-gradient(135deg, #606060, #808080);
    color: white;
    padding: 20px 24px;
    border-radius: 16px;
    margin: 32px 0 24px 0;
    box-shadow: 0 8px 30px rgba(128, 128, 128, 0.3);
}

.category-section-title h2 {
    margin: 0;
    font-size: 1.4em;
    font-weight: 700;
}

.results-info {
    background: linear-gradient(135deg, #f0f9ff, #e0f2fe);
    border: 1px solid #7dd3fc;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
    color: #0369a1;
    font-weight: 500;
}

/* Page produit */
.product-header {
    background: linear-gradient(135deg, #606060, #808080);
    color: white;
    padding: 32px;
    border-radius: 16px;
    margin-bottom: 32px;
    box-shadow: 0 8px 30px rgba(128, 128, 128, 0.3);
}

.price-highlight {
    font-size: 2.2em;
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #3f8ec1, #3f8ec1);
    padding: 12px 20px;
    border-radius: 12px;
    display: inline-block;
    box-shadow: 0 4px 12px rgba(63, 142, 193, 0.3);
}

.breadcrumb {
    background: transparent;
    padding: 0;
    margin-bottom: 24px;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #64748b;
}

.breadcrumb-item a {
    color: #808080;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #606060;
}

.breadcrumb-item.active {
    color: #1e293b;
    font-weight: 600;
}

.btn-back {
    margin-bottom: 24px !important;
    background: linear-gradient(135deg, #808080, #606060) !important;
    border: none !important;
    color: white !important;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-back:hover {
    background: linear-gradient(135deg, #606060, #505050) !important;
    color: white !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(128, 128, 128, 0.3);
}

.card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.card-header {
    background: linear-gradient(135deg, #808080, #606060) !important;
    border-bottom: none;
    border-radius: 16px 16px 0 0 !important;
    padding: 20px 24px;
}

.card-header h5 {
    font-weight: 700;
    font-size: 1.2em;
}

.card-body {
    padding: 24px;
}

.btn-outline-secondary {
    border: 2px solid #808080;
    color: #808080;
    font-weight: 600;
    border-radius: 8px;
    padding: 10px 20px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: linear-gradient(135deg, #606060, #808080);
    border-color: #808080;
    color: white;
    transform: translateY(-1px);
}

/* Bouton burger et bouton fermer sidebar — visibles uniquement sur mobile */
.sidebar-toggle-btn, .sidebar-close-btn {
    display: none;
}

/* Overlay du drawer */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
}

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

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }

    /* Drawer off-canvas */
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        min-width: 0;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        z-index: 1050;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        padding-top: 60px;
        margin-bottom: 0;
        box-shadow: 4px 0 25px rgba(0, 0, 0, 0.2);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle-btn {
        display: flex;
        align-items: center;
        background: none;
        border: none;
        padding: 4px 8px 4px 0;
        margin-right: 8px;
        cursor: pointer;
        flex-shrink: 0;
    }

    .sidebar-toggle-btn .burger-bars {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 22px;
    }

    .sidebar-toggle-btn .burger-bars span {
        display: block;
        height: 2px;
        background: white;
        border-radius: 2px;
    }

    .sidebar-close-btn {
        position: absolute;
        top: 14px;
        right: 14px;
        background: none;
        border: none;
        color: #475569;
        font-size: 1.6em;
        cursor: pointer;
        line-height: 1;
        padding: 4px 8px;
    }

    .category-menu {
        display: block;
    }

    .category-item {
        margin-bottom: 10px;
    }

    .subcategory-menu {
        position: static;
        background: transparent;
        box-shadow: none;
        padding: 6px 0 0 0;
        min-width: 0;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    /* Réduction du vide sous le header sticky */
    .page-content {
        padding-top: 70px !important;
        margin-top: 0 !important;
    }

    .page-content h1 {
        margin-top: 0 !important;
        margin-bottom: 12px !important;
        font-size: 1.4em;
    }

    .product-card .card-body {
        flex-direction: column;
        align-items: stretch;
    }

    .price-section {
        margin-left: 0;
        margin-top: 16px;
        align-items: center;
    }

    .price-tag {
        font-size: 1.2em;
        padding: 10px 16px;
        text-align: center;
    }

    .search-row {
        flex-direction: column;
        gap: 12px;
    }

    .filter-checkboxes {
        justify-content: center;
    }
}
