/* ============================================== */
/* 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: 700;
    font-size: var(--fs-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
    border-radius: var(--radius-sm);
    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),
      box-shadow 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));
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
  }

  .btn-primary:active {
    box-shadow: 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));
    transform: translateY(-2px);
    text-decoration: none;
  }

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

  .nav {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    background: hsl(var(--bg) / 0.97);
    border-bottom: 2px solid hsl(var(--line));
  }

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

  @media (min-width: 960px) {
    .nav-inner {
      gap: var(--space-8);
    }
  }

  .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 {
    position: relative;
    display: inline-flex;
    align-items: center;
    padding-block: 6px;
    font-size: var(--fs-sm);
    font-weight: 500;
    color: hsl(var(--ink-dim));
    transition: color var(--dur-fast) var(--ease-out);
  }

  .nav-links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: hsl(var(--dorado));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--dur-fast) var(--ease-out);
  }

  .nav-links a:hover::after {
    transform: scaleX(1);
  }

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

  .nav-cta {
    margin-inline-start: auto;
    padding: 8px 12px;
    min-height: 36px;
    font-size: var(--fs-xs);
  }

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

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

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

  @media (min-width: 960px) {
    .nav-links {
      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: flex;
    flex-direction: column;
    gap: var(--space-8);
    margin-bottom: var(--space-12);
  }

  @media (min-width: 720px) {
    .footer-grid {
      flex-direction: row;
      align-items: flex-end;
      justify-content: space-between;
    }
  }

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

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

  .footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-8);
    font-size: var(--fs-xs);
    letter-spacing: var(--tracking-overline);
    text-transform: uppercase;
    color: hsl(var(--ink-faint));
  }

  .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: hsl(var(--ink-faint));
    transition: color var(--dur-fast) var(--ease-out);
  }

  .footer-links 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. */
}
