/* ==========================================================================
   FASMET — Wallpapers
   Blanco + rojo. Grilla de packs.
   Todos los colores salen del bloque :root de acá abajo.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TOKENS
   -------------------------------------------------------------------------- */
:root {
  --bg:            #FFFFFF;
  --surface:       #FAFAFA;
  --surface-2:     #F4F4F5;

  --fg:            #0C0C0D;   /* 19.4:1 sobre blanco */
  --fg-muted:      #565659;   /*  7.4:1 */
  --fg-subtle:     #78787D;   /*  4.9:1 */

  --red:           #DC2626;   /*  4.8:1 sobre blanco — apto para texto */
  --red-dark:      #A81616;   /*  7.7:1 — para texto chico */
  --red-hover:     #B91C1C;
  --red-soft:      #FEF2F2;
  --red-border:    #FECACA;
  --on-red:        #FFFFFF;

  --border:        #E7E7EA;
  --border-strong: #C9C9CE;
  --ring:          #DC2626;

  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.375rem;
  --text-2xl:  clamp(1.5rem, 3vw, 2rem);
  --text-3xl:  clamp(2.5rem, 7vw, 4.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  --container: 1440px;
  --gutter: clamp(1rem, 3vw, 2.5rem);

  --radius-sm: 4px;
  --radius:    10px;
  --radius-lg: 16px;
  --shadow:      0 1px 2px rgba(12,12,13,.05), 0 8px 24px -8px rgba(12,12,13,.10);
  --shadow-lift: 0 2px 4px rgba(12,12,13,.06), 0 20px 44px -12px rgba(12,12,13,.18);

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 150ms;
  --dur:      250ms;
  --dur-slow: 400ms;

  --z-header: 100;
  --z-modal: 1000;
}

/* --------------------------------------------------------------------------
   2. RESET
   -------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; }

/* Traba de descarga.
   No es infalible —nada lo es en un navegador— pero saca el clic derecho,
   el arrastrar y el "mantener apretado" del celular.
   La protección de verdad es que los archivos son chicos y están borrosos. */
img {
  -webkit-user-drag: none;
  -webkit-touch-callout: none;   /* iOS: no ofrece "Guardar imagen" */
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;          /* el clic derecho cae en el contenedor */
}

h1, h2, h3 { font-weight: 800; line-height: 1.08; letter-spacing: -0.03em; }
a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* --------------------------------------------------------------------------
   3. UTILIDADES
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  top: var(--space-2); left: var(--space-2);
  z-index: calc(var(--z-modal) + 1);
  padding: var(--space-3) var(--space-4);
  background: var(--red);
  color: var(--on-red);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transform: translateY(-200%);
  transition: transform var(--dur) var(--ease-out);
}
.skip-link:focus-visible { transform: translateY(0); }

/* --------------------------------------------------------------------------
   4. BOTONES
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: var(--space-3) var(--space-6);
  border: 1.5px solid transparent;
  border-radius: 999px;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn--primary { background: var(--red); color: var(--on-red); }
.btn--primary:hover { background: var(--red-hover); }

.btn--outline { background: var(--bg); color: var(--fg); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--fg); }

.btn--block { width: 100%; }

/* --------------------------------------------------------------------------
   5. HEADER
   -------------------------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  padding-block: var(--space-4);
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.logo {
  display: inline-flex;
  align-items: baseline;
  font-size: var(--text-xl);
  font-weight: 900;
  letter-spacing: 0.02em;
}
.logo__dot { color: var(--red); }

.header__tag {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-muted);
}
@media (max-width: 599px) { .header__tag { display: none; } }

/* --------------------------------------------------------------------------
   6. CABECERA DE LA COLECCIÓN
   -------------------------------------------------------------------------- */
.page-head {
  padding-block: clamp(var(--space-10), 7vw, var(--space-16)) var(--space-8);
}
.page-head h1 {
  font-size: var(--text-3xl);
  font-weight: 900;
  letter-spacing: -0.05em;
  text-transform: uppercase;
}
.page-head h1 .dot { color: var(--red); }
.page-head__sub {
  margin-top: var(--space-3);
  font-size: var(--text-base);
  color: var(--fg-muted);
}
.page-head__sub strong { color: var(--fg); font-weight: 600; }

/* --------------------------------------------------------------------------
   7. GRILLA DE PACKS
   2 columnas en celular, 3 en tablet, 4 en desktop.
   -------------------------------------------------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4) var(--space-3);
  padding-bottom: var(--space-16);
}
@media (min-width: 750px)  { .grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-8) var(--space-5); } }
@media (min-width: 1100px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.card__media {
  position: relative;
  aspect-ratio: 1 / 1;              /* reserva el espacio: nada salta al cargar */
  background: var(--surface-2);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: var(--space-3);
}
.card__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform var(--dur-slow) var(--ease-out);
}
.card:hover .card__media img { transform: scale(1.035); }

.card__badge {
  position: absolute;
  bottom: var(--space-3);
  left: var(--space-3);
  padding: var(--space-1) var(--space-3);
  background: var(--red);
  color: var(--on-red);
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.card__badge--best { background: var(--fg); }

.card__title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  line-height: 1.35;
}
@media (min-width: 750px) { .card__title { font-size: var(--text-base); } }

.card__qty {
  margin-top: var(--space-1);
  font-size: var(--text-sm);
  color: var(--fg-subtle);
}

.card__price {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-variant-numeric: tabular-nums;
}
.card__price-now { font-size: var(--text-base); font-weight: 700; color: var(--red-dark); }
.card__price-was {
  font-size: var(--text-sm);
  color: var(--fg-subtle);
  text-decoration: line-through;
}

/* --------------------------------------------------------------------------
   8. MODAL DEL PACK
   -------------------------------------------------------------------------- */
.modal {
  width: min(1100px, 100vw);
  max-width: 100vw;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;               /* entra desde la derecha */
  padding: 0;
  border: 0;
  background: var(--bg);
  color: var(--fg);
  overflow: hidden;
}
.modal::backdrop { background: rgba(12,12,13,0.45); }

.modal__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.modal__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border);
}
.modal__title { font-size: var(--text-2xl); text-transform: uppercase; }
.modal__meta { margin-top: var(--space-2); font-size: var(--text-sm); color: var(--fg-muted); }

.modal__close {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1.5px solid var(--border-strong);
  border-radius: 50%;
  background: var(--bg);
  cursor: pointer;
  transition: background-color var(--dur) var(--ease-out),
              border-color var(--dur) var(--ease-out),
              color var(--dur) var(--ease-out);
}
.modal__close:hover { background: var(--red); border-color: var(--red); color: var(--on-red); }
.modal__close svg { width: 18px; height: 18px; }

.modal__body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-6);
}

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(140px, 45%), 1fr));
  gap: var(--space-3);
}
.preview {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.preview--ancho { aspect-ratio: 16 / 9; grid-column: span 2; }
.preview img { width: 100%; height: 100%; object-fit: cover; }

/* Las bloqueadas ya vienen borrosas desde el archivo.
   Esto solo agrega el candado encima. */
.preview--locked::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.14);
}
.preview__lock {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.92);
  color: var(--fg);
  box-shadow: 0 2px 8px rgba(12,12,13,.2);
}
.preview__lock svg { width: 15px; height: 15px; }

.previews__note {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-5);
  padding: var(--space-3) var(--space-4);
  background: var(--red-soft);
  border: 1px solid var(--red-border);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  color: var(--red-dark);
}
.previews__note svg { width: 16px; height: 16px; flex-shrink: 0; }

.modal__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: var(--space-5) var(--space-6);
  padding-bottom: max(var(--space-5), env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.modal__price {
  display: flex;
  align-items: baseline;
  gap: var(--space-3);
  font-variant-numeric: tabular-nums;
}
.modal__price-now { font-size: var(--text-xl); font-weight: 800; }
.modal__price-was { font-size: var(--text-base); color: var(--fg-subtle); text-decoration: line-through; }

.modal__buy { flex: 1 1 280px; }

.modal__trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-top: var(--space-2);
  font-size: var(--text-xs);
  line-height: 1.4;
  color: var(--fg-subtle);
  text-align: center;
}
.modal__trust svg { width: 13px; height: 13px; flex-shrink: 0; }

.btn__icon { width: 17px; height: 17px; flex-shrink: 0; }

@media (max-width: 749px) {
  .modal__head, .modal__body, .modal__foot { padding-inline: var(--space-4); }
}

/* --------------------------------------------------------------------------
   9. FOOTER
   -------------------------------------------------------------------------- */
.footer {
  padding-block: var(--space-10);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--fg-subtle);
}
.footer__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
}
.footer a { transition: color var(--dur) var(--ease-out); }
.footer a:hover { color: var(--red); }

/* --------------------------------------------------------------------------
   10. ESTADO VACÍO
   -------------------------------------------------------------------------- */
.empty {
  padding: var(--space-16) var(--space-6);
  text-align: center;
  color: var(--fg-subtle);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-lg);
}

/* --------------------------------------------------------------------------
   11. MOVIMIENTO REDUCIDO
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   12. PÁGINA DE GRACIAS
   -------------------------------------------------------------------------- */
.thanks {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  text-align: center;
  padding: var(--gutter);
}
.thanks__card { max-width: 520px; }
.thanks__icon {
  display: grid;
  place-items: center;
  width: 68px; height: 68px;
  margin: 0 auto var(--space-8);
  border-radius: 50%;
  background: var(--red-soft);
  border: 1.5px solid var(--red-border);
  color: var(--red);
}
.thanks__icon svg { width: 30px; height: 30px; }
.thanks h1 { font-size: var(--text-2xl); margin-bottom: var(--space-4); }
.thanks p { color: var(--fg-muted); margin-bottom: var(--space-8); }
