/* ==========================================================================
   CSS RESTRUCTURÉ (SAFE) — Serres de Royaucourt / PrestaShop
   Source : CSS-AVANT-OPTIMISATION.txt
   Objectif :
   - Lisible + maintenable
   - Fonctionnement identique (cascade respectée)
   - Doublons "équivalents" supprimés, dernières règles conservées
   ========================================================================== */

/* ==========================================================================
   SOMMAIRE
   1) Global / Sécurités
   2) Homepage (layout 3 colonnes)
   3) Header custom (titre + sous-titre + séparateur)
   4) Menu catégories (sous-header)
   5) Barre outils header (recherche + maps)
   6) Barre compte + panier (custom + fix AJAX)
   7) Désactivations PrestaShop (bandeau pub / slider / éléments natifs)
   8) Catalogue / listing produits (grille 4 colonnes + tri)
   9) Variants ROY (preview horizontal + pastilles stock + promo + popup)
   10) Fiche produit (prix, TTC, caractéristiques)
   11) Badges/flags + synonymes + mise en page cartes produits
   12) Topiaires (cartes)
   13) Thumbnail produit (cadre image fixe + overlays)
   14) Responsive (regroupé en fin)
   ========================================================================== */


/* ==========================================================================
   1) GLOBAL / SÉCURITÉS
   ========================================================================== */

/* Masquage d’éléments header natifs PrestaShop (remplacés par le custom) */
.header-top,
.search-widget,
#search_widget,
#_desktop_search {
  display: none !important;
}

/* Largeur globale du site (MAX 1200px) */
#custom-header,
#custom-header-tools,
#custom-category-main-menu,
#user-cart-bar,
#wrapper,
#content,
#main,
.container,
.page-home .container,
.page-home #wrapper,
/*.home-top-banner,
.separator,
.home-main-columns {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  width: 100%;
  box-sizing: border-box;
}


/* ==========================================================================
   2) HOMEPAGE — LAYOUT 3 COLONNES
   ========================================================================== */

/* Bandeau principal */
.home-top-banner {
  max-width: 1100px;
  margin: 0 auto 30px;
}

.home-top-banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* Conteneur 3 colonnes */
.home-main-columns {
  max-width: 1100px;
  margin: 0 auto 40px;
  display: flex;
  gap: 25px;
  align-items: flex-start;
}

.home-col {
  box-sizing: border-box;
}

.home-col-left   { flex: 0 0 42%; }
/* ✅ dernière règle conservée : colonne centrale 35% */
.home-col-center { flex: 0 0 35%; }

.home-col-right {
  flex: 0 0 18%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Images colonne gauche */
.home-image-block {
  margin-bottom: 18px;
}

.home-image-block img {
  width: 100%;
  border: 2px solid #6bbfd9;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Boutons milieu */
.home-cat-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.home-cat-btn {
  display: block;
  padding: 6px 10px;
  border-radius: 3px;
  border: 2px solid #444;
  background: #f6f6f6;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: #222;
  text-decoration: none;
  transition: all 0.2s;
}

.home-cat-btn:hover {
  background: #1a76d1;
  border-color: #1a76d1;
  color: #fff;
}

/* Bandes verticales */
.home-vertical-col {
  border: 2px solid #444;
  background: #f6f6f6;
  min-height: 575px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  writing-mode: vertical-rl;
  text-transform: uppercase;
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
}


/* ==========================================================================
   3) HEADER CUSTOM
   ========================================================================== */

#custom-header {
  width: 100%;
  text-align: center;
  padding-top: 20px;
  padding-bottom: 10px;
}

#custom-header .sr-title h1 {
  font-family: 'Georgia', serif;
  font-size: 56px;
  font-weight: 900;
  color: #3b6fa5;
  margin: 0;
}

#custom-header .sub {
  display: inline-block;
  padding: 8px 20px;
  border: 3px solid #3b6fa5;
  margin: 12px 0 15px 0;
  font-size: 24px;
  font-weight: 700;
  background: white;
  color: #234b73;
}

#custom-header .notice {
  margin-top: 15px;
  font-size: 12px;
  color: #234b73;
}

#custom-header .separator {
  width: 92%;
  height: 2px;
  background: #3b6fa5;
  margin: 18px auto 0;
}


/* ==========================================================================
   4) MENU CATÉGORIES (SOUS HEADER)
   ========================================================================== */

#custom-category-main-menu {
  text-align: center;
  padding: 12px 0;
  background: #f7f9fc;
  border-bottom: 2px solid #d5dce4;
  margin-top: 10px;
}

#custom-category-main-menu ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: inline-flex;
  gap: 40px;
}

#custom-category-main-menu a {
  font-size: 18px;
  font-weight: 600;
  color: #1a365d;
  text-transform: uppercase;
  text-decoration: none;
  padding: 4px 6px;
  transition: 0.2s;
}

#custom-category-main-menu a:hover {
  color: #2c7be5;
}

/* Menu “Autres” — version au clic */
.sr-more { position: relative; }
.sr-more-btn { cursor: pointer; user-select: none; }

.sr-more-box {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border: 2px solid #d5dce4;
  border-radius: 4px;
  padding: 8px 0;
  min-width: 240px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  flex-direction: column;
  z-index: 9999;
}

.sr-more-box li a {
  padding: 8px 12px;
  display: block;
  color: #1a365d;
  text-decoration: none;
}

.sr-more-box li a:hover {
  background: #eef3ff;
}

/* Sécurité : jamais affiché sans clic */
.sr-more .sr-more-box {
  display: none !important;
  visibility: hidden;
  opacity: 0;
}

.sr-more.open .sr-more-box {
  display: flex !important;
  visibility: visible;
  opacity: 1;
}


/* ==========================================================================
   5) BARRE OUTILS HEADER (RECHERCHE + MAPS)
   ========================================================================== */

#custom-header-tools {
  width: 100%;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  box-sizing: border-box;
}

#custom-search {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#custom-search input {
  padding: 6px 10px;
  border: 2px solid #3b6fa5;
  border-radius: 6px;
  width: 240px;
}

#custom-search button {
  background: transparent !important;
  border: 2px solid #3b6fa5 !important;
  padding: 4px 6px !important;
  border-radius: 6px !important;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

#custom-search button::before {
  content: "";
  width: 18px;
  height: 18px;
  background-size: contain;
  background-repeat: no-repeat;
  background-image: url("data:image/svg+xml;utf8,<svg viewBox='0 0 24 24' fill='none' stroke='%233b6fa5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' xmlns='http://www.w3.org/2000/svg'><circle cx='11' cy='11' r='7'/><line x1='16.5' y1='16.5' x2='22' y2='22'/></svg>");
}

#custom-action-btn {
  background: transparent !important;
  color: #3b6fa5 !important;
  border: 2px solid #3b6fa5 !important;
}
#custom-action-btn {
  background: transparent !important;
  color: #3b6fa5 !important;
  border: 2px solid #3b6fa5 !important;
  margin-left: 10px;   /* ← espace ajouté ici */
}

#custom-header .maps-link {
  margin-left: auto !important;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #1a365d;
  text-decoration: none;
}

#custom-header .maps-link img {
  width: 26px;
  height: 26px;
  opacity: 0.9;
}


/* ==========================================================================
   6) BARRE COMPTE + PANIER (CUSTOM + FIX AJAX)
   ========================================================================== */

/* Conteneur global */
#user-cart-bar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start !important; /* ✅ dernière règle conservée */
  width: 100%;
  padding: 5px 25px;
}

/* Bloc utilisateur (Nom + Déconnexion en colonne) */
.uc-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Boutons uniformes (Connexion / Nom / Déconnexion) */
.uc-left a,
.uc-left span,
.uc-left .customer-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 2px solid #3b6fa5;
  border-radius: 6px;
  background: white;
  font-family: 'Georgia', serif;
  font-size: 17px;
  font-weight: 700;
  color: #3b6fa5 !important;
  text-decoration: none !important;
  transition: 0.2s;
  width: fit-content;
}

.uc-left a:hover,
.uc-left span:hover,
.uc-left .customer-name:hover {
  background: #3b6fa5;
  color: white !important;
}

/* Nom client (non cliquable) */
.uc-left .user-info .user-name {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border: 2px solid #3b6fa5;
  border-radius: 6px;
  background: white;
  font-family: 'Georgia', serif;
  font-size: 17px;
  font-weight: 700;
  color: #3b6fa5 !important;
  text-decoration: none !important;
  transition: 0.2s;
  cursor: default;
}

.uc-left .user-info .user-name:hover {
  background: #3b6fa5;
  color: white !important;
}

/* Petit espace sous le nom utilisateur (connecté) */
#user-cart-bar .user-name {
  margin-bottom: 6px;
  display: block;
}

/* Zone panier à droite */
.uc-right,
#user-cart-bar .uc-right {
  display: flex;
  align-items: flex-start !important;
  padding-top: 0 !important;
  white-space: nowrap; /* ✅ nécessaire pour éviter retours */
}

/* Bouton panier natif PrestaShop (AJAX compris) */
#user-cart-bar .blockcart a {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 2px solid #3b6fa5;
  border-radius: 6px;
  background: white;
  font-family: 'Georgia', serif;
  font-size: 17px;
  font-weight: 700;
  color: #3b6fa5 !important;
  text-decoration: none !important;
  transition: 0.2s;
}

#user-cart-bar .blockcart a:hover {
  background: #3b6fa5;
  color: white !important;
}

#user-cart-bar .blockcart i {
  font-style: normal;
  margin-right: 4px;
}

/* Suppression du "Connexion" parasite injecté (AJAX ps_shoppingcart) */
#user-cart-bar .uc-right a.account,
#user-cart-bar .uc-right a[href*="login"],
#user-cart-bar .uc-right a[href*="connexion"],
#user-cart-bar .uc-right .user-info,
#user-cart-bar .uc-right .header-user-info,
#user-cart-bar .uc-right .material-icons {
  display: none !important;
}


/* ==========================================================================
   7) DÉSACTIVATIONS PRESTASHOP (PUB / SLIDER)
   ========================================================================== */

.banner,
.banner *,
#banner,
#banner *,
.top-banner,
.top-banner *,
#home-banner,
#home-banner * {
  display: none !important;
}

#carousel,
#home-slider,
#slider {
  display: none !important;
}

/* Désactivation du select variantes natif PS8 (remplacé par le cadre bleu) */
.product-variants {
  display: none !important;
}


/* ==========================================================================
   8) CATALOGUE / LISTING PRODUITS
   ========================================================================== */

/* Cadre bleu autour des fiches produits */
.product-miniature {
  border: 2px solid #6bbfd9;
  border-radius: 6px;
  padding: 10px;
  box-sizing: border-box;
  background: #ffffff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-miniature:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
}

/* Alignement barre résultats / tri */
#js-product-list-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

#js-product-list-top .total-products {
  flex: 0 0 auto;
  white-space: nowrap;
}

#js-product-list-top .products-sort-order,
#js-product-list-top .sort-by-row {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

/* Select "Trier" */
#js-product-list-top select {
  width: auto;
  min-width: 260px;
  max-width: 280px;
  white-space: nowrap;
}

/* Fix : "Trier par" ne passe jamais à la ligne */
#js-product-list-top .sort-by-row {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  white-space: nowrap;
}

#js-product-list-top .sort-by-row label,
#js-product-list-top .sort-by-row span {
  white-space: nowrap;
  margin-right: 8px;
  flex: 0 0 auto;
}

/* Mise en page cartes (pour avoir le prix toujours en bas) */
.products .product-miniature {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.products .thumbnail-container {
  display: flex;
  flex-direction: column;
  flex: 1;
}

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

.products .product-price-and-shipping {
  margin-top: auto;
}

.products .js-product {
  margin-bottom: 25px;
}


/* ==========================================================================
   9) VARIANTS ROY
   ========================================================================== */

#roy-variant-preview {
  margin-top: 1.5rem;
}

#roy-variant-preview .roy-variant-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 12px;
  border: 1px solid #e3e3e3;
  background-color: #fafafa;
}

#roy-variant-preview .roy-variant-card__media {
  flex: 0 0 120px;
}

#roy-variant-preview .roy-variant-card__media img {
  display: block;
  width: 100%;
  height: auto;
}

#roy-variant-preview .roy-variant-card__content {
  flex: 1;
}

#roy-variant-preview .roy-variant-card__label {
  margin: 0 0 4px 0;
  font-size: 0.95rem;
  font-weight: 400;
  color: #000;
}

#roy-variant-preview .roy-variant-card__line,
#roy-variant-preview .roy-variant-card__sku {
  margin: 0;
  font-size: 0.85rem;
  font-weight: 400;
  color: #000;
}

/* Pastilles stock */
.roy-stock-dot {
  display: inline-block;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
}

.roy-stock-dot--green  { background-color: #4caf50; }
.roy-stock-dot--yellow { background-color: #fbc02d; }

/* QTY en stock sous le prix */
.total-variants-stock {
  margin: 10px auto 0;
  text-align: center;
  font-weight: 700;
  color: #67bed9;
  border: 2px solid #67bed9;
  display: inline-block;
  padding: 6px 14px;
  border-radius: 4px;
  position: relative !important;
  top: -18px !important;
}

/* Zone commande dans variant */
.roy-blue-variant .variant-order-zone {
  display: none;
  margin-top: 8px;
  gap: 4px;
  align-items: center;
  flex-wrap: wrap;
}

.roy-blue-variant.is-active .variant-order-zone {
  display: flex;
}

.roy-blue-variant > div:last-child {
  flex: 1;
}

.roy-blue-variant .variant-qty {
  width: 50px;
  min-width: 50px;
}

.roy-blue-variant .variant-order-zone button {
  padding: 4px 12px;
  font-size: 13px;
  height: auto;
  line-height: 1.2;
}

/* Cadre miroir (aperçu variant) */
.product-information {
  position: relative;
}

.roy-variant-preview-right {
  /* position laissé volontairement tel quel (commentaires historiques conservés)
     - Des changements ici peuvent impacter le layout.
  */
  top: 0px;
  right: 180px;
  width: 180px;
  height: 180px;
  background: #fff;
  border: 2px solid #1976d2;
  padding: 8px;
  z-index: 20;
  display: none;
  box-sizing: border-box;
  overflow: hidden;
}

.roy-variant-preview-right img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Marge entre l'image du variant et la remise */
.product-discounts {
  margin-top: 10px;
}

/* Select variantes PS8 (si jamais réactivé : sécurité) */
.product-variants select.form-control {
  max-width: 50%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Bouton Ajouter au panier (PS8 natif) */
.product-actions .add-to-cart {
  max-width: 220px;
  padding-left: 10px;
  padding-right: 12px;
}

/* Popup image centrée */
#roy-image-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  cursor: zoom-out;
}

#roy-image-popup img {
  max-width: 90vw;
  max-height: 90vh;
  background: #fff;
  padding: 10px;
  box-shadow: 0 0 40px rgba(0,0,0,0.5);
}

/* Ruban stock variant */
.roy-variant-stock-ribbon {
  position: absolute;
  top: 10px;
  left: -6px;
  background: #2ecc71;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 12px;
  z-index: 5;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
}

.roy-variant-stock-ribbon::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  border-top: 6px solid #1eaa5d;
  border-left: 6px solid transparent;
}

/* Promo ribbon */
.roy-blue-variant .roy-promo-ribbon {
  display: inline-block;
  margin-left: 8px;
  background: #f57c00;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 4px;
  vertical-align: middle;
  line-height: 1.1;
  text-decoration: line-through;
  white-space: nowrap;
  position: relative;
  top: -2px;
}

/* Cadre ORANGE image — variant en promotion */
.roy-blue-variant.is-promo img {
  border: 2px solid #ff9800 !important;
  box-shadow: 0 0 0 1px rgba(255, 152, 0, 0.35);
}

.roy-promo-text {
  margin-top: 4px;
  margin-left: 9px;
  font-size: 15px;
  font-weight: 700;
  color: #f57c00;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Couleur taille variant */
#roy-current-variant-size,
#roy-current-variant-size * {
  color: #000 !important;
}


/* ==========================================================================
   10) FICHE PRODUIT — PRIX / TTC / CARACTÉRISTIQUES
   ========================================================================== */

/* TTC sur la même ligne */
.tax-label,
.tax-shipping-delivery-label {
  display: inline !important;
  margin-left: 8px !important;
  vertical-align: baseline;
}

/* Taille du prix */
.product-prices .product-price,
.product-prices .current-price {
  font-size: 32px;
  font-weight: 700;
  line-height: 1.1;
}

/* Valeurs caractéristiques produit */
.product-features .data-sheet dd,
.product-features .data-sheet .value {
  text-transform: none;
  font-size: 0.75rem;
  font-weight: 400;
}

#product-details .product-features .data-sheet dd {
  text-transform: none !important;
  font-size: 0.75rem;
}


/* ==========================================================================
   11) BADGES / FLAGS / SYNONYMES / FLAGS FICHE PRODUIT
   ========================================================================== */

.product-cover {
  position: relative;
}

/* Seulement sur la fiche produit */
.page-product .product-flags {
  position: absolute;
  top: 30px;
  left: 10px;
  z-index: 5;
}

/* Synonyme recherche */
.roy-search-synonym {
  font-size: 1.10rem;
  color: #1976d2;
  line-height: 1.2;
  font-weight: 500;
  text-align: center;
  display: block;
  width: 100%;
  margin: 24px 0 8px 0;
}

/* Badge stock (base) */
.roy-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.8rem;
  padding: 4px 8px;
  border-radius: 4px;
  font-weight: 600;
  color: #fff;
  z-index: 2;
}

/* Variante “pill” (flags + badge) — dernière version conservée */
.product-flag,
.roy-stock-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  font-size: 0.75rem !important;
  font-weight: 600;
  padding: 5px 10px !important;
  border-radius: 20px !important;
  color: #fff !important;
  line-height: 1;
  min-width: 90px;
  text-align: center;
  z-index: 2;
}

.stock-available { background: #2e7d32 !important; }
.stock-order     { background: #f57c00 !important; }

/* Flags PrestaShop masquées */
.product-flag.out-of-stock { background: #1565c0 !important; }
.product-flag.out-of-stock,
.product-flag.out_of_stock,
.product-flag.new,
.product-flag.discount {
  display: none !important;
}

/* Badge “nb variants” */
.roy-variants-count-badge {
  margin-top: 10px;
  margin-bottom: 5px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  color: #555;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  text-align: center;
  line-height: 1;
}


/* ==========================================================================
   12) TOPIAIRES
   ========================================================================== */

.topiaire-card {
  border: 2px solid #1e73be;
  border-radius: 8px;
  padding: 15px;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: 0.3s ease;
  min-height: 520px; /* uniformise les hauteurs */
}

.topiaire-card:hover {
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.topiaire-image {
  height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 15px;
}

.topiaire-image img {
  max-height: 100%;
  max-width: 100%;
  height: auto;
  width: auto;
  display: block;
}

.topiaire-content {
  flex: 1;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.topiaire-title {
  font-size: 14px;
  font-weight: 600;
  min-height: 50px;
}

.topiaire-title a {
  text-decoration: none;
  color: #222;
}

.topiaire-price {
  font-size: 16px;
  font-weight: bold;
  color: #1e73be;
  margin-top: 10px;
}

/* Espacement vertical entre cartes */
.topiaires-list .row > div {
  margin-bottom: 25px;
}


/* ==========================================================================
   13) THUMBNAIL PRODUIT — CADRE IMAGE FIXE + OVERLAYS
   ========================================================================== */

/* Zone image fixe */
.product-miniature .thumbnail-top {
  position: relative;
  height: 250px;
  overflow: hidden;
}

/* Image plein cadre */
.product-miniature .thumbnail-top img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Overlays / badges (ajustements) */
.product-miniature .roy-stock-badge {
  top: 5px !important;
  left: 12px !important;
}

.product-miniature .wishlist-button-add {
  top: 5px !important;
  right: 12px !important;
}

.product-miniature .highlighted-informations {
  display: none !important;
}

.product-miniature .roy-search-synonym {
  margin-top: 5px !important;
  padding-top: 0 !important;
}


/* ==========================================================================
   14) RESPONSIVE (REGROUPÉ EN FIN)
   ========================================================================== */

/* --------------------------------------------------------------------------
   DESKTOP ≥ 992px
   -------------------------------------------------------------------------- */

@media (min-width: 992px) {

  #products .products {
    margin-left: -6px;
    margin-right: -6px;
  }

  #products .product-miniature {
    box-sizing: border-box;
    padding-left: 6px;
    padding-right: 6px;
    margin-bottom: 12px !important;
    width: 100%;
    max-width: 100%;
  }

  #products .product-miniature img {
    width: 100%;
    height: auto;
    display: block;
  }

  #products .product-description,
  #products .thumbnail-container {
    width: 100%;
    box-sizing: border-box;
  }

  /* Force 4 colonnes même après AJAX */
  #products .products > div {
    flex: 0 0 25% !important;
    max-width: 25% !important;
  }
}


/* --------------------------------------------------------------------------
   TABLETTE ≤ 991px
   -------------------------------------------------------------------------- */

@media (max-width: 991px) {

  /* Cadre miroir variants (comportement actuel conservé) */
  .roy-variant-preview-right {
    display: block !important;
  }

}


/* --------------------------------------------------------------------------
   MOBILE ≤ 767.98px
   -------------------------------------------------------------------------- */

@media (max-width: 767.98px) {

  body {
    overflow-x: hidden;
  }

  /* ===============================
     HOMEPAGE STRUCTURE
     =============================== */

  .product-miniature .thumbnail-top {
    height: auto;
    aspect-ratio: 1 / 1;
  }

  /* Produits mobile : 2 colonnes */
  #products .products > div {
    flex: 0 0 50%;
    max-width: 50%;
  }

  /* Masquer le texte "notice" sur mobile uniquement */
  #custom-header .notice {
    display: none;
  }
  
  /* Supprimer la grande bannière sur mobile */
  .home-top-banner {
    display: none;
  }

  .home-main-columns {
    flex-direction: column;
    gap: 20px;
    padding: 0 15px;
  }

  /* Conteneur module "Bloc de texte personnalisé" */
#custom-text {
  padding-top: 0 !important;
}
  /* On supprime les colonnes inutiles */
  .home-col-left {
    display: none;
  }

  .home-col-right {
    display: none;
  }

  .home-col-center {
    flex: 0 0 100%;
    max-width: 100%;
  }

  /* ===============================
     BANNIÈRE MOBILE
     =============================== */

  .home-top-banner {
    max-width: none;
    width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
    margin-bottom: 20px;
  }

  .home-top-banner img {
    width: 100%;
    height: 350px;      /* ← AJUSTE ICI : 200 / 220 / 250 */
    object-fit: cover;
    display: block;
  }

  /* ===============================
     HEADER MOBILE
     =============================== */

  #custom-header {
    padding-top: 12px;
    padding-bottom: 0;
  }

  #custom-header .sr-title h1 {
    font-size: 28px;
    line-height: 1.2;
  }

  #custom-header .sub {
    font-size: 14px;
    padding: 6px 12px;
    border-width: 2px;
    margin-bottom: 5px;
  }

  /* ===============================
     MENU CATÉGORIES MASQUÉ
     =============================== */

  #custom-category-main-menu {
    display: none;
  }

  /* ===============================
     BOUTONS CATÉGORIES
     =============================== */

  .home-cat-btn {
    width: 100%;
    padding: 14px;
    font-size: 15px;
    border-radius: 6px;
  }

  /* ===============================
     BADGE VARIANTS
     =============================== */

  .roy-variants-count-badge {
    position: static;
    margin-top: 10px;
    margin-bottom: 5px;
  }
  
  /* ===============================
  HEADER TOOLS – MOBILE CORRECT
  =============================== */

#custom-header-tools {
  flex-direction: column;
  align-items: flex-start;
}

#custom-search {
  width: 100%;
}

#custom-search input {
  width: 100%;
}

#custom-header .maps-link {
  margin-left: 0 !important;   /* annule le auto */
  justify-content: center;
  width: 100%;
}

/* ===============================
   MOBILE – Liste variants scrollable
   =============================== */

/* ===============================
   MOBILE – Indication scroll variants
   =============================== */

  #roy-variant-list-blue::before {
    content: none;
  }

  /* CIBLE UNIQUEMENT le titre principal */
  #roy-variant-list-blue > strong {
    display: block;
    text-align: center;
    font-size: 15px;
    margin-bottom: 2px;
  }

  /* Message scroll juste sous le titre */
  #roy-variant-list-blue > strong::after {
    content: "↓↓  Liste à faire défiler  ↓↓";
    display: block;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #1976d2;
    margin-top: 4px;
    margin-bottom: 8px;
  }

/* MOBILE – Réduire l’espace sous le titre du cadre bleu */
#roy-variant-list-blue > br {
  display: none;
}

#roy-variant-list-blue {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 5px;   /* évite que le scroll colle au bord */
}

#custom-action-btn {
  width: auto !important;
  flex: 0 0 auto;
}

#custom-action-btn {
  margin-left: 0 !important;
}

}


/* --------------------------------------------------------------------------
   VARIANT PREVIEW ≤ 600px
   -------------------------------------------------------------------------- */

@media (max-width: 600px) {

  #roy-variant-preview .roy-variant-card {
    flex-direction: column;
  }

  #roy-variant-preview .roy-variant-card__media {
    max-width: 200px;
  }

}


/* --------------------------------------------------------------------------
   PROMO RIBBON ≤ 480px
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {

  .roy-blue-variant .roy-promo-ribbon {
    font-size: 9px;
    padding: 2px 6px;
  }

}

/* --------------------------------------------------------------------------
   Réduction espace page maintenance 
-------------------------------------------------------------------------- */

body#maintenance {
    padding-top: 20px !important;
}

#maintenance .logo {
    margin-bottom: 15px !important;
}

#maintenance .page-content {
    margin-top: 0 !important;
}

#maintenance {
    min-height: auto !important;
}