/* =========================================
   BACK IN STOCK NOTIFIER + SWEETALERT POPUP
========================================= */

/* =========================================
   1) FORM del plugin (general)
========================================= */
body .cwginstock-subscribe-form .panel-primary,
body .cwginstock-subscribe-form .cwginstock-panel-primary {
  border-color: #80b700 !important;
  border-radius: 20px !important;
  overflow: hidden !important;
  margin: 0 !important;
  box-shadow: none !important;
}

body .cwginstock-subscribe-form .panel-primary > .panel-heading,
body .cwginstock-subscribe-form .cwginstock-panel-heading {
  background-color: #80b700 !important;
  border-color: #80b700 !important;
  padding: 12px 12px !important;
}

body .cwginstock-subscribe-form .cwginstock-panel-heading h4 {
  color: #fff !important;
  font-weight: 700 !important;
  margin: 0 !important;
}

/* Inputs */
body .cwginstock-subscribe-form .cwginstock-panel-body input[type="text"],
body .cwginstock-subscribe-form .cwginstock-panel-body input[type="email"],
body .cwginstock-subscribe-form .cwginstock-panel-body input[type="tel"] {
  border-radius: 10px !important;
  border: 1px solid #e6e6e6 !important;
  height: 46px !important;
  width: 100% !important;
  text-align: center !important;
  line-height: 1.2 !important;
}

/* =========================================
   2) WhatsApp (intl-tel-input) SOLO en el form
========================================= */
body .cwginstock-subscribe-form .iti {
  width: 100%;
}

/* bloque bandera + prefijo (más angosto) */
body .cwginstock-subscribe-form .iti .iti__country-container {
  width: 44px;
  min-width: 44px;
}

/* botón interno (menos padding) */
body .cwginstock-subscribe-form .iti .iti__selected-country {
  padding: 0 4px;
  background-color: var(--btn-bgcolor, #FFF);
}

/* separación bandera / +54 */
body .cwginstock-subscribe-form .iti .iti__selected-country-primary {
  gap: 4px;
}

/* tamaño del +54 */
body .cwginstock-subscribe-form .iti .iti__selected-dial-code {
  font-size: 13px;
  padding-right: 4px;
}

/* dar más lugar al número */
body .cwginstock-subscribe-form input.cwgstock_phone {
  padding-left: 70px !important;
}

/* =========================================
   3) SweetAlert: CONTENEDOR + ESPACIADOS
========================================= */
/* CONTENEDOR BLANCO */
.swal2-popup {
  border-radius: 20px !important;
  padding: 10px !important;
  box-sizing: border-box;
}

/* Título (tu franja verde grande arriba) */
.swal2-title {
  margin: -10px -10px 10px -10px;
  padding: 30px 20px;
  background: #c6daa6;
  color: #fff !important;
  border-radius: 20px 20px 0 0;
}

/* CONTENIDO INTERNO */
.swal2-html-container {
  margin: 0 !important;
  padding: 0 !important;
}

/* ===== EXPANDIR INPUTS DENTRO DEL POPUP ===== */
.swal2-popup .cwginstock-panel-body {
  padding-left: 10px !important;
  padding-right: 10px !important;
}

/* por si mete columnas bootstrap */
.swal2-popup .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* por si hay un .col-* envolviendo */
.swal2-popup [class*="col-"] {
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* =========================================
   4) Achicar márgenes laterales del panel (borde verde)
========================================= */
.swal2-popup .cwginstock-subscribe-form .panel-primary,
.swal2-popup .cwginstock-subscribe-form .cwginstock-panel-primary {
  margin: 0 10px 10px 10px !important;
  border-radius: 20px !important;
}

/* si el plugin mete padding exagerado dentro */
.swal2-popup .cwginstock-subscribe-form .panel-body,
.swal2-popup .cwginstock-subscribe-form .cwginstock-panel-body {
  padding-left: 20px !important;
  padding-right: 20px !important;
}

/* por si aparece un row con márgenes negativos */
.swal2-popup .cwginstock-subscribe-form .row {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* =========================================
   5) BOTÓN CERRAR (SweetAlert)
========================================= */
.swal2-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 25px !important;
  height: 25px !important;
  border-radius: 8px;
  background: transparent;
  color: #bfbfbf;
  font-size: 25px !important;
  font-weight: 800;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
  transition: all 0.2s ease;
}

/* hover: verde y listo */
.swal2-close:hover {
  color: #c6daa6 !important;
  background: transparent;
  outline: none !important;
  box-shadow: none !important;
}

.swal2-close:focus,
.swal2-close:focus-visible {
  outline: none !important;
  box-shadow: none !important;
}

.swal2-close:active {
  transform: scale(0.9);
}

.swal2-content {
  padding: 0 !important;
}

/* Botón AVISAR STOCK - simple + variable */
body .outofstock input[type="submit"][value*="Avisarme"],
body .woocommerce-variation .out-of-stock + input[type="submit"][value*="Avisarme"] {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 600;
  line-height: 1;
  padding: 10px 6px;
  border-radius: 10px;
  background: #80b700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
  animation: stockPulse 1.2s infinite;
}

/* Hover */
body .outofstock input[type="submit"][value*="Avisarme"]:hover,
body .woocommerce-variation .out-of-stock + input[type="submit"][value*="Avisarme"]:hover {
  background: #80b700;
  color: #000;
}

/* Animación */
@keyframes stockPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(128, 183, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(128, 183, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(128, 183, 0, 0);
  }
}

/* ====== AVISAR STOCK (VARIACIÓN SIN STOCK - PLUGIN) ====== */
.woocommerce div.product .cwg_popup_submit {
  all: unset;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: inherit;
  font-size: clamp(11px, 3vw, 14px);
  font-weight: 600;
  line-height: 1;
  padding: 10px 10px;
  margin-top: 5px;
  border-radius: 10px;
  background: #80b700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  box-sizing: border-box;
  animation: stockPulse 1.2s infinite;
}

/* Hover */
.woocommerce div.product .cwg_popup_submit:hover {
  background: #80b700;
  color: #000;
}

@supports (-webkit-touch-callout: none) {
  body .cwg_popup_submit {
    display: block !important;
    text-align: center !important;
    line-height: 1.2 !important;
  }
}

/* Botón Avisarme cuando haya stock dentro de formulario */
.cwgstock_button {
  background-color: #80b700 !important;
  border-color: #80b700 !important;
  color: #fff !important;
  padding: 14px 26px;
  border-radius: 10px !important;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-transform: none !important;
  letter-spacing: normal !important;
  animation: stockPulse 1.2s infinite;
}

/* Hover */
.cwgstock_button:hover {
  background-color: #6aa000 !important;
  border-color: #6aa000 !important;
  color: #000 !important;
}

/* Error de telefono (Back In Stock) */
body .cwginstock-subscribe-form .sup-cwg-phone-error {
  display: none;
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.3;
  color: #d93025;
  text-align: left;
}

body .cwginstock-subscribe-form input.cwgstock_phone.sup-cwg-phone-invalid {
  border-color: #d93025 !important;
}
