/*
 Theme Name: Hello Elementor Child
 Theme URI: https://example.com
 Description: Thème enfant pour Hello Elementor
 Author: 123 Agency Web
 Author URI: https://123agencyweb.com
 Template: hello-elementor
 Version: 1.0.0
 Text Domain: hello-elementor-child
*/

/* =========================================================
   WooCommerce > Mon compte > Mes adresses
   Objectif :
   - 2 colonnes desktop (vraies colonnes, pas les floats Woo)
   - mêmes hauteurs
   - cartes fines + fond léger coordonné
   - bouton "Modifier" propre
   - responsive : 1 colonne < 900px
   ========================================================= */

body.woocommerce-account{
  --eb-green: #2e6e3f; /* ajuste si tu veux */
  --eb-gold:  #f4c64d; /* ajuste si tu veux */
  --eb-border: rgba(46,110,63,.22);
  --eb-border-soft: rgba(46,110,63,.14);
  --eb-bg: rgba(244,198,77,.06);
}

/* ============ FORCER LE CONTENEUR EN GRID (écrase les floats) ============ */
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.addresses{
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 22px !important;
  width: 100% !important;
  margin: 18px 0 0 !important;
  align-items: stretch !important;
  justify-items: stretch !important;
  text-align: left !important;
}

/* Neutraliser TOUT ce que Woo/thème fait en "colonnes" legacy */
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses .u-column1,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses .u-column2,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses .col-1,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.col2-set.addresses .col-2,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.addresses .u-column1,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.addresses .u-column2,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.addresses .col-1,
body.woocommerce-account .woocommerce-MyAccount-content .u-columns.woocommerce-Addresses.addresses .col-2{
  float: none !important;
  clear: none !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
}

/* ============ LA CARTE (les 2 blocs) ============ */
body.woocommerce-account .woocommerce-MyAccount-content
.u-columns.woocommerce-Addresses.col2-set.addresses > .woocommerce-Address,
body.woocommerce-account .woocommerce-MyAccount-content
.u-columns.woocommerce-Addresses.addresses > .woocommerce-Address{
  border: 1px solid var(--eb-border) !important;
  border-radius: 16px !important;
  padding: 20px 22px !important;
  background: var(--eb-bg) !important;
  box-sizing: border-box !important;

  display: flex !important;
  flex-direction: column !important;
  min-height: 100% !important;
}

/* Supprime les <p> vides que Woo injecte parfois */
body.woocommerce-account .woocommerce-MyAccount-content
.u-columns.woocommerce-Addresses.addresses > .woocommerce-Address > p:empty,
body.woocommerce-account .woocommerce-MyAccount-content
.u-columns.woocommerce-Addresses.col2-set.addresses > .woocommerce-Address > p:empty{
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* ============ HEADER : titre + bouton ============ */
body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title{
  display: flex !important;
  align-items: flex-start !important;
  justify-content: space-between !important;
  gap: 12px !important;
  flex-wrap: wrap !important;

  margin: 0 0 12px !important;
  padding: 0 0 10px !important;
  border-bottom: 1px solid var(--eb-border-soft) !important;
}

body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title h2{
  margin: 0 !important;
  line-height: 1.1 !important;
  text-align: left !important;
}

body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title p{
  margin: 0 !important;
}

/* Nettoyage des <br> dans le lien "Modifier" */
body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title .edit br{
  display: none !important;
}

/* Bouton "Modifier" : discret + propre */
body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title .edit{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;

  padding: 9px 12px !important;
  border-radius: 999px !important;

  background: transparent !important;
  color: var(--eb-green) !important;
  border: 1px solid rgba(46,110,63,.30) !important;

  font-size: 13px !important;
  font-weight: 700 !important;
  line-height: 1 !important;
  text-decoration: none !important;
  white-space: nowrap !important;

  transition: background .15s ease, border-color .15s ease, transform .15s ease !important;
}

body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title .edit::before{
  content: "✎" !important;
  margin-right: 8px !important;
  opacity: .9 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address-title .edit:hover{
  background: rgba(46,110,63,.08) !important;
  border-color: rgba(46,110,63,.55) !important;
  transform: translateY(-1px) !important;
}

/* ============ CONTENU ADRESSE : mêmes hauteurs ============ */
body.woocommerce-account .woocommerce-MyAccount-content
.woocommerce-Address address{
  margin: 0 !important;
  font-style: normal !important;
  line-height: 1.55 !important;
  flex: 1 1 auto !important; /* clé pour égaliser les cartes */
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px){
  body.woocommerce-account .woocommerce-MyAccount-content
  .u-columns.woocommerce-Addresses.col2-set.addresses,
  body.woocommerce-account .woocommerce-MyAccount-content
  .u-columns.woocommerce-Addresses.addresses{
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-content
  .woocommerce-Address-title{
    flex-direction: column !important;
    align-items: flex-start !important;
  }

  body.woocommerce-account .woocommerce-MyAccount-content
  .woocommerce-Address-title .edit{
    width: 100% !important;
    justify-content: center !important;
  }
}
/* =========================================================
   WooCommerce > Mon compte > Détails du compte (edit-account)
   -> Encadrer le formulaire comme une carte (même style que adresses)
   ========================================================= */

body.woocommerce-account{
  /* si déjà défini ailleurs, pas grave */
  --eb-green: #2e6e3f;
  --eb-gold:  #f4c64d;
  --eb-border: rgba(46,110,63,.22);
  --eb-bg: rgba(244,198,77,.06);
}

/* La "carte" autour du formulaire */
body.woocommerce-account .woocommerce-MyAccount-content form.woocommerce-EditAccountForm,
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account{
  border: 1px solid var(--eb-border) !important;
  border-radius: 16px !important;
  padding: 22px 24px !important;
  background: var(--eb-bg) !important;
  box-sizing: border-box !important;
  max-width: 760px !important;   /* rendu plus premium (pas trop large) */
}

/* Légendes / titres internes */
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account legend{
  font-weight: 800 !important;
  color: var(--eb-green) !important;
  padding: 0 6px !important;
}

/* Champs : un peu plus propres */
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account input[type="text"],
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account input[type="email"],
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account input[type="password"]{
  border-radius: 10px !important;
  border: 1px solid rgba(46,110,63,.20) !important;
  padding: 10px 12px !important;
  background: rgba(255,255,255,.75) !important;
}

/* Focus (important pour l'UX) */
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account input:focus{
  outline: none !important;
  border-color: rgba(46,110,63,.45) !important;
  box-shadow: 0 0 0 3px rgba(46,110,63,.10) !important;
}

/* Bouton "Enregistrer" accordé au thème */
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account button[type="submit"]{
  background: var(--eb-green) !important;
  border: 1px solid var(--eb-green) !important;
  color: #fff !important;
  border-radius: 12px !important;
  padding: 10px 14px !important;
  font-weight: 800 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content form.edit-account button[type="submit"]:hover{
  filter: brightness(0.95) !important;
  transform: translateY(-1px) !important;
}
body.woocommerce-account .woocommerce-MyAccount-content form.edit-account button[type="submit"] {
	margin-top: 25px;
}

/* Responsive : padding réduit + pleine largeur */
@media (max-width: 900px){
  body.woocommerce-account .woocommerce-MyAccount-content form.edit-account{
    padding: 18px 16px !important;
    max-width: 100% !important;
  }
}

.eb-stock{display:inline-block;padding:.35rem .6rem;border-radius:999px;font-weight:600;font-size:.9rem}
.eb-stock--in{background:#e8f5e9}
.eb-stock--low{background:#fff8e1}
.eb-stock--out{background:#ffebee}


/* =========================================================
   FIX MOBILE : image principale qui reste coupée / trop petite
   Neutralise hauteur fixée + overflow + viewport slider
   ========================================================= */
@media (max-width: 767px){

  /* 1) On interdit toute coupe au-dessus de l’image */
  .eb-gallery-main,
  .eb-gallery-main [data-eb-main],
  .eb-gallery [data-eb-main],
  .woocommerce-product-gallery,
  .woocommerce-product-gallery__wrapper,
  .woocommerce-product-gallery__image,
  .woocommerce-product-gallery .flex-viewport,
  .swiper,
  .swiper-wrapper,
  .swiper-slide{
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }


  /* 3) Image : on force l’affichage complet */
  .eb-gallery-main img,
  .woocommerce-product-gallery img,
  .woocommerce-product-gallery__image img{
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    object-position: center center !important;
  }
}

/* Elementor popup close button: keep this fix scoped to the acquisition survey only. */
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-close-button,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-close-button,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .elementor-popup-modal__close,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-lightbox-close-button {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  min-height: 44px !important;
  padding: 0 !important;
  margin: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 50% !important;
  box-sizing: border-box !important;
  cursor: pointer !important;
  z-index: 999999 !important;
  pointer-events: auto !important;
}

.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-close-button i,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-close-button i,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .elementor-popup-modal__close i,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-lightbox-close-button i,
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-close-button svg,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-close-button svg,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .elementor-popup-modal__close svg,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-lightbox-close-button svg {
  pointer-events: none !important;
}

.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap),
.elementor-popup-modal:has(.eb-acq-survey-form-wrap),
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-widget-content,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-widget-content {
  position: relative !important;
}

.elementor-popup-modal .eb-acq-survey-form-wrap,
.dialog-widget.dialog-lightbox-widget .eb-acq-survey-form-wrap {
  position: relative !important;
  z-index: 1 !important;
  padding-top: 8px !important;
  padding-right: 72px !important;
  box-sizing: border-box !important;
}

.elementor-popup-modal .eb-acq-survey-form,
.dialog-widget.dialog-lightbox-widget .eb-acq-survey-form {
  position: relative !important;
  z-index: 1 !important;
}

.elementor-popup-modal .eb-acq-survey-title,
.dialog-widget.dialog-lightbox-widget .eb-acq-survey-title {
  position: relative !important;
  z-index: 1 !important;
  padding-right: 88px !important;
  box-sizing: border-box !important;
}

.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-close-button,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .elementor-popup-modal__close,
.elementor-popup-modal:has(.eb-acq-survey-form-wrap) .dialog-lightbox-close-button,
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-close-button,
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .elementor-popup-modal__close,
.dialog-widget.dialog-lightbox-widget:has(.eb-acq-survey-form-wrap) .dialog-lightbox-close-button,
.eb-acq-native-close {
  z-index: 1000001 !important;
}
