/* Inicio de Comerciapp: blanco y negro, igual que los catálogos. Usa Bootstrap para la grilla y los paneles. */
:root {
  --cp-negro: #000;
  --cp-gris: #666;
  --cp-linea: rgba(0, 0, 0, .12);
  --bs-body-font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-bg: #fff;
  --bs-body-color: #111;
}
html, body { overflow-x: hidden; }
h1, h2, h3, h4, h5, .cp-logo { font-family: Poppins, sans-serif; }

/* Encabezado */
.cp-header { background: #fff; border-bottom: 1px solid #000; position: sticky; top: 0; z-index: 30; }
.cp-logo { display: inline-flex; align-items: center; gap: 10px; color: #000; text-decoration: none; font-weight: 800; font-size: 20px; letter-spacing: .06em; }

/* Botones: negro con texto blanco; al pasar se invierten. */
.cp-btn, .cp-btn-linea, .cp-btn-blanco, .cp-btn-blanco-linea {
  border-radius: 999px; font-weight: 600; padding-left: 1.6rem; padding-right: 1.6rem; border-width: 1px; border-style: solid;
}
.cp-btn { background: #000; color: #fff; border-color: #000; }
.cp-btn:hover, .cp-btn:focus-visible { background: #fff; color: #000; border-color: #000; }
.cp-btn-linea { background: #fff; color: #000; border-color: #000; }
.cp-btn-linea:hover, .cp-btn-linea:focus-visible { background: #000; color: #fff; border-color: #000; }
.cp-btn-blanco { background: #fff; color: #000; border-color: #fff; }
.cp-btn-blanco:hover { background: #000; color: #fff; border-color: #fff; }
.cp-btn-blanco-linea { background: transparent; color: #fff; border-color: #fff; }
.cp-btn-blanco-linea:hover { background: #fff; color: #000; border-color: #fff; }

/* Presentación */
.cp-hero { padding-top: 3.5rem; }
.cp-titulo { font-weight: 800; font-size: clamp(2rem, 6vw, 3.6rem); line-height: 1.08; color: #000; }
.cp-bajada { max-width: 680px; margin-top: 1rem; font-size: 1.1rem; color: var(--cp-gris); }
.cp-subtitulo { font-weight: 800; font-size: clamp(1.4rem, 3.5vw, 2rem); }

/* Para qué sirve */
.cp-info { border-top: 1px solid var(--cp-linea); border-bottom: 1px solid var(--cp-linea); }
.cp-tarjeta { height: 100%; padding: 1.25rem; border: 1px solid #000; border-radius: 8px; background: #fff; }
.cp-tarjeta h3 { font-size: 1.1rem; font-weight: 700; margin-bottom: .4rem; }
.cp-tarjeta p { margin: 0; color: var(--cp-gris); font-size: .95rem; }

/* Cierre y pie: bandas negras */
.cp-cierre { background: #000; color: #fff; }
.cp-pie { background: #000; color: #fff; border-top: 1px solid #333; font-size: .9rem; }

/* Paneles laterales (entran desde la derecha) */
.cp-panel { --bs-offcanvas-width: 420px; --bs-offcanvas-border-color: #000; }
.cp-panel .offcanvas-header { border-bottom: 1px solid #000; }
.cp-panel .offcanvas-title { font-size: 1rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* Campos y pestañas */
.cp-input { border: 1px solid #000; border-radius: 8px; padding: .7rem .9rem; }
.cp-input:focus { border-color: #000; box-shadow: 0 0 0 3px rgba(0, 0, 0, .15); }
.form-label { font-weight: 600; font-size: .9rem; margin-bottom: .25rem; }
.cp-pestanas { --bs-nav-pills-border-radius: 999px; --bs-nav-pills-link-active-bg: #000; --bs-nav-pills-link-active-color: #fff; gap: .5rem; }
.cp-pestanas .nav-link { border: 1px solid #000; color: #000; font-weight: 600; }
.cp-error { color: #000; font-weight: 600; font-size: .9rem; min-height: 1.2em; margin-bottom: .5rem; }
.cp-trampa { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* Lista de comercios */
.cp-lista { border: 1px solid #000; border-radius: 8px; overflow: hidden; }
.cp-comercio { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .85rem 1rem; border-top: 1px solid var(--cp-linea); }
.cp-comercio:first-child { border-top: 0; }
.cp-comercio__nombre { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-ver { flex: none; padding: .4rem 1rem; border-radius: 999px; background: #000; color: #fff; border: 1px solid #000; font-size: .85rem; font-weight: 700; text-decoration: none; }
.cp-ver:hover { background: #fff; color: #000; }
.cp-vacio { padding: 1.4rem 1rem; color: var(--cp-gris); text-align: center; }

/* Portada: imagen de fondo con blur, texto sobre un panel de vidrio esmerilado. */
.cp-portada { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: 82vh; overflow: hidden; }
.cp-portada::before {
  content: ""; position: absolute; inset: -12px; z-index: -2;
  background: url("img/fondo.jpg?v=2") center / cover no-repeat;
  filter: blur(3px) saturate(.9); transform: scale(1.03);
}
.cp-portada::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .18), rgba(0, 0, 0, .42)); }
.cp-vidrio {
  max-width: 760px; margin: 0 auto; padding: 2.6rem 1.6rem;
  background: rgba(255, 255, 255, .68);
  -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15);
  border: 1px solid rgba(255, 255, 255, .7); border-radius: 18px; box-shadow: 0 24px 70px rgba(0, 0, 0, .3);
}
.cp-vidrio .cp-bajada { color: #333; }
/* Encabezado translúcido sobre la imagen. */
.cp-header { background: rgba(255, 255, 255, .82); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
@media (max-width: 600px) { .cp-portada { min-height: 88vh; } .cp-portada__centro { padding: 2rem 0; } .cp-vidrio { padding: 2rem 1.2rem; } }

/* Centro de la portada y banda del pie con efecto blur sobre la imagen. */
.cp-portada__centro { flex: 1; display: grid; align-items: center; padding: 4rem 0; }
.cp-portada__pie {
  padding: 1.8rem 0 2rem; text-align: center; color: #fff;
  background: rgba(0, 0, 0, .48);
  -webkit-backdrop-filter: blur(16px) saturate(1.1); backdrop-filter: blur(16px) saturate(1.1);
  border-top: 1px solid rgba(255, 255, 255, .25);
}

/* Banda del pie: título, resumen y botones en blanco sobre vidrio oscuro. */
.cp-portada__pie { padding: 2.4rem 0 2.6rem; background: rgba(0, 0, 0, .55); }
.cp-portada__pie .cp-titulo { color: #fff; font-size: clamp(1.7rem, 4.6vw, 3rem); }
.cp-portada__pie .cp-bajada { color: rgba(255, 255, 255, .86); font-size: 1.02rem; }

/* Frase debajo del título. */
.cp-cita { max-width: 640px; margin: 1rem auto 0; color: #fff; }
.cp-cita p { margin: 0; font-family: Poppins, sans-serif; font-style: italic; font-weight: 500; font-size: clamp(1.05rem, 2.4vw, 1.3rem); }
.cp-cita footer { margin-top: .3rem; font-size: .9rem; opacity: .8; }

/* ---- Inicio en PC (formato de buscador de fotos): enlaces, título grande, buscador, tarjetas y pestañas ---- */
.cp-nav-link { color: #000; text-decoration: none; font-weight: 500; }
.cp-nav-link:hover { text-decoration: underline; }
.cp-px { padding-top: 1.5rem; }
.cp-px-titulo { font-family: Poppins, sans-serif; font-weight: 800; font-size: clamp(2.4rem, 3.6vw, 3.6rem); line-height: 1.05; letter-spacing: -.02em; color: #000; }
.cp-px-cita { margin: 1.2rem 0 1.8rem; color: var(--cp-gris); font-size: 1.1rem; }
.cp-px-cita em { color: #000; }
.cp-px-buscar { display: flex; align-items: center; gap: .6rem; max-width: 640px; padding: .55rem .9rem; background: #f2f2f2; border-radius: 14px; }
.cp-px-buscar input { flex: 1; border: 0; background: transparent; padding: .7rem .4rem; font-size: 1.05rem; outline: none; }
.cp-px-buscar button { border: 0; background: transparent; padding: .4rem .5rem; color: #555; }
.cp-px-card { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; gap: .15rem; min-height: 360px; padding: 1.2rem; overflow: hidden;
  border-radius: 18px; color: #fff; text-decoration: none; background: #222 center / cover no-repeat; transition: transform .15s ease; }
.cp-px-card::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(0, 0, 0, .05) 25%, rgba(0, 0, 0, .75)); }
.cp-px-card:hover { transform: translateY(-3px); color: #fff; }
.cp-px-card__etq { font-size: .85rem; opacity: .9; }
.cp-px-card strong { font-family: Poppins, sans-serif; font-size: 1.3rem; line-height: 1.15; }
.cp-px-card__ir { margin-top: .3rem; font-size: .95rem; font-weight: 600; }


/* Pestañas dinámicas: la activa avanza sola hacia la derecha; debajo cambia la información. */
.cp-px-bloque { padding: 2.4rem 0 3.5rem; }
.cp-px-tabs { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem; }
.cp-px-tab { position: relative; overflow: hidden; border: 0; background: transparent; color: #000; font: inherit; font-weight: 500; padding: .7rem 1.4rem; border-radius: 999px; cursor: pointer; }
.cp-px-tab:hover:not(.activa) { background: #f2f2f2; }
.cp-px-tab.activa { background: #000; color: #fff; }
.cp-px-tab.activa::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: rgba(255, 255, 255, .75); transform-origin: left; animation: cp-progreso 5s linear forwards; }
.cp-px-bloque:hover .cp-px-tab.activa::after, .cp-px-bloque:focus-within .cp-px-tab.activa::after { animation-play-state: paused; }
.cp-px-panel { max-width: 780px; margin: 1.8rem auto 0; min-height: 190px; }
.cp-px-info { padding: 1rem 1rem 0; text-align: center; }
.cp-px-info.is-activo { animation: cp-entra .45s ease; }
.cp-px-info h2 { font-family: Poppins, sans-serif; font-weight: 800; font-size: 1.6rem; margin-bottom: .6rem; }
.cp-px-info p { margin: 0; color: var(--cp-gris); font-size: 1.08rem; }
@keyframes cp-progreso { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes cp-entra { from { opacity: 0; transform: translateX(48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cp-px-tab.activa::after { animation: none; } .cp-px-info.is-activo { animation: none; } }

/* El pie negro siempre llega hasta el borde inferior de la pantalla. */
body { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
.cp-pie { margin-top: auto; padding-bottom: calc(1.5rem + env(safe-area-inset-bottom)); }

/* Botones de ícono del encabezado en celular. */
.cp-icono { display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: transparent; color: #000; }
.cp-icono:hover { background: #f2f2f2; }
.cp-menu { border: 1px solid #000; border-radius: 12px; }

/* Celular y tablet: mismo formato que en PC, adaptado (título centrado, tarjetas y pestañas que se deslizan de costado). */
@media (max-width: 991.98px) {
  .cp-px { padding-top: 1.2rem; text-align: center; }
  .cp-px-titulo { font-size: clamp(2rem, 8.6vw, 2.7rem); }
  .cp-px-cita { margin: .9rem 0 1.4rem; }
  .cp-px-buscar { max-width: none; margin: 0 auto; }
  .cp-px-cards { flex-wrap: nowrap; overflow-x: auto; margin-left: 0; margin-right: 0; padding-bottom: .4rem;
    scroll-snap-type: x mandatory; scrollbar-width: none; }
  .cp-px-cards::-webkit-scrollbar { display: none; }
  .cp-px-cards > * { flex: 0 0 82%; max-width: 82%; scroll-snap-align: start; }
  .cp-px-card { min-height: 300px; text-align: left; }
  .cp-px-bloque { padding-top: 1.4rem; }
  .cp-px-tabs { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 0 2px 4px; }
  .cp-px-tabs::-webkit-scrollbar { display: none; }
  .cp-px-tab { flex: none; white-space: nowrap; }
}

/* ---- Portada ordenada (PC y celular) ---- */
.cp-px { padding-top: 3rem; }
.cp-px .row.align-items-center { row-gap: 2.2rem; }
.cp-px-titulo { max-width: 14ch; }
.cp-px-cita { margin: 1.2rem 0 1.6rem; }
.cp-px-buscar { max-width: 560px; border: 1px solid transparent; transition: border-color .15s ease; }
.cp-px-buscar:focus-within { border-color: #000; background: #fff; }
.cp-px-card { min-height: 380px; }

/* La información va dentro de un recuadro, para que se lea como un bloque. */
.cp-px-bloque { margin: 3.2rem 0 3.5rem; padding: 1.4rem 1.2rem 2rem; border: 1px solid #000; border-radius: 20px; }
.cp-px-panel { margin-top: 1.4rem; min-height: 150px; }
.cp-px-info h2 { font-size: 1.5rem; }
.cp-px-info p { max-width: 62ch; margin-left: auto; margin-right: auto; }

@media (max-width: 991.98px) {
  .cp-px { padding-top: 1.6rem; }
  .cp-px > .row { --bs-gutter-y: 1.6rem; }
  .cp-px-titulo { max-width: none; font-size: clamp(2rem, 9vw, 2.6rem); }
  .cp-px-cita { font-size: 1rem; margin: .8rem 0 1.3rem; }
  .cp-px-buscar { max-width: none; }
  /* Las dos tarjetas a la vista, una al lado de la otra (sin deslizar). */
  .cp-px-cards { flex-wrap: wrap; overflow-x: visible; scroll-snap-type: none; padding-bottom: 0; }
  .cp-px-cards > * { flex: 0 0 50%; max-width: 50%; }
  .cp-px-card { min-height: 240px; padding: 1rem; }
  .cp-px-card strong { font-size: 1.05rem; }
  .cp-px-card__ir { font-size: .85rem; }
  /* Pestañas: en filas, todas visibles. */
  .cp-px-bloque { margin: 2rem 0 2.5rem; padding: 1.1rem .9rem 1.5rem; border-radius: 16px; }
  .cp-px-tabs { flex-wrap: wrap; justify-content: center; overflow-x: visible; gap: .4rem; padding: 0; }
  .cp-px-tab { padding: .55rem 1rem; font-size: .92rem; }
  .cp-px-panel { min-height: 170px; }
  .cp-px-info { padding: .6rem .4rem 0; }
  .cp-px-info h2 { font-size: 1.3rem; }
  .cp-px-info p { font-size: 1rem; }
}

/* Botones de la portada (donde estaba el buscador): Crear una cuenta y Acceder. */
.cp-px-acciones { display: flex; flex-wrap: wrap; gap: .8rem; }
.cp-px-acciones .btn { padding-left: 2rem; padding-right: 2rem; }
@media (max-width: 991.98px) {
  .cp-px-acciones { justify-content: center; }
  .cp-px-acciones .btn { flex: 1 1 0; padding-left: 1rem; padding-right: 1rem; white-space: nowrap; }
}

/* ---- Portada a pantalla completa: fondo negro con métricas de crecimiento animadas ---- */
html, body { background: #000; }
.cp-header { position: absolute; top: 0; left: 0; right: 0; background: transparent; border-bottom: 0; z-index: 30; }
.cp-header .cp-logo { color: #fff; }
.cp-header .cp-logo img { filter: invert(1); }
.cp-hero { position: relative; display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; background: #000; color: #fff; overflow: hidden; }
/* La marca y el gráfico comparten el mismo lugar: la marca queda fija atrás y el gráfico se anima encima. */
.cp-hero__arriba { position: relative; flex: 1 1 auto; display: grid; place-items: center; min-height: 40vh; padding-top: 4.5rem; }
.cp-hero__arriba > * { grid-area: 1 / 1; }
.cp-hero__marca { position: relative; z-index: 2; width: min(54vw, 30vh); height: auto; color: #fff; pointer-events: none; }
.cp-hero__zona { position: relative; display: grid; place-items: center; place-self: stretch; }
.mt-grafico { width: min(88vw, 520px); height: auto; overflow: visible; opacity: .5; }
.mt-guias line { stroke: rgba(255, 255, 255, .14); stroke-width: 1; stroke-dasharray: 3 6; }
.mt-barra { fill: rgba(255, 255, 255, .22); transform-box: fill-box; transform-origin: bottom; }
.mt-barra:nth-child(n + 8) { fill: rgba(255, 255, 255, .42); }
.mt-barra:last-child { fill: #fff; }
.mt-area { fill: rgba(255, 255, 255, .06); }
.mt-linea { fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.mt-punto { fill: #fff; }
.mt-punto-halo { fill: rgba(255, 255, 255, .25); transform-box: fill-box; transform-origin: center; }
/* Animación de cada ciclo (se agrega la clase "anima" desde portada.js). */
.anima .mt-barra { animation: mt-sube .9s cubic-bezier(.22, .9, .28, 1) both; animation-delay: calc(var(--i) * .13s); }
.anima .mt-area { animation: mt-aparece 1.2s ease-out 1.4s both; }
.anima .mt-linea { animation: mt-dibuja 2.4s ease-in-out .8s both; }
.anima .mt-punto, .anima .mt-punto-halo { animation: mt-aparece .4s ease-out 3.1s both; }
.anima .mt-punto-halo { animation: mt-aparece .4s ease-out 3.1s both, mt-pulso 1.6s ease-out 3.5s infinite; }
@keyframes mt-sube { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes mt-dibuja { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes mt-aparece { from { opacity: 0; } to { opacity: 1; } }
@keyframes mt-pulso { from { transform: scale(1); opacity: .6; } to { transform: scale(2.6); opacity: 0; } }
/* Tarjetas con las métricas */
.mt-chip { z-index: 3; position: absolute; display: flex; flex-direction: column; gap: .1rem; padding: .55rem .85rem; border: 1px solid rgba(255, 255, 255, .28); border-radius: 14px; background: rgba(0, 0, 0, .55);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.mt-chip span { font-size: .72rem; letter-spacing: .04em; text-transform: uppercase; opacity: .7; }
.mt-chip strong { font: 800 1.35rem Poppins, sans-serif; line-height: 1.15; font-variant-numeric: tabular-nums; }
.mt-chip b { font: inherit; }
.mt-chip--a { top: 24%; left: 6%; }
.mt-chip--b { top: 12%; right: 6%; }
.mt-chip--c { bottom: 4%; left: 12%; }
.anima .mt-chip { animation: mt-aparece .6s ease-out both; }
.anima .mt-chip--a { animation-delay: .9s; }
.anima .mt-chip--b { animation-delay: 1.5s; }
.anima .mt-chip--c { animation-delay: 2.1s; }
@media (prefers-reduced-motion: reduce) { .cp-hero__zona { animation: none; } .anima * { animation: none !important; } }
.cp-hero__contenido { width: 100%; max-width: 520px; margin: 0 auto; padding: 0 1.5rem calc(2.2rem + env(safe-area-inset-bottom)); text-align: center; position: relative; }
.cp-hero__titulo { font-family: Poppins, sans-serif; font-weight: 800; font-size: clamp(2rem, 7.4vw, 2.9rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 .9rem; }
.cp-hero__texto { margin: 0 auto 1.6rem; max-width: 40ch; opacity: .85; font-size: 1.02rem; line-height: 1.45; }
.cp-hero__crear { display: flex; align-items: center; justify-content: center; width: 100%; height: 56px; text-decoration: none; border: 1px solid #fff; border-radius: 16px; background: #fff; color: #000; font: 600 1.05rem Inter, system-ui, sans-serif;
  transition: background .15s ease, color .15s ease; }
.cp-hero__crear:hover, .cp-hero__crear:focus-visible { background: transparent; color: #fff; }
.cp-hero__login { margin: 1.1rem 0 0; opacity: .9; font-size: .98rem; }
.cp-hero__login a { color: #fff; font-weight: 700; text-decoration: none; }
.cp-hero__login a:hover { text-decoration: underline; }
/* PC: texto a la izquierda y el gráfico animado a la derecha. */
@media (min-width: 992px) {
  .cp-hero { flex-direction: row; align-items: stretch; }
  .cp-hero__contenido { order: 1; flex: 0 0 min(560px, 50%); margin: 0 0 0 max(7vw, 2rem); padding: 0; align-self: center; text-align: left; }
  .cp-hero__arriba { order: 2; min-height: 0; padding: 0 4vw 0 0; }
  .cp-hero__marca { width: min(26vw, 40vh); }
  .mt-grafico { width: min(40vw, 560px); }
  .cp-hero__titulo { font-size: 3.1rem; }
  .cp-hero__texto { margin-left: 0; }
}
.cp-px { padding-top: 2.6rem; }
.cp-px-cards { max-width: 760px; margin-left: auto; margin-right: auto; }
@media (min-width: 992px) { .cp-px-cards > * { flex: 0 0 50%; max-width: 50%; } }
