/* Panier, Commande, Mon compte (18/11/2026). Chargé par le thème enfant sur ces trois pages, après
   le CSS du bloc Panier de WooCommerce. Les variables du site (--gold, --gris, --big-space…) sont
   déjà dans la page (variables globales de Bricks).
   Les styles WooCommerce de Bricks sont dans @layer bricks : une règle hors couche les remplace sans
   !important. Le CSS des blocs de WooCommerce n'est pas en couche : là, spécificité et quelques
   !important de WooCommerce à battre.
   Panier : bloc Panier de WooCommerce gardé tel quel, habillé comme Croze (../nicolas-croze,
   panier.css) aux couleurs du site. Balisage relevé sur WooCommerce 11.3 : à revoir après une grosse
   mise à jour de WooCommerce. Le bloc change de mise en page selon sa propre largeur (is-large,
   is-medium, is-small, is-mobile sur .wc-block-cart), pas selon l'écran. */

/* ---- Mon compte et Panier : de l'air sous l'en-tête et au-dessus du pied ----
   Leurs sections Bricks n'ont pas de marge (Mon compte annule celles de sa classe) : le contenu
   collait à l'en-tête et au pied dès qu'il dépassait la hauteur minimale. */
:is(.woocommerce-account, .woocommerce-cart) #brx-content > .brxe-section {
  padding-block: var(--big-space);
}
@media (max-width: 478px) {
  :is(.woocommerce-account, .woocommerce-cart) #brx-content > .brxe-section { padding-block: var(--medium-space); }
}

/* ---- Commande : « Commander avec obligation de paiement » moins haut, de l'air au-dessus ---- */
.woocommerce-checkout #place_order {
  display: block;
  width: 100%;
  margin-top: var(--small-space);
  padding: 0.7em 1.2em;
  border-radius: var(--radius-btn);
  line-height: 1.3;
  text-wrap: balance;
}
/* bouteille devant le nom, dans le récapitulatif (boutique/panier.php) ; 48 → 144 px (Nino, 18/11/2026) ;
   flottante : nom et quantité à sa droite, la cellule de tableau la contient */
.woocommerce-checkout .l4v-recap-image {
  float: left;
  width: auto;
  height: 144px;
  margin-inline-end: 0.8em;
}

/* ---- Panier ---- */
/* le bloc porte .alignwide, que Bricks élargit à 120 % du conteneur (margin-left: -10 %) : ramené à
   la largeur du panier d'origine (80 % de l'écran, celle de « Mon compte »), pleine largeur sur mobile */
.woocommerce-cart .wp-block-woocommerce-cart.alignwide {
  width: 100%;
  max-width: 100%;
  margin-inline: auto;
  @media (min-width: 479px) { width: 80vw; }
}
.woocommerce-cart .wp-block-woocommerce-cart {
  font-family: 'Montserrat', Helvetica, Arial, sans-serif;
  color: #000;

  & :is(table.wc-block-cart-items, table.wc-block-cart-items th, table.wc-block-cart-items td,
        .wc-block-components-totals-wrapper, .wp-block-woocommerce-cart-order-summary-block,
        .wc-block-cart__totals-title) {
    border-color: var(--gris) !important; /* WooCommerce : filets en !important */
  }
  /* intitulés des colonnes et du récapitulatif : petites capitales espacées, dorées */
  & :is(.wc-block-cart-items__header, .wc-block-cart__totals-title) {
    font-size: 0.85em !important; /* WooCommerce : 0.875em en !important sur le titre */
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--gold);
  }

  /* lignes : bouteille entière (image medium, boutique/panier.php), nom en EB Garamond comme les vins */
  & .wc-block-cart-item__image a { display: flex; justify-content: center; }
  & .wc-block-cart-item__image img {
    width: auto !important; /* WooCommerce : 100 % de la colonne */
    max-width: none;
    height: 120px;
    object-fit: contain;
  }
  & .wc-block-components-product-name {
    font-family: 'EB Garamond', Georgia, serif;
    font-size: 1.25em;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-decoration: none;
    color: #000;
  }
  & .wc-block-components-product-metadata p { margin: 0; }

  /* quantité − 3 + : pilule dorée */
  & .wc-block-components-quantity-selector {
    width: auto !important; /* WooCommerce : largeur fixe */
    min-width: 0;
    border: 1px solid var(--gold);
    border-radius: var(--radius-btn);
    overflow: hidden;
    &::after { display: none; } /* WooCommerce : second cadre gris */
  }
  & .wc-block-components-quantity-selector__button { color: var(--gold); opacity: 1; }
  & .wc-block-components-quantity-selector__button:disabled { opacity: 0.35; }
  & .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
    width: 2.6em;
    font-weight: 600;
    color: #000;
  }
  & .wc-block-cart-item__remove-link { color: #000; opacity: 0.6; }

  /* récapitulatif : total en grand */
  & .wc-block-components-totals-footer-item :is(.wc-block-components-totals-item__label, .wc-block-components-totals-item__value) {
    font-size: 1.25em;
    font-weight: 600;
  }

  /* « Valider la commande » : bouton doré du site (Theme Style : fond doré, texte blanc, inversé au survol) */
  & .wc-block-cart__submit-button {
    min-height: 0;
    padding: 0.7em 1.4em;
    border: 1px solid var(--gold);
    border-radius: var(--radius-btn);
    background: var(--gold);
    color: #fff;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    box-shadow: none;
    transition: var(--quick-transition);
    &:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }
  }
  & .wc-block-cart__submit-container--sticky { background: #fff; }

  @media (hover: hover) and (pointer: fine) {
    & :is(.wc-block-cart-item__remove-link, .wc-block-components-product-name):hover { color: var(--gold); opacity: 1; }
    & .wc-block-cart__submit-button:hover { background: #fff; color: var(--gold); }
  }

  /* messages : cadre doré, fond blanc ; erreurs en rouge */
  & .wc-block-components-notice-banner {
    border: 1px solid var(--gold);
    border-radius: 0;
    background: #fff;
    color: #000;
    & > svg { background: var(--gold); fill: #fff; }
    &.is-error { border-color: #b3261e; color: #b3261e; }
    &.is-error > svg { background: #b3261e; }
    /* pas de croix sur les erreurs : fermée, l'erreur laissait passer « Valider la commande » (Croze) */
    &.is-error .wc-block-components-notice-banner__dismiss { display: none; }
  }
  /* erreurs au clic seulement (js/panier-valider.js) */
  &:not(.l4v-valider-tente) .wc-block-components-notices .wc-block-components-notice-banner.is-error { display: none; }

  /* rappel sous « Valider la commande » (boutique/panier.php) */
  & .l4v-rappel {
    margin: var(--small-space) 0 0;
    font-size: 0.9em;
    line-height: 1.6;
    text-align: center;
  }
}

/* ---- Panier vide (bloc) : message et bouton natifs de WooCommerce, aux couleurs du site ; le
   séparateur et « Nouveau dans la boutique » sont retirés du contenu de la page Panier ---- */
.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--medium-space);
  padding-block: var(--medium-space);
  & h2 {
    margin: 0;
    font-family: 'EB Garamond', Georgia, serif;
    font-size: var(--title-font-size);
    font-weight: 400;
    letter-spacing: var(--title-letter-spacing);
    text-transform: uppercase;
    color: #000;
  }
  & .wp-block-button__link {
    padding: 0.7em 1.4em;
    border: 1px solid var(--gold);
    border-radius: var(--radius-btn);
    background: var(--gold);
    color: #fff;
    font-weight: 500;
    line-height: 1.3;
    text-decoration: none;
    transition: var(--quick-transition);
  }
  @media (hover: hover) and (pointer: fine) {
    & .wp-block-button__link:hover { background: #fff; color: var(--gold); }
  }
}

/* ---- Renoncer au contrat (legal/retractation.php du kit, code court [renoncer_au_contrat]) ----
   Formulaire, récapitulatif et accusé à la largeur d'un texte, centrés ; libellés en noir (Bricks :
   gris pâle) ; « Modifier » en simple lien. Repris de Croze (pages.css). */
.kit-retractation {
  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  margin-inline: auto;
  padding: var(--big-space) 1.5rem;
  line-height: 1.7;
  color: #000;
  & > p:first-child, & > .woocommerce-message + p { margin-bottom: var(--inter-space-1); }
  & .form-row { margin: 0 0 1.2rem; }
  & .form-row label { display: block; margin-bottom: 0.3rem; color: #000; font-weight: 500; }
  & .required { color: var(--gold); text-decoration: none; }
  & .kit-retractation__erreur { display: block; margin-top: 0.3rem; font-size: 0.9em; color: #b3261e; }
  & .woocommerce-invalid .input-text { border-color: #b3261e; }
  & :is(.woocommerce-message, .woocommerce-error) { margin-bottom: var(--inter-space-1); }
  & .kit-retractation__tableau { width: 100%; margin: 0 0 var(--inter-space-1); }
  & .kit-retractation__tableau :is(th, td) { padding: 0.5rem 0.75rem 0.5rem 0; border-bottom: 1px solid var(--gris); vertical-align: top; }
  & .kit-retractation__tableau th { font-weight: 600; white-space: nowrap; }
  & .kit-retractation__modifier {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    cursor: pointer;
  }
  @media (max-width: 478px) { padding-block: var(--medium-space); }
}
