/* ======================================================================
   UBD Visual UX · PRODUCT SELECT → RADIO CARDS 1.6.17

   El <select> original NO se elimina.
   Sólo queda visualmente oculto cuando la mejora fue creada correctamente.
   ====================================================================== */

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.product-variants .product-variants-item.ubd-radioized-variant {
  position: relative !important;
}

/* Desactiva el chevron de 1.6.16 únicamente cuando ya existen radios visibles. */
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.product-variants .product-variants-item.ubd-radioized-variant::after {
  display: none !important;
  content: none !important;
}

/* El select sigue dentro del formulario y conserva name/value/eventos.
   Se oculta de forma visual, NO con display:none ni disabled. */
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.product-variants .product-variants-item select.ubd-radioized-select {
  position: absolute !important;
  width: 1px !important;
  min-width: 1px !important;
  height: 1px !important;
  min-height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  box-shadow: none !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-grid.is-single {
  grid-template-columns: minmax(0, 1fr) !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option {
  position: relative !important;
  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 9px !important;

  width: 100% !important;
  min-width: 0 !important;
  min-height: 48px !important;
  margin: 0 !important;
  padding: 10px 12px !important;

  border: 1px solid rgba(23, 56, 62, .10) !important;
  border-radius: 16px !important;
  outline: 0 !important;

  background: #fff !important;
  color: #17383e !important;
  -webkit-text-fill-color: #17383e !important;

  font: inherit !important;
  font-size: 13px !important;
  font-weight: 760 !important;
  line-height: 1.25 !important;
  text-align: left !important;

  box-shadow: none !important;
  text-transform: none !important;
  cursor: pointer !important;

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

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option:hover {
  border-color: rgba(75, 139, 97, .30) !important;
  background: #F8FBF8 !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option:focus-visible {
  outline: 3px solid rgba(75, 139, 97, .16) !important;
  outline-offset: 2px !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-dot {
  position: relative !important;
  flex: 0 0 18px !important;
  width: 18px !important;
  height: 18px !important;
  border: 2px solid rgba(23, 56, 62, .28) !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: none !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-dot::after {
  content: "" !important;
  position: absolute !important;
  inset: 3px !important;
  border-radius: 999px !important;
  background: transparent !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-text {
  min-width: 0 !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  overflow-wrap: anywhere !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option.is-selected {
  border-color: rgba(75, 139, 97, .42) !important;
  background: #EAF4EC !important;
  color: #245743 !important;
  -webkit-text-fill-color: #245743 !important;
  box-shadow: inset 0 0 0 1px rgba(75, 139, 97, .08) !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option.is-selected .ubd-select-choice-dot {
  border-color: #4B8B61 !important;
  background: #fff !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option.is-selected .ubd-select-choice-dot::after {
  background: #4B8B61 !important;
}

/* Una sola opción: ya se muestra resuelta, sin apariencia de “hay que abrir algo”. */
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option.is-only-option {
  cursor: default !important;
  min-height: 46px !important;
}

/* En escritorio podemos aprovechar ancho sin convertirlo en una lista interminable. */
@media (min-width: 768px) {
  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-grid:not(.is-single) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }

  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-grid.is-short {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 420px) {
  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-option {
    min-height: 46px !important;
    padding: 9px 10px !important;
    font-size: 12.5px !important;
  }
}
