/* ==========================================================================
   Vinademy — botón y tarjeta de compra de cursos ([vinademy_comprar], plugin vinademy-cursos · includes/class-compra.php)
   Mismo lenguaje que .vnd-btn (home-editorial.css): Poppins, mayúsculas espaciadas, magenta → tinta.
   Radios de la casa: botón 8px, tarjeta 16px.
   ========================================================================== */
/* ---------- blindaje: lo que el tema pone a párrafos, listas, enlaces y botones no entra en la tarjeta.
   Especificidad (1,1,1) con :where(): gana a los temas y pierde contra las reglas de abajo (mismo peso, van después).
   Comprobado en vinademy.com: no cambia nada de lo que se ve hoy. ---------- */
body:not(#vnd) .vnd-compra :where(h1,h2,h3,h4,h5,h6,p,ul,ol,li,dl,dt,dd,figure,blockquote,small,label,section,header,footer,aside,nav,article,fieldset,legend,table,th,td){margin:0;padding:0;border:0;background:none;color:inherit;font-family:inherit;font-size:inherit;font-weight:inherit;font-style:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;text-align:inherit;text-shadow:none;max-width:none;box-shadow:none}
body:not(#vnd) .vnd-compra :where(h1,h2,h3,h4,h5,h6){line-height:1.2}
body:not(#vnd) .vnd-compra :where(ul,ol,li){list-style:none}
body:not(#vnd) .vnd-compra :where(button,[type=button],[type=submit],[type=reset]){margin:0;padding:0;border:0;border-radius:0;background:none;box-shadow:none;color:inherit;font:inherit;line-height:inherit;letter-spacing:inherit;text-transform:none;text-decoration:none;text-shadow:none;min-height:auto;width:auto;height:auto;transform:none;cursor:pointer}
body:not(#vnd) .vnd-compra :where(button,[type=button],[type=submit]):where(:hover,:focus,:active){background:none;color:inherit;box-shadow:none}
body:not(#vnd) .vnd-compra :where(input:not([type=checkbox]):not([type=radio]):not([type=range]),select,textarea){margin:0;box-shadow:none;font:inherit;color:inherit;min-height:auto;height:auto;line-height:inherit;letter-spacing:inherit;text-transform:none}
body:not(#vnd) .vnd-compra :where(a){color:inherit;box-shadow:none;text-shadow:none}
body:not(#vnd) .vnd-compra :where(img,svg,video,canvas){box-shadow:none;border:0;border-radius:0}

body:not(#vnd) .vnd-compra {
  --cp-accent: var(--vnd-accent, #B80872);
  --cp-ink: var(--vnd-ink, #0B0A0B);
  --cp-muted: var(--vnd-muted, #62575B);
  --cp-line: var(--vnd-line, rgba(11, 10, 11, .12));
  font-family: "Poppins", sans-serif;
}

/* ---------- botón ---------- */
body:not(#vnd) .vnd-compra-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 56px;
  padding: 18px 30px;
  border: 0;
  border-radius: 8px;
  background: var(--cp-accent);
  color: #fff !important;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .2em;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none !important;
  transition: background-color .3s ease, color .3s ease;
}
body:not(#vnd) .vnd-compra-btn:hover,
body:not(#vnd) .vnd-compra-btn:focus-visible {
  background: var(--cp-ink);
  color: #fff !important;
}
body:not(#vnd) .vnd-compra-btn:focus-visible {
  outline: 2px solid var(--cp-accent);
  outline-offset: 3px;
}
/* precio dentro del botón, separado por un filete */
body:not(#vnd) .vnd-compra-bp {
  padding-left: 12px;
  border-left: 1px solid rgba(255, 255, 255, .45);
  letter-spacing: .06em;
}
body:not(#vnd) .vnd-compra-bp .woocommerce-Price-amount { color: inherit; }
body:not(#vnd) .vnd-compra-i {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .3s ease;
}
body:not(#vnd) .vnd-compra-btn:hover .vnd-compra-i { transform: translateX(4px); }

/* sobre fondo oscuro (cierre de las páginas de curso): el hover no puede ser tinta */
body:not(#vnd) .vnd-ap-fin .vnd-compra--boton .vnd-compra-btn:hover,
body:not(#vnd) .vnd-final .vnd-compra--boton .vnd-compra-btn:hover {
  background: #fff;
  color: var(--cp-accent) !important;
}

/* ---------- tarjeta ---------- */
body:not(#vnd) .vnd-compra--tarjeta {
  background: #fff;
  color: var(--cp-ink);
  border: 1px solid var(--cp-line);
  border-radius: 16px;
  padding: clamp(24px, 3vw, 36px);
  box-shadow: 0 24px 60px -36px rgba(11, 10, 11, .35);
}
body:not(#vnd) .vnd-compra--tarjeta p { margin: 0; }
body:not(#vnd) .vnd-compra-k {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--cp-accent);
}
body:not(#vnd) .vnd-compra-k::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: #1F9D55;
  vertical-align: 1px;
}
body:not(#vnd) .vnd-compra--tarjeta.is-cerrada .vnd-compra-k { color: var(--cp-muted); }
body:not(#vnd) .vnd-compra--tarjeta.is-cerrada .vnd-compra-k::before { background: var(--cp-muted); }
body:not(#vnd) .vnd-compra-t {
  margin-top: 14px !important;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -.02em;
}
body:not(#vnd) .vnd-compra-precio {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--cp-line);
  margin-bottom: 6px;
  font-size: clamp(2.2rem, 3.4vw, 2.8rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.03em;
}
body:not(#vnd) .vnd-compra-precio del {
  font-size: .5em;
  font-weight: 500;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra-precio ins { text-decoration: none; }
body:not(#vnd) .vnd-compra-precio > span:last-child {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .04em;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra-lista {
  list-style: none;
  margin: 22px 0 24px;
  padding: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--cp-ink);
}
body:not(#vnd) .vnd-compra-lista li {
  position: relative;
  margin: 0;
  padding: 7px 0 7px 28px;
}
body:not(#vnd) .vnd-compra-lista li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: 12px;
  width: 12px;
  height: 7px;
  border: solid var(--cp-accent);
  border-width: 0 0 2px 2px;
  transform: rotate(-45deg);
}
body:not(#vnd) .vnd-compra--tarjeta .vnd-compra-btn { width: 100%; }
body:not(#vnd) .vnd-compra-txt {
  margin: 14px 0 22px !important;
  font-size: 15px;
  line-height: 1.6;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra--tarjeta.is-cerrada .vnd-compra-txt { margin-bottom: 0 !important; }
body:not(#vnd) .vnd-compra-pie {
  margin-top: 14px !important;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra-alt {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 16px !important;
  padding-top: 16px;
  border-top: 1px solid var(--cp-line);
  font-size: 13px;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra-alt a {
  color: var(--cp-ink) !important;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--cp-accent);
  text-underline-offset: 4px;
}
body:not(#vnd) .vnd-compra-alt a:hover { color: var(--cp-accent) !important; }

body:not(#vnd) .vnd-compra-aviso {
  padding: 12px 16px;
  border: 1px dashed var(--vnd-accent, #B80872);
  border-radius: 8px;
  font-size: 13px;
}

/* en el cierre oscuro de las páginas de curso, la tarjeta ocupa la columna derecha sin el filete de arriba */
body:not(#vnd) .vnd-ap-fin-b:has(.vnd-compra--tarjeta) {
  border-top: 0;
  padding-top: 0 !important;
}
@media (min-width: 1024px) {
  body:not(#vnd) .vnd-ap-fin-grid:has(.vnd-compra--tarjeta) {
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
  }
}

/* ---------- barra de compra fija ([vinademy_comprar fijo="si"], assets/js/compra.js) ---------- */
body:not(#vnd) .vnd-compra-fijo {
  position: fixed;
  z-index: 9990;
  left: 50%;
  bottom: 20px;
  width: min(760px, calc(100% - 40px));
  transform: translate(-50%, calc(100% + 40px));
  opacity: 0;
  transition: transform .35s ease, opacity .25s ease;
  pointer-events: none;
}
body:not(#vnd) .vnd-compra-fijo.is-on {
  transform: translate(-50%, 0);
  opacity: 1;
  pointer-events: auto;
}
body:not(#vnd) .vnd-compra-fijo-in {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 12px 12px 24px;
  background: #fff;
  border: 1px solid var(--cp-line);
  border-radius: 16px;
  box-shadow: 0 18px 50px -18px rgba(11, 10, 11, .4);
}
body:not(#vnd) .vnd-compra-fijo-tx {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.3;
}
body:not(#vnd) .vnd-compra-fijo-tx b {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--cp-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body:not(#vnd) .vnd-compra-fijo-tx span {
  font-size: 13px;
  color: var(--cp-muted);
}
body:not(#vnd) .vnd-compra-fijo-tx strong { font-weight: 600; color: var(--cp-ink); }
body:not(#vnd) .vnd-compra-fijo-tx del { font-weight: 400; color: var(--cp-muted); }
body:not(#vnd) .vnd-compra-fijo-tx ins { text-decoration: none; }
body:not(#vnd) .vnd-compra-fijo .vnd-compra-btn {
  flex: none;
  min-height: 52px;
  padding: 16px 26px;
}
/* móvil: barra a lo ancho, pegada abajo */
@media (max-width: 640px) {
  body:not(#vnd) .vnd-compra-fijo {
    bottom: 0;
    width: 100%;
  }
  body:not(#vnd) .vnd-compra-fijo-in {
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 16px 16px 0 0;
  }
  body:not(#vnd) .vnd-compra-fijo-tx b { font-size: 14px; }
  body:not(#vnd) .vnd-compra-fijo-tx span { font-size: 12px; }
  body:not(#vnd) .vnd-compra-fijo .vnd-compra-btn {
    min-height: 48px;
    padding: 14px 18px;
    letter-spacing: .14em;
  }
  body:not(#vnd) .vnd-compra-fijo .vnd-compra-i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(#vnd) .vnd-compra-fijo { transition: none; }
}
