/* ==========================================================================
   Rebootique — feuille de style commune (vitrine + back-office)
   --------------------------------------------------------------------------
   Aucune valeur de couleur, de police ou de taille de titre n'est écrite ici :
   elles viennent des variables CSS --rb-* déclarées dans <head> à partir des
   réglages de la page « Apparence du site » (ThemeManager).
   ========================================================================== */

/* ---------- Valeurs de repli (si les variables du thème sont absentes) ---------- */
:root {
    --rb-primary: #458b33;
    --rb-on-primary: #ffffff;
    --rb-accent: #63b22f;
    --rb-on-accent: #1a1a1a;
    --rb-heading: #458b33;
    --rb-text: #212529;
    --rb-bg: #ffffff;
    --rb-font-body: 'Montserrat', sans-serif;
    --rb-font-heading: 'Montserrat', sans-serif;
    --rb-font-menu: 'Michroma', sans-serif;
    --rb-h1: 2.25rem;
    --rb-h2: 1.75rem;
    --rb-h3: 1.5rem;
    --rb-h4: 1.25rem;
    --rb-h5: 1.1rem;
    --rb-h6: 1rem;
}

/* ---------- Jetons dérivés (calculés à partir du thème) ---------- */
:root {
    --rb-primary-hover: color-mix(in srgb, var(--rb-primary) 82%, #000);
    --rb-primary-soft: color-mix(in srgb, var(--rb-primary) 10%, var(--rb-bg));
    --rb-border: color-mix(in srgb, var(--rb-text) 14%, var(--rb-bg));
    --rb-muted: color-mix(in srgb, var(--rb-text) 62%, var(--rb-bg));
    --rb-surface: color-mix(in srgb, var(--rb-text) 3%, var(--rb-bg));
    --rb-radius: .5rem;
    --rb-shadow: 0 .25rem 1rem rgba(0, 0, 0, .08);
    --rb-shadow-hover: 0 .5rem 1.5rem rgba(0, 0, 0, .14);
    --rb-header-height: 72px;
    --rb-gap: 1.5rem;

    /* Branchement de Bootstrap 5.2 sur le thème */
    --bs-body-font-family: var(--rb-font-body);
    --bs-body-color: var(--rb-text);
    --bs-body-bg: var(--rb-bg);
    --bs-link-color: var(--rb-primary);
    --bs-link-hover-color: var(--rb-accent);
    --bs-border-color: var(--rb-border);
}

@font-face {
    font-family: 'ETmodules';
    font-display: block;
    src: url('font/modules.woff') format('woff'), url('font/modules.ttf') format('truetype');
    font-style: normal;
}

/* ---------- Base ---------- */
html { scroll-padding-top: calc(var(--rb-header-height) + 1rem); }

body {
    font-family: var(--rb-font-body);
    color: var(--rb-text);
    background-color: var(--rb-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip;   /* le bandeau pleine largeur (100vw) ne crée pas de défilement horizontal */
}

.rb-main { flex: 1 0 auto; padding-block: 2rem 3rem; }

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--rb-font-heading);
    color: var(--rb-heading);
    line-height: 1.2;
    margin-bottom: .75rem;
}
h1, .h1 { font-size: var(--rb-h1); }
h2, .h2 { font-size: var(--rb-h2); }
h3, .h3 { font-size: var(--rb-h3); }
h4, .h4 { font-size: var(--rb-h4); }
h5, .h5 { font-size: var(--rb-h5); }
h6, .h6 { font-size: var(--rb-h6); }

a { color: var(--rb-primary); text-decoration: none; }
a:hover, a:focus-visible { color: var(--rb-accent); }

img { max-width: 100%; height: auto; }

/* Cellules de tableau : centrage vertical au lieu d'une hauteur forcée */
.table > :not(caption) > * > *,
table.dataTable td, table.dataTable th { vertical-align: middle; }
table, td, th, tr { border-color: var(--rb-border); }

input[type=checkbox], input[type=radio], .form-check-input { accent-color: var(--rb-primary); }
.form-check-input:checked { background-color: var(--rb-primary); border-color: var(--rb-primary); }
.form-control:focus, .form-select:focus, .form-check-input:focus {
    border-color: var(--rb-accent);
    box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--rb-accent) 25%, transparent);
}

/* ---------- Boutons ---------- */
.btn-primary, .btn-info, .dt-button, .btnReg, .autoButton {
    --bs-btn-bg: var(--rb-primary);
    --bs-btn-border-color: var(--rb-primary);
    --bs-btn-color: var(--rb-on-primary);
    --bs-btn-hover-bg: var(--rb-primary-hover);
    --bs-btn-hover-border-color: var(--rb-primary-hover);
    --bs-btn-hover-color: var(--rb-on-primary);
    --bs-btn-active-bg: var(--rb-primary-hover);
    --bs-btn-active-border-color: var(--rb-primary-hover);
    --bs-btn-active-color: var(--rb-on-primary);
    --bs-btn-disabled-bg: var(--rb-primary);
    --bs-btn-disabled-border-color: var(--rb-primary);
    --bs-btn-disabled-color: var(--rb-on-primary);
}
.btn-primary, .btn-info, .dt-button { border-radius: .375rem; }
.btn-primary a, .btn-info a, .dt-button a,
.btn-primary a:hover, .dt-button a:hover { color: inherit !important; }
div.dt-container .dt-button,
button.dt-button {
    background: var(--rb-primary) !important;
    border-color: var(--rb-primary) !important;
    color: var(--rb-on-primary) !important;
}
div.dt-container .dt-button:hover,
button.dt-button:hover { background: var(--rb-primary-hover) !important; }

.btn-secondary { --bs-btn-bg: #626262; --bs-btn-border-color: #626262; }
.btn-danger { --bs-btn-bg: #b22f2f; --bs-btn-border-color: #b22f2f; --bs-btn-hover-bg: #8f1f1f; --bs-btn-hover-border-color: #8f1f1f; }

.btn-outline-primary {
    --bs-btn-color: var(--rb-primary);
    --bs-btn-border-color: var(--rb-primary);
    --bs-btn-hover-bg: var(--rb-primary);
    --bs-btn-hover-border-color: var(--rb-primary);
    --bs-btn-hover-color: var(--rb-on-primary);
    --bs-btn-active-bg: var(--rb-primary-hover);
    --bs-btn-active-color: var(--rb-on-primary);
}

.btnReg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 3rem;
    padding: .5rem 1.25rem;
    margin-bottom: .75rem;
    background: var(--rb-primary);
    color: var(--rb-on-primary);
    border: 0;
    border-radius: .375rem;
    font-size: 1.1rem;
    font-weight: 700;
}
.btnReg:hover { background: var(--rb-primary-hover); color: var(--rb-on-primary); }

/* Gros bouton d'action (fiche produit, panier) */
.btn-reboot-md, .btn-md-cart {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
    width: 100%;
    min-height: 3.5rem;
    padding: .5rem 1rem;
    border: 0;
    border-radius: .6rem;
    background: var(--rb-primary);
    color: var(--rb-on-primary);
    font-weight: 700;
    font-size: 1.15rem;
    transition: background-color .15s ease;
}
.btn-reboot-md:hover:not(:disabled), .btn-md-cart:hover:not(:disabled) { background: var(--rb-primary-hover); }
.btn-reboot-md:disabled, .btn-md-cart:disabled { opacity: .5; cursor: not-allowed; }
.btn-md-cart { background: var(--rb-accent); color: var(--rb-on-accent); margin-top: 1.5rem; }
.imgpanier { width: 1.5rem; height: 1.5rem; object-fit: contain; flex-shrink: 0; }

/* ---------- Messages flash ---------- */
.rb-flashes {
    position: fixed;
    top: calc(var(--rb-header-height) + .75rem);
    right: 1rem;
    z-index: 1080;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    max-width: min(28rem, calc(100vw - 2rem));
}
.rb-flashes .alert { margin: 0; box-shadow: var(--rb-shadow); }

/* ==========================================================================
   En-tête
   ========================================================================== */
.rb-header {
    background-color: var(--rb-bg);
    border-bottom: 1px solid var(--rb-border);
    min-height: var(--rb-header-height);
    z-index: 1030;
}
.rb-header .navbar-brand { display: flex; align-items: center; padding: 0; margin-right: 1.5rem; }
.rb-header .rb-logo { height: 44px; width: auto; max-width: 220px; object-fit: contain; }
.rb-header .navbar-nav { align-items: center; gap: .25rem; }
.rb-header .nav-link {
    display: flex;
    align-items: center;
    gap: .35rem;
    padding: .5rem .75rem;
    font-family: var(--rb-font-menu);
    font-size: .85rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--rb-accent);
    border-radius: .375rem;
}
.rb-header .nav-link:hover, .rb-header .nav-link:focus-visible { color: var(--rb-primary); background: var(--rb-primary-soft); }
.rb-header .nav-link.active { color: var(--rb-text); }
.rb-header .nav-link .bi { font-size: 1.15rem; line-height: 1; }
.rb-header .rb-nav-icons { border-left: 1px solid var(--rb-border); padding-left: .5rem; margin-left: .5rem; }
.rb-header .rb-badge {
    position: absolute;
    top: .1rem;
    right: .05rem;
    font-size: .65rem;
    line-height: 1;
}
.rb-header .rb-backmenu-toggle {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--rb-border);
    background: transparent;
    border-radius: .5rem;
    padding: .25rem .6rem .25rem .25rem;
    margin-right: 1rem;
    color: var(--rb-text);
    font-family: var(--rb-font-menu);
    font-size: .8rem;
}
.rb-header .rb-backmenu-toggle img { width: 36px; height: 36px; object-fit: contain; }
.rb-header .rb-backmenu-toggle:hover { background: var(--rb-primary-soft); }
.navbar-toggler { border-color: var(--rb-border); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem color-mix(in srgb, var(--rb-accent) 25%, transparent); }

/* Bandeau des rayons de la boutique */
.menuTop {
    background: var(--rb-primary);
    color: var(--rb-on-primary);
    margin: 0 calc(50% - 50vw) 1.5rem;   /* pleine largeur, même dans un .container */
    width: 100vw;
}
.menuTop .rb-rayons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: .25rem 2rem;
    list-style: none;
    margin: 0 auto;
    padding: .65rem 1rem;
    max-width: 1320px;
}
.menuTop a, .menuTop .white {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    color: var(--rb-on-primary);
    font-weight: 600;
    padding: .25rem .5rem;
    border-radius: .375rem;
}
.menuTop a:hover, .menuTop a.active { background: color-mix(in srgb, var(--rb-on-primary) 18%, transparent); color: var(--rb-on-primary); }
.white { color: var(--rb-on-primary); }
.fleche { font-family: 'ETmodules'; font-size: 1rem; font-weight: 800; line-height: 1; }

/* ==========================================================================
   Pied de page
   ========================================================================== */
.rb-footer { flex-shrink: 0; color: var(--rb-muted); padding-top: 2rem; border-top: 1px solid var(--rb-border); background: var(--rb-surface); }
.rb-footer .rb-reassurance { text-align: center; }
.rb-footer .rb-reassurance img { width: 48px; height: 48px; object-fit: contain; }
.rb-footer .rb-reassurance p { font-weight: 700; margin: .75rem 0 0; font-size: .9rem; }
.rb-footer .rb-footer-main {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2rem;
    padding: 1.5rem 0;
    margin-top: 1.5rem;
    border-top: 2px solid var(--rb-text);
    font-size: .875rem;
}
.rb-footer .rb-footer-main p { margin: .2rem 0; }
.rb-footer .rb-footer-left { text-align: right; }
.rb-footer .rb-footer-logo { width: 200px; max-width: 100%; height: auto; object-fit: contain; }
.rb-footer .rb-legal { text-align: center; font-size: .85rem; padding-bottom: 1.5rem; margin: 0; }
@media (max-width: 767.98px) {
    .rb-footer .rb-footer-main { grid-template-columns: 1fr; text-align: center; }
    .rb-footer .rb-footer-left { text-align: center; }
    .rb-footer .rb-footer-logo { margin: 0 auto; }
}

/* ==========================================================================
   Composants vitrine
   ========================================================================== */
.titreBoutique { text-align: center; padding: 2rem 0 1rem; }
.titreBoutique h1, .titreBoutique h2 { margin: 0; }
.texteBoutique ul { padding-left: 1.25rem; }
.texteBoutique li { margin-bottom: .35rem; }
.spanTitle { font-size: 1.5rem; }

/* Carte générique : image au-dessus, texte centré, hauteurs égales dans une rangée */
.vignette, .rb-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    padding: 1.25rem 1rem 1rem;
    text-align: center;
    background: var(--rb-bg);
    border: 1px solid var(--rb-border);
    border-radius: var(--rb-radius);
    box-shadow: var(--rb-shadow);
    transition: box-shadow .2s ease, transform .2s ease;
}
.vignette:hover, .rb-card:hover { box-shadow: var(--rb-shadow-hover); transform: translateY(-2px); }
.vignette > a, .rb-card > a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .75rem;
    width: 100%;
    height: 100%;
    color: var(--rb-text);
}
.vignette a:hover { color: var(--rb-primary); }
.vignette p { margin: 0; }

/* Boîte image de hauteur fixe : toutes les images s'alignent quelle que soit leur taille */
.rb-card-img, .homeMenuImg {
    width: 100%;
    height: 96px;
    object-fit: contain;
    flex-shrink: 0;
}
.rb-card-title { font-weight: 600; line-height: 1.3; margin: 0; }
.rb-card-subtitle { color: var(--rb-muted); font-size: .9rem; margin: 0; }
.rb-card-price { color: var(--rb-primary); font-weight: 700; font-size: 1.15rem; margin: auto 0 0; padding-top: .5rem; }
.rb-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Grille de cartes (accueil, recommandations) */
.rb-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: var(--rb-gap);
    margin-bottom: 2rem;
}
.rb-card-grid.rb-card-grid-center { grid-template-columns: repeat(auto-fit, minmax(160px, 190px)); justify-content: center; }
.rb-product-card .rb-card-img { height: 130px; }

/* ---------- Liste boutique ---------- */
.barreFiltre { margin-bottom: 1rem; align-items: center; }
.barreFiltre.bg-light { border-radius: var(--rb-radius); padding: .5rem; }
.barreFiltre .dropdown-menu { max-height: 60vh; overflow-y: auto; }
#gammePrix { color: var(--rb-primary); }
.ui-slider-horizontal { height: 4px; border: 0; background: var(--rb-border); margin: .75rem .5rem 0; }
.ui-slider-horizontal .ui-slider-range { background: var(--rb-accent); }
.ui-slider-horizontal .ui-slider-handle {
    top: -8px;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    border: 0;
    background: var(--rb-primary);
    cursor: grab;
}

.rb-listing-item {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--rb-border);
    align-items: center;
}
.rb-listing-item .image_boutique {
    width: 100%;
    max-width: 260px;
    max-height: 220px;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}
.rb-listing-item h3 { margin-bottom: .25rem; }
.rb-listing-item .rb-price { color: var(--rb-primary); font-weight: 700; font-size: 1.25rem; margin-bottom: .5rem; }
.rb-listing-item .table { margin-bottom: 0; font-size: .875rem; }
.rb-listing-item .table th { width: 40%; font-weight: 600; }
.rb-pictos {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    justify-items: center;
    align-items: center;
}
.pictoBoutique { max-width: 110px; max-height: 70px; width: 100%; object-fit: contain; }

/* Pagination */
.rb-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; margin: 2rem 0; }
.casepage {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    background: var(--rb-bg);
    color: var(--rb-primary);
    border: 1px solid var(--rb-border);
    border-radius: .375rem;
    box-shadow: var(--rb-shadow);
    font-weight: 600;
}
.casepage:hover { background: var(--rb-primary); color: var(--rb-on-primary); }
.classactive { background: var(--rb-primary); color: var(--rb-on-primary); border-color: var(--rb-primary); }

/* ---------- Fiche produit ---------- */
.rb-breadcrumb { font-size: .875rem; margin-bottom: 1rem; color: var(--rb-muted); }
.shadowed {
    background: var(--rb-bg);
    border-radius: var(--rb-radius);
    box-shadow: 0 5px 15px rgba(0, 0, 0, .12);
    padding: 1.5rem;
}
.marge20 { margin: 0; }
.rb-product-top { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--rb-gap); }
@media (min-width: 992px) {
    .rb-product-top { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
}
#show-img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    cursor: zoom-in;
}
#show-img:hover { opacity: .85; }
.small-img { margin-top: 1rem; }
#small-img-roll {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    justify-content: center;
}
.show-small-img {
    width: 64px;
    height: 64px;
    object-fit: contain;
    padding: 2px;
    border: 1px solid var(--rb-border);
    border-radius: .375rem;
    cursor: pointer;
}
.show-small-img:hover { border-color: var(--rb-accent); }

.ficheProduit-left-container { padding: 0; }
.ficheProduit-description { font-size: 1.1rem; margin-bottom: 1rem; }
.ficheProduit-descriptionadd { font-size: 1.25rem; padding-bottom: .5rem; }
.ficheProduit-descriptionsupp { font-size: 1rem; border-top: 1px solid var(--rb-border); padding-top: 1rem; }
.ficheProduit-descriptionsupp ul li { margin-top: .5rem; }
.garantie { margin: 0; }
.garantie h3 { color: var(--rb-text) !important; font-size: 1.1rem; font-weight: 400; }

.containButton { display: flex; flex-direction: column; align-items: center; font-size: .8rem; color: var(--rb-muted); }
.choiceGrade {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .25rem;
    width: 100%;
    min-height: 4.5rem;
    padding: .5rem;
    margin: .5rem 0;
    background: var(--rb-surface);
    color: var(--rb-text);
    border: 1px solid var(--rb-primary);
    border-radius: .375rem;
    font-size: 1rem;
    line-height: 1.2;
}
.choiceGrade p { margin: 0; }
.choiceGrade:hover { border-color: var(--rb-accent); }
.choiceGrade.is-selected { background: var(--rb-primary-soft); border-width: 2px; box-shadow: 0 0 0 .15rem color-mix(in srgb, var(--rb-primary) 25%, transparent); }
.tarifInButton { font-weight: 700; color: var(--rb-primary); }

.cedCounter { display: flex; align-items: center; gap: .5rem; }
.quantite { font-weight: 700; margin: 0; }
.countContainer input { width: 2.5rem; text-align: center; font-size: 1.15rem; font-weight: 700; border: 0; background: transparent; }
.buttonContainer { display: flex; flex-direction: column; font-family: 'ETmodules'; }
.upBouton, .downBouton {
    width: 2rem;
    height: 1.5rem;
    padding: 0;
    border: 1px solid var(--rb-border);
    background: var(--rb-bg);
    font-weight: 700;
    line-height: 1;
}
.upBouton { border-radius: .375rem .375rem 0 0; }
.downBouton { border-radius: 0 0 .375rem .375rem; border-top: 0; }

/* Onglets de la fiche */
.nav-tabs .nav-link { color: var(--rb-primary); font-weight: 600; }
.nav-tabs .nav-link.active { color: var(--rb-text); }

#tableDetailProduit, .tableOption { width: 100%; border-collapse: collapse; margin-top: .5rem; }
#tableDetailProduit tr { border-top: 1px solid var(--rb-primary); border-bottom: 1px solid var(--rb-primary); }
#tableDetailProduit th, #tableDetailProduit td { padding: .6rem .25rem; vertical-align: middle; }
#tableDetailProduit th { width: 40%; }
#tableDetailProduit td { text-align: right; }
.tableOption td { border-bottom: 1px solid var(--rb-border); padding: .6rem .25rem; vertical-align: middle; }
.onleftInTab { display: block; margin-bottom: .5rem; }
.optionName { display: inline-block; width: 100%; }
.optionhide { display: block; padding: .5rem .75rem; margin: 0 0 .5rem 1.5rem; }
.detailhide:hover { background-color: rgba(0, 0, 0, .05); cursor: pointer; }
.devant { display: inline-block; width: 1.5rem; font-family: 'ETmodules'; font-size: 1.1rem; font-weight: 700; }
.shut { display: none; }

/* ---------- Panier / commande ---------- */
.shopping-cart { width: 100%; padding: 0; }
.item {
    align-items: center;
    padding-block: 1rem;
    border-bottom: 1px solid var(--rb-border);
    background: var(--rb-bg);
}
/* Ligne de panier : vignette à gauche, description à droite, centrées verticalement */
.item > div:has(> .image) { display: flex; align-items: center; gap: 1rem; }
.item .description { display: flex; flex-direction: column; gap: .2rem; min-width: 0; }
.item .prixarticle { font-weight: 700; color: var(--rb-primary); font-size: 1.1rem; }
.imgProduitPanier { width: 96px; height: 96px; object-fit: contain; flex-shrink: 0; }
.recapPanier { margin-left: 0; }
.recapPanier .row { margin-bottom: .25rem; }
.btnPaiement { width: 100%; margin-top: .5rem; }
.secure, .acceptation { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1.25rem; }
.secure img { width: 180px; height: auto; object-fit: contain; }
.acceptation img { width: 64px; height: 40px; object-fit: contain; }

/* ---------- Utilitaires historiques (conservés pour les templates existants) ---------- */
.alignRight { text-align: right; }
.marge-head { margin-left: 0; }
.marge-top-10 { margin-top: 10px; }
.marge-top-20 { margin-top: 20px; }
.marge-right-10 { margin-right: 10px; }
.marge-bottom-50 { margin-bottom: 50px; }
.hr-colorAccent { border: 0; border-top: 1px solid var(--rb-accent); opacity: 1; }
.borderGreen { border: 2px solid var(--rb-primary); }
.rb-text-primary { color: var(--rb-primary) !important; }
.rb-bg-surface { background-color: var(--rb-surface) !important; }
.text-overflow-hidden { overflow: hidden; text-overflow: ellipsis; }
