/* ============================================== */
/* Components — botones, nav, footer, badges      */
/* ============================================== */

@layer components {

  /* ============================================== */
  /* Section wrapper                                */
  /* ============================================== */

  .section {
    padding-block: var(--space-16);
  }

  @media (min-width: 960px) {
    .section {
      padding-block: var(--space-24);
    }
  }

  /* ============================================== */
  /* Botón                                          */
  /* ============================================== */

  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 14px 24px;
    min-height: 48px;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: var(--fs-body);
    line-height: 1;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition:
      transform var(--dur-fast) var(--ease-out),
      background-color var(--dur-fast) var(--ease-out),
      color var(--dur-fast) var(--ease-out);
  }

  .btn:active {
    transform: translateY(1px);
  }

  .btn-primary {
    background: hsl(var(--dorado));
    color: hsl(var(--bg-deep));
  }

  .btn-primary:hover {
    background: hsl(var(--dorado-light));
    text-decoration: none;
  }

  .btn-ghost {
    background: transparent;
    color: hsl(var(--ink));
    border-color: hsl(var(--line));
  }

  .btn-ghost:hover {
    background: hsl(var(--bg-raised));
    border-color: hsl(var(--ink-faint));
    text-decoration: none;
  }

  /* ============================================== */
  /* Store badges (App Store / Google Play)         */
  /* Placeholder hasta que entren los SVGs oficiales*/
  /* ============================================== */

  .store-badges {
    display: flex;
    gap: var(--space-3);
    flex-wrap: wrap;
    align-items: center;
  }

  .store-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    min-width: 140px;
    padding: 0 var(--space-4);
    background: hsl(var(--bg-deep));
    color: hsl(var(--ink));
    border: 1px solid hsl(var(--line));
    border-radius: var(--radius-md);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.02em;
    transition:
      border-color var(--dur-fast) var(--ease-out),
      background var(--dur-fast) var(--ease-out);
  }

  .store-badge:hover {
    border-color: hsl(var(--dorado));
    background: hsl(var(--bg-raised));
    text-decoration: none;
  }

  .store-badge img {
    height: 100%;
    width: auto;
  }

  /* ============================================== */
  /* Nav (header sticky)                            */
  /* ============================================== */

  .nav {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: hsl(var(--bg) / 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid hsl(var(--line-soft));
  }

  .nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding-block: var(--space-3);
  }

  .nav-logo {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.375rem;
    letter-spacing: 0.06em;
    color: hsl(var(--ink));
  }

  .nav-logo:hover {
    text-decoration: none;
    color: hsl(var(--dorado));
  }

  .nav-links {
    display: none;
    gap: var(--space-8);
    align-items: center;
  }

  .nav-links a {
    font-size: var(--fs-sm);
    font-weight: 500;
    color: hsl(var(--ink-dim));
    transition: color var(--dur-fast) var(--ease-out);
  }

  .nav-links a:hover {
    color: hsl(var(--ink));
    text-decoration: none;
  }

  .nav-cta {
    display: none;
    /* btn padding override para que no domine la nav */
    padding: 10px 18px;
    min-height: 40px;
    font-size: var(--fs-sm);
  }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    color: hsl(var(--ink));
    font-size: 1.5rem;
    line-height: 1;
  }

  .nav-burger::before {
    content: "☰";
  }

  .nav-burger[aria-expanded="true"]::before {
    content: "✕";
  }

  @media (min-width: 960px) {
    .nav-links,
    .nav-cta {
      display: inline-flex;
    }

    .nav-burger {
      display: none;
    }
  }

  /* ============================================== */
  /* Drawer mobile                                  */
  /* ============================================== */

  .nav-drawer {
    position: fixed;
    inset: 0;
    z-index: var(--z-drawer);
    background: hsl(var(--bg-deep) / 0.98);
    backdrop-filter: blur(8px);
    padding: calc(var(--space-16) + 44px) var(--space-6) var(--space-8);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    transform: translateY(-100%);
    transition: transform var(--dur-base) var(--ease-out);
    visibility: hidden;
  }

  .nav-drawer[data-open="true"] {
    transform: translateY(0);
    visibility: visible;
  }

  .nav-drawer a {
    font-family: var(--font-display);
    font-size: var(--fs-h2);
    font-weight: 900;
    color: hsl(var(--ink));
    padding-block: var(--space-3);
    border-bottom: 1px solid hsl(var(--line-soft));
  }

  .nav-drawer a:hover {
    color: hsl(var(--dorado));
    text-decoration: none;
  }

  .nav-drawer .btn {
    margin-top: var(--space-6);
    border-bottom: 0;
    font-family: var(--font-body);
    font-size: var(--fs-body);
  }

  @media (min-width: 960px) {
    .nav-drawer {
      display: none;
    }
  }

  /* ============================================== */
  /* Footer                                         */
  /* ============================================== */

  .footer {
    border-top: 1px solid hsl(var(--line-soft));
    padding-block: var(--space-16) var(--space-8);
    margin-top: var(--space-16);
    color: hsl(var(--ink-dim));
    font-size: var(--fs-sm);
    background: hsl(var(--bg-deep));
  }

  .footer-grid {
    display: grid;
    gap: var(--space-12);
    grid-template-columns: 1fr;
    margin-bottom: var(--space-12);
  }

  @media (min-width: 720px) {
    .footer-grid {
      grid-template-columns: 2fr 1fr 1fr;
      gap: var(--space-8);
    }
  }

  .footer h4 {
    font-family: var(--font-body);
    font-size: var(--fs-xs);
    letter-spacing: var(--tracking-overline);
    text-transform: uppercase;
    font-weight: 600;
    color: hsl(var(--ink));
    margin-bottom: var(--space-4);
  }

  .footer .nav-logo {
    display: inline-block;
    margin-bottom: var(--space-3);
  }

  .footer p {
    margin-bottom: var(--space-1);
  }

  .footer-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
  }

  .footer-list a {
    color: hsl(var(--ink-dim));
    transition: color var(--dur-fast) var(--ease-out);
  }

  .footer-list a:hover {
    color: hsl(var(--ink));
    text-decoration: none;
  }

  .footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid hsl(var(--line-soft));
  }

  /* ============================================== */
  /* Placeholder visual                             */
  /* ============================================== */
  /* Cualquier .placeholder se ve como bloque       */
  /* identificable hasta que haya foto/asset real.  */

  .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--space-8);
    background:
      repeating-linear-gradient(
        45deg,
        hsl(var(--bg-raised)),
        hsl(var(--bg-raised)) 12px,
        hsl(var(--bg-elev)) 12px,
        hsl(var(--bg-elev)) 24px
      );
    color: hsl(var(--ink-faint));
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    border: 1px dashed hsl(var(--line));
    border-radius: var(--radius-lg);
    min-height: 200px;
  }

  /* Cuando se reemplace el contenido por <img>, eliminar la clase .placeholder
     del elemento. Las dimensiones reales las define cada layout en layout.css. */
}
