/* Componentes de la tienda nueva que antes dependian de style.css (la tienda nueva no lo carga).
   Se cargan despues de tienda.css. */

/* Resumen de errores del checkout y marca en cada campo (auditoria FORM-01 / FEED-01) */
.checkout-errores { display: grid; gap: 6px; margin: 0 0 16px; padding: 14px 16px; border: 1px solid #f1c7c2; border-left: 4px solid #b42318; border-radius: 14px; background: #fef3f2; color: #912018; scroll-margin-top: 90px; }
.checkout-errores strong { font-size: 15px; color: #912018; }
.checkout-errores a { display: block; padding: 3px 0; color: #912018; font-size: 14px; line-height: 1.4; text-decoration: underline; text-underline-offset: 2px; }
.checkout-errores:focus { outline: 3px solid rgba(180, 35, 24, .35); outline-offset: 2px; }
.campo-invalido { border-color: #b42318 !important; background-color: #fffafa; }
.campo-invalido:focus { box-shadow: 0 0 0 3px rgba(180, 35, 24, .22); }
.campo-error { display: block; margin-top: 6px; color: #b42318; font-size: 13px; line-height: 1.35; font-weight: 600; }
html.dark .checkout-errores { background: rgba(255, 142, 158, .12); border-color: rgba(255, 142, 158, .4); border-left-color: #ff8e9e; color: #ffd1d8; }
html.dark .checkout-errores strong, html.dark .checkout-errores a { color: #ffd1d8; }
html.dark .campo-invalido { border-color: #ff8e9e !important; background-color: rgba(255, 142, 158, .08); }
html.dark .campo-error { color: #ffb4c0; }

/* El boton de chat no debe tapar el final del boton principal del checkout (auditoria VIS-01).
   En el checkout se oculta (ahi el contacto esta en el pie y en el pedido). */
body[data-page="checkout.checkout"] .boton-whatsapp-flotante,
body[data-page="tienda.go_premium"] .boton-whatsapp-flotante,
body[data-page="checkout.seguimiento"] .boton-whatsapp-flotante { display: none; }

/* Selector de archivo propio (auditoria DS-01): el nativo mostraba "Choose File / No file chosen" en ingles */
.archivo-propio { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px; border: 1px dashed rgba(74, 92, 255, .45); border-radius: 14px; background: rgba(255, 255, 255, .5); cursor: pointer; }
.archivo-input { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip-path: inset(50%); }
.archivo-boton { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 12px; background: #3B4AE6; color: #fff; font-weight: 700; font-size: 14px; }
.archivo-propio:hover .archivo-boton { background: #2f3dd0; }
.archivo-input:focus-visible + .archivo-boton { outline: 3px solid rgba(59, 74, 230, .45); outline-offset: 2px; }
.archivo-nombre { font-size: 14px; color: #4b5563; overflow-wrap: anywhere; }
.archivo-nombre.elegido { color: #0b6b4a; font-weight: 600; }
.campo-archivo { position: relative; }
html.dark .archivo-propio { background: rgba(255, 255, 255, .05); border-color: rgba(165, 180, 252, .45); }
html.dark .archivo-boton { background: #5b6cff; }
html.dark .archivo-nombre { color: #b6c0da; }
html.dark .archivo-nombre.elegido { color: #8fd9b8; }

/* Preguntas frecuentes agrupadas (auditoria FAQ-01) */
.faq-grupo { margin: 22px 0 8px; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; color: #4b5563; font-weight: 800; }
.faq-grupo:first-child { margin-top: 0; }
html.dark .faq-grupo { color: #b6c0da; }

/* La imagen provisoria de producto (recuadro casi blanco) no debe ser lo mas claro de la pantalla en oscuro (auditoria VIS-03) */
html.dark .card-img img[src*="producto-placeholder"], html.dark .carrito-item img[src*="producto-placeholder"] { filter: brightness(.55) saturate(.85); }

/* App instalable (PWA): invitacion, ayuda de iOS, avisos del pedido y modo "app" sin rastro del navegador */
.pwa-banner { position: fixed; left: 50%; bottom: calc(92px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 95; width: min(560px, calc(100% - 24px)); display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 18px; }
.pwa-banner[hidden], .pwa-ayuda[hidden] { display: none; }
.pwa-banner-ico { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--rf-btn, #3B49E8); color: var(--rf-btn-ink, #fff); }
.pwa-banner-ico svg { width: 20px; height: 20px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pwa-banner > span { flex: 1; min-width: 0; display: grid; gap: 2px; }
.pwa-banner b { font-size: 15px; }
.pwa-banner small { font-size: 12.5px; color: var(--tx2); line-height: 1.35; }
.pwa-banner .btn { min-height: 40px; padding: 0 16px; }
.pwa-banner-x { flex: none; width: 32px; height: 32px; border: 0; border-radius: 10px; background: transparent; color: var(--tx3); font-size: 15px; cursor: pointer; }
.pwa-banner-x:hover { background: rgba(127, 127, 127, .15); }
@media (min-width: 901px) { .pwa-banner { bottom: 24px; left: auto; right: 24px; transform: none; width: 420px; } }
.pwa-ayuda { position: fixed; inset: 0; z-index: 400; display: grid; place-items: center; padding: 20px; background: rgba(10, 15, 25, .5); }
.pwa-ayuda-c { width: min(420px, 100%); padding: 22px; border-radius: 22px; display: grid; gap: 14px; background: var(--rf-surface, #fff); }
.pwa-ayuda-c strong { font-size: 18px; }
.pwa-ayuda-c ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; color: var(--tx2); font-size: 15px; }
button.mm-t { font: inherit; color: inherit; cursor: pointer; }
button.mm-t[hidden], .f-link[hidden] { display: none; }
.f-link { display: block; padding: 5px 0; border: 0; background: none; font: inherit; color: var(--tx2); font-size: 14.5px; cursor: pointer; text-align: left; }
.f-link:hover { color: var(--tx); }
.pedido-avisos { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin: 18px 0; padding: 14px 18px; border-radius: 18px; }
.pedido-avisos[hidden] { display: none; }
.pedido-avisos > span { display: grid; gap: 2px; flex: 1; min-width: 220px; }
.pedido-avisos small { color: var(--tx2); }
.sin-conexion { padding-block: 72px; display: grid; place-items: center; }
.sin-conexion-card { max-width: 480px; padding: 32px; border-radius: 22px; text-align: center; display: grid; gap: 14px; justify-items: center; }
.sin-conexion-card p { color: var(--tx2); }

/* Dentro de la app instalada: respeta las zonas seguras, sin rebote ni seleccion de interfaz */
html.pwa-app { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
html.pwa-app body { padding-top: env(safe-area-inset-top); }
html.pwa-app .header, html.pwa-app .nav-m, html.pwa-app .boton-whatsapp-flotante, html.pwa-app .btn, html.pwa-app .nav a, html.pwa-app .nav-m a { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
html.pwa-app [data-pwa-instalar], html.pwa-app [data-pwa-banner] { display: none !important; }
body.tv2 .pwa-ayuda-c.glass { background: var(--rf-surface); }

/* Intro de la app instalada (solo cuando <html> tiene .intro-pendiente) */
#intro-app { display: none; }
html.intro-pendiente #intro-app { display: block; position: fixed; inset: 0; z-index: 10000; overflow: hidden; background: linear-gradient(180deg, #ECEFFB, #F2F0F9 55%, #F6F1F3); touch-action: manipulation; transition: opacity .4s ease, transform .4s ease; }
html.dark.intro-pendiente #intro-app { background: linear-gradient(180deg, #0B1020, #0A0F19); }
#intro-app.intro-sale { opacity: 0; transform: scale(1.03); pointer-events: none; }
.intro-blob { position: absolute; border-radius: 50%; filter: blur(90px); }
.ib1 { width: 60vmax; height: 60vmax; left: -20vmax; top: -18vmax; background: #A9B6FF; opacity: .55; }
.ib2 { width: 50vmax; height: 50vmax; right: -16vmax; bottom: -16vmax; background: #FFD6C4; opacity: .5; }
.ib3 { width: 34vmax; height: 34vmax; left: 30%; top: 40%; background: #BDEBFF; opacity: .35; }
html.dark .ib1 { background: #3B49E8; opacity: .22; } html.dark .ib2 { background: #1F6F8B; opacity: .16; } html.dark .ib3 { opacity: .1; }
.intro-orbita { position: absolute; left: 50%; top: 44%; width: 0; height: 0; }
.intro-orbita .it { position: absolute; left: 0; top: 0; will-change: transform, filter, opacity; opacity: 0; }
.intro-orbita .it img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 22px rgba(40, 50, 130, .28)); }
.intro-sello, .intro-anillo { position: absolute; left: 50%; top: 44%; width: min(30vmin, 150px); aspect-ratio: 1; margin: calc(min(30vmin, 150px) / -2) 0 0 calc(min(30vmin, 150px) / -2); opacity: 0; }
.intro-sello img { display: block; width: 100%; border-radius: 26%; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .4), 0 30px 60px -18px rgba(40, 50, 200, .65), 0 8px 18px -8px rgba(40, 50, 200, .4); }
.intro-sello::after { content: ""; position: absolute; inset: 0; border-radius: 26%; background: linear-gradient(135deg, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0) 45%); pointer-events: none; }
.intro-anillo { border-radius: 50%; border: 2px solid rgba(59, 73, 232, .5); }
.intro-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 44%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 55%); opacity: 0; pointer-events: none; }
html.dark .intro-flash { background: radial-gradient(circle at 50% 44%, rgba(160, 180, 255, .55), rgba(160, 180, 255, 0) 55%); }
.intro-marca { position: absolute; left: 0; right: 0; top: calc(44% + min(30vmin, 150px) / 2 + 26px); display: flex; justify-content: center; overflow: hidden; padding: 4px 0; font: 800 min(24px, 5.4vw) Manrope, system-ui, sans-serif; letter-spacing: .3em; text-indent: .3em; white-space: nowrap; color: #0E1330; }
html.dark .intro-marca { color: #F3F6FF; }
.intro-marca span { display: inline-block; transform: translateY(120%); }

/* Enlace discreto al sorteo mensual (solo se pinta cuando esta activo) */
.enlace-sorteo-mensual { margin: 10px 0 0; text-align: center; font-size: 13px; }
.enlace-sorteo-mensual a { color: inherit; opacity: .7; text-decoration: underline; text-underline-offset: 3px; }
.enlace-sorteo-mensual a:hover { opacity: 1; }
