/* Design System Base — Reset, Typography, Layout & State Utilities */

@layer base {
  *, *::before, *::after {
    box-sizing: border-box;
  }

  html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  html.is-clipped {
    overflow: hidden;
  }

  body {
    margin: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--bg-page);
    min-height: 100vh;
  }

  a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.15s ease;

    &:hover {
      color: var(--accent-hover);
    }
  }

  h1, h2, h3, h4, p {
    margin-top: 0;
  }

  /* Layout Containers & Grids */
  .ui-container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-4);
  }

  .ui-stack {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
  }

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

  .ui-between {
    justify-content: space-between;
  }

  .ui-py-4 {
    padding-block: var(--space-4);
  }

  .ui-grid {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;

    @media (min-width: 640px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    @media (min-width: 1024px) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
    }
  }

  .ui-grid-2 {
    display: grid;
    gap: var(--space-4);
    grid-template-columns: 1fr;

    @media (min-width: 768px) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }
  }

  /* Typography Helpers */
  .ui-h1 {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -0.02em;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
  }

  .ui-h2 {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
  }

  .ui-h3 {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
  }

  .ui-text-muted {
    color: var(--text-muted);
    font-size: 0.875rem;
  }

  .ui-text-secondary {
    color: var(--text-secondary);
  }

  .ui-price {
    font-weight: 800;
    color: var(--accent);
  }

  /* Universal JS State Helpers */
  .is-hidden {
    display: none !important;
  }
}
