/*
Theme Name: الأول ويب
Theme URI: https://example.com
Author: Your Company
Description: قالب احترافي لشركة خدمات التجارة الإلكترونية
Version: 1.0
Text Domain: alawwalweb
RTL: yes
*/

/* ==========================================================================
   Base - RTL & Arabic
   ========================================================================== */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #3b82f6;
  --secondary: #1e40af;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f8fafc;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  --radius: 12px;
  --radius-lg: 20px;
  --transition: 0.3s ease;
  --font-main: 'Cairo', sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[dir="rtl"] {
  text-align: right;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-main);
  color: var(--text);
  background-color: var(--bg);
  line-height: 1.6;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  min-width: 0;
}

/* منع التكبير التلقائي على iOS عند focus الحقول */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
input[type="search"],
textarea {
  font-size: 16px;
}

@media (min-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="search"],
  textarea {
    font-size: 1rem;
  }
}

/* Dark Mode */
body.dark-mode {
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --bg: #0f172a;
  --bg-alt: #1e293b;
  --border: #334155;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.2;
  margin-top: 0;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--primary-hover);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s;
}

img[loading="lazy"].loaded {
  opacity: 1;
}

/* Container - متوافق مع الموبايل */
.sg-container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  min-width: 0;
}

@media (min-width: 480px) {
  .sg-container {
    padding: 0 1.25rem;
  }
}

@media (min-width: 768px) {
  .sg-container {
    padding: 0 2rem;
  }
}

/* Buttons */
.sg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  min-height: 44px;
  font-family: var(--font-main);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
}

@media (min-width: 768px) {
  .sg-btn {
    padding: 0.75rem 1.5rem;
  }
}

.sg-btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow);
}

.sg-btn-primary:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.sg-btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.sg-btn-outline:hover {
  background: var(--primary-hover);
  color: #fff;
  border-color: var(--primary-hover);
  transform: translateY(-2px);
}

/* Section Title */
.sg-section-title {
  text-align: center;
  margin-bottom: 2.5rem;
}

.sg-section-title h2 {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.sg-section-title p {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Screen reader */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
}

.screen-reader-text:focus {
  clip: auto !important;
  height: auto;
  width: auto;
  padding: 0.5rem 1rem;
  background: var(--bg);
  z-index: 9999;
}
