/* ============ Paleta oficial CompralU ============ */
:root {
  --azul: #0B2D6B;
  --azul-2: #13408F;
  --turquesa: #14B8A6;
  --turquesa-texto: #0F8C7E;
  --amarillo: #F4B400;
  --fondo-suave: #F4F6FB;
  --texto: #12182B;
  --texto-suave: #5A6275;
  --borde: #C9CFDC;
  --borde-suave: #E3E6EE;
  --error: #C62828;
  --ancho: 1100px;
  --margen: max(20px, calc((100% - var(--ancho)) / 2 + 20px));
}

* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, "Segoe UI", sans-serif; background: #FFFFFF; color: var(--texto); }
a { color: var(--turquesa-texto); font-weight: 700; }
img { max-width: 100%; }
.oculto { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.suave { color: var(--texto-suave); font-weight: 400; }

/* ============ Logo con sonrisa ============ */
.marca { display: inline-flex; align-items: center; gap: 8px; color: #fff; text-decoration: none; }
.wordmark { position: relative; display: inline-block; font-size: 22px; font-weight: 900; letter-spacing: -0.5px; line-height: 1; padding-bottom: 8px; color: #fff; }
.wordmark b { color: var(--amarillo); }
.sonrisa { position: absolute; left: 4%; bottom: 0; width: 92%; height: 8px; fill: var(--amarillo); }

/* ============ Encabezado ============ */
.barra { background: var(--azul); color: #fff; }
.barra-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 76px; padding: 10px var(--margen); flex-wrap: wrap; }
.barra-acciones { display: flex; align-items: center; gap: 10px; }
.barra-acciones form { margin: 0; }
.btn-barra { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 16px; border-radius: 12px; font-size: 15px; font-weight: 600; font-family: inherit; text-decoration: none; cursor: pointer; border: 0; }
.btn-barra.sec { background: rgba(255, 255, 255, 0.12); color: #fff; }
.btn-barra.borde { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.85); }
.btn-barra.pri { background: var(--amarillo); color: var(--azul); }
.btn-barra.icono { padding: 0 10px; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.6); background: transparent; }
.saludo { font-size: 14px; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: 0.9; }
.solo-movil { display: none !important; }
@media (max-width: 640px) {
  .solo-escritorio { display: none !important; }
  .solo-movil { display: inline-flex !important; }
  .btn-barra.sec span { display: none; }
  .barra-in { flex-wrap: nowrap; padding: 10px 14px; min-height: 66px; }
  .barra-acciones { gap: 6px; }
  .btn-barra { padding: 0 10px; font-size: 13px; min-height: 40px; }
  .barra .marca img { width: 30px; height: 30px; }
  .barra .wordmark { font-size: 15px; }
  .barra-acciones { flex-wrap: nowrap; }
  .btn-barra { white-space: nowrap; flex: none; }
}
@media (max-width: 380px) {
  .barra .wordmark { font-size: 14px; }
  .btn-barra { padding: 0 8px; }
  .btn-barra.icono, .btn-barra.sec { padding: 0 7px; }
}

/* ============ Botones y avisos ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 22px; border: 0; border-radius: 13px; font-size: 16px; font-weight: 800; font-family: inherit; text-decoration: none; cursor: pointer; }
.btn.amarillo { background: var(--amarillo); color: var(--azul); }
.btn.azul { background: var(--azul); color: #fff; }
.formulario .btn, .detalle-info .btn { width: 100%; }
.enlace-boton { background: none; border: 0; padding: 0; font: inherit; color: var(--turquesa-texto); font-weight: 700; text-decoration: underline; cursor: pointer; }
.centro { text-align: center; font-size: 14px; color: #3A4256; }

.aviso { border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; }
.aviso.demo { background: #FFF4E5; color: #5C3B00; }
.aviso.ok { background: #E1F3E9; color: #0B6B3A; }
.aviso.info { background: #E3F6F3; color: #0B5C53; }
.aviso.error { background: #FDECEC; color: var(--error); font-weight: 700; }
.aviso.colegiatura { background: #EEF2FA; color: var(--azul); }

/* ============ Formularios ============ */
.contenedor { max-width: 480px; margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 14px; }
.titulo-pagina { margin: 4px 0 0; font-size: 26px; color: var(--azul); }
.formulario { display: flex; flex-direction: column; gap: 14px; }
label, .campo { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 700; }
.etiqueta { font-size: 14px; font-weight: 700; }
input[type=text], input[type=email], input[type=password], input[type=tel], input[type=search], select, textarea {
  min-height: 46px; border: 1px solid var(--borde); border-radius: 11px; padding: 0 12px; font-size: 15px; font-family: inherit; background: #fff; color: var(--texto);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--turquesa); outline-offset: 1px; border-color: var(--turquesa); }
textarea { padding: 10px 12px; resize: vertical; }
.dos-columnas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.casilla { flex-direction: row; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--borde-suave); border-radius: 12px; padding: 12px; cursor: pointer; }
.casilla.sin-borde { border: 0; padding: 0; justify-content: space-between; }
.casilla input { width: 22px; height: 22px; accent-color: var(--azul); flex: none; }
.casilla small { display: block; font-weight: 400; color: var(--texto-suave); font-size: 12px; margin-top: 2px; }
.bloque-vendedor { border-left: 3px solid var(--turquesa); padding-left: 12px; display: flex; flex-direction: column; gap: 12px; }
.error-campo { color: var(--error); font-size: 13px; font-weight: 600; }
.coincide { font-size: 13px; font-weight: 700; min-height: 0; }
.coincide.si { color: #0B6B3A; }
.coincide.no { color: var(--error); }
.otp { height: 58px; text-align: center; letter-spacing: 12px; font-size: 26px; font-weight: 800; border: 2px solid var(--azul) !important; }

/* Fotos con vista previa */
.fotos-rejilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.agregar-foto, .miniatura { aspect-ratio: 1; border-radius: 12px; }
.agregar-foto { border: 2px dashed #9AA6C4; background: var(--fondo-suave); color: var(--azul); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-size: 12px; cursor: pointer; }
.miniatura { position: relative; overflow: hidden; border: 1px solid var(--borde-suave); }
.miniatura img { width: 100%; height: 100%; object-fit: cover; display: block; }
.quitar { position: absolute; top: 4px; right: 4px; width: 28px; height: 28px; border-radius: 14px; border: 0; background: rgba(11, 45, 107, 0.85); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }

/* Aporte a colegiatura */
.tarjeta-aporte { border: 1px solid var(--borde-suave); border-left: 4px solid var(--turquesa); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.rango { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.rango input { flex: 1; accent-color: var(--turquesa); }
.rango-valor { font-size: 20px; font-weight: 900; color: var(--turquesa-texto); min-width: 60px; text-align: right; }
.desglose { background: var(--fondo-suave); border-radius: 10px; padding: 12px; margin-top: 10px; font-size: 13px; display: flex; flex-direction: column; gap: 6px; font-weight: 400; }
.desglose div { display: flex; justify-content: space-between; gap: 10px; }
.desglose .azul { color: var(--azul); font-weight: 700; }
.desglose .total { font-weight: 800; }

/* Banner de bienvenida */
.bienvenida { position: relative; overflow: hidden; display: flex; align-items: center; gap: 12px; padding: 18px; border-radius: 18px; color: #fff; background: linear-gradient(135deg, var(--azul) 0%, var(--azul-2) 100%); }
.bienvenida-texto { position: relative; flex: 1; }
.bienvenida h2 { margin: 10px 0 6px; font-size: 20px; line-height: 1.2; }
.bienvenida p { margin: 0; font-size: 14px; line-height: 1.45; opacity: 0.92; }
.bienvenida img { position: relative; flex: none; }
.pastilla { display: inline-block; background: var(--amarillo); color: var(--azul); font-weight: 900; font-size: 12px; padding: 4px 10px; border-radius: 999px; }

/* Trazos decorativos (amarillo y turquesa, como en el stand) */
.trazo { position: absolute; border-radius: 999px; pointer-events: none; }
.b1 { right: -40px; bottom: -26px; width: 200px; height: 46px; background: var(--turquesa); transform: rotate(-18deg); }
.b2 { left: -30px; top: -14px; width: 140px; height: 26px; background: var(--amarillo); transform: rotate(-14deg); }

.mayusculas { text-transform: uppercase; }

/* ============ Iniciar sesión: banner + formulario ============ */
.acceso { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100vh - 76px); }
.acceso-banner { position: relative; overflow: hidden; display: flex; align-items: center; padding: 48px 48px 48px max(20px, calc((100vw - var(--ancho)) / 2 + 20px)); color: #fff; background: linear-gradient(150deg, var(--azul) 0%, var(--azul-2) 100%); }
.acceso-banner-texto { position: relative; max-width: 460px; }
.acceso-logo { display: block; margin-bottom: 8px; }
.acceso-banner h2 { margin: 12px 0 6px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; }
.acceso-banner h2 em { font-style: normal; color: var(--amarillo); }
.acceso-sub { margin: 0 0 18px; font-size: 17px; font-weight: 700; opacity: 0.92; }
.acceso-lista { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15px; }
.acceso-lista li::before { content: "✓"; color: var(--turquesa); font-weight: 900; margin-right: 8px; }
.acceso-form { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 40px max(24px, calc((100vw - var(--ancho)) / 2 + 20px)) 40px 56px; }
.acceso-form > * { width: 100%; max-width: 440px; }
.a1 { right: -70px; bottom: -30px; width: 320px; height: 70px; background: var(--turquesa); transform: rotate(-20deg); }
.a2 { left: -40px; top: -16px; width: 220px; height: 36px; background: var(--amarillo); transform: rotate(-14deg); }
.a3 { right: 40px; top: 30px; width: 120px; height: 20px; background: var(--turquesa); transform: rotate(-30deg); opacity: 0.45; }
@media (max-width: 800px) {
  .acceso { grid-template-columns: 1fr; min-height: 0; }
  .acceso-banner { margin: 14px 16px 0; border-radius: 18px; padding: 24px 20px; }
  .acceso-banner-texto { margin-left: 0; }
  .acceso-logo, .acceso-lista, .a3 { display: none; }
  .acceso-banner h2 { font-size: 24px; }
  .acceso-sub { margin: 0; font-size: 14px; }
  .a1 { width: 200px; height: 44px; }
  .acceso-form { padding: 20px 16px 32px;}
}

/* ============ Portada del catálogo ============ */
.hero { position: relative; overflow: hidden; background: var(--fondo-suave); padding: 40px 0 48px; }
.hero-in { position: relative; display: grid; grid-template-columns: 1.2fr 0.8fr; align-items: center; gap: 20px; padding: 0 var(--margen); }
.hero h1 { margin: 0; font-size: clamp(34px, 6vw, 54px); line-height: 1.05; color: var(--azul); font-weight: 900; }
.hero h1 em { font-style: normal; color: var(--amarillo); }
.hero-sub { margin: 12px 0 20px; font-size: 18px; font-weight: 700; color: #3A4256; }
.hero-logo { justify-self: center; width: 220px; height: auto; }
.buscador { display: flex; gap: 8px; max-width: 560px; margin-bottom: 14px; }
.buscador input { flex: 1; }
.buscador button { border: 0; border-radius: 11px; background: var(--azul); color: #fff; font-weight: 800; padding: 0 18px; font-family: inherit; font-size: 15px; cursor: pointer; }
.t1 { right: -60px; top: -40px; width: 420px; height: 110px; background: var(--turquesa); transform: rotate(-24deg); opacity: 0.9; }
.t2 { right: 14%; bottom: -46px; width: 340px; height: 64px; background: var(--amarillo); transform: rotate(-12deg); }
.t3 { left: -80px; top: 24px; width: 220px; height: 44px; background: var(--turquesa); transform: rotate(-30deg); opacity: 0.35; }
@media (max-width: 720px) {
  .hero-in { grid-template-columns: 1fr; }
  .hero-logo { display: none; }
  .t1 { width: 240px; height: 70px; right: -80px; }
}

/* ============ Catálogo ============ */
.catalogo { max-width: var(--ancho); margin: 0 auto; padding: 24px 20px 40px; display: flex; flex-direction: column; gap: 16px; }
.titulo-seccion { margin: 6px 0 0; font-size: 20px; }
.titulo-seccion::after { content: ""; display: block; width: 56px; height: 5px; border-radius: 3px; background: var(--turquesa); margin-top: 8px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.chips a { flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 20px; border: 1px solid #D5D9E3; background: #fff; color: var(--texto); text-decoration: none; font-size: 14px; }
.chips a.activo { background: var(--azul); border-color: var(--azul); color: #fff; }
.vacio { color: var(--texto-suave); }

.rejilla { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (min-width: 700px) { .rejilla { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .rejilla { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.tarjeta { background: #fff; border: 1px solid var(--borde-suave); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; color: var(--texto); text-decoration: none; font-weight: 400; transition: transform .15s; }
.tarjeta:hover { transform: translateY(-2px); }
.tarjeta.destacada { border: 2px solid var(--amarillo); box-shadow: 0 6px 16px rgba(244, 180, 0, 0.18); }
.tarjeta-foto { position: relative; aspect-ratio: 4 / 3; background: #E4ECFA; display: flex; align-items: center; justify-content: center; }
.tarjeta-foto img { width: 100%; height: 100%; object-fit: cover; }
.sin-foto { color: var(--azul); opacity: 0.6; font-weight: 700; font-size: 13px; }
.vineta-destacado { position: absolute; top: 10px; left: 10px; display: inline-flex; align-items: center; gap: 4px; background: var(--amarillo); color: var(--azul); font-size: 12px; font-weight: 800; padding: 5px 9px; border-radius: 999px; }
.vineta-destacado.en-linea { position: static; align-self: flex-start; }
.tarjeta-texto { padding: 12px; display: flex; flex-direction: column; gap: 4px; }
.tarjeta-titulo { font-size: 15px; font-weight: 700; line-height: 1.25; }
.tarjeta-precio { font-size: 18px; font-weight: 900; color: var(--azul); }
.tarjeta-vendedor { font-size: 12px; color: var(--texto-suave); }

/* ============ Detalle de producto ============ */
.detalle { max-width: 960px; margin: 0 auto; padding: 20px 20px 40px; display: grid; gap: 20px; }
@media (min-width: 800px) { .detalle { grid-template-columns: 1fr 1fr; } .volver { grid-column: 1 / -1; } }
.volver { font-size: 14px; text-decoration: none; }
.detalle-fotos { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; }
.detalle-fotos img { flex: none; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 16px; scroll-snap-align: start; }
.sin-foto.grande { width: 100%; aspect-ratio: 4 / 3; background: #E4ECFA; border-radius: 16px; display: flex; align-items: center; justify-content: center; font-size: 16px; }
.detalle-info { display: flex; flex-direction: column; gap: 12px; }
.detalle-info h1 { margin: 0; font-size: 26px; }
.etiqueta-categoria { font-size: 12px; font-weight: 800; color: var(--turquesa-texto); letter-spacing: .4px; text-transform: uppercase; }
.precio-grande { margin: 0; font-size: 30px; font-weight: 900; color: var(--azul); }
.descripcion { margin: 0; line-height: 1.55; color: #3A4256; }
.vendedor { display: flex; align-items: center; justify-content: space-between; gap: 12px; border: 1px solid var(--borde-suave); border-radius: 14px; padding: 14px; }
.vendedor small { display: block; color: var(--texto-suave); }
.verificado { background: #E1F3E9; color: #0B6B3A; font-size: 12px; font-weight: 700; padding: 5px 8px; border-radius: 8px; }

/* ============ Footer ============ */
.pie { position: relative; background: var(--azul); color: #fff; margin-top: 24px; }
.pie-franja { height: 10px; background: linear-gradient(90deg, var(--amarillo) 0 40%, var(--turquesa) 40% 100%); }
.pie-in { padding-left: var(--margen); padding-right: var(--margen); }
.pie-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 28px; padding-top: 36px; padding-bottom: 28px; }
.pie h2 { margin: 4px 0 12px; font-size: 16px; }
.pie a, .pie span { display: block; color: #D9E0EE; margin-bottom: 10px; font-size: 14px; font-weight: 400; text-decoration: none; }
.pie .marca { display: inline-flex; margin-bottom: 0; color: #fff; }
.pie .wordmark { display: inline-block; margin-bottom: 0; color: #fff; font-size: 20px; font-weight: 900; }
.pie .wordmark b { color: var(--amarillo); }
.pie-lema { margin: 16px 0 8px; line-height: 1.5; color: #E8ECF5; }
.pie-tri { margin: 0; font-size: 12px; letter-spacing: 3px; font-weight: 800; color: var(--turquesa); }
.pie-base { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, 0.18); padding-top: 16px; padding-bottom: 18px; font-size: 13px; }
.pie-base span { color: #B9C3D8; margin: 0; }
@media (max-width: 760px) { .pie-grid { grid-template-columns: 1fr 1fr; } .pie-grid > div:first-child { grid-column: 1 / -1; } }
