/* ==========================================================
   Maqueta de la tienda · lo propio de esta marca de muestra.
   Como en la plataforma: tienda.css trae las pantallas comunes
   y el tema suma su inicio a medida. Lo demás usa las variables
   --t-*, así funciona con los tres estilos de la demo.
   ========================================================== */

/* ---------- Control flotante de la maqueta (no existe en la tienda real) ---------- */
.m-demo {
  position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 40;
  display: flex; align-items: center; gap: 6px; padding: 5px;
  background: #121212; color: #f4f4f2; border-radius: 999px;
  box-shadow: 0 8px 24px -8px rgb(0 0 0 / 0.45);
  font-size: 0.8125rem;
}
.m-demo-sello { padding: 0 8px 0 10px; font-weight: 600; opacity: 0.75; white-space: nowrap; }
.m-temas { display: flex; gap: 2px; }
.m-temas button {
  position: relative; min-height: 34px; padding: 0 12px; border-radius: 999px;
  font-size: 0.8125rem; font-weight: 600; color: #f4f4f2;
  transition: background-color 0.16s, color 0.16s;
}
.m-temas button::after { content: ''; position: absolute; inset: -5px -1px; } /* área de toque más grande */
.m-temas button[aria-pressed='true'] { background: #f4f4f2; color: #121212; }
.t-con-barra .m-demo { display: none; }
@media (max-width: 380px) { .m-demo-sello { display: none; } }

/* ---------- Encabezado flotando sobre la portada ---------- */
.m-sobre-portada .t-encabezado,
.m-sobre-portada .t-submenu {
  position: fixed; left: 0; right: 0; z-index: 30;
  background: transparent; border-color: transparent; backdrop-filter: none;
  color: var(--m-tinta);
  transition: background-color 0.25s, border-color 0.25s, color 0.25s;
}
.m-sobre-portada .t-encabezado { top: 0; }
.m-sobre-portada .t-submenu { top: var(--t-alto-encabezado); }
.m-sobre-portada:not(.m-bajo-portada) .t-menu-enlace { color: var(--m-tinta); }
.m-sobre-portada:not(.m-bajo-portada) .t-menu-enlace:hover,
.m-sobre-portada:not(.m-bajo-portada) .t-menu-enlace[aria-current='page'] { background: rgb(255 255 255 / 0.35); }
.m-sobre-portada:not(.m-bajo-portada) .t-icono { border-color: rgb(12 29 39 / 0.28); }
.m-sobre-portada.m-bajo-portada .t-encabezado,
.m-sobre-portada.m-bajo-portada .t-submenu {
  background: color-mix(in srgb, var(--t-fondo) 92%, transparent); backdrop-filter: blur(10px);
  border-bottom-color: var(--t-borde); color: var(--t-texto);
}
@media (max-width: 760px) {
  .m-sobre-portada.m-bajo-portada .t-submenu { display: none; } /* al bajar queda solo la barra de arriba */
}

/* ---------- Portada a pantalla completa, en capas ---------- */
.t-pagina { --m-tinta: #0c1d27; }
.m-portada {
  position: relative; overflow: hidden;
  height: 100svh; min-height: 620px; max-height: 1100px;
  color: var(--m-tinta);
}
/* Caja de las capas: misma altura que la foto. Recorta el cielo de arriba (sobra) */
.m-capas {
  position: absolute; left: 0; right: 0; bottom: 0; height: 128%;
  container-type: size;
}
/* El cielo extiende la foto a los costados, con los mismos tonos que tiene la foto a cada altura */
.m-cielo {
  position: absolute; inset: 0;
  background: linear-gradient(#13abd4 0%, #2eb7db 13%, #39bee1 27%, #4ec6e6 40%, #5ccce9 49%, #77d6f1 62%, #96e0f7 76%, #b1eafb 89%, #b8edfd 100%);
}
.m-portada .m-capa, .m-coleccion .m-capa {
  position: absolute; bottom: 0; height: 100%; width: auto; max-width: none;
  right: 5vw;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 88%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 16%, #000 88%, transparent);
}
/* La palabra va entre la foto y la persona recortada: le pasa por detrás de la cabeza */
.m-palabra {
  position: absolute; left: var(--t-lado); top: 27%; margin: 0;
  font-family: var(--t-fuente-titulos); font-weight: 800; text-transform: uppercase;
  font-size: min(31cqh, 26vw); line-height: 0.8; letter-spacing: -0.035em;
  color: var(--m-tinta); white-space: nowrap;
}
[data-tema='noche'] .m-palabra { letter-spacing: 0; font-size: min(31cqh, 36vw); }

.m-portada-texto {
  position: absolute; left: var(--t-lado); bottom: clamp(88px, 12vh, 128px); z-index: 2;
  display: grid; justify-items: start; gap: 14px; max-width: 470px;
}
.m-portada-texto .t-rotulo { color: var(--m-tinta); opacity: 0.75; }
.m-portada-texto h1 { color: var(--m-tinta); font-size: clamp(2rem, 1.2rem + 2.4vw, 3.25rem); }
.m-portada-texto p { font-size: 1.0625rem; max-width: 40ch; color: rgb(12 29 39 / 0.82); }
.m-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }
.m-portada .t-boton-principal { background: var(--m-tinta); color: #f2fbff; border-color: var(--m-tinta); }
.m-portada .t-boton-secundario { color: var(--m-tinta); border-color: rgb(12 29 39 / 0.35); background: rgb(255 255 255 / 0.25); }

/* Celular: la foto centrada en la persona y el texto abajo, sobre el mismo celeste */
@media (max-width: 760px) {
  .m-portada { height: auto; min-height: 0; max-height: none; display: flex; flex-direction: column; background: #b8edfd; }
  .m-capas { position: relative; height: 68svh; min-height: 480px; }
  .m-portada .m-capa { right: auto; left: 50%; transform: translateX(-50%); -webkit-mask-image: none; mask-image: none; }
  .m-capas::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 22%; background: linear-gradient(transparent, #b8edfd); }
  .m-palabra { left: 0; right: 0; top: 41%; text-align: center; font-size: min(31cqh, 25.5cqw); }
  [data-tema='noche'] .m-palabra { font-size: min(31cqh, 30cqw); }
  .m-portada-texto { position: relative; left: auto; bottom: auto; padding: 0 var(--t-lado) 40px; margin-top: -24px; max-width: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .m-capas { animation: m-asienta 1.4s cubic-bezier(0.23, 1, 0.32, 1) both; transform-origin: 50% 100%; }
  .m-palabra { animation: m-sube 1s cubic-bezier(0.23, 1, 0.32, 1) 0.15s both; }
  .m-portada-texto > * { animation: m-sube 700ms cubic-bezier(0.23, 1, 0.32, 1) both; }
  .m-portada-texto > :nth-child(1) { animation-delay: 0.35s; }
  .m-portada-texto > :nth-child(2) { animation-delay: 0.41s; }
  .m-portada-texto > :nth-child(3) { animation-delay: 0.47s; }
  .m-portada-texto > :nth-child(4) { animation-delay: 0.53s; }
}
@keyframes m-asienta { from { transform: scale(1.05); } }
@keyframes m-sube { from { opacity: 0; transform: translateY(18px); } }

/* ---------- Ventajas ---------- */
.m-ventajas {
  display: grid; gap: 1px; margin: 0; list-style: none; padding: 0;
  background: var(--t-borde); border-bottom: 1px solid var(--t-borde);
}
.m-ventajas li { display: grid; gap: 2px; padding: 18px var(--t-lado); background: var(--t-fondo); }
.m-ventajas b { font-weight: 600; }
.m-ventajas span { font-size: 0.875rem; color: var(--t-texto-suave); }
@media (min-width: 760px) { .m-ventajas { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Categorías con foto ---------- */
.m-categorias { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(10px, 1.6vw, 18px); }
@media (min-width: 760px) { .m-categorias { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .m-categorias { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.m-categoria { position: relative; display: block; aspect-ratio: 4 / 5; border-radius: var(--t-radio); overflow: hidden; background: var(--t-superficie-alta); }
.m-categoria img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.23, 1, 0.32, 1); }
.m-categoria::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgb(10 12 10 / 0.6), transparent 55%); }
.m-categoria span {
  position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 1;
  display: flex; justify-content: space-between; align-items: baseline; gap: 8px;
  color: #f6f6f3; font-family: var(--t-fuente-titulos); font-weight: var(--t-titulos-peso);
  text-transform: var(--t-titulos-caja); letter-spacing: var(--t-titulos-espaciado); font-size: 1.125rem;
}
.m-categoria small { font-family: var(--t-fuente-textos); font-size: 0.8125rem; font-weight: 500; opacity: 0.8; text-transform: none; }
@media (hover: hover) and (pointer: fine) { .m-categoria:hover img { transform: scale(1.04); } }

/* ---------- Banda editorial: la palabra detrás de la silueta ---------- */
.m-coleccion { background: #fbfbfb; color: #111; }
.m-col-capas { position: relative; aspect-ratio: 16 / 8; container-type: size; overflow: hidden; }
.m-coleccion .m-col-capas .m-capa {
  left: 0; right: 0; width: 100%; height: 100%; object-fit: contain; object-position: 100% 50%;
  -webkit-mask-image: linear-gradient(to right, transparent, #000 5%); mask-image: linear-gradient(to right, transparent, #000 5%);
}
.m-col-palabra {
  position: absolute; left: var(--t-lado); top: 15%; margin: 0;
  font-family: var(--t-fuente-titulos); font-weight: 800; text-transform: uppercase;
  font-size: min(31cqh, 13.5cqw); line-height: 0.82; letter-spacing: -0.03em;
  color: #e2552d;
}
[data-tema='noche'] .m-col-palabra { letter-spacing: 0; }
.m-col-texto {
  display: grid; gap: 18px 48px; padding: clamp(28px, 4vw, 48px) var(--t-lado) clamp(48px, 7vw, 88px);
  border-top: 1px solid #ececec;
}
.m-col-texto .t-rotulo { color: #6b6b6b; }
.m-col-texto h2 { color: #111; }
.m-col-texto p { color: #4a4a4a; max-width: 46ch; margin-bottom: 18px; }
.m-coleccion .t-boton-principal { background: #111; color: #fff; border-color: #111; }
@media (min-width: 760px) { .m-col-texto { grid-template-columns: 1fr 1fr; align-items: end; } }
@media (max-width: 760px) {
  .m-col-capas { aspect-ratio: 4 / 5; }
  .m-coleccion .m-col-capas .m-capa { object-position: 50% 100%; }
  .m-col-palabra { top: 5%; font-size: 17.5cqw; }
}

/* ---------- Aviso de la maqueta (en vez de cobrar) ---------- */
.m-aviso {
  width: min(460px, calc(100% - 32px)); padding: 28px; border: 1px solid var(--t-borde); border-radius: var(--t-radio);
  background: var(--t-superficie); color: var(--t-texto);
}
.m-aviso::backdrop { background: rgb(0 0 0 / 0.55); }
.m-aviso[open] { animation: m-aparece 220ms cubic-bezier(0.23, 1, 0.32, 1); }
@keyframes m-aparece { from { opacity: 0; transform: translateY(8px) scale(0.98); } }
.m-aviso p { margin-top: 10px; color: var(--t-texto-suave); }
.m-aviso-botones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.m-aviso-botones .t-boton { flex: 1 1 140px; }

.m-listo .t-resumen { max-width: 56ch; margin-top: 14px; font-size: 1rem; }

/* En el celular, mientras se ve la portada, el control de la maqueta va arriba para no tapar los botones */
@media (max-width: 760px) {
  .m-sobre-portada:not(.m-bajo-portada) .m-demo { bottom: auto; top: calc(var(--t-alto-encabezado) + 68px); left: 50%; transform: translateX(-50%); }
}
