:root {
  --papillon-qa-pink: #e2007a;
  --papillon-qa-pink-hover: #c40068;
  --papillon-qa-ink: #1a1a1a;
  --papillon-qa-soft-ink: #6e5a63;
  --papillon-qa-ivory: #fcf8f2;
  --papillon-qa-line: rgba(26, 26, 26, 0.1);
  --papillon-qa-line-strong: rgba(26, 26, 26, 0.16);
}

body.papillon-qa-open { overflow: hidden; }

.papillon-qa {
  position: fixed;
  inset: 0;
  z-index: 999999;
  visibility: hidden;
  pointer-events: none;
  font-family: "Lato", Arial, sans-serif;
}

.papillon-qa.is-open { visibility: visible; pointer-events: auto; }

.papillon-qa__backdrop {
  position: absolute;
  inset: 0;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  /* Overlay neutro: nunca fucsia (Astra pinta button:focus/active). */
  background: rgba(26, 20, 24, 0.44) !important;
  background-color: rgba(26, 20, 24, 0.44) !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer;
  opacity: 0;
  transition: opacity .3s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  -webkit-appearance: none;
  appearance: none;
}

.papillon-qa__backdrop:hover,
.papillon-qa__backdrop:focus,
.papillon-qa__backdrop:focus-visible,
.papillon-qa__backdrop:active,
.papillon-qa.is-open .papillon-qa__backdrop:hover,
.papillon-qa.is-open .papillon-qa__backdrop:focus,
.papillon-qa.is-open .papillon-qa__backdrop:active {
  background: rgba(26, 20, 24, 0.44) !important;
  background-color: rgba(26, 20, 24, 0.44) !important;
  color: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  outline: none !important;
  opacity: 1;
}

.papillon-qa.is-open .papillon-qa__backdrop { opacity: 1; }

.papillon-qa__sheet {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: min(100%, 820px);
  max-height: min(88vh, 760px);
  margin-inline: auto;
  overflow: auto;
  border-radius: 0 !important;
  background: var(--papillon-qa-ivory);
  box-shadow: 0 -20px 60px rgba(26, 20, 24, .16);
  color: var(--papillon-qa-ink);
  transform: translateY(102%);
  transition: transform .38s cubic-bezier(.22, .8, .25, 1);
  outline: 0;
}

.papillon-qa.is-open .papillon-qa__sheet { transform: translateY(0); }

.papillon-qa__handle {
  width: 44px;
  height: 4px;
  margin: 12px auto 0;
  border-radius: 0 !important;
  background: rgba(26, 26, 26, .14);
}

.papillon-qa__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 32px 20px;
  border-bottom: 1px solid var(--papillon-qa-line);
}

.papillon-qa__eyebrow {
  margin: 0 0 5px;
  color: var(--papillon-qa-pink);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.papillon-qa__header h2 {
  margin: 0;
  font-size: clamp(20px, 2.6vw, 26px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: .01em;
}

/* Misma lógica que el CTA "¡Lo quiero!" de la Home:
   reposo liviano con borde, hover que se pinta de fucsia con el contenido en blanco. */
.papillon-qa .papillon-qa__close,
.papillon-qa button.papillon-qa__close {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 44px;
  width: 44px !important;
  height: 44px !important;
  padding: 0 !important;
  border: 1px solid rgba(26, 26, 26, 0.18) !important;
  border-radius: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  background: #fff !important;
  background-color: #fff !important;
  color: #1a1a1a !important;
  box-shadow: none !important;
  outline: none !important;
  cursor: pointer;
  transition:
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease;
}

.papillon-qa .papillon-qa__close svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2;
}

.papillon-qa .papillon-qa__close:hover,
.papillon-qa .papillon-qa__close:focus-visible,
.papillon-qa button.papillon-qa__close:hover,
.papillon-qa button.papillon-qa__close:focus-visible {
  border-color: var(--papillon-qa-pink) !important;
  background: var(--papillon-qa-pink) !important;
  background-color: var(--papillon-qa-pink) !important;
  color: #fff !important;
}

.papillon-qa__content { padding: 24px 32px 32px; }
.papillon-qa__loading, .papillon-qa__error { margin: 24px 0; text-align: center; }
.papillon-qa__error { color: #a40035; }

.papillon-qa__product {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 18px;
  margin-bottom: 24px;
}

.papillon-qa__thumb img {
  display: block;
  width: 84px;
  height: 104px;
  border-radius: 0 !important;
  object-fit: cover;
}

.papillon-qa__product-name {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .02em;
  text-transform: uppercase;
}

.papillon-qa__base-price,
.papillon-qa .woocommerce-variation-price {
  color: var(--papillon-qa-pink);
  font-size: 18px;
  font-weight: 700;
}

.papillon-qa__attributes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.papillon-qa__field {
  display: grid;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--papillon-qa-soft-ink);
  text-transform: uppercase;
}

.papillon-qa__field-label {
  display: block;
}

/* Atributo con un solo valor o atributo Línea: ya viene elegido, no se muestra. */
.papillon-qa__field--auto,
.papillon-qa__field--hidden { display: none !important; }

.papillon-qa__select,
.papillon-qa select {
  width: 100%;
  min-height: 52px;
  padding: 12px 44px 12px 16px;
  border: 1px solid var(--papillon-qa-line-strong);
  border-radius: 0 !important;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231a1a1a' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 17px 17px;
  color: var(--papillon-qa-ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.papillon-qa__select:hover { border-color: rgba(226, 0, 122, .4); }

.papillon-qa__select:focus,
.papillon-qa__select:focus-visible {
  border-color: var(--papillon-qa-pink);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(226, 0, 122, .16);
}

/* Select oculto: las pastillas propias son la UI (sin WVS). */
.papillon-qa__form--native select.papillon-qa__select,
.papillon-qa__form--native .papillon-qa__select--hidden,
.papillon-qa__form--native .variable-items-wrapper {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.papillon-qa-swatches {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
}

.papillon-qa-swatch {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-width: 48px !important;
  min-height: 44px !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  border: 1px solid rgba(26, 26, 26, 0.16) !important;
  border-radius: 0 !important;
  background: #fcf8f2 !important;
  color: #1a1a1a !important;
  font-family: "Lato", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  line-height: 1.2 !important;
  text-transform: uppercase !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  box-shadow: none !important;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease !important;
}

.papillon-qa-swatch:hover,
.papillon-qa-swatch:focus-visible {
  border-color: rgba(226, 0, 122, 0.5) !important;
  outline: none !important;
}

.papillon-qa-swatch.is-selected {
  border-color: #e2007a !important;
  background: #e2007a !important;
  color: #fff !important;
}

.papillon-qa .single_variation { min-height: 26px; margin-top: 16px; }

.papillon-qa .woocommerce-variation-description,
.papillon-qa .woocommerce-variation-availability {
  color: var(--papillon-qa-soft-ink);
  font-size: 14px;
}

.papillon-qa__actions {
  display: grid;
  grid-template-columns: minmax(120px, 140px) minmax(180px, 1fr);
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.papillon-qa__quantity {
  display: grid !important;
  gap: 8px !important;
  visibility: visible !important;
  opacity: 1 !important;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--papillon-qa-soft-ink);
  text-transform: uppercase;
}

/* Cantidad +/− como el side cart */
.papillon-qa-qty {
  display: inline-flex !important;
  align-items: center !important;
  gap: 0 !important;
  box-sizing: border-box !important;
  width: 100% !important;
  min-height: 52px !important;
  border: 1px solid rgba(26, 26, 26, 0.28) !important;
  border-radius: 0 !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 1px rgba(26, 26, 26, 0.12) !important;
  overflow: hidden !important;
  visibility: visible !important;
}

.papillon-qa-qty__btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 40px;
  width: 40px !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #757575 !important;
  font-family: Lato, Arial, sans-serif !important;
  font-size: 20px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  cursor: pointer !important;
  transition: background 0.15s ease, color 0.15s ease !important;
}

.papillon-qa-qty__btn span {
  color: inherit !important;
}

.papillon-qa-qty__btn:hover,
.papillon-qa-qty__btn:focus-visible {
  background: #e2007a !important;
  color: #fff !important;
  outline: none !important;
}

.papillon-qa-qty__input {
  flex: 1 1 auto;
  width: 100% !important;
  min-width: 0 !important;
  height: 50px !important;
  margin: 0 !important;
  padding: 0 4px !important;
  border: 0 !important;
  border-left: 1px solid rgba(26, 26, 26, 0.12) !important;
  border-right: 1px solid rgba(26, 26, 26, 0.12) !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: #1a1a1a !important;
  font-family: Lato, Arial, sans-serif !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  text-align: center !important;
  -moz-appearance: textfield;
  box-shadow: none !important;
}

.papillon-qa-qty__input::-webkit-outer-spin-button,
.papillon-qa-qty__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.papillon-qa-qty__input:focus,
.papillon-qa-qty__input:focus-visible {
  outline: 0 !important;
  box-shadow: none !important;
}

.papillon-qa .single_add_to_cart_button {
  min-height: 52px !important;
  margin: 0 !important;
  padding: 14px 28px !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: var(--papillon-qa-pink) !important;
  color: #fff !important;
  font-family: inherit !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  letter-spacing: .02em !important;
  text-transform: none !important;
  cursor: pointer;
  transition: background-color .2s ease, opacity .2s ease;
}

.papillon-qa .single_add_to_cart_button:hover:not(:disabled) {
  background: var(--papillon-qa-pink-hover) !important;
}

.papillon-qa .single_add_to_cart_button:disabled {
  background: #efe7e3 !important;
  color: var(--papillon-qa-soft-ink) !important;
  cursor: not-allowed;
}

.papillon-qa__message {
  min-height: 20px;
  margin: 14px 0 0;
  color: #8a3a4a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.papillon-qa.is-success .papillon-qa__message { color: #16783e; font-weight: 600; }

/* =========================================================
   Swatches (WVS) dentro del sheet — pastillas rectas, no círculos
   (en archive no aplica el CSS de body.single-product)
   ========================================================= */
.papillon-qa .woo-variation-swatches,
.papillon-qa .variations {
  width: 100%;
}

.papillon-qa .woo-variation-swatches .variable-items-wrapper,
.papillon-qa ul.variable-items-wrapper {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 10px !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  float: none !important;
}

.papillon-qa .woo-variation-swatches .variable-item,
.papillon-qa .variable-items-wrapper .variable-item {
  position: relative !important;
  float: none !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  width: auto !important;
  max-width: none !important;
  min-width: 48px !important;
  height: auto !important;
  max-height: none !important;
  min-height: 44px !important;
  aspect-ratio: auto !important;
  margin: 0 !important;
  padding: 10px 16px !important;
  border: 1px solid var(--papillon-qa-line-strong) !important;
  border-radius: 0 !important;
  border-top-left-radius: 0 !important;
  border-top-right-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-bottom-left-radius: 0 !important;
  background: #fcf8f2 !important;
  box-shadow: none !important;
  outline: none !important;
  overflow: visible !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  color: var(--papillon-qa-ink) !important;
  z-index: 2 !important;
}

.papillon-qa .woo-variation-swatches .variable-item:hover {
  border-color: rgba(226, 0, 122, 0.45) !important;
  background: color-mix(in srgb, #c28c9f 12%, #fcf8f2) !important;
}

.papillon-qa .woo-variation-swatches .variable-item.selected,
.papillon-qa .woo-variation-swatches .variable-item.selected:hover,
.papillon-qa .woo-variation-swatches .button-variable-item.selected,
.papillon-qa .woo-variation-swatches .color-variable-item.selected,
.papillon-qa .woo-variation-swatches li.selected,
.papillon-qa .variable-items-wrapper .variable-item.selected {
  border-color: #e2007a !important;
  background: #e2007a !important;
  background-color: #e2007a !important;
  color: #fff !important;
  box-shadow: none !important;
}

.papillon-qa .woo-variation-swatches .variable-item.selected .variable-item-span,
.papillon-qa .woo-variation-swatches .color-variable-item.selected .variable-item-span,
.papillon-qa .woo-variation-swatches .color-variable-item.selected .variable-item-contents::after {
  color: #fff !important;
}

/* Ocultar tooltip negro de WVS */
.papillon-qa .wvs-has-image-tooltip::before,
.papillon-qa .wvs-has-image-tooltip::after,
.papillon-qa [data-wvstooltip]::before,
.papillon-qa .woo-variation-swatches-stylesheet-enabled .wvs-tooltip,
body .papillon-qa .variable-item .rtwpvs-image-tooltip {
  display: none !important;
  content: none !important;
  opacity: 0 !important;
  visibility: hidden !important;
}

.papillon-qa .woo-variation-swatches .variable-item .variable-item-span,
.papillon-qa .woo-variation-swatches .button-variable-item .variable-item-span,
.papillon-qa .variable-items-wrapper .variable-item-span {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  position: static !important;
  width: auto !important;
  min-width: 0 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: inherit !important;
  font-family: "Lato", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: 0.02em !important;
  white-space: nowrap !important;
  overflow: visible !important;
  text-indent: 0 !important;
}

.papillon-qa .woo-variation-swatches .variable-item.selected .variable-item-span {
  color: #fff !important;
}

.papillon-qa .woo-variation-swatches .variable-item.selected::before,
.papillon-qa .woo-variation-swatches .variable-item.selected::after,
.papillon-qa .woo-variation-swatches .button-variable-item .variable-item-contents::before,
.papillon-qa .woo-variation-swatches .button-variable-item .variable-item-contents::after {
  display: none !important;
  content: none !important;
}

/* Color: pastilla con swatch + nombre; seleccionado = fucsia */
.papillon-qa .woo-variation-swatches .color-variable-item {
  gap: 8px !important;
  min-width: 0 !important;
  padding: 8px 14px 8px 10px !important;
  background: #fff !important;
  color: #1a1a1a !important;
}

.papillon-qa .woo-variation-swatches .color-variable-item.selected {
  border-color: #e2007a !important;
  background: #e2007a !important;
  color: #fff !important;
}

.papillon-qa .woo-variation-swatches .color-variable-item .variable-item-span-color,
.papillon-qa .woo-variation-swatches .color-variable-item .variable-item-span {
  flex: 0 0 16px !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  min-height: 16px !important;
  border: 1px solid rgba(0, 0, 0, 0.1) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

.papillon-qa .woo-variation-swatches .color-variable-item .variable-item-contents {
  display: inline-flex !important;
  align-items: center !important;
  gap: 8px !important;
  width: auto !important;
  height: auto !important;
}

.papillon-qa .woo-variation-swatches .color-variable-item .variable-item-contents::after {
  content: attr(data-wvstooltip);
  display: inline-block;
  color: inherit !important;
  font-family: "Lato", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  white-space: nowrap;
}

.papillon-qa .woo-variation-swatches .color-variable-item[data-title] .variable-item-contents::after,
.papillon-qa .woo-variation-swatches .color-variable-item[title] .variable-item-contents::after {
  content: attr(data-title);
}

.papillon-qa .woo-variation-swatches .color-variable-item[title] .variable-item-contents::after {
  content: attr(title);
}

.papillon-qa .woo-variation-swatches .color-variable-item[data-wvstooltip] .variable-item-contents::after {
  content: attr(data-wvstooltip);
}

.papillon-qa .woo-variation-swatches .color-variable-item.selected .variable-item-span,
.papillon-qa .woo-variation-swatches .color-variable-item.selected .variable-item-contents::after {
  color: #fff !important;
}

/* Si WVS muestra pastillas, ocultar el select nativo duplicado */
.papillon-qa .woo-variation-swatches .papillon-qa__field > select,
.papillon-qa .papillon-qa__field:has(.variable-items-wrapper) > select {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
  clip: rect(0, 0, 0, 0) !important;
}

@media (max-width: 600px) {
  .papillon-qa__sheet { max-height: 92vh; border-radius: 0 !important; }
  .papillon-qa__header { padding: 14px 20px 16px; }
  .papillon-qa__content { padding: 20px 20px max(24px, env(safe-area-inset-bottom)); }
  .papillon-qa__attributes { grid-template-columns: 1fr; gap: 14px; }
  .papillon-qa__actions { grid-template-columns: 88px 1fr; gap: 12px; }
  .papillon-qa__product { grid-template-columns: 70px 1fr; gap: 14px; }
  .papillon-qa__thumb img { width: 70px; height: 88px; }
  .papillon-qa__product-name { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .papillon-qa__sheet, .papillon-qa__backdrop { transition: none; }
}
