/* =========================
   Variables (se sobreescriben desde Ajustes del plugin)
========================= */
:root{
  --mohs-vb-bg: #ffffff;
  --mohs-vb-bg-hover: #94D3D1;
  --mohs-vb-text: #111111;
  --mohs-vb-border: #111111;

  --mohs-vb-selected-bg: #111111;
  --mohs-vb-selected-text: #ffffff;

  --mohs-vb-disabled-opacity: 0.55;
  --mohs-vb-x-color: #e11d48;
}

/* =========================
   Base
========================= */
.mohs-vb-wrap{
  margin-top: 12px;
}

.mohs-vb-title{
  font-weight: 700;
  margin-bottom: 8px;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .4px;
}

.mohs-vb-items{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
/* ✅ ARCHIVE / RELATED: centrar tallas */
.mohs-vb-archive .mohs-vb-items{
  justify-content: center;
}


/* Base de botón/etiqueta */
.mohs-vb-swatch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--mohs-vb-border);
  border-radius: 999px;
  background: var(--mohs-vb-bg);
  color: var(--mohs-vb-text);
  position:relative;
  font-size: 14px;
  line-height: 1;
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .05s ease;
}

/* Single: botones */
button.mohs-vb-swatch{
  cursor:pointer;
  user-select:none;
}

button.mohs-vb-swatch:hover{
  background: var(--mohs-vb-bg-hover);
}

/* Seleccionado */
button.mohs-vb-swatch.is-selected{
  background: var(--mohs-vb-selected-bg);
  color: var(--mohs-vb-selected-text);
  border-color: var(--mohs-vb-selected-bg);
  outline: none;
}

/* Disabled */
.mohs-vb-swatch.is-disabled{
  opacity: var(--mohs-vb-disabled-opacity);
}

button.mohs-vb-swatch.is-disabled{
  cursor:not-allowed;
}

/* X roja */
.mohs-vb-swatch.is-disabled::after{
  content:"";
  position:absolute;
  inset:7px;
  border-radius:999px;
  background:
    linear-gradient(45deg, transparent 46%, var(--mohs-vb-x-color) 47%, var(--mohs-vb-x-color) 53%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, var(--mohs-vb-x-color) 47%, var(--mohs-vb-x-color) 53%, transparent 54%);
  pointer-events:none;
}

/* =========================
   SINGLE: Ocultar select nativo (sin eliminarlo)
   Marcamos el form con .mohs-vb-enabled desde JS
========================= */
.single-product form.variations_form.mohs-vb-enabled table.variations select[name^="attribute_"]{
  position:absolute !important;
  left:-9999px !important;
  width:1px !important;
  height:1px !important;
  opacity:0 !important;
  pointer-events:none !important;
}

/* Como SOLO hay 1 atributo por producto, ocultamos la fila completa para evitar duplicados */
.single-product form.variations_form.mohs-vb-enabled table.variations tr{
  display:none !important;
}

/* =========================
   ARCHIVE / RELATED: compacto
========================= */
.mohs-vb-archive .mohs-vb-swatch{
  transform: scale(.92);
}

/* =========================
   FIX: Layout Add to cart cuando ocultamos el selector
   (Evita botón raro / descolocado)
========================= */
.single-product form.variations_form.cart{
  display:block;
  width:100%;
}

.single-product .single_variation_wrap{
  width:100%;
}

/* ✅ SINGLE: Queremos columnas: tallas arriba, botón debajo */
.single-product .woocommerce-variation-add-to-cart,
.single-product .variations_button{
  display:flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  gap: 12px;
  width:100%;
  margin-top: 12px;
}

/* El bloque de tallas ocupa todo el ancho */
.single-product .variations_button .mohs-vb-wrap{
  width: 100%;
}

/* Botón debajo y alineado a la izquierda (desktop) */
.single-product .variations_button .single_add_to_cart_button{
  width: auto;
  min-width: 220px;
  margin: 0 !important;
}


.single-product .variations_button .quantity{
  margin: 0 !important;
}

.single-product .variations_button .single_add_to_cart_button{
  width: auto;
  min-width: 220px;
  padding: 12px 18px;
  line-height: 1.1;
}

/* Si el tema/elementor fuerza comportamientos raros, esto estabiliza */
.single-product .variations_button button,
.single-product .variations_button input,
.single-product .variations_button a{
  max-width: 100%;
}

@media (max-width: 767px){
  /* En móvil: todo a 100% y centrado visualmente */
  .single-product .woocommerce-variation-add-to-cart,
  .single-product .variations_button{
    align-items: stretch !important;
  }

  .single-product .variations_button .mohs-vb-items{
    justify-content: center;
  }

  .single-product .variations_button .single_add_to_cart_button{
    width: 100%;
    min-width: 0;
  }
}
/* =========================================
   SINGLE (Elementor/tema): tallas arriba, botón debajo
   ========================================= */

/* Fuerza que el bloque de add-to-cart sea flex en columna */
.single-product form.variations_form.mohs-vb-enabled .woocommerce-variation-add-to-cart,
.single-product form.variations_form.mohs-vb-enabled .variations_button{
  display: flex !important;
  flex-direction: column !important;
  align-items: flex-start !important;
  width: 100% !important;
  gap: 12px !important;
}

/* El bloque de tallas SIEMPRE ocupa una línea completa */
.single-product form.variations_form.mohs-vb-enabled .variations_button .mohs-vb-wrap{
  width: 100% !important;
  flex: 0 0 100% !important;
}

/* Y el contenedor de los botones de tallas puede centrarse si quieres */
.single-product form.variations_form.mohs-vb-enabled .mohs-vb-items{
  justify-content: flex-start;
}

/* Quantity y botón: debajo, sin saltos raros */
.single-product form.variations_form.mohs-vb-enabled .variations_button .quantity{
  margin: 0 !important;
}

.single-product form.variations_form.mohs-vb-enabled .variations_button .single_add_to_cart_button{
  width: auto !important;
  min-width: 220px !important;
  margin: 0 !important;
  align-self: flex-start !important;
}

/* Responsive móvil: centramos tallas y botón a 100% */
@media (max-width: 767px){
  .single-product form.variations_form.mohs-vb-enabled .variations_button{
    align-items: stretch !important;
  }

  .single-product form.variations_form.mohs-vb-enabled .mohs-vb-items{
    justify-content: center !important;
  }

  .single-product form.variations_form.mohs-vb-enabled .variations_button .single_add_to_cart_button{
    width: 100% !important;
    min-width: 0 !important;
  }
}ç
/* =========================================
   ARCHIVE / RELATED: centrar swatches
   ========================================= */

.mohs-vb-wrap.mohs-vb-archive{
  width: 100% !important;
  text-align: center;
}

.mohs-vb-wrap.mohs-vb-archive .mohs-vb-items{
  justify-content: center !important;
}
.single-product form.variations_form.mohs-vb-enabled .single_add_to_cart_button{
  float: none !important;
}
/* ==============================
   Estilo botón Añadir al carrito
   ============================== */

.single-product form.variations_form.mohs-vb-enabled .single_add_to_cart_button{
  background-color: #7fb8b6 !important;   /* color normal */
  border-color: #7fb8b6 !important;
  color: #ffffff !important;
}

.single-product form.variations_form.mohs-vb-enabled .single_add_to_cart_button:hover{
  background-color: #94D3D1 !important;   /* color hover */
  border-color: #94D3D1 !important;
  color: #ffffff !important;
}

.single-product form.variations_form.mohs-vb-enabled .single_add_to_cart_button:disabled{
  background-color: #94D3D1 !important;
  border-color: #94D3D1 !important;
  cursor: not-allowed;
}
