@layer base {
  html {
    font-family: var(--font-family);
    font-size: var(--text-normal);
    color: var(--color-ink);
    background-color: var(--color-canvas);
    line-height: var(--leading-relaxed);
    scroll-behavior: smooth;
    scroll-padding-top: 4.5rem;
  }

  body {
    display: flex;
    flex-direction: column;
    padding: env(safe-area-inset-top) env(safe-area-inset-right)
             env(safe-area-inset-bottom) env(safe-area-inset-left);
    background-image: url("/assets/fundo_site-b7cf074e.webp");
    background-size: cover;
    background-position: center top;
    background-attachment: scroll;
    background-repeat: no-repeat;

    @media (min-width: 1024px) {
      background-attachment: fixed;
    }
  }

  body.bg-pedido {
    background-image: url("/assets/fundo_pedido-8e450677.webp");
  }

  body.bg-sober,
  body.admin-page {
    background-image: none;
  }

  body.admin-page {
    background-color: var(--color-canvas-alt);
    background-image:
      radial-gradient(at 0% 0%, color-mix(in oklch, var(--color-primary) 6%, transparent) 0%, transparent 45%),
      radial-gradient(at 100% 100%, color-mix(in oklch, var(--color-accent) 5%, transparent) 0%, transparent 50%);
    background-attachment: scroll;

    @media (min-width: 1024px) {
      background-attachment: fixed;
    }
  }

  /* Overlay escuro sutil em páginas que não são home/admin pra dar contraste no conteúdo */
  body:not(.home-page):not(.bg-sober):not(.no-overlay):not(.admin-page)::after {
    content: "";
    position: fixed;
    inset: 0;
    background: oklch(0% 0 0 / 0.40);
    z-index: -1;
    pointer-events: none;
  }

  h1 {
    font-size: var(--text-xlarge);
    font-weight: 800;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;

    @media (min-width: 1024px) {
      font-size: var(--text-xxlarge);
    }
  }

  h2 {
    font-size: var(--text-normal);
    font-weight: 700;
    line-height: var(--leading-tight);

    @media (min-width: 1024px) {
      font-size: var(--text-large);
    }
  }

  h3 {
    font-size: var(--text-small);
    font-weight: 700;
    line-height: var(--leading-tight);
  }

  a {
    color: var(--color-primary);
    transition: color var(--duration-fast) ease;

    @media (any-hover: hover) {
      &:hover { color: var(--color-primary-hover); }
    }
  }

  img { height: auto; }

  ::selection {
    background: var(--color-primary);
    color: white;
  }

  button, input, select, textarea { min-height: 44px; }
  input, select, textarea {
    min-width: 44px;
    font-size: 1rem;
  }

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

  /* Layout */
  .main-content {
    flex: 1;
    width: 100%;
    max-width: var(--max-width);
    margin-inline: auto;
    padding: var(--space-md) var(--main-padding) var(--space-2xl);
  }

  .has-bottom-nav .main-content {
    padding-bottom: calc(var(--space-2xl) + 4rem);

    @media (min-width: 1024px) {
      padding-bottom: 0;
    }
  }

  .section {
    margin-block: var(--space-xl);

    & > h2 {
      margin-bottom: var(--space-md);
      padding-bottom: var(--space-xs);
      border-bottom: 2px solid var(--color-primary);
      display: inline-block;
    }
  }

  /* On the home page the section sits on the stadium photo (no overlay) —
     make the section title big and bright so it reads against the busy bg. */
  body.home-page .section > h2 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 3.25rem);
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.005em;
    line-height: 1;
    color: white;
    text-shadow: 0 2px 16px oklch(0% 0 0 / 0.6);
    border-bottom: 4px solid var(--color-primary);
    padding-bottom: var(--space-sm);
    animation: home-section-h2-stamp 600ms var(--ease-out) 850ms both;
  }

  @keyframes home-section-h2-stamp {
    from { opacity: 0; transform: translateY(8px); letter-spacing: 0.12em; }
    to   { opacity: 1; transform: translateY(0);    letter-spacing: 0.005em; }
  }

  .section-narrow {
    max-width: var(--narrow-width);
    margin-inline: auto;
  }

  .section-checkout {
    width: 800px;
    margin-inline: auto;
  }
}
