/*
 Theme Name: Divi Child Gignoux
 Theme URI: https://www.elegantthemes.com/gallery/divi/
 Description: Divi Child Theme
 Author: Mathias RIMBAUT
 Author URI:
 Template: Divi
 Version: 1.0.1
*/

/* =Theme customization starts here
------------------------------------------------------- */
/* 1. Vidéo d'en-tête : pas de fond sombre pendant le chargement,
      on voit l'image header.avif à la place */
.et-pb-background-video .mejs-container,
.et-pb-background-video .mejs-mediaelement,
.et-pb-background-video video {
  background: transparent !important;
}

/* 2. Header : cacher la version mobile sur desktop (et l'inverse)
      dès le premier affichage */
@media (min-width: 981px) {
  .et_pb_section_0_tb_header { display: none !important; }
}
@media (max-width: 980px) {
  .et_pb_section_1_tb_header { display: none !important; }
}

/* 3. Icônes du header : taille et couleur dès le départ */
.et-l--header .et_pb_icon_wrap .et-pb-icon {
  font-size: 18px;
  color: #1d1d1f;
}
/* 4. Pop-up « Changement de langue » (WooCommerce Multilingual)
      Apparaît quand le client change de langue avec un panier non vide.
      Les sélecteurs sont préfixés par « body #… » pour passer devant le
      <style> inline que le plugin injecte en bas de page (pas de !important
      nécessaire, et la personnalisation survit aux mises à jour du plugin). */

body #wcml-cart-dialog-wrapper {
  --gx-ink: #1d1d1f;      /* titres */
  --gx-text: #6b6b70;     /* texte courant */
  --gx-dark: #292929;     /* bouton principal */
  --gx-line: #3d3d3d;     /* bouton secondaire (contour) */
  --gx-radius: 16px;      /* arrondi de la carte */

  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 24px;
  background: rgba(29, 29, 31, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  z-index: 999999;
  font-family: "DM Sans", sans-serif;
  animation: gx-fade 0.2s ease-out;
}

body #wcml-cart-dialog-wrapper .wcml-cart-dialog-confirm {
  box-sizing: border-box;
  width: 100%;
  max-width: 480px;
  margin: 0;
  padding: 32px;
  background: #fff;
  border: 0;
  border-radius: var(--gx-radius);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  animation: gx-pop 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

body #wcml-cart-dialog-wrapper .wcml-cart-dialog-title {
  margin: 0 0 12px;
  padding: 0;
  border: 0;
  color: var(--gx-ink);
  font-size: 22px;
  font-weight: 600;
  line-height: 1.25;
}

body #wcml-cart-dialog-wrapper .wcml-cart-dialog-content {
  margin: 0 0 28px;
  padding: 0;
  color: var(--gx-text);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.6;
}

body #wcml-cart-dialog-wrapper .wcml-cart-dialog-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  text-align: right;
}

/* Boutons : pilule comme sur le reste du site */
body #wcml-cart-dialog-wrapper .wcml-cart-dialog-buttons button {
  margin: 0;
  min-height: 44px;
  padding: 10px 22px;
  border: 1px solid var(--gx-line);
  border-radius: 30px;
  box-shadow: none;
  background: transparent;
  color: #363636;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

/* « Rester en anglais » : contour (action qui vide le panier) */
body #wcml-cart-dialog-wrapper #wcml-cart-dialog-switch:hover,
body #wcml-cart-dialog-wrapper #wcml-cart-dialog-switch:focus {
  background: #f4f4f5;
  color: var(--gx-ink);
}

/* « Revenir au français » : bouton plein (action qui garde le panier) */
body #wcml-cart-dialog-wrapper #wcml-cart-dialog-stay {
  background: var(--gx-dark);
  border-color: var(--gx-dark);
  color: #fff;
}
body #wcml-cart-dialog-wrapper #wcml-cart-dialog-stay:hover,
body #wcml-cart-dialog-wrapper #wcml-cart-dialog-stay:focus {
  background: #000;
  border-color: #000;
  color: #fff;
}

body #wcml-cart-dialog-wrapper .wcml-cart-dialog-buttons button:focus-visible {
  outline: 2px solid var(--gx-ink);
  outline-offset: 2px;
}

/* Mobile : boutons empilés pleine largeur, le bouton plein en premier */
@media (max-width: 480px) {
  body #wcml-cart-dialog-wrapper { padding: 16px; }
  body #wcml-cart-dialog-wrapper .wcml-cart-dialog-confirm { padding: 24px; }
  body #wcml-cart-dialog-wrapper .wcml-cart-dialog-title { font-size: 20px; }
  body #wcml-cart-dialog-wrapper .wcml-cart-dialog-buttons {
    flex-direction: column-reverse;
    gap: 10px;
  }
  body #wcml-cart-dialog-wrapper .wcml-cart-dialog-buttons button { width: 100%; }
}

@keyframes gx-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes gx-pop {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  body #wcml-cart-dialog-wrapper,
  body #wcml-cart-dialog-wrapper .wcml-cart-dialog-confirm { animation: none; }
}
