/* ==========================================================
   JM24 — CSS global ultra-compatible Joomla / VirtueMart
   Version: 2026-05-11 compat
   Objectif: moderniser sans dépendre d'une seule classe template.
   Règle: override visuel réversible, aucun core modifié.
   ========================================================== */

:root {
  --jm24-primary: #1b1b1b;
  --jm24-primary-2: #2b2b2b;
  --jm24-accent: #d4a017;
  --jm24-accent-dark: #a8790d;
  --jm24-bg: #f5f5f5;
  --jm24-card: #ffffff;
  --jm24-text: #2f2f2f;
  --jm24-muted: #777777;
  --jm24-border: #e3e3e3;
  --jm24-radius: 10px;
  --jm24-radius-sm: 6px;
  --jm24-shadow: 0 8px 24px rgba(0,0,0,.08);
  --jm24-shadow-sm: 0 3px 12px rgba(0,0,0,.07);
  --jm24-speed: .28s;
}

html body {
  background: var(--jm24-bg) !important;
  color: var(--jm24-text) !important;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Layout Joomla/theme685/Gantry: amélioration douce, sans casser les grilles existantes */
#main,
#content,
#component,
#rt-main,
#rt-mainbody,
#rt-content-top,
#rt-content-bottom,
.site,
.wrapper,
.container,
.container-fluid,
.main-content,
.content-area {
  box-sizing: border-box;
}

/* Header / navigation: sélecteurs multiples pour theme685, Gantry, Joomla menus */
#header,
.header,
#rt-header,
.rt-header,
.t3-header,
.site-header,
.header-container {
  background: linear-gradient(135deg, var(--jm24-primary) 0%, var(--jm24-primary-2) 100%) !important;
  border-bottom: 2px solid var(--jm24-accent) !important;
  box-shadow: 0 3px 14px rgba(0,0,0,.16) !important;
}

#header a,
.header a,
#rt-header a,
.rt-header a,
.site-header a,
.header-container a,
#navigation a,
.navigation a,
.navbar a,
.nav a,
ul.menu a,
.moduletable_menu a,
#icemegamenu a,
.ice-megamenu a {
  transition: color var(--jm24-speed) ease, background-color var(--jm24-speed) ease, border-color var(--jm24-speed) ease !important;
}

#navigation,
.navigation,
#rt-navigation,
.rt-navigation,
.navbar,
.navbar-inner,
.menu-block,
#icemegamenu,
.ice-megamenu,
ul.menu {
  background: var(--jm24-primary) !important;
}

#navigation a,
.navigation a,
#rt-navigation a,
.rt-navigation a,
.navbar a,
.menu-block a,
#icemegamenu > li > a,
.ice-megamenu > li > a,
ul.menu > li > a {
  color: #ffffff !important;
  font-weight: 600 !important;
  letter-spacing: .25px !important;
  text-decoration: none !important;
}

#navigation a:hover,
.navigation a:hover,
#rt-navigation a:hover,
.rt-navigation a:hover,
.navbar a:hover,
.menu-block a:hover,
#icemegamenu > li > a:hover,
.ice-megamenu > li > a:hover,
ul.menu > li > a:hover,
ul.menu > li.active > a,
ul.menu > li.current > a {
  color: var(--jm24-accent) !important;
}

/* Modules / blocs génériques Joomla */
.moduletable,
.module,
.moduletable_menu,
.module-surround,
.sidebar .module,
#aside-left .module,
#aside-right .module {
  border-radius: var(--jm24-radius) !important;
}

.moduletable > h3,
.module-title,
.module h3,
.componentheading,
.contentheading,
.page-header h1,
.page-title,
h1.title,
h2.title {
  color: var(--jm24-primary) !important;
  letter-spacing: -.02em;
}

/* Conteneurs VirtueMart courants */
.category-view,
.featured-view,
.latest-view,
.topten-view,
.recent-view,
.browse-view,
.virtuemart_search,
.vmgroup,
.vm-products,
.vm-product-container,
.productdetails-view {
  box-sizing: border-box;
}

/* Grilles: ne force que les conteneurs VM identifiés, avec fallback flexible */
.category-view .row,
.featured-view .row,
.latest-view .row,
.topten-view .row,
.recent-view .row,
.browse-view .row,
.vmgroup ul,
.vm-products,
.products,
.product-list,
.product-grid {
  gap: 18px !important;
}

@supports (display: grid) {
  .browse-view .row,
  .category-view .row,
  .featured-view .row,
  .latest-view .row,
  .topten-view .row,
  .recent-view .row,
  .vm-products,
  .product-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)) !important;
    align-items: stretch !important;
  }
}

/* Cartes produit/catégorie — couvre VM2/VM3 + templates classiques
   FIX: .spacer seul est retiré — c'est une classe Joomla générique qui casse les modules */
.category-view .category,
.category-view .category.floatleft,
.browse-view .product,
.browse-view .product.vm-col,
.product.vm-col,
.product,
.vm-product,
.vm-product-container,
.vm-product-descr-container,
.product-container,
.product-item,
.item.product,
.vmgroup li,
.products .item,
.product-grid .item,
.product-list .item {
  background: var(--jm24-card) !important;
  border: 1px solid var(--jm24-border) !important;
  border-radius: var(--jm24-radius) !important;
  box-shadow: var(--jm24-shadow-sm) !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  transition: transform var(--jm24-speed) ease, box-shadow var(--jm24-speed) ease, border-color var(--jm24-speed) ease !important;
}

.category-view .category:hover,
.browse-view .product:hover,
.product:hover,
.vm-product:hover,
.product-container:hover,
.product-item:hover,
.item.product:hover,
.vmgroup li:hover,
.products .item:hover,
.product-grid .item:hover {
  border-color: rgba(212,160,23,.45) !important;
  box-shadow: var(--jm24-shadow) !important;
  transform: translateY(-2px) !important;
}

/* Espacement interne compatible — FIX: .spacer seul retiré */
.category-view .category,
.browse-view .product .spacer,
.product .spacer,
.vm-product .spacer,
.product-container,
.product-item,
.vm-product-descr-container,
.products .item,
.product-grid .item {
  padding: 14px !important;
}

/* Images produits/catégories: N&B uniquement dans les zones produit, jamais logos/icons */
.category-view .category img,
.browse-view .product img,
.product img,
.vm-product img,
.vm-product-media-container img,
.product-container img,
.product-item img,
.productdetails-view img,
.vmgroup li img,
.products .item img,
.product-grid .item img,
img.browseProductImage,
img.featuredProductImage,
img.product-image,
img.vm-product-media-img {
  max-width: 100% !important;
  height: auto !important;
  border-radius: var(--jm24-radius-sm) !important;
  filter: grayscale(100%) contrast(1.04) !important;
  transition: filter var(--jm24-speed) ease, transform var(--jm24-speed) ease, opacity var(--jm24-speed) ease !important;
  backface-visibility: hidden;
}

.category-view .category:hover img,
.browse-view .product:hover img,
.product:hover img,
.vm-product:hover img,
.vm-product-media-container:hover img,
.product-container:hover img,
.product-item:hover img,
.productdetails-view img:hover,
.vmgroup li:hover img,
.products .item:hover img,
.product-grid .item:hover img {
  filter: grayscale(0%) contrast(1) !important;
  transform: scale(1.015) !important;
}

/* Exclusions sécurité — FIX: ajout livraison/garantie/badges de confiance */
#logo img,
.logo img,
.site-logo img,
.header img,
#header img,
#rt-header img,
img.logo,
img[src*="logo"],
img[src*="Logo"],
img[src*="icon"],
img[src*="payment"],
img[src*="paypal"],
img[src*="visa"],
img[src*="mastercard"],
img[src*="stripe"],
img[src*="livraison"],
img[src*="garantie"],
img[src*="serenite"],
img[src*="qualite"],
img[src*="badge"],
img[src*="trust"],
img[src*="cart"],
img[src*="panier"] {
  filter: none !important;
  transform: none !important;
  border-radius: 0 !important;
}

/* Titres produit */
.product h2,
.product h3,
.product h4,
.product-title,
.product-name,
.vm-product-descr-container h2,
.vm-product-descr-container h3,
.browse-view h2,
.browse-view h3,
.category-view h2,
.category-view h3,
a.product-name,
a.product-title,
.vmproduct-title,
.vm-product-title {
  color: var(--jm24-primary) !important;
  font-weight: 700 !important;
  line-height: 1.25 !important;
  text-decoration: none !important;
}

.product h2 a,
.product h3 a,
.product-title a,
.product-name a,
.vm-product-descr-container a,
.browse-view h2 a,
.browse-view h3 a,
a.product-name,
a.product-title {
  color: inherit !important;
  text-decoration: none !important;
}

.product h2 a:hover,
.product h3 a:hover,
.product-title a:hover,
.product-name a:hover,
.browse-view h2 a:hover,
.browse-view h3 a:hover {
  color: var(--jm24-accent-dark) !important;
}

/* Prix VirtueMart multi-versions */
.PricesalesPrice,
.PricebasePrice,
.PricepriceWithoutTax,
.PricepriceWithTax,
.vm-price-value,
.product-price,
.price,
.salesPrice,
span.PricesalesPrice,
div.PricesalesPrice,
.PricebillTotal,
.cart-summary .priceColor2 {
  color: var(--jm24-accent-dark) !important;
  font-weight: 800 !important;
  font-size: 1.08em !important;
}

/* Boutons Joomla / VM */
button,
.button,
.btn,
.btn-primary,
input.button,
input[type="submit"],
input[type="button"],
a.button,
a.btn,
.addtocart-button,
.addtocart-button input,
.addtocart-area button,
.addtocart-area input,
.addtocart-bar .addtocart-button,
.vm-button-correct,
.vm-button-correct:link,
.vm-button-correct:visited,
.vm-button,
.details-button,
.productdetails,
a.product-details,
span.addtocart-button input.addtocart-button {
  border-radius: 999px !important;
  border: 1px solid var(--jm24-accent) !important;
  background: linear-gradient(135deg, var(--jm24-accent), var(--jm24-accent-dark)) !important;
  color: #1c1c1c !important;
  box-shadow: 0 4px 12px rgba(212,160,23,.25) !important;
  font-weight: 700 !important;
  text-decoration: none !important;
  text-transform: none !important;
  transition: transform var(--jm24-speed) ease, box-shadow var(--jm24-speed) ease, filter var(--jm24-speed) ease !important;
}

button:hover,
.button:hover,
.btn:hover,
.btn-primary:hover,
input.button:hover,
input[type="submit"]:hover,
input[type="button"]:hover,
a.button:hover,
a.btn:hover,
.addtocart-button:hover,
.addtocart-button input:hover,
.vm-button-correct:hover,
.vm-button:hover,
.details-button:hover,
.productdetails:hover,
a.product-details:hover {
  filter: brightness(1.04) !important;
  transform: translateY(-1px) !important;
  box-shadow: 0 7px 18px rgba(212,160,23,.32) !important;
}

/* Champs formulaire */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="tel"],
input[type="number"],
select,
textarea,
.inputbox {
  border: 1px solid var(--jm24-border) !important;
  border-radius: var(--jm24-radius-sm) !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

input:focus,
select:focus,
textarea:focus,
.inputbox:focus {
  border-color: var(--jm24-accent) !important;
  outline: none !important;
  box-shadow: 0 0 0 3px rgba(212,160,23,.14) !important;
}

/* Pagination / breadcrumbs */
.breadcrumb,
ul.breadcrumb,
.pagination,
ul.pagination,
.vm-pagination {
  border-radius: var(--jm24-radius-sm) !important;
}

.pagination a,
.pagination span,
ul.pagination a,
ul.pagination span,
.vm-pagination a,
.vm-pagination span {
  border-radius: var(--jm24-radius-sm) !important;
}

/* Tables panier / checkout: lisibilité sans casser */
.cart-view table,
.checkout table,
table.cart-summary,
.vm-cart-header-container,
.vm-cart-item-basic {
  background: #fff !important;
  border-radius: var(--jm24-radius) !important;
}

/* Footer */
#footer,
.footer,
#rt-footer,
.rt-footer,
.site-footer,
.footer-container {
  background: var(--jm24-primary) !important;
  color: #f3f3f3 !important;
  border-top: 2px solid var(--jm24-accent) !important;
}

#footer a,
.footer a,
#rt-footer a,
.rt-footer a,
.site-footer a {
  color: #f3f3f3 !important;
}

#footer a:hover,
.footer a:hover,
#rt-footer a:hover,
.rt-footer a:hover,
.site-footer a:hover {
  color: var(--jm24-accent) !important;
}

/* Responsive sécurité */
@media (max-width: 768px) {
  .browse-view .row,
  .category-view .row,
  .featured-view .row,
  .latest-view .row,
  .topten-view .row,
  .recent-view .row,
  .vm-products,
  .product-grid {
    grid-template-columns: 1fr !important;
  }

  .category-view .category,
  .browse-view .product,
  .product,
  .vm-product,
  .product-container,
  .product-item {
    margin-bottom: 16px !important;
  }

  button,
  .button,
  .btn,
  input.button,
  input[type="submit"],
  .addtocart-button,
  .addtocart-button input,
  .vm-button-correct {
    max-width: 100% !important;
    white-space: normal !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* --- Message rassurant client : 8 ans JM24 --- */
.jm24-trust-banner {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;
  background: linear-gradient(135deg, #1b1b1b 0%, #2b2b2b 100%) !important;
  color: #ffffff !important;
  border: 1px solid rgba(212,160,23,.55) !important;
  border-left: 5px solid var(--jm24-accent, #d4a017) !important;
  border-radius: var(--jm24-radius, 10px) !important;
  box-shadow: var(--jm24-shadow-sm, 0 3px 12px rgba(0,0,0,.07)) !important;
  padding: 14px 18px !important;
  margin: 18px 0 !important;
}

.jm24-trust-banner strong {
  color: var(--jm24-accent, #d4a017) !important;
  font-size: 1.05rem !important;
  letter-spacing: .02em !important;
}

.jm24-trust-banner span {
  color: #f3f3f3 !important;
}
