/**
 * ============================================================
 * FEUILLE DE STYLE PRINCIPALE — BATIMSHOP
 * Fichier : assets/css/app.css
 * ============================================================
 */

/* ── Variables de couleurs et polices ── */
:root {
    --primary-color: #1a3a5c;    /* Bleu marin (thème principal) */
    --secondary-color: #e67e22;  /* Orange (prix, actions fortes) */
    --success-color: #27ae60;    /* Vert (succès, nouveautés) */
    --bg-light: #f4f6f9;         /* Gris très clair (fond) */
    --text-main: #333333;
    --text-muted: #7f8c8d;
    --border-color: #e0e0e0;
}

/* ── Reset de base ── */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.2s;
}

a:hover {
    color: var(--secondary-color);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* ── Boutons ── */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #122b46;
    color: #ffffff;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
}

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

/* ── En-tête (Header) ── */
.header {
    background-color: #ffffff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header__top .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 15px;
    flex-wrap: wrap;
    gap: 15px;
}

.header__logo {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.header__logo .logo-primary {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

.header__logo small {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* ── Barre de recherche ── */
.search-bar {
    display: flex;
    flex: 1;
    max-width: 500px;
    position: relative;
}

#search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-radius: 5px 0 0 5px;
    font-size: 1rem;
    outline: none;
}

#search-input:focus {
    border-color: var(--primary-color);
}

.btn-search {
    background-color: var(--primary-color);
    color: white;
    padding: 0 20px;
    border: 1px solid var(--primary-color);
    border-radius: 0 5px 5px 0;
    cursor: pointer;
}

.btn-search:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* ── Actions (Connexion, Panier) ── */
.header__actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.btn-cart {
    font-size: 1.2rem;
    position: relative;
    color: var(--primary-color);
    padding: 5px 10px;
}

.badge {
    position: absolute;
    top: -5px;
    right: -10px;
    background-color: var(--secondary-color);
    color: white;
    font-size: 0.75rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 20px;
}

/* ── Navigation (Catégories) ── */
.header__nav {
    background-color: var(--primary-color);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-categories {
    list-style: none;
    display: flex;
    gap: 20px;
    overflow-x: auto; /* Scroll sur mobile */
    padding: 12px 0;
}

.nav-categories a {
    color: #ffffff;
    font-weight: 500;
    white-space: nowrap;
    font-size: 0.95rem;
}

.nav-categories a:hover {
    color: var(--secondary-color);
}

.nav-categories .nav-count {
    font-size: 0.8rem;
    opacity: 0.7;
}

.nav-categories .nav-sell {
    color: #f1c40f; /* Doré pour attirer l'oeil */
    font-weight: bold;
}

/* ── Cartes Produits (Accueil) ── */
.accueil-featured article, 
.accueil-recents article {
    background: #ffffff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.accueil-featured article:hover, 
.accueil-recents article:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

/* ── Messages Flash ── */
.flash {
    padding: 15px;
    margin: 15px auto;
    max-width: 1200px;
    border-radius: 5px;
    position: relative;
}

.flash--success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.flash--error { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

.flash__close {
    position: absolute;
    right: 15px;
    top: 15px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
}

/* ── Responsive Mobile ── */
@media (max-width: 768px) {
    .header__top .container {
        flex-direction: column;
    }
    .search-bar {
        width: 100%;
        margin: 10px 0;
        max-width: 100%;
    }
    .header__actions {
        width: 100%;
        justify-content: center;
    }
}
/* Masquer la barre de défilement du menu sous Windows/Chrome */
.nav-categories::-webkit-scrollbar {
    display: none;
}
.nav-categories {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* ── Mise en page Boutique (Sidebar + Grille) ── */
.page-boutique {
    display: flex;
    gap: 30px;
    margin-top: 40px;
}

/* Sidebar de filtres */
.filters-sidebar {
    width: 280px;
    flex-shrink: 0;
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: fit-content;
}

.filter-block {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.filter-block h3 {
    font-size: 1.1rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.filter-list {
    list-style: none;
    padding: 0;
}

.filter-list li { margin-bottom: 8px; }

.filter-list a {
    color: #555;
    font-size: 0.95rem;
    display: block;
    padding: 5px 0;
}

.filter-list a.active {
    color: var(--secondary-color);
    font-weight: bold;
}

.filter-sublist {
    padding-left: 15px;
    list-style: none;
    margin-top: 5px;
}

/* Grille de produits */
.produits-main {
    flex: 1;
}

.produits-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.produits-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* Carte Produit */
.produit-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #eee;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.produit-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.produit-card__img {
    height: 180px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.produit-card__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.produit-card__body {
    padding: 15px;
    flex: 1;
}

.produit-card__nom {
    font-size: 1rem;
    margin-bottom: 8px;
    height: 2.4em;
    overflow: hidden;
}

.produit-card__prix {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: bold;
    margin: 10px 0;
}

.produit-card__footer {
    padding: 15px;
    border-top: 1px solid #f5f5f5;
    display: flex;
    gap: 10px;
}

/* Responsive */
@media (max-width: 992px) {
    .page-boutique { flex-direction: column; }
    .filters-sidebar { width: 100%; }
}