/* Base CSS - Reset & Base Styles */
/* Note: variables.css is included separately in HTML */

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-primary);
  color: var(--color-charcoal);
  line-height: 1.6;
  background-color: var(--color-white);
  overflow-x: hidden;
  margin: 0;
  padding: 0;
  width: 100%;
  position: relative;
  max-width: 100vw;
}

/* Prevent horizontal scroll */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

/* RTL support */
[dir="rtl"] html,
[dir="rtl"] body {
  overflow-x: hidden;
  direction: rtl;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
  transition: color var(--transition-fast);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

ul {
  list-style: none;
}

/* Typography - Responsive */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-sm);
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
}

h3 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: var(--spacing-sm);
  font-size: clamp(0.875rem, 2vw, 1rem);
}

/* Responsive container */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--spacing-md);
  width: 100%;
}

@media (max-width: 768px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-sm);
    max-width: 100%;
  }

  h1 {
    font-size: clamp(1.75rem, 6vw, 2rem);
    line-height: 1.2;
  }

  h2 {
    font-size: clamp(1.5rem, 5vw, 1.75rem);
    line-height: 1.3;
  }

  h3 {
    font-size: clamp(1.25rem, 4vw, 1.5rem);
    line-height: 1.3;
  }

  h4 {
    font-size: clamp(1.1rem, 3.5vw, 1.25rem);
    line-height: 1.4;
  }

  p {
    font-size: clamp(0.9rem, 2.5vw, 1rem);
    line-height: 1.6;
  }

  /* Ensure touch targets are at least 44x44px, except for indicators and specific UI controls that need to be smaller/thinner */
  button:not(.hero-indicator):not(.category-hero-indicator):not(.hero-nav):not(.category-hero-nav),
  a:not(.hero-indicator):not(.category-hero-indicator):not(.hero-nav):not(.category-hero-nav),
  input,
  select,
  textarea {
    min-height: 44px;
    min-width: 44px;
  }

  /* Prevent text size adjustment on iOS */
  input,
  select,
  textarea {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 var(--spacing-xs);
  }
}