/* =========================================
   CONTAINER PRINCIPAL (.rnf-ps)
   Sécurisé contre le scroll horizontal et vertical
   ========================================= */
.rnf-ps {
  --ps-ratio: 4/5;
  --ps-gap: 12px;
  --ps-desktop: 5;
  --ps-tablet: 3;
  --ps-mobile: 2;

  position: relative;
  padding: 0 44px;
  
  /* CORRECTIFS DE SÉCURITÉ */
  width: 100%;
  max-width: 100%;
  box-sizing: border-box; /* Empêche le padding d'élargir la page */
  overflow-x: clip;       /* Coupe tout ce qui dépasse (ombres, flèches) */
  padding-top: 1px;       /* Bloque la fusion des marges verticales */
  padding-bottom: 1px;
}

.rnf-ps-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - (var(--cols) - 1) * var(--ps-gap)) / var(--cols));
  gap: var(--ps-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  /* Sécurité track */
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
.rnf-ps-track::-webkit-scrollbar { display:none; }

/* colonnes responsives */
.rnf-ps { --cols: var(--ps-desktop); }
@media (max-width: 1024px) { .rnf-ps { --cols: var(--ps-tablet); } }
@media (max-width: 768px) { .rnf-ps { --cols: var(--ps-mobile); } }

/* carte */
.rnf-ps-card { scroll-snap-align: start; display:flex; flex-direction:column; align-items:center; }
.rnf-ps-thumb {
  position:relative; display:block; width:100%;
  aspect-ratio: var(--ps-ratio);
  overflow:hidden; border:1px solid #e8e2d7; border-radius:10px; background:#fff;
}
.rnf-ps-img {
  position:absolute; inset:0; height:100%;
  object-fit:cover; object-position:center; display:block; margin:0; border:0; margin-left: auto; margin-right: auto;
}
.rnf-ps-title {
  margin:.7rem 0 .3rem; font-size: clamp(0.9rem, 0.25vw + 0.75rem, 0.98rem);
  font-weight:600; text-align:center; color:#2b2112;
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; width:100%;
}
.rnf-ps-title a { color:inherit; text-decoration:none; }
.rnf-ps-price { font-weight:700; text-align:center; }
.rnf-ps-price del { color:#e11d48; margin-right:.35rem; }

/* nav */
.rnf-ps-nav {
  position:absolute; top:38%; transform:translateY(-50%);
  width:38px; height:38px; border-radius:999px; border:1px solid #eac9d5; background:#f7e6eb; color:#a14b68;
  display:flex; align-items:center; justify-content:center; cursor:pointer; box-shadow:0 4px 12px rgba(0,0,0,.12);
  z-index: 10; /* Assure que les flèches sont au-dessus */
}
.rnf-ps-nav.prev { left:6px; } 
.rnf-ps-nav.next { right:6px; }

@media (max-width:768px) { 
  .rnf-ps { padding:0 38px; } 
  .rnf-ps-nav { width:34px; height:34px; top:34%; } 
}

/* Badges */
.rnf-ps-badge {
  position: absolute; top: 8px; padding: 4px 8px;
  border-radius: 999px; font-size: .78rem; line-height: 1;
  color: #fff; z-index: 1; pointer-events: none; user-select: none;
}
.rnf-ps-badge-sale { left: 8px; background:#e11d48; }
.rnf-ps-badge-heart { right: 8px; background:#a14b68; }

/* Dots (pastilles de progression) */
.rnf-ps-dots {
  display:flex; justify-content:center; gap:8px;
  margin-top: 10px;
}
.rnf-ps-dots .dot {
  width:8px; height:8px; border-radius:999px;
  background:#e6d7df; border:0; padding:0; cursor:pointer;
  transition: transform .2s ease, background-color .2s ease;
}
.rnf-ps-dots .dot.active {
  background:#a14b68; transform: scale(1.25);
}

/* ===== Bouton En voir plus ===== */
.rnf-ps-more-wrap {
  /* CORRECTIF : Padding au lieu de margin pour éviter la barre verticale */
  padding-top: 1rem;
  margin-top: 0;
  display: flex;
  justify-content: flex-end;
  width: 100%;
  box-sizing: border-box;
}
@media (max-width:768px) {
  .rnf-ps-more-wrap { justify-content:center; }
}

.rnf-ps-more {
  display:inline-block;
  background: #f7e6eb; color: #a14b68; border: 1px solid #eac9d5;
  border-radius: 12px; padding: .7rem 1.2rem; font-weight: 600; text-decoration: none;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  transition: background-color .2s ease, border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.rnf-ps-more:hover {
  background: #f3d3df; border-color: #e4b6c8;
  transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.rnf-ps-more:active {
  transform: translateY(0); box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.rnf-ps-more:focus {
  outline: 2px solid rgba(161,75,104,.25); outline-offset: 2px;
}
@media (max-width:480px) {
  .rnf-ps-more { width: 100%; max-width:260px; text-align:center; }
}

/* Variante badge Précommande */
.rnf-ps-badge-preorder {
  top: auto; bottom: 8px; left: 8px;
  background: #111; color: #fff;
}

/* ===== Badges Promo Thème ===== */
.rnf-ps .rnf-ps-thumb { position: relative; }

.rnf-ps .onsale::before,
.rnf-ps [class*="promo"]::before,
.rnf-ps [class*="sale"]::before,
.rnf-ps .onsale,
.rnf-ps [class*="promo"],
.rnf-ps [class*="sale"] {
  position: absolute !important;
  top: 8px; left: 8px; margin: 0 !important;
  border-radius: 999px !important; background: #e11d48 !important; color: #fff !important;
  line-height: 1 !important; z-index: 3;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}

@media (max-width: 768px) {
  .rnf-ps .onsale, .rnf-ps [class*="promo"], .rnf-ps [class*="sale"] {
    padding: 3px 6px !important; font-size: 11px !important;
  }
}
@media (min-width: 769px) and (max-width: 1024px) {
  .rnf-ps .onsale::before, .rnf-ps [class*="promo"]::before, .rnf-ps [class*="sale"]::before,
  .rnf-ps .onsale, .rnf-ps [class*="promo"], .rnf-ps [class*="sale"] {
    padding: 4px 8px !important; font-size: 12px !important;
  }
}
@media (min-width: 1025px) {
  .rnf-ps .onsale::before, .rnf-ps [class*="promo"]::before, .rnf-ps [class*="sale"]::before,
  .rnf-ps .onsale, .rnf-ps [class*="promo"], .rnf-ps [class*="sale"] {
    padding: 5px 9px !important; font-size: 13px !important;
  }
}

.rnf-ps .rnf-ps-badge { z-index: 4; }

/* Icône panier & Prix */
.rnf-ps-price { display:flex; align-items:center; justify-content:center; gap:8px; flex-wrap:wrap; }
.rnf-ps .rnf-ps-cart-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:999px; border:1px solid #eac9d5;
  background:#f7e6eb; color:#a14b68; text-decoration:none;
  transition:transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.rnf-ps .rnf-ps-cart-icon:hover {
  transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.08); background:#f3d3df;
}
.rnf-ps .rnf-ps-cart-ico { font-size:14px; line-height:1; }
.rnf-ps-badge-oos { top:auto; bottom:8px; right:8px; left:auto; background:#6b7280; color:#fff; }

/* Prix promo propres */
.rnf-ps .rnf-ps-price {
  display:flex; align-items:baseline; justify-content:center; gap:10px; flex-wrap:wrap; line-height:1.2;
}
.rnf-ps .rnf-ps-price del {
  order:1; color:#9ca3af; opacity:.95; text-decoration: none; position: relative;
}
.rnf-ps .rnf-ps-price del .amount { position:relative; }
.rnf-ps .rnf-ps-price del .amount::after {
  content:""; position:absolute; left:0; right:0; top:50%; transform:translateY(-50%);
  height:2px; background:#e11d48; border-radius:2px;
}
.rnf-ps .rnf-ps-price ins { order:2; text-decoration:none; color:#2b2112; font-weight:800; }
.rnf-ps .rnf-ps-price .amount { display:inline-flex; align-items:baseline; gap:2px; }

/* Screen Reader Text Hidden (Correctif 9999px inclus) */
.rnf-ps .screen-reader-text {
  position:absolute !important; width:1px !important; height:1px !important;
  padding:0 !important; margin:-1px !important; overflow:hidden !important;
  clip:rect(1px,1px,1px,1px) !important; clip-path:inset(50%) !important;
  border:0 !important; white-space:nowrap !important;
}

/* Icône panier SVG */
.rnf-ps .rnf-ps-cart-icon {
  display:inline-flex; align-items:center; justify-content:center;
  width:28px; height:28px; border-radius:999px;
  background:#f7e6eb; color:#a14b68; border:1px solid #eac9d5;
  text-decoration:none; transition:transform .15s, box-shadow .2s, background-color .2s;
}
.rnf-ps .rnf-ps-cart-icon:hover {
  transform:translateY(-1px); box-shadow:0 4px 12px rgba(0,0,0,.08); background:#f3d3df;
}
.rnf-ps .rnf-ps-cart-ico { display:none !important; }
.rnf-ps .rnf-ps-cart-icon::before {
  content:""; width:16px; height:16px; display:block; background:currentColor;
  -webkit-mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 18a2 2 0 1 0 0 4a2 2 0 0 0 0-4m10 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4M6.2 5l.3 1.5L8 14.2c.1.5.6.8 1.1.8h8.6a1 1 0 0 0 1-.8l1.3-6.6a1 1 0 0 0-1-1.2H7.2L6.8 5zm.8-3l1 2H21a2 2 0 0 1 2 2c0 .1 0 .2-.1.3l-1.3 6.6A3 3 0 0 1 17.7 16H9.1a3 3 0 0 1-3-2.3L4.2 4H2a1 1 0 1 1 0-2z"/></svg>') center / contain no-repeat;
  mask:url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="%23000" d="M7 18a2 2 0 1 0 0 4a2 2 0 0 0 0-4m10 0a2 2 0 1 0 0 4a2 2 0 0 0 0-4M6.2 5l.3 1.5L8 14.2c.1.5.6.8 1.1.8h8.6a1 1 0 0 0 1-.8l1.3-6.6a1 1 0 0 0-1-1.2H7.2L6.8 5zm.8-3l1 2H21a2 2 0 0 1 2 2c0 .1 0 .2-.1.3l-1.3 6.6A3 3 0 0 1 17.7 16H9.1a3 3 0 0 1-3-2.3L4.2 4H2a1 1 0 1 1 0-2z"/></svg>') center / contain no-repeat;
}
@media (max-width: 768px) {
  .rnf-ps .rnf-ps-price { gap:8px; }
  .rnf-ps .rnf-ps-cart-icon { width:26px; height:26px; }
}

/* Style Prix Amount */
.rnf-ps .rnf-ps-price ins .woocommerce-Price-amount.amount {
  font-size: 1.15rem !important;
  color: #2b2112 !important;
  font-weight: 800 !important;
  vertical-align: baseline !important;
}

/* Badge Promo compact */
.rnf-ps .rnf-ps-price ins .woocommerce-Price-amount.amount::before {
  content: "Promo" !important; display: inline-block !important; position: static !important;
  transform: none !important; width: auto !important;
  margin: 0 8px 0 0 !important; padding: 2px 6px !important;
  border-radius: 999px !important; font-size: .72rem !important;
  font-weight: 700 !important; line-height: 1 !important;
  background: #f7e6eb !important; color: #a14b68 !important;
}

/* Ancien prix */
.rnf-ps .rnf-ps-price del {
  color: #9ca3af !important; opacity: .95; text-decoration: none !important; position: relative;
}
.rnf-ps .rnf-ps-price del .amount::after {
  content:""; position:absolute; left:0; right:0; top:50%; transform:translateY(-50%);
  height:2px; background:#e11d48; border-radius:2px;
}

.rnf-ps .rnf-ps-price .rnf-ps-cart-icon { margin-left: 8px; }
.rnf-ps .rnf-ps-price ins { margin-left: 6px; }
.rnf-ps .rnf-ps-actions .rnf-ps-btn + .rnf-ps-btn { margin-left: 8px; }
.rnf-ps .rnf-ps-actions { margin-top: 8px; }
.rnf-ps [dir="rtl"] .rnf-ps-price .rnf-ps-cart-icon { margin-left: 0; margin-right: 8px; }

/* Tabs Styles */
.rnf-tabs .rnf-tab-btn { margin-left:20px; }

/* CORRECTIF FINAL : Inputs radios cachés proprement */
.rnf-tabs input[type=radio] {
    left: 0 !important;
    top: 0 !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    clip: rect(0 0 0 0) !important;
    margin: -1px !important;
    overflow: hidden !important;
}