/* Angal · Tallas rápidas en listados (medidas tomadas de womensecret.com) */
.aqs {
  --aqs-ink: var(--adm-ink, #141617);
  --aqs-mute: #878b8f;
  --aqs-gap: 12px;
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  pointer-events: none;
}
.aqs-form { margin: 0; }

/* ---------- Escritorio: cápsula con tallas al pasar el ratón ---------- */
.aqs-bar {
  position: absolute;
  left: var(--aqs-gap);
  right: var(--aqs-gap);
  bottom: var(--aqs-gap);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  max-height: 50%;
  overflow-y: auto;
  padding: 14px 14px 7px;
  background: #fff;
  border-radius: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
  pointer-events: auto;
  box-sizing: border-box;
}
.aqs-size {
  appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 0 8px 7px;
  font: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--aqs-ink);
  cursor: pointer;
  text-transform: none;
  letter-spacing: 0;
}
.aqs-size:hover, .aqs-size:focus-visible { text-decoration: underline; outline: 0; }
.aqs-size[disabled] { color: var(--aqs-mute); text-decoration: line-through; cursor: not-allowed; }
.aqs-size.aqs-single { text-transform: uppercase; font-size: 12px; font-weight: 600; }

/* Estados tras pulsar: capa blanca con giro mientras añade, y "✓ Añadido" al terminar */
.aqs.is-adding .aqs-bar { pointer-events: none; }
.aqs.is-adding .aqs-bar::before,
.aqs.is-added .aqs-bar::before {
  content: attr(data-added);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: inherit;
  background: #fff;
  font-size: 13px;
  font-weight: 600;
  color: var(--aqs-ink);
}
.aqs.is-adding .aqs-bar::before { content: ""; }
.aqs.is-adding .aqs-bar::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #ebebeb;
  border-top-color: var(--aqs-ink);
  border-radius: 50%;
  animation: aqs-spin .7s linear infinite;
}
.aqs.is-added .aqs-bar { opacity: 1; visibility: visible; transform: none; }
@keyframes aqs-spin { to { transform: rotate(360deg); } }

/* Botón de bolsa (móvil/tablet) */
.aqs-bag {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  margin: 0 auto;
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .8);
  color: var(--aqs-ink);
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
}

/* Con ratón: la cápsula aparece al pasar por la foto o al llegar con el teclado */
@media (hover: hover) and (pointer: fine) {
  .product-miniature .thumbnail-container:hover .aqs-bar,
  .product-miniature .thumbnail-container:focus-within .aqs-bar {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .2s ease, visibility 0s;
  }
  /* Las etiquetas (Nuevo, -20 %…) suben para no quedar tapadas */
  .product-miniature.aqs-ready .product-flags { transition: bottom .2s ease; }
  .product-miniature.aqs-ready .thumbnail-container:hover .product-flags,
  .product-miniature.aqs-ready .thumbnail-container:focus-within .product-flags { bottom: 72px; }
}

/* Táctil: bolsa en lugar de cápsula */
@media (hover: none), (pointer: coarse) {
  .aqs-bar { display: none; }
  .aqs-bag { display: flex; }
  .product-miniature.aqs-ready .product-flags { bottom: 70px; }
}

/* ---------- Panel "Seleccionar talla" (móvil) ---------- */
.aqs-sheet { position: fixed; inset: 0; z-index: 10050; visibility: hidden; pointer-events: none; }
.aqs-sheet.is-open { visibility: visible; pointer-events: auto; }
.aqs-sheet-backdrop { position: absolute; inset: 0; background: rgba(20, 22, 23, .45); opacity: 0; transition: opacity .2s ease; }
.aqs-sheet.is-open .aqs-sheet-backdrop { opacity: 1; }
.aqs-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 16px 16px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  transform: translateY(100%);
  transition: transform .25s ease;
  color: var(--adm-ink, #141617);
}
.aqs-sheet.is-open .aqs-sheet-panel { transform: none; }
.aqs-sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.aqs-sheet-title { font-size: 16px; font-weight: 600; }
.aqs-sheet-close { border: 0; background: none; font-size: 28px; line-height: 1; padding: 0 4px; cursor: pointer; color: inherit; }
.aqs-sheet-name { margin: 0 0 16px; font-size: 14px; color: #4c5258; }
.aqs-opts { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.aqs-opt {
  min-width: 64px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid #ebebeb;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
  color: inherit;
  cursor: pointer;
}
.aqs-opt.is-selected { border-color: var(--adm-ink, #141617); }
.aqs-opt[disabled] { color: #878b8f; text-decoration: line-through; cursor: not-allowed; background: #f7f7f7; }
.aqs-sheet-add {
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 8px;
  background: var(--adm-ink, #141617);
  color: #fff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
}
.aqs-sheet-add[disabled] { opacity: .35; cursor: not-allowed; }
.aqs-sheet-error { margin: 8px 0 0; font-size: 13px; color: #b44f4f; min-height: 1em; }

/* ---------- Ficha y vista rápida: tallas agotadas tachadas y no seleccionables ---------- */
.product-variants .aqs-oos .radio-label,
.product-variants .attribute-not-in-stock .radio-label {
  color: #878b8f !important;
  text-decoration: line-through;
  background: #f7f7f7 !important;
  cursor: not-allowed;
}
.product-variants .aqs-oos .input-radio,
.product-variants .aqs-oos .input-color { cursor: not-allowed; }
.product-variants .aqs-oos .color { opacity: .35; }
