:root {
    --color-yape: #74006e;
    --color-plin: #00E4C3;
    --color-fondo: #f4f7f6;
    --color-texto: #333;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', Arial, sans-serif; }
body { background-color: var(--color-fondo); color: var(--color-texto); line-height: 1.6; padding: 15px; }

header { text-align: center; margin-bottom: 25px; }
h1 { color: var(--color-yape); margin-bottom: 5px; font-size: 1.8rem;}
p { font-size: 0.95rem; color: #555; }

.bloque-adsense { background: #e0e0e0; color: #777; text-align: center; padding: 15px; margin: 15px auto; max-width: 1200px; border: 1px dashed #bbb; font-size: 0.85rem; border-radius: 6px; }

/* CUADRÍCULA PRINCIPAL (Plantilla enorme en PC) */
.contenedor-principal { display: flex; flex-direction: column; gap: 25px; max-width: 1200px; margin: 0 auto; }

@media (min-width: 992px) {
    .contenedor-principal { flex-direction: row; align-items: flex-start; justify-content: space-between; }
    .formulario-zona { width: 100%; max-width: 420px; flex-shrink: 0; }
    .vista-previa-zona { flex-grow: 1; display: flex; justify-content: center; position: sticky; top: 20px; }
    
    /* TAMAÑO GIGANTE DEL CARTEL EN PC */
    .cartel-diseno { max-width: 550px !important; padding: 40px !important; }
    .encabezado-cartel { font-size: 1.8rem !important; min-height: 60px !important; }
    .logos-marcas { font-size: 1.3rem !important; padding: 8px 25px !important; margin: 15px 0 !important; }
    #txtNombre { font-size: 1.8rem !important; margin-bottom: 8px !important; }
    #txtCelular { font-size: 1.5rem !important; }
    #txtAviso { font-size: 1.1rem !important; margin-top: 10px !important; }
    .espacio-qr { margin: 20px 0 !important; padding: 20px !important; }
    
    #btnBurbujaMovil { display: none !important; }
    .cabecera-movil-cerrar { display: none !important; }
}

/* FORMULARIO Y SECCIONES */
.formulario-zona { background: white; padding: 25px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.bloque-seccion { margin-bottom: 25px; }
.bloque-seccion h2 { font-size: 1.1rem; border-bottom: 2px solid #eee; padding-bottom: 5px; margin-bottom: 15px; color: #444; }

.campo { margin-bottom: 15px; }
label { display: block; margin-bottom: 6px; font-weight: bold; font-size: 0.9rem; }
input[type="text"], input[type="tel"], select { width: 100%; padding: 10px; border: 2px solid #ddd; border-radius: 6px; font-size: 1rem; outline: none; background: #fafafa; transition: border-color 0.2s; }
input:focus, select:focus { border-color: var(--color-yape); }

.btn-subir-foto { display: block; background: #ffebee; border: 1px solid #ffcdd2; padding: 20px; text-align: center; border-radius: 6px; cursor: pointer; font-weight: bold; color: #b71c1c; transition: background 0.2s; }
.btn-subir-foto:hover { background: #ffcdd2; }
.btn-eliminar-foto { width: 100%; background: #ffcdd2; color: #b71c1c; border: 1px solid #ef9a9a; padding: 10px; border-radius: 6px; margin-top: 8px; font-weight: bold; cursor: pointer; }

.btn-descargar { width: 100%; background-color: var(--color-plin); color: #004d41; font-size: 1.1rem; font-weight: bold; padding: 15px; border: none; border-radius: 6px; cursor: pointer; transition: background 0.2s; margin-top: 15px;}
.btn-descargar:hover { background-color: #00bfa5; }
.btn-descargar:disabled { background-color: #ccc; color: #666; cursor: not-allowed;}

.seccion-ayuda { margin-top: 20px; padding: 15px; background: #f9f9f9; border: 1px solid #eee; border-radius: 6px; font-size: 0.85rem; color: #555; }
.seccion-ayuda h3 { font-size: 0.95rem; margin-bottom: 5px; color: #333; }
.seccion-apoyo { max-width: 1200px; margin: 25px auto; text-align: center; background: white; padding: 25px; border-radius: 10px; box-shadow: 0 4px 10px rgba(0,0,0,0.05); }
.seccion-apoyo h3 { color: #d32f2f; margin-bottom: 10px; }
.btn-mostrar-qr-apoyo { background: #eee; border: 1px solid #ccc; padding: 8px 15px; border-radius: 6px; cursor: pointer; font-weight: bold; margin-top: 10px; }

/* MODAL CELULAR */
@media (max-width: 991px) {
    .vista-previa-zona { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.95); z-index: 1000; justify-content: flex-start; align-items: center; padding: 30px 15px; overflow-y: auto; }
    .vista-previa-zona.abierto { display: flex; flex-direction: column; }
    .cabecera-movil-cerrar { display: flex; justify-content: space-between; width: 100%; max-width: 400px; color: white; margin-bottom: 20px; align-items: center; }
    .cabecera-movil-cerrar h3 { margin: 0; font-size: 1.2rem; }
    .cabecera-movil-cerrar button { background: #ef4444; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-weight: bold; cursor: pointer; font-size: 1rem; }
    .burbuja-flotante { display: block; position: fixed; bottom: 20px; right: 20px; background: var(--color-plin); color: #004d41; padding: 15px 20px; border-radius: 30px; font-weight: bold; border: none; box-shadow: 0 4px 15px rgba(0,0,0,0.5); cursor: pointer; z-index: 999; }
}

/* CARTEL BASE Y FORMATOS */
.cartel-diseno { width: 100%; max-width: 400px; border-radius: 12px; padding: 20px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; box-shadow: 0 10px 25px rgba(0,0,0,0.15); transition: all 0.3s ease; margin: 0 auto; }
.formato-a4 { aspect-ratio: 1 / 1.414; }
.formato-acrilico { aspect-ratio: 10 / 15; }

.encabezado-cartel { font-weight: 900; font-size: 1.25rem; line-height: 1.2; text-transform: uppercase; width: 100%; text-align: center; display: flex; align-items: center; justify-content: center; min-height: 45px; word-break: break-word; }
.logos-marcas { padding: 4px 16px; border-radius: 20px; font-weight: bold; font-size: 1.1rem; margin: 5px 0; }
.espacio-qr { background: white; width: 80%; aspect-ratio: 1 / 1; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 12px; margin: 10px auto; overflow: hidden; }
.espacio-qr img { width: 100% !important; height: 100% !important; object-fit: contain !important; margin: 0 auto !important; display: block !important; }
.espacio-qr canvas { display: none !important; }
#placeholderText { color: #999; font-size: 0.85rem; text-align: center; }

.datos-usuario { width: 100%; padding: 12px 10px; border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
#txtNombre { font-weight: 900; font-size: 1.25rem; margin-bottom: 3px; word-break: break-word; line-height: 1.1; }
#txtCelular { font-size: 1.15rem; font-weight: bold; }
#txtAviso { display: none; font-weight: 600; font-size: 0.85rem; margin-top: 5px; width: 100%; word-break: break-word; }

/* =========================================================
   COLORES FORZADOS A BLANCO PURO (Elimina el 'café raro')
   ========================================================= */
#txtNombre, #txtCelular, #viewFrase, #txtAviso { color: #ffffff !important; }

/* 1. Yape */
.estilo-yape { background: var(--color-yape); }
.estilo-yape .logos-marcas { background: var(--color-plin); color: #004d41 !important; }
.estilo-yape .datos-usuario { background: rgba(255, 255, 255, 0.1); }
.estilo-yape #txtCelular { color: var(--color-plin) !important; }
.estilo-yape #txtAviso { color: #ffeb3b !important; }

/* 2. Plin */
.estilo-plin { background: #005a74; }
.estilo-plin .logos-marcas { background: var(--color-plin); color: #004d41 !important; }
.estilo-plin .datos-usuario { background: rgba(255, 255, 255, 0.1); }
.estilo-plin #txtCelular { color: var(--color-plin) !important; }
.estilo-plin #txtAviso { color: #ffeb3b !important; }

/* 3. Premium Negro (Arreglado el nombre café, ahora es blanco) */
.estilo-premium { background: #111; border: 2px solid #f5cb5c; }
.estilo-premium .logos-marcas { background: #f5cb5c; color: #111 !important; }
.estilo-premium .datos-usuario { background: rgba(255, 255, 255, 0.05); border: 1px dashed #f5cb5c; }
.estilo-premium #txtNombre, .estilo-premium #txtCelular, .estilo-premium #viewFrase { color: #ffffff !important; } /* BLANCO PURO */
.estilo-premium #txtAviso { color: #f5cb5c !important; }

/* 4. Blanco Claro (Ahorro Tinta) */
.estilo-claro { background: white; border: 4px solid #111; }
.estilo-claro .logos-marcas { background: #111; color: white !important; }
.estilo-claro .datos-usuario { background: #f0f0f0; border: 1px solid #ccc; }
.estilo-claro #txtNombre, .estilo-claro #viewFrase { color: #111111 !important; }
.estilo-claro #txtCelular { color: var(--color-yape) !important; }
.estilo-claro #txtAviso { color: #d32f2f !important; }

/* 5. Azul */
.estilo-azul { background: #0d47a1; }
.estilo-azul .logos-marcas { background: #ffca28; color: #000 !important; }
.estilo-azul .datos-usuario { background: rgba(255, 255, 255, 0.1); border: 1px solid rgba(255,255,255,0.3); }
.estilo-azul #txtCelular, .estilo-azul #txtAviso { color: #ffca28 !important; }

/* 6. Rosa */
.estilo-rosa { background: #f48fb1; border: 2px solid #d81b60; }
.estilo-rosa .logos-marcas { background: #d81b60; color: white !important; }
.estilo-rosa .datos-usuario { background: rgba(255, 255, 255, 0.7); border: 1px solid #d81b60; }
.estilo-rosa #txtNombre, .estilo-rosa #viewFrase { color: #333333 !important; }
.estilo-rosa #txtCelular, .estilo-rosa #txtAviso { color: #d81b60 !important; }

/* 7. Naranja */
.estilo-naranja { background: #e65100; }
.estilo-naranja .logos-marcas { background: white; color: #e65100 !important; }
.estilo-naranja .datos-usuario { background: rgba(0, 0, 0, 0.15); border: 1px solid rgba(255, 255, 255, 0.3); }
.estilo-naranja #txtAviso { color: #ffeb3b !important; }

/* 8. Verde */
.estilo-verde { background: #1b5e20; }
.estilo-verde .logos-marcas { background: white; color: #1b5e20 !important; }
.estilo-verde .datos-usuario { background: rgba(255, 255, 255, 0.15); border: 1px solid rgba(255, 255, 255, 0.3); }
.estilo-verde #txtCelular { color: #c8e6c9 !important; }
.estilo-verde #txtAviso { color: #ffeb3b !important; }

.pie-pagina { text-align: center; font-size: 0.8rem; color: #777; margin-top: 20px; }

/* =========================================================
   LAYOUT GLOBAL Y ANUNCIOS LATERALES (SOLO PC)
   ========================================================= */
.layout-global { display: flex; justify-content: center; align-items: flex-start; gap: 20px; max-width: 1600px; margin: 0 auto; width: 100%; }
.anuncio-lateral { display: none; width: 160px; min-height: 600px; background: #e0e0e0; border: 1px dashed #bbb; border-radius: 8px; color: #777; text-align: center; padding: 20px 5px; font-size: 0.85rem; position: sticky; top: 20px; }

/* Mostrar anuncios laterales solo en pantallas ultra anchas */
@media (min-width: 1350px) {
    .anuncio-lateral { display: flex; align-items: center; justify-content: center; }
}
