/* ======================================================================
   UBD Visual UX · RADIO CARDS APP STYLE 1.6.18

   Objetivo:
   - Mantener la lógica segura de 1.6.17.
   - Mejorar visualmente los selectores convertidos a radio-cards.
   - Dar un look más tipo app / UX moderno.
   - Corregir cualquier resto visual de flechas/chevrons heredados.
   ====================================================================== */

html.ubd-product-ready body#product.ubd-modular-page {
  --ubd-app-card-bg: #FFFFFF;
  --ubd-app-card-bg-hover: #F7FBF8;
  --ubd-app-card-bg-selected: linear-gradient(180deg, #F2FAF4 0%, #E8F4EC 100%);
  --ubd-app-card-border: rgba(23, 56, 62, .08);
  --ubd-app-card-border-strong: rgba(69, 134, 96, .34);
  --ubd-app-card-ink: #17383e;
  --ubd-app-card-muted: #5E777C;
  --ubd-app-card-green: #4B8B61;
  --ubd-app-card-green-dark: #356F4A;
  --ubd-app-card-shadow: 0 1px 1px rgba(15, 44, 50, .03), 0 8px 18px rgba(15, 44, 50, .04);
  --ubd-app-card-shadow-selected: 0 2px 4px rgba(75, 139, 97, .07), 0 10px 24px rgba(75, 139, 97, .10);
}

/* Mata cualquier pseudo-elemento viejo del item radioizado. */
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::before,
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;
}

/* Grid más respirado y elegante. */
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: 10px !important;
  width: 100% !important;
  margin: 6px 0 2px !important;
  padding: 0 !important;
  align-items: stretch !important;
}

/* Tarjetas estilo app */
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option {
  position: relative !important;
  isolation: isolate !important;

  display: flex !important;
  align-items: center !important;
  justify-content: flex-start !important;
  gap: 10px !important;

  width: 100% !important;
  min-width: 0 !important;
  min-height: 60px !important;
  padding: 12px 14px !important;
  margin: 0 !important;

  border: 1px solid var(--ubd-app-card-border) !important;
  border-radius: 20px !important;
  background: var(--ubd-app-card-bg) !important;
  color: var(--ubd-app-card-ink) !important;
  -webkit-text-fill-color: var(--ubd-app-card-ink) !important;

  font: inherit !important;
  font-size: 14px !important;
  font-weight: 770 !important;
  line-height: 1.22 !important;
  text-align: left !important;
  letter-spacing: -.01em !important;

  box-shadow: var(--ubd-app-card-shadow) !important;
  outline: 0 !important;
  cursor: pointer !important;
  overflow: hidden !important;

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

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  border-radius: inherit !important;
  background: linear-gradient(180deg, rgba(255,255,255,.45) 0%, rgba(255,255,255,0) 52%) !important;
  pointer-events: none !important;
  z-index: 0 !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;
  z-index: 1 !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option:hover {
  transform: translateY(-1px) !important;
  background: var(--ubd-app-card-bg-hover) !important;
  border-color: rgba(75, 139, 97, .18) !important;
  box-shadow: 0 2px 4px rgba(15, 44, 50, .04), 0 12px 20px rgba(15, 44, 50, .06) !important;
}

html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option:active {
  transform: translateY(0) scale(.995) !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;
}

/* Radio visual más bonito */
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 22px !important;
  width: 22px !important;
  height: 22px !important;
  border: 2px solid rgba(86, 108, 113, .30) !important;
  border-radius: 999px !important;
  background: #fff !important;
  box-shadow: inset 0 1px 2px rgba(23, 56, 62, .04) !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: 4px !important;
  border-radius: 999px !important;
  background: transparent !important;
  transform: scale(.88) !important;
  transition: 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-text {
  min-width: 0 !important;
  flex: 1 1 auto !important;
  color: inherit !important;
  -webkit-text-fill-color: inherit !important;
  overflow-wrap: anywhere !important;
}

/* Seleccionada */
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: var(--ubd-app-card-border-strong) !important;
  background: var(--ubd-app-card-bg-selected) !important;
  color: var(--ubd-app-card-green-dark) !important;
  -webkit-text-fill-color: var(--ubd-app-card-green-dark) !important;
  box-shadow: var(--ubd-app-card-shadow-selected) !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: var(--ubd-app-card-green) !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.88), 0 0 0 3px 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::after {
  background: linear-gradient(180deg, #63B57E 0%, #4B8B61 100%) !important;
  transform: scale(1) !important;
}

/* Única opción: mostrar resuelta y tranquila */
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-grid.is-single .ubd-select-choice-option,
html.ubd-product-ready body#product.ubd-modular-page
#wrapper #main form#add-to-cart-or-refresh
.ubd-select-choice-option.is-only-option {
  min-height: 56px !important;
}

/* Muchas opciones: una columna si el texto empieza a apretarse demasiado. */
@media (max-width: 767px) {
  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-grid.is-many {
    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 {
    min-height: 58px !important;
    padding: 12px 13px !important;
    border-radius: 18px !important;
    font-size: 13.5px !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-grid {
    gap: 9px !important;
  }

  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-option {
    min-height: 56px !important;
    padding: 11px 12px !important;
    font-size: 13px !important;
  }

  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-dot {
    flex-basis: 20px !important;
    width: 20px !important;
    height: 20px !important;
  }
}

/* Escritorio: tres columnas cuando sí cabe bonito. */
@media (min-width: 960px) {
  html.ubd-product-ready body#product.ubd-modular-page
  #wrapper #main form#add-to-cart-or-refresh
  .ubd-select-choice-grid:not(.is-single):not(.is-many) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}
