/* Base CSS - Modern Reset + RTL Foundation */

/* Modern CSS Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-size-adjust: 100%;
}

body {
  font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Container & Layout */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--container-padding);
  width: 100%;
}

.section {
  padding-block: var(--gap-3xl);
}

.section-sm {
  padding-block: var(--gap-2xl);
}

/* Grid System (Simple utility) */
.grid {
  display: grid;
  gap: var(--gap-lg);
}

.grid-cols-1 {
  grid-template-columns: 1fr;
}

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

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

/* Accessibility Utilities */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.skip-to-content {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--color-primary);
  color: var(--color-inverse);
  padding: var(--gap-base) var(--gap-lg);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: var(--gap-base);
}

/* Responsive Image */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

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

/* Lists */
ul, ol {
  list-style: none;
}

/* Buttons Reset */
button {
  font-family: inherit;
  font-size: 100%;
  border: none;
  background: none;
  cursor: pointer;
}

/* Form Elements */
input, select, textarea {
  font-family: inherit;
  font-size: 100%;
  width: 100%;
}

/* Breakpoints - Mobile First */
/* Small: 360px - 639px (default) */
/* Medium: 640px - 1023px */
@media (min-width: 640px) {
  :root {
    --container-padding: var(--space-lg);
  }
  
  .section {
    padding: var(--space-3xl) 0;
  }
}

/* Large: 1024px+ */
@media (min-width: 1024px) {
  :root {
    --container-padding: var(--space-xl);
  }
}

/* Focus Management (Accessibility) */
:focus {
  outline: none;
}

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

/* Interactive Element Minimum Size (Touch Target) */
button,
a,
input,
select,
textarea {
  min-height: 44px;
  min-width: 44px;
}

/* Enhanced Mobile Touch Targets */
@media (max-width: 767px) {
  button:not(.back-to-top),
  a:not(.back-to-top),
  .card,
  .faq-question,
  .product-tab {
    min-height: 48px;
  }
  
  /* Prevent iOS zoom on input focus */
  input[type="text"],
  input[type="tel"],
  input[type="email"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Reduced Motion (Accessibility) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  html {
    scroll-behavior: auto;
  }
}

