/* Prueba gratis: formulario, botón con estados (P13), celular con la tienda y ventana en grande.
   Usa los mismos colores, curvas y radios de estilos.css. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.trial { overflow: hidden; }
.trial::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(60% 50% at 85% 30%, var(--accent-soft), transparent 70%);
}
.trial-grid { position: relative; display: grid; gap: 48px; align-items: start; }
.trial-form { display: grid; gap: 20px; margin-top: 32px; max-width: 520px; }
.field { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field label, .field legend { font-weight: 700; font-size: 15px; padding: 0; }
.field .opt { font-weight: 500; color: var(--muted); }
.field input[type=text], .field input[type=tel], .field select, .thumbs input {
  width: 100%; min-height: 52px; padding: 0 16px; border-radius: 14px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font: inherit; font-size: 16px; transition: border-color 200ms ease, box-shadow 200ms ease;
}
.field select {
  appearance: none; -webkit-appearance: none; padding-right: 44px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 22px) 23px, calc(100% - 16px) 23px; background-size: 6px 6px; background-repeat: no-repeat;
}
.field input::placeholder, .thumbs input::placeholder { color: var(--muted); }
.field input:focus-visible, .field select:focus-visible, .thumbs input:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field input[aria-invalid="true"] { border-color: var(--error); }
.help { color: var(--muted); font-size: 14px; }
.field-error, .form-error { color: var(--error); font-size: 14px; }
.field-error:empty, .form-error:empty { display: none; }
:root { --error: #F28B82; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) { --error: #B42318; } }

/* Elegir fotos y video: dos opciones lado a lado */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.seg label { position: relative; display: grid; place-items: center; text-align: center; min-height: 48px; padding: 8px 10px; border-radius: 13px; font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--ink-2); cursor: pointer; transition: background-color 220ms ease, color 220ms ease; user-select: none; -webkit-user-select: none; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(input:checked) { background: var(--accent); color: var(--on-accent); }
.seg label:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.upload { display: grid; gap: 12px; margin-top: 4px; }
.upload[hidden], .trial-after[hidden] { display: none; }
.upload:not([hidden]) { animation: panel-in 260ms var(--ease-out) both; }
.drop {
  display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 14px 18px; border-radius: 16px;
  border: 1.5px dashed var(--line-strong); color: var(--ink-2); font-weight: 600; cursor: pointer;
  transition: border-color 200ms ease, background-color 200ms ease, transform 160ms var(--ease-out);
}
.drop .ic { width: 26px; height: 26px; color: var(--accent-ink); }
.drop:active { transform: scale(0.98); }
.upload:focus-within .drop { border-color: var(--accent); }
@media (hover: hover) and (pointer: fine) { .drop:hover { border-color: var(--accent); background: var(--accent-soft); } }
.upload-state { color: var(--muted); font-size: 14px; }
.upload-state:empty { display: none; }
.thumbs { display: grid; gap: 10px; }
.thumbs li { display: grid; grid-template-columns: 64px 1fr 96px auto; gap: 10px; align-items: center; animation: thumb-in 320ms var(--ease-out) both; animation-delay: calc(var(--i, 0) * 40ms); }
.thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--surface-2); transition: opacity 200ms ease; }
.thumbs .subiendo img { opacity: .45; }
.thumbs input { min-height: 46px; padding: 0 12px; }
.thumbs .quitar { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); transition: background-color 200ms ease, transform 160ms var(--ease-out); }
.thumbs .quitar:active { transform: scale(0.94); }
.thumbs .quitar .ic { width: 18px; height: 18px; }
@media (hover: hover) and (pointer: fine) { .thumbs .quitar:hover { background: var(--surface-2); color: var(--ink); } }
@keyframes thumb-in { from { opacity: 0; transform: scale(0.96); } }
@media (max-width: 420px) { .thumbs li { grid-template-columns: 52px 1fr 72px auto; gap: 8px; } .thumbs img { width: 52px; height: 52px; } }

/* Botón con estados (P13): mismo tamaño en reposo, creando, lista y error */
.trial-go { width: 100%; max-width: 520px; }
.trial-go .go-icon { display: grid; place-items: center; width: 24px; height: 24px; }
.trial-go .go-icon .ic { width: 22px; height: 22px; }
.trial-go.is-busy { pointer-events: none; }
.trial-go.is-busy .go-icon .ic { display: none; }
.trial-go.is-busy .go-icon::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%;
  border: 2.5px solid currentColor; border-right-color: transparent; animation: girar 650ms linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }

/* Celular con la tienda de prueba */
.trial-stage { display: grid; justify-items: center; gap: 18px; }
.trial-phone { width: min(78vw, 320px); }
.trial-empty {
  position: absolute; inset: 7px; display: grid; place-content: center; justify-items: center; gap: 12px; text-align: center;
  border-radius: calc(var(--r-phone) - 7px); color: var(--muted); font-weight: 600;
  background: linear-gradient(110deg, var(--surface) 30%, var(--surface-2) 50%, var(--surface) 70%) 0 0 / 300% 100%;
  transition: opacity 300ms var(--ease-out);
}
.trial-phone.loading .trial-empty { animation: brillo 1.4s linear infinite; }
@keyframes brillo { to { background-position: -150% 0; } }
.trial-screen { position: absolute; inset: 7px; overflow: hidden; border-radius: calc(var(--r-phone) - 7px); opacity: 0; transform: scale(0.98); transition: opacity 420ms var(--ease-out), transform 420ms var(--ease-out); }
.trial-phone.ready .trial-screen { opacity: 1; transform: none; }
.trial-phone.ready .trial-empty { opacity: 0; }
/* En el celular el teléfono vacío no ocupa una pantalla entera: aparece al crear la tienda (en la computadora queda al lado del formulario) */
@media (max-width: 959px) { .trial-phone:not(.loading):not(.ready) { display: none; } }
.trial-screen iframe, .dialog-screen iframe { border: 0; display: block; background: #000; }
.trial-screen iframe { width: 390px; height: 844px; transform-origin: 0 0; transform: scale(var(--s, .74)); }
.trial-after { display: grid; justify-items: center; gap: 12px; }
.trial-after:not([hidden]) { animation: panel-in 320ms var(--ease-out) both; }
.trial-meta { color: var(--ink-2); font-size: 15px; text-align: center; }
.trial-meta strong { color: var(--ink); }
.trial-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.trial-note { max-width: 340px; text-align: center; color: var(--muted); font-size: 13px; }
.trial-note a { text-decoration: underline; text-underline-offset: 2px; }

/* Ver en grande, sin salir de la página */
.trial-dialog { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.trial-dialog::backdrop { background: rgba(2, 6, 16, .82); }
.trial-dialog[open] { display: grid; place-items: center; animation: fade 220ms ease-out; }
.dialog-screen { width: min(100vw, 430px); height: 100dvh; overflow: hidden; background: #000; animation: dialog-in 300ms var(--ease-out) both; }
.dialog-screen iframe { width: 100%; height: 100%; }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.96); } }
.dialog-x { position: fixed; top: calc(12px + env(safe-area-inset-top)); right: 12px; z-index: 2; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--accent); color: var(--on-accent); box-shadow: var(--shadow); transition: transform 160ms var(--ease-out); }
.dialog-x:active { transform: scale(0.94); }
.dialog-x .ic { width: 22px; height: 22px; }
@media (min-width: 600px) { .dialog-screen { border-radius: 28px; height: min(92dvh, 932px); } }

@media (min-width: 960px) {
  .trial-grid { grid-template-columns: 1.05fr .95fr; gap: 72px; }
  .trial-stage { position: sticky; top: 96px; }
  .trial-phone { width: 330px; }
}
@media (prefers-reduced-motion: reduce) {
  .thumbs li, .upload:not([hidden]), .trial-after:not([hidden]), .dialog-screen { animation-name: fade; }
  .trial-phone.loading .trial-empty { animation: none; }
  .trial-screen { transform: none; }
  .trial-go.is-busy .go-icon::after { animation-duration: 1.6s; }
}
