/* ═══════════════════════════════════════════════════════
   AGRILAND A.D.S.L — Feuille de style principale
   ═══════════════════════════════════════════════════════ */

:root {
    --vert-fonce: #1a5c1a;
    --vert: #2d7a2d;
    --vert-clair: #4caf50;
    --jaune: #f5a623;
    --jaune-clair: #ffc107;
    --gris-clair: #f5f7f5;
    --gris: #e8ede8;
    --texte: #2c2c2c;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    color: var(--texte);
    background: #fff;
}

h1,
h2,
h3,
h4,
h5,
h6,
.fw-bold {
    font-family: 'Montserrat', sans-serif;
}

/* ── TOPBAR ──────────────────────────────────────────── */
.topbar {
    background: var(--vert-fonce);
    color: #fff;
    font-size: .8rem;
    padding: 6px 0;
}

.topbar a {
    color: rgba(255, 255, 255, .85);
    text-decoration: none;
}

.topbar a:hover {
    color: var(--jaune);
}

/* ── NAVBAR ──────────────────────────────────────────── */
.navbar-main {
    background: #fff;
    border-bottom: 3px solid var(--vert);
    box-shadow: 0 2px 10px rgba(0, 0, 0, .08);
    padding: 10px 0;
}

.navbar-brand img {
    height: 56px;
}

.navbar-nav .nav-link {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    color: var(--texte) !important;
    font-size: .9rem;
    padding: 8px 14px !important;
    border-radius: 4px;
    transition: all .2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--vert) !important;
    background: var(--gris);
}

.btn-contact-nav {
    background: var(--jaune);
    color: #fff !important;
    border-radius: 20px;
    padding: 7px 18px !important;
    font-weight: 700 !important;
}

.btn-contact-nav:hover {
    background: var(--vert) !important;
    color: #fff !important;
}


/* ── HERO DÉFAUT ─────────────────────────────────────── */
.hero-defaut {
    background: linear-gradient(135deg, var(--vert-fonce) 0%, var(--vert) 60%, #3d9140 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

.hero-defaut .slider-titre {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 16px;
}

.hero-defaut .slider-sous-titre {
    color: rgba(255, 255, 255, .85);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 540px;
}

.hero-defaut .slider-icon-deco {
    font-size: 16rem;
    color: rgba(255, 255, 255, .08);
}

/* ── DROPDOWN ────────────────────────────────────────── */
.dropdown-menu {
    min-width: 220px;
    border: none;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .12);
    border-radius: 10px;
    padding: 8px;
}

.dropdown-item {
    border-radius: 6px;
    font-family: 'Montserrat', sans-serif;
    font-size: .87rem;
    font-weight: 600;
    padding: 8px 14px;
    color: var(--texte);
    transition: all .15s;
}

.dropdown-item:hover {
    background: var(--gris) !important;
    color: var(--vert) !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background: var(--vert) !important;
    color: #fff !important;
}

/* ── BOUTONS ─────────────────────────────────────────── */
.btn-vert {
    background: var(--vert);
    color: #fff;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    border-radius: 6px;
    transition: all .2s;
}

.btn-vert:hover {
    background: var(--vert-fonce);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(45, 122, 45, .3);
}

.btn-jaune {
    background: var(--jaune);
    color: #fff;
    border: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    border-radius: 6px;
    transition: all .2s;
}

.btn-jaune:hover {
    background: #e6951f;
    color: #fff;
    transform: translateY(-1px);
}

.btn-outline-vert {
    border: 2px solid var(--vert);
    color: var(--vert);
    background: transparent;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    border-radius: 6px;
    transition: all .2s;
}

.btn-outline-vert:hover {
    background: var(--vert);
    color: #fff;
}

/* ── BADGES ──────────────────────────────────────────── */
.badge-marque {
    background: var(--jaune);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.badge-famille {
    background: var(--vert-clair);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
}

.badge-neuf {
    background: var(--vert);
    color: #fff;
}

.badge-occasion {
    background: var(--jaune);
    color: #fff;
}

/* ── CARDS PIÈCES ────────────────────────────────────── */
.card-piece {
    border: 1px solid var(--gris);
    border-radius: 10px;
    overflow: hidden;
    transition: all .25s;
    background: #fff;
    height: 100%;
}

.card-piece:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .12);
    border-color: var(--vert-clair);
}

.card-piece .card-img-wrap {
    height: 200px;
    overflow: hidden;
    background: var(--gris-clair);
    display: flex;
    align-items: center;
    justify-content: center;
}

.card-piece .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s;
}

.card-piece:hover .card-img-wrap img {
    transform: scale(1.05);
}

.card-piece .card-body {
    padding: 14px;
}

.card-piece .price {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--vert-fonce);
    font-size: 1.2rem;
}

.card-piece .ref {
    font-size: .75rem;
    color: #888;
    font-family: 'Montserrat', sans-serif;
}

.card-piece .designation {
    font-size: .9rem;
    font-weight: 600;
    color: var(--texte);
    min-height: 40px;
    line-height: 1.3;
}

/* ── NO PHOTO ────────────────────────────────────────── */
.no-photo {
    height: 200px;
    background: linear-gradient(135deg, var(--gris-clair) 0%, var(--gris) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ccc;
}

/* ── STOCK ───────────────────────────────────────────── */
.stock-ok {
    color: var(--vert);
    font-weight: 600;
    font-size: .8rem;
}

.stock-no {
    color: #999;
    font-size: .8rem;
}

/* ── SIDEBAR FILTRES ─────────────────────────────────── */
.sidebar-filtres {
    background: var(--gris-clair);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid var(--gris);
}

.sidebar-filtres h5 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--vert-fonce);
    font-size: 1rem;
    border-bottom: 2px solid var(--vert);
    padding-bottom: 8px;
    margin-bottom: 16px;
}

.sidebar-filtres .filter-group {
    margin-bottom: 16px;
}

.sidebar-filtres .filter-group label.group-label {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .82rem;
    color: var(--vert-fonce);
    text-transform: uppercase;
    letter-spacing: .5px;
    margin-bottom: 8px;
    display: block;
}

.sidebar-filtres .form-check-label {
    font-size: .85rem;
    cursor: pointer;
}

.sidebar-filtres .form-check-input:checked {
    background-color: var(--vert);
    border-color: var(--vert);
}

.sidebar-filtres .form-select:focus {
    border-color: var(--vert);
    box-shadow: 0 0 0 .2rem rgba(45, 122, 45, .15);
}

.sous-famille {
    margin-left: 14px;
    border-left: 2px solid var(--gris);
    padding-left: 8px;
}

/* ── FILTRES PILLS ───────────────────────────────────── */
.custom-select-multi {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
    padding-right: 4px;
}

.custom-select-multi::-webkit-scrollbar {
    width: 4px;
}

.custom-select-multi::-webkit-scrollbar-track {
    background: var(--gris);
    border-radius: 2px;
}

.custom-select-multi::-webkit-scrollbar-thumb {
    background: var(--vert-clair);
    border-radius: 2px;
}

.select-option {
    display: block;
    padding: 5px 10px;
    font-size: .82rem;
    border-radius: 6px;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all .15s;
    color: var(--texte);
    background: #fff;
    user-select: none;
}

.select-option:hover {
    background: var(--gris);
    border-color: var(--vert-clair);
}

.select-option.selected {
    background: var(--vert);
    color: #fff;
    border-color: var(--vert-fonce);
    font-weight: 600;
}

/* ── BARRE RECHERCHE ─────────────────────────────────── */
.search-bar {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .1);
    padding: 16px 20px;
    margin-bottom: 24px;
}

.search-bar .form-control {
    border: 2px solid var(--gris);
    border-radius: 6px 0 0 6px;
    font-size: .95rem;
}

.search-bar .form-control:focus {
    border-color: var(--vert);
    box-shadow: none;
}

/* ── SECTION TITRE ───────────────────────────────────── */
.section-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: var(--vert-fonce);
    position: relative;
    padding-bottom: 10px;
    margin-bottom: 24px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: var(--jaune);
    border-radius: 2px;
}

/* ── RÉSULTATS ───────────────────────────────────────── */
.results-bar {
    background: var(--gris-clair);
    border-radius: 6px;
    padding: 8px 14px;
    font-size: .88rem;
    color: #666;
    margin-bottom: 16px;
}

.results-bar strong {
    color: var(--vert-fonce);
}

/* ── PAGINATION ──────────────────────────────────────── */
.pagination .page-link {
    border-color: var(--gris);
    color: var(--vert-fonce);
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
}

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

.pagination .page-link:hover {
    background: var(--gris);
    color: var(--vert-fonce);
}

/* ── BREADCRUMB ──────────────────────────────────────── */
.breadcrumb-item a {
    color: var(--vert);
}

.breadcrumb-item.active {
    color: #888;
}

/* ── FOOTER ──────────────────────────────────────────── */
footer {
    background: var(--vert-fonce);
    color: rgba(255, 255, 255, .85);
}

footer a {
    color: rgba(255, 255, 255, .7);
    text-decoration: none;
    transition: color .2s;
}

footer a:hover {
    color: var(--jaune);
}

footer .footer-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
    font-size: .95rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}

footer .footer-bottom {
    background: var(--vert);
    padding: 12px 0;
    font-size: .8rem;
}

/* ── CARDS CATÉGORIES ────────────────────────────────── */
.card-categorie {
    border: 1px solid var(--gris);
    border-radius: 12px;
    overflow: hidden;
    transition: all .25s;
    background: #fff;
    text-decoration: none;
    color: inherit;
    display: block;
}

.card-categorie:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 28px rgba(0, 0, 0, .12);
    border-color: var(--vert-clair);
    color: inherit;
}

.card-categorie .cat-icon {
    height: 90px;
    background: linear-gradient(135deg, var(--vert-fonce), var(--vert));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: rgba(255, 255, 255, .8);
}

.card-categorie .cat-body {
    padding: 14px;
}

.card-categorie .cat-nom {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: .92rem;
    color: var(--vert-fonce);
    margin-bottom: 4px;
}

.card-categorie .cat-count {
    font-size: .78rem;
    color: #999;
}

/* ── HERO VAGUE ──────────────────────────────────────── */
.hero-wave {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns=%22http://www.w3.org/2000/svg%22 viewBox=%220 0 100 20%22><path d=%22M0,10 Q25,0 50,10 Q75,20 100,10 L100,20 L0,20Z%22 fill=%22rgba(255,255,255,0.05)%22/></svg>') repeat-x bottom;
    background-size: 200px 40px;
}

/* ── SLIDER BANNIÈRE ─────────────────────────────────── */
.carousel-item {
    min-height: 480px;
    position: relative;
}

.slider-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(26, 92, 26, .85) 0%, rgba(45, 122, 45, .6) 60%, rgba(61, 145, 64, .3) 100%);
}

.slider-content {
    position: relative;
    z-index: 2;
    padding: 60px 0;
}

.slider-titre {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    color: #fff;
    font-size: 2.4rem;
    line-height: 1.2;
    margin-bottom: 16px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .2);
}

.slider-sous-titre {
    color: rgba(255, 255, 255, .85);
    font-size: 1.05rem;
    line-height: 1.6;
    max-width: 540px;
}

.slider-icon-deco {
    font-size: 10rem;
    color: rgba(255, 255, 255, .08);
    animation: rotate-slow 20s linear infinite;
}

@keyframes rotate-slow {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .5);
    border: none;
    transition: all .3s;
}

.carousel-indicators button.active {
    background: var(--jaune);
    width: 28px;
    border-radius: 5px;
}

/* ── HERO DÉFAUT ─────────────────────────────────────── */
.hero-defaut {
    background: linear-gradient(135deg, var(--vert-fonce) 0%, var(--vert) 60%, #3d9140 100%);
    padding: 60px 0;
    position: relative;
    overflow: hidden;
}

/* ── CHIFFRES BAR ────────────────────────────────────── */
.chiffres-bar {
    background: #fff;
    border-bottom: 3px solid var(--gris);
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
}

.chiffre-item {
    padding: 20px 16px;
    text-align: center;
    border-right: 1px solid var(--gris);
}

.chiffre-item:last-child {
    border-right: none;
}

.chiffre-item i {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 6px;
}

.chiffre-val {
    font-family: 'Montserrat', sans-serif;
    font-weight: 800;
    font-size: 1.15rem;
    color: var(--vert-fonce);
}

.chiffre-label {
    font-size: .75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: .5px;
}

/* ── RESPONSIVE ──────────────────────────────────────── */
@media (max-width: 768px) {
    .card-piece .card-img-wrap {
        height: 160px;
    }

    .no-photo {
        height: 160px;
    }

    .sidebar-filtres {
        margin-bottom: 16px;
    }

    .slider-titre {
        font-size: 1.6rem;
    }

    .carousel-item {
        min-height: 360px;
    }

    .chiffre-item {
        border-right: none;
        border-bottom: 1px solid var(--gris);
    }
}