/**
 * Smart River — fiche produit : informations (KAN-27)
 *
 * En-tête (catalog/_partials/sr-product-header.tpl) : marque, nom, référence, EAN, stock, quantité minimale ;
 * description courte ; arguments B2B ; bloc de réassurance (module blockreassurance).
 * Chargé uniquement sur la page produit (config/theme.yml > assets > css > product), après product-page.css
 * dont il réutilise les variables --sr-pp-*. Règles limitées à #main.sr-product .sr-product__info.
 * Script : assets/js/product-info.js (mise à jour au changement de déclinaison).
 */

/* ------------------------------------------------------------------ en-tête */

#main.sr-product .sr-pinfo {
  margin-bottom: 1.25rem;
}

/* marque : logo + nom, lien vers la page de la marque */
#main.sr-product .sr-pinfo__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: var(--sr-pp-muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color var(--sr-pp-transition);
}

#main.sr-product .sr-pinfo__brand:hover {
  color: var(--sr-pp-ink);
  text-decoration: none;
}

#main.sr-product .sr-pinfo__brand-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0.25rem;
  border: 0;
  border-radius: 6px;
  background: var(--sr-pp-surface);
}

#main.sr-product .sr-pinfo__brand-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#main.sr-product .sr-pinfo__brand-name {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

#main.sr-product .sr-pinfo__brand:not(:has(.sr-pinfo__brand-logo)) .sr-pinfo__brand-name::before {
  content: "";
  width: 1.25rem;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--sr-pp-accent), var(--sr-pp-energy));
}

#main.sr-product .sr-pinfo__title {
  margin: 0 0 0.75rem;
  color: var(--sr-pp-text);
  font-size: clamp(1.5rem, 1.1rem + 1.15vw, 2.125rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: none;
}

/* référence · EAN · stock · minimum */
#main.sr-product .sr-pinfo__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--sr-pp-muted);
  font-size: 0.8125rem;
}

#main.sr-product .sr-pinfo__meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

#main.sr-product .sr-pinfo__meta-item[hidden] {
  display: none;
}

/* séparateur discret entre les éléments visibles */
#main.sr-product .sr-pinfo__meta-item:not([hidden]) ~ .sr-pinfo__meta-item:not([hidden])::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 0.75rem;
  border-radius: 50%;
  background: var(--sr-pp-border);
}

#main.sr-product .sr-pinfo__meta-item strong {
  color: var(--sr-pp-text);
  font-weight: 700;
}

#main.sr-product .sr-pinfo__meta-item--stock .sr-stock {
  font-size: 0.8125rem;
}

/* ------------------------------------------------------------------ description courte */

#main.sr-product .sr-product__info .product-information > .product-description {
  margin: 0 0 1.5rem;
  color: var(--sr-pp-description-text);
  font-size: .9375rem;
  line-height: 1.7;
}

#main.sr-product .sr-product__info .product-information > .product-description p,
#main.sr-product .sr-product__info .product-information > .product-description li {
  color: inherit;
  font-size: inherit;
}

#main.sr-product .sr-product__info .product-information > .product-description p:last-child {
  margin-bottom: 0;
}

#main.sr-product .sr-product__info .product-information > .product-description ul {
  padding-left: 1.25rem;
  list-style: disc;
}

#main.sr-product .sr-product__info .product-information > .product-description li::marker {
  color: var(--sr-pp-accent);
}

/* ------------------------------------------------------------------ arguments B2B */

#main.sr-product .sr-pinfo__trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1.25rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
}

#main.sr-product .sr-pinfo__trust li {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  color: var(--sr-pp-muted);
  font-size: 0.8125rem;
  font-weight: 700;
}

#main.sr-product .sr-pinfo__trust li::before {
  content: "✓";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--sr-pp-accent);
  color: var(--sr-pp-on-accent);
  font-size: 0.6875rem;
  font-weight: 800;
  line-height: 1;
}

/* ------------------------------------------------------------------ réassurance (module blockreassurance) */

#main.sr-product .blockreassurance_product {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 0;
}

#main.sr-product .blockreassurance_product > .clearfix {
  display: none;
}

/* carte : icône en haut, titre et texte centrés (adapté aux cartes étroites) */
#main.sr-product .blockreassurance_product > div:not(.clearfix) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  margin: 0;
  padding: 1rem 0.75rem;
  border: 1px solid var(--sr-pp-border);
  border-radius: var(--sr-pp-radius-sm);
  background: var(--sr-pp-soft-bg);
  text-align: center;
}

#main.sr-product .blockreassurance_product .item-product {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin: 0 0 0.25rem;
  border-radius: 50%;
  background: var(--sr-pp-accent-soft);
  font-size: 0;
}

#main.sr-product .blockreassurance_product .item-product img,
#main.sr-product .blockreassurance_product .item-product svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* icônes à la couleur d'accent (le module injecte un SVG coloré en ligne) */
#main.sr-product .blockreassurance_product .item-product svg path,
#main.sr-product .blockreassurance_product .item-product svg circle,
#main.sr-product .blockreassurance_product .item-product svg rect,
#main.sr-product .blockreassurance_product .item-product svg polygon {
  fill: var(--sr-pp-accent) !important;
}

#main.sr-product .blockreassurance_product .block-title {
  color: var(--sr-pp-text) !important;
  font-size: 0.8125rem;
  font-weight: 800;
  line-height: 1.3;
}

#main.sr-product .blockreassurance_product p {
  margin: 0.125rem 0 0;
  color: var(--sr-pp-muted) !important;
  font-size: 0.75rem;
  line-height: 1.4;
}

@media (max-width: 767px) {
  #main.sr-product .sr-pinfo__meta {
    gap: 0.375rem 0.75rem;
  }

  #main.sr-product .sr-pinfo__meta-item:not([hidden]) ~ .sr-pinfo__meta-item:not([hidden])::before {
    margin-right: 0.5rem;
  }

  /* mobile : une carte par ligne, icône à gauche */
  #main.sr-product .blockreassurance_product {
    grid-template-columns: 1fr;
  }

  #main.sr-product .blockreassurance_product > div:not(.clearfix) {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0.75rem;
    align-items: center;
    text-align: left;
  }

  #main.sr-product .blockreassurance_product .item-product {
    grid-row: span 2;
    margin: 0;
  }
}

/* Fiche produit: visibility only, independent of miniatures and quick view.
   The parent flags survive PrestaShop's AJAX replacement of product fragments. */
#main.sr-product--hide-brand .sr-pinfo__brand,
#main.sr-product--hide-brand .product-manufacturer,
#main.sr-product--hide-reference [data-sr-meta="ref"],
#main.sr-product--hide-reference .product-reference,
#main.sr-product--hide-short_description [id^="product-description-short-"],
#main.sr-product--hide-old_price .product-prices .product-discount,
#main.sr-product--hide-discount .product-prices .discount,
#main.sr-product--hide-discount .product-discounts,
#main.sr-product--hide-discount .product-flags .discount,
#main.sr-product--hide-tax .sr-product-tax-label,
#main.sr-product--hide-tax .product-without-taxes,
#main.sr-product--hide-unit_price .product-unit-price,
#main.sr-product--hide-stock [data-sr-meta="stock"],
#main.sr-product--hide-stock #product-availability,
#main.sr-product--hide-quantity .product-add-to-cart>.control-label,
#main.sr-product--hide-quantity .product-add-to-cart .product-quantity>.qty,
#main.sr-product--hide-add_to_cart .product-add-to-cart .product-quantity>.add,
#main.sr-product--hide-add_to_cart .sr-sticky-buy,
#main.sr-product--hide-description .sr-ptabs .nav-item:has(a[href="#description"]),
#main.sr-product--hide-description #description,
#main.sr-product--hide-description .sr-tab-toggle[aria-controls="description"],
#main.sr-product--hide-features .sr-ptabs .nav-item:has(a[href="#product-details"]),
#main.sr-product--hide-features #product-details,
#main.sr-product--hide-features .sr-tab-toggle[aria-controls="product-details"],
#main.sr-product--hide-attachments .sr-ptabs .nav-item:has(a[href="#attachments"]),
#main.sr-product--hide-attachments #attachments,
#main.sr-product--hide-attachments .sr-tab-toggle[aria-controls="attachments"],
#main.sr-product--hide-accessories .product-accessories{display:none!important}

/* Compact reassurance, retaining the module's content and appearance colours. */
#main.sr-product .sr-product__info .sr-reassurance--product{margin:16px 0;padding:16px 0 0;gap:14px;border-top:1px solid var(--sr-pp-border)}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{padding:0;border-radius:0;background:transparent;border:0;gap:10px;box-shadow:none}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon{flex:0 0 22px;width:22px;height:24px;min-width:22px;border-radius:0;background:transparent;box-shadow:none}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon svg,
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon img{width:20px;height:20px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__title{font-size:11px;font-weight:650;line-height:1.4;letter-spacing:.02em}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__text{font-size:12px;line-height:1.5;margin-top:0}

#main.sr-product .sr-pinfo__meta-item[data-sr-meta="ref"],
#main.sr-product .sr-pinfo__meta-item[data-sr-meta="ref"] strong{font-size:11px;font-weight:500;color:var(--sr-pp-muted)}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item::after{display:none}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__content{gap:3px;padding-top:0}

/* Product status colours override the shared miniature stock indicator only here. */
#main.sr-product .sr-stock--in{color:var(--sr-pp-success)}
#main.sr-product .sr-stock--out{color:var(--sr-pp-danger)}
#main.sr-product .sr-stock--order{color:var(--sr-pp-warning)}

/* Reassurance spans the purchase column, with height adapting to its width/content. */
#main.sr-product .sr-product__info .sr-reassurance--product{width:100%;max-width:none;grid-template-columns:minmax(0,1fr);justify-items:stretch;container-type:inline-size}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{width:100%;max-width:none;box-sizing:border-box;align-items:center;min-height:52px;min-height:clamp(52px,8cqi,72px);height:auto;padding:8px 0}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__content{flex:1 1 auto;min-width:0}

/* Readable reassurance proportions within the full purchase-column width. */
#main.sr-product .sr-product__info .sr-reassurance--product{gap:8px;padding-top:16px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{min-height:64px;height:auto;padding:10px 0;gap:14px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon{flex:0 0 36px;width:36px;min-width:36px;height:36px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon :is(svg,img){width:30px;height:30px;max-width:30px;max-height:30px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__title{font-size:13px;font-weight:650;line-height:1.4;letter-spacing:0}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__text{font-size:13px;line-height:1.5}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__content{gap:4px}
@media(max-width:767px){
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{gap:12px;padding:8px 0}
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon{flex-basis:32px;width:32px;min-width:32px;height:32px}
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon :is(svg,img){width:26px;height:26px;max-width:26px;max-height:26px}
}

/* Reassurance cards matching the supplied reference. */
#main.sr-product .sr-product__info .sr-reassurance--product{margin:24px 0;padding:0;border-top:0;gap:14px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{width:100%;min-height:86px;height:auto;align-items:flex-start;padding:17px 16px;gap:14px;border:1px solid var(--sr-pp-border);border-radius:18px;background:var(--sr-pp-soft-bg);box-shadow:none}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon{flex:0 0 50px;width:50px;min-width:50px;height:50px;border-radius:16px;background:var(--sr-rea-soft,var(--sr-pp-accent-soft));color:var(--sr-rea-accent,var(--sr-pp-accent));box-shadow:none}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon :is(svg,img){width:30px;height:30px;max-width:30px;max-height:30px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__content{gap:6px;padding-top:2px}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__title{font-size:13px;font-weight:800;line-height:1.4;letter-spacing:.015em}
#main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__text{font-size:13px;line-height:1.6}
@media(max-width:767px){
 #main.sr-product .sr-product__info .sr-reassurance--product{gap:12px}
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__item{min-height:80px;padding:14px;gap:12px;border-radius:16px}
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon{flex-basis:44px;width:44px;min-width:44px;height:44px;border-radius:14px}
 #main.sr-product .sr-product__info .sr-reassurance--product .sr-reassurance__icon :is(svg,img){width:27px;height:27px;max-width:27px;max-height:27px}
}
