.maryon-mvs-preview-list,
.maryon-mvs-modal-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.maryon-mvs-item {
  padding: 10px;
  border: 1px solid #ccc;
  text-align: center;
  cursor: pointer;
  user-select: none;
}

.maryon-mvs-item.active {
  border-color: #000;
  background: #f5f5f5;
}

.maryon-mvs-item.out {
  opacity: .4;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Preview: cuando se completan las 7 opciones con sin stock, mostrar el "circulito tachado" */
.maryon-mvs-preview .maryon-mvs-item.out{
  position: relative;
  overflow: visible;
}
.maryon-mvs-preview .maryon-mvs-item.out .maryon-mvs-swatch,
.maryon-mvs-preview .maryon-mvs-item.out .swatch-term{
  position: relative;
}
.maryon-mvs-preview .maryon-mvs-item.out .maryon-mvs-swatch::before,
.maryon-mvs-preview .maryon-mvs-item.out .maryon-mvs-swatch::after,
.maryon-mvs-preview .maryon-mvs-item.out .swatch-term::before,
.maryon-mvs-preview .maryon-mvs-item.out .swatch-term::after{
  content: "";
  position: absolute;
  left: -8%;
  top: 50%;
  width: 116%;
  height: 2px;
  background: #d40000;
  opacity: 0.85;
  pointer-events: none;
}
.maryon-mvs-preview .maryon-mvs-item.out .maryon-mvs-swatch::before,
.maryon-mvs-preview .maryon-mvs-item.out .swatch-term::before{ transform: translateY(-50%) rotate(35deg); }
.maryon-mvs-preview .maryon-mvs-item.out .maryon-mvs-swatch::after,
.maryon-mvs-preview .maryon-mvs-item.out .swatch-term::after{ transform: translateY(-50%) rotate(-35deg); }

.maryon-mvs-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  display: none;
  z-index: 9999;
}

.maryon-mvs-modal.open {
  display: flex;
  align-items: center;
  justify-content: center;
}

.maryon-mvs-modal-content {
  background: #f2f2f2;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 15px;
}

.maryon-mvs-selected .maryon-mvs-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.maryon-mvs-row .qty {
  display: flex;
  gap: 5px;
}

.maryon-mvs-row button {
  cursor: pointer;
}


/* Modal inner layout + close */
.maryon-mvs-modal-inner{
  background:#fff;
  width:min(720px, calc(100% - 40px));
  max-height:calc(100vh - 80px);
  overflow:auto;
  border-radius:12px;
  padding:18px 18px 16px;
  box-shadow:0 12px 40px rgba(0,0,0,.25);
  position:relative;
}
.maryon-mvs-modal-header{
  font-weight:700;
  margin:0 40px 12px 0;
}
.maryon-mvs-modal-close{position:absolute;top:14px;right:16px;line-height:1;font-size:22px;color:#000;background:transparent !important;border:0;padding:0;cursor:pointer;}
.maryon-mvs-modal-close:hover{ opacity:1; }
.maryon-mvs-modal-actions{
  display:flex;
  justify-content:flex-end;
  gap:10px;
  margin-top:14px;
}


/* MVS: forzar estado "clickable" del botón nativo cuando hay selecciones */
.single_add_to_cart_button.maryon-mvs-ready,
.single_add_to_cart_button.maryon-mvs-ready:hover {
  cursor: pointer !important;
}


/* Theme swatches inside MVS */
.maryon-mvs-item.has-swatch{background:transparent;padding:0;border:none;}
.maryon-mvs-item.has-swatch .maryon-mvs-swatch{display:inline-block;}
.maryon-mvs-item.has-swatch{cursor:pointer;}
.maryon-mvs-preview-list .maryon-mvs-item.has-swatch{margin-right:3px;}


/* --- Swatches: respetar estilo del theme (círculos + tooltip) --- */
.maryon-mvs-preview-list.mvs-has-swatches{
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Neutraliza el "cuadradito" del plugin cuando el item contiene swatch del theme */
.maryon-mvs-item.has-swatch{
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  width: auto !important;
  min-width: 0 !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
}

.maryon-mvs-item.has-swatch.active{
  background: transparent !important;
  border: 0 !important;
}

.maryon-mvs-item.has-swatch .swatch-term{
  margin: 0 !important;
}


/* --- Modal: lista con nombre + swatch, scroll interno y botón fijo --- */
.maryon-mvs-modal-inner{
  display:flex;
  flex-direction:column;
  max-height:80vh;
}

.maryon-mvs-modal-content{
  flex:1 1 auto;
  overflow:auto;
  background:#fff;
  padding:5px 5px 0;
}

.maryon-mvs-modal-list{
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:12px;
  padding-bottom:20px;
}

.maryon-mvs-modal-list.mvs-has-swatches{
  display:grid;
}


.maryon-mvs-modal-list.mvs-has-swatches{
  display: grid;
}

@media (max-width: 768px){
  .maryon-mvs-modal-list{
    grid-template-columns:1fr;
  }
}

.maryon-mvs-modal-actions{
  position:sticky;
  bottom:0;
  background:#fff;
  padding:16px 20px 20px;
  border-top:1px solid rgba(0,0,0,0.06);
}

/* Importante: en modal, NO queremos que .has-swatch deje el item "invisible" */
.maryon-mvs-modal-list .maryon-mvs-item,
.maryon-mvs-modal-list .maryon-mvs-item.has-swatch{
  display:flex !important;
  align-items:center !important;
  justify-content:flex-start !important;
  gap:11px !important;
  width:100% !important;
  padding:5px 7px !important;
  border-radius:12px !important;
  background: rgb(239 239 239) !important;
  border: 1px solid rgba(0, 0, 0, 0.06) !important;
  cursor:pointer;
  user-select:none;
}

.maryon-mvs-modal-list .maryon-mvs-item:hover{
  background:rgba(0,0,0,0.05) !important;
}

.maryon-mvs-modal-list .maryon-mvs-item.active{
  background:rgba(0,0,0,0.06) !important;
  border-color:rgba(0,0,0,0.25) !important;
  box-shadow:0 0 0 2px rgba(0,0,0,0.12) inset;
}

.maryon-mvs-modal-list .maryon-mvs-item .swatch-term{
  margin:0 !important;
}

/* SOLO MODAL: tamaño de círculos (imagen/color) */
.maryon-mvs-modal-list .swatch-term,
.maryon-mvs-modal-list .maryon-mvs-swatch{
  width: 50px !important;
  height: 50px !important;
  min-width: 50px !important;
  min-height: 50px !important;
}

.maryon-mvs-item-label{
  font-size:14px;
  font-weight: 500;
  text-transform:none;
  letter-spacing:.02em;
  color:#111;
  line-height:1.2;
  white-space:normal;
  word-break:break-word;
}
/* Lock background scroll when modal is open */

/* Extra hardening for scroll lock */
html.maryon-mvs-html-locked{ overflow:hidden !important; }
body.maryon-mvs-body-locked{
  position:fixed !important;
  left:0;
  right:0;
  width:100%;
  overflow:hidden !important;
}

/* Modal close button (theme-like: black X, no box) */
.maryon-mvs-modal-close{
  background:transparent !important;
  border:0 !important;
  padding:0 !important;
  width:auto !important;
  height:auto !important;
  line-height:1 !important;
  color:#000 !important;
  opacity:1 !important;
  font-size:22px !important;
  cursor:pointer !important;
}
.maryon-mvs-modal-close:hover{
  color:#888 !important;
}

/* --- UI: lista de seleccionados (como referencia) --- */
.maryon-mvs-selected{
  display:flex;
  flex-direction:column;
  gap:4px;
  font-size:12px;
  line-height:17px;
  font-style:italic;
  text-align:center;
}

.maryon-mvs-selected .maryon-mvs-row{
  background: rgba(0,0,0,0.035);
  border-radius: 12px;
  padding: 10px 12px 10px 18px;
  display:flex;
  align-items:center;
  gap: 10px;
  margin:0;
}

.maryon-mvs-selected .maryon-mvs-row .name{
  flex: 1 1 auto;
  min-width: 0;
  display:flex;
  align-items:center;
  font-size: 14px;
  letter-spacing: 0;
  text-transform: none;
  color:#111;
  line-height: 1.2;
}

/* Swatch dentro de cada fila (antes del nombre) */
.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  margin-right:14px;
  vertical-align:middle;
  flex:0 0 auto;
}

.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch .swatch-term,
.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch .maryon-mvs-swatch{
  width:28px !important;
  height:28px !important;
  min-width:28px !important;
  min-height:28px !important;
  padding:0 !important;
  margin:0 !important;
  border:0 !important;
  border-radius:50% !important;
  overflow:hidden !important;
  display:block !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18) !important;
}

/* Swatch de color del theme (usa .pls-tooltip con background-color inline) */
.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch .swatch-term .pls-tooltip{
  display:block !important;
  width:100% !important;
  height:100% !important;
  border-radius:50% !important;
  text-indent:-9999px !important;
  font-size:0 !important;
  line-height:0 !important;
  padding:0 !important;
  margin:0 !important;
}

/* Swatch de imagen */
.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  border-radius:50% !important;
  display:block !important;
}

.maryon-mvs-selected .maryon-mvs-row .qty{
  flex: 0 0 auto;
  display:flex;
  align-items:center;
  gap: 6px;
  background:#fff;
  border-radius: 12px;
  padding: 6px 8px;
  border: 1px solid rgba(0,0,0,0.06);
}

.maryon-mvs-selected .maryon-mvs-row .qty button,
.maryon-mvs-selected .maryon-mvs-row .qty .minus,
.maryon-mvs-selected .maryon-mvs-row .qty .plus{
  appearance:none !important;
  -webkit-appearance:none !important;
  background: transparent !important;
  border: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  border-radius: 10px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color:#111 !important;
  cursor:pointer !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:none !important;
}

.maryon-mvs-selected .maryon-mvs-row .qty button:hover{
  background: rgba(0,0,0,0.05) !important;
}

.maryon-mvs-selected .maryon-mvs-row .qty input[type="number"]{
  appearance: textfield;
  -moz-appearance: textfield;
  -webkit-appearance: none;
  width: 44px;
  max-width: 52px;
  text-align:center;
  border: 0 !important;
  background: transparent !important;
  padding: 0 !important;
  margin: 0 !important;
  height: 28px;
  line-height: 28px;
  font-size: 14px;
  font-weight: 600;
  color:#111;
  box-shadow:none !important;
}

.maryon-mvs-selected .maryon-mvs-row .qty input[type="number"]::-webkit-outer-spin-button,
.maryon-mvs-selected .maryon-mvs-row .qty input[type="number"]::-webkit-inner-spin-button{
  -webkit-appearance: none;
  margin: 0;
}

.maryon-mvs-selected .maryon-mvs-row .remove{
  flex: 0 0 auto;
  appearance:none !important;
  -webkit-appearance:none !important;
  background:#fff !important;
  border: 1px solid rgba(0,0,0,0.06) !important;
  width: 34px !important;
  height: 34px !important;
  line-height: 34px !important;
  border-radius: 12px !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 18px !important;
  color:#111 !important;
  cursor:pointer !important;
  display:inline-flex !important;
  align-items:center !important;
  justify-content:center !important;
  box-shadow:none !important;
}

.maryon-mvs-selected .maryon-mvs-row .remove:hover{
  background: rgba(0,0,0,0.05) !important;
}

@media (max-width: 520px){
  .maryon-mvs-selected .maryon-mvs-row{
    padding: 10px 12px 10px 18px;
  }
  .maryon-mvs-selected .maryon-mvs-row .qty input[type="number"]{
    width: 40px;
  }
}


/* --- Botón "Ver más opciones" (más chico + blanco con filete negro) --- */
.maryon-mvs-preview{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap: 12px;
}

.maryon-mvs-preview .maryon-mvs-preview-list{
  flex: 0 0 auto;
  width: fit-content;
}

.maryon-mvs-preview .maryon-mvs-more{
  flex: 0 0 auto;
  appearance:none !important;
  -webkit-appearance:none !important;
  background: #fff !important;
  border: 1px solid #000 !important;
  color: #000 !important;
  padding: 15px 24px !important;
  border-radius: 7px !important;
  font-size: 13px;
  font-weight: 700 !important;
  letter-spacing: .06em !important;
  text-transform: uppercase !important;
  line-height: 1 !important;
  height: auto !important;
  box-shadow:none !important;
}

.maryon-mvs-preview .maryon-mvs-more:hover{
  background: rgba(0,0,0,0.04) !important;
}

@media (max-width: 768px){
  .maryon-mvs-preview .maryon-mvs-more{
  font-size: 13px;
    width: auto !important;
    justify-content: center;
  }
}


/* Fix18: spacing tweaks requested */
.maryon-mvs-preview.pls-product-variations{padding-bottom:14px;}


/* --- Fix22: tamaños y separación de swatches --- */
.maryon-mvs-preview-list.mvs-has-swatches{
  display:flex !important;
  flex-wrap:nowrap;
  width: fit-content;
  gap:4px !important;
}

/* Swatches principales (los 6 de preview) */
.maryon-mvs-preview-list .swatch-term,
.maryon-mvs-preview-list .maryon-mvs-swatch{
  width:50px !important;
  height:50px !important;
  min-width:50px !important;
  min-height:50px !important;
  border-radius:50% !important;
  overflow:hidden !important;
  padding:0 !important;
}

/* Que las muestras de IMAGEN también sean circulares */
.maryon-mvs-preview-list .swatch-term img,
.maryon-mvs-modal-list .swatch-term img,
.maryon-mvs-selected .maryon-mvs-row .name .maryon-mvs-row-swatch img{
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
  border-radius:50% !important;
  display:block !important;
}

/* En modal, forzar círculo (por si viene cuadrado del theme) */
.maryon-mvs-modal-list .swatch-term,
.maryon-mvs-modal-list .maryon-mvs-swatch{
  border-radius:50% !important;
  overflow:hidden !important;
}

/* --- Fix24: en modal, dar tamaño real al swatch (si no, colapsa al esconder texto) --- */
.maryon-mvs-modal-list .swatch-term,
.maryon-mvs-modal-list .maryon-mvs-swatch{
  width:50px !important;
  height:50px !important;
  min-width:50px !important;
  min-height:50px !important;
  padding:0 !important;
  flex:0 0 auto !important;
}



/* --- Fix23: que el color (pls-tooltip) rellene el círculo en preview/modal --- */
.maryon-mvs-preview-list .swatch-term,
.maryon-mvs-modal-list .swatch-term{
  display:flex !important;
  align-items:stretch !important;
  justify-content:stretch !important;
}
.maryon-mvs-preview-list .swatch-term .pls-tooltip,
.maryon-mvs-modal-list .swatch-term .pls-tooltip{
  display:block !important;
  width:100% !important;
  height:100% !important;
  border-radius:50% !important;
  overflow:hidden !important;
  font-size:0 !important;
  line-height:0 !important;
  text-indent:-9999px !important;
}

/* v1.0.4.31 modal layout */
.maryon-mvs-modal-content{width:100%!important;}
.maryon-mvs-modal-actions{padding:5px 5px 5px!important;}
.maryon-mvs-modal-header strong{font-size:20px;font-weight:700;color:#000;}
.maryon-mvs-modal-header small{display:block;margin-top:4px;font-size:13px;font-weight:400;color:#777;}

.maryon-mvs-selected-title{margin-bottom:10px;}


/* Total price label (replaces Cantidad:) */
.pls-quantity-label { display:flex; align-items:center; gap:8px; }
.pls-quantity-label .maryon-mvs-total-price { font-weight:700; }

/* v1.0.4.39 UI tweaks (requested) */
.maryon-mvs-selected-title{padding-bottom:11px;font-weight:500;}
div.summary .pls-quantity-label{margin:19px;}

/* Evita parpadeo (FOUC): oculta la UI nativa del tema hasta que MVS inicializa */
html.mvs-preload body.single-product form.variations_form .variations,
html.mvs-preload body.single-product form.variations_form .single_variation_wrap .quantity,
html.mvs-preload body.single-product form.variations_form .single_variation_wrap .woocommerce-variation-add-to-cart,
html.mvs-preload body.single-product form.variations_form .tawcvs-swatches,
html.mvs-preload body.single-product form.variations_form .variable-items-wrapper,
html.mvs-preload body.single-product form.variations_form .woo-variation-swatches,
html.mvs-preload body.single-product form.variations_form .wvs-swatches {
  display: none !important;
}


/* Out of stock: make it VERY evident in modal */
.maryon-mvs-modal .maryon-mvs-item.out{
  position: relative;
  overflow: hidden;
}
.maryon-mvs-modal .maryon-mvs-item.out::before,
.maryon-mvs-modal .maryon-mvs-item.out::after{
  content: "";
  position: absolute;
  left: -10%;
  top: 50%;
  width: 120%;
  height: 2px;
  background: #d40000;
  opacity: 0.85;
  pointer-events: none;
}
.maryon-mvs-modal .maryon-mvs-item.out::before{ transform: translateY(-50%) rotate(12deg); }
.maryon-mvs-modal .maryon-mvs-item.out::after{ transform: translateY(-50%) rotate(-12deg); }

.maryon-mvs-item-note{
  font-size: 12px;
  font-weight: 500;
  color: #666;
  margin-left: 10px;
  white-space: nowrap;
}
.maryon-mvs-modal .maryon-mvs-item.out .maryon-mvs-item-note{
  color: #777;
}


/* --- Modo texto (atributos tipo select): chips --- */
.maryon-mvs-preview.maryon-mvs-mode-text {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.maryon-mvs-preview.maryon-mvs-mode-text .maryon-mvs-preview-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.maryon-mvs-preview.maryon-mvs-mode-text .maryon-mvs-item {
  padding: 8px 12px;
  border: 1px solid #cfcfcf;
  border-radius: 10px;
  background: #f2f2f2;
  text-align: left;
  width: auto;
}

.maryon-mvs-preview.maryon-mvs-mode-text .maryon-mvs-item .name,
.maryon-mvs-preview.maryon-mvs-mode-text .maryon-mvs-item .maryon-mvs-item-label {
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
}

.maryon-mvs-preview.maryon-mvs-mode-text .maryon-mvs-more {
  margin-left: 2px;
}

/*
 * Modal en modo texto (labels):
 * - Desktop: 2 columnas (como los otros modos)
 * - Mobile: 1 columna
 */
.maryon-mvs-modal-list.maryon-mvs-mode-text {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

@media (max-width: 767px) {
  .maryon-mvs-modal-list.maryon-mvs-mode-text {
    grid-template-columns: 1fr;
  }
}

/* Asegura que cada item use el estilo de "tarjeta" base, no chip */
.maryon-mvs-modal-list.maryon-mvs-mode-text .maryon-mvs-item {
  width: 100%;
}



/* --- LABEL MODE CLEANUP --- */
.maryon-mvs-mode-label .maryon-mvs-selected-item .maryon-mvs-swatch,
.maryon-mvs-mode-label .maryon-mvs-selected-item .swatch-term{
    display:none!important;
}

/* spacing under preview chips (solo modo texto/label) */
.maryon-mvs-preview.maryon-mvs-mode-text{
    padding-bottom:14px!important;
}


/* --- LABEL MODE: hide mini swatch inside selected rows (keep only text) --- */
.maryon-mvs-mode-label .maryon-mvs-row-swatch{
    display:none!important;
}
/* Fallback: some installs tag label mode as mode-text; hide swatch if it contains theme label swatch */
.maryon-mvs-mode-text .maryon-mvs-row-swatch .swatch-label,
.maryon-mvs-mode-text .maryon-mvs-row-swatch:has(.swatch-label){
    display:none!important;
}


.maryon-mvs-mode-text .maryon-mvs-row-swatch .swatch-label{
    display:none!important;
}
.maryon-mvs-mode-text .maryon-mvs-row-swatch{
    width:auto!important;
    height:auto!important;
    margin-right:0!important;
}


/* --- Ajustes de diseño (integrado desde snippet) --- */
@media (max-width: 767px) {
  .maryon-mvs-preview-list.mvs-has-swatches{
    gap: 0px !important;
  }
  .maryon-mvs-preview-list .maryon-mvs-item.has-swatch{
    margin-right: 5px !important;
  }
  .maryon-mvs-preview{
    justify-content: center;
  }
  .pls-swatches{
    gap: 0.3rem;
  }
  .maryon-mvs-modal-header small{
    margin-top: 2px;
    font-size: 12px;
    line-height: 16px;
  }
  .maryon-mvs-modal-header{
    margin: 0 24px 15px 0;
    text-align: center;
  }
  .maryon-mvs-modal-header strong{
    font-size: 16px;
  }
  .maryon-mvs-modal-content{
    padding: 0px 0px 0 !important;
    background: #ffffff !important;
  }
  .maryon-mvs-modal-list .swatch-term,
  .maryon-mvs-modal-list .maryon-mvs-swatch{
    width: 45px !important;
    height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
  }
  .maryon-mvs-preview-list .swatch-term,
  .maryon-mvs-preview-list .maryon-mvs-swatch{
    width: 42px !important;
    height: 42px !important;
    min-width: 42px !important;
    min-height: 42px !important;
  }
}
