/* ==========================================================================
   معلم دهانات جدة المحترف - التنسيقات الأساسية القياسية (Modern CSS)
   Zero Libraries | Zero CLS | Mobile-First UX | 100% Lighthouse Score
   ========================================================================== */

:root {
  --primary-color: #1a2332;
  --primary-light: #243247;
  --primary-dark: #0f1622;
  --accent-color: #ea580c;
  --accent-hover: #c2410c;
  --accent-light: #ffedd5;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --text-dark: #0f172a;
  --text-muted: #475569;
  --text-light: #f8fafc;
  --border-color: #e2e8f0;
  --border-dark: #334155;
  --success-color: #16a34a;
  --whatsapp-color: #25d366;
  --whatsapp-hover: #1eb954;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, Tahoma, sans-serif;
  --header-height: 70px;
}

/* Reset & Base Rules */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--font-family);
  font-size: 16px;
  line-height: 1.6;
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

body {
  background-color: var(--bg-light);
  color: var(--text-dark);
  font-family: var(--font-family);
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

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

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

ul, ol {
  list-style: none;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.25rem;
  padding-right: 1.25rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-color);
  line-height: 1.3;
  font-weight: 700;
  margin-bottom: 0.75rem;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: clamp(1.15rem, 2.5vw, 1.5rem); }
p { margin-bottom: 1rem; color: var(--text-muted); }
p:last-child { margin-bottom: 0; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-align: center;
  transition: all var(--transition-fast);
  min-height: 48px;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--accent-color);
  color: #ffffff;
}
.btn-primary:hover {
  background-color: var(--accent-hover);
  color: #ffffff;
}

.btn-secondary {
  background-color: var(--primary-color);
  color: #ffffff;
}
.btn-secondary:hover {
  background-color: var(--primary-light);
  color: #ffffff;
}

.btn-whatsapp {
  background-color: var(--whatsapp-color);
  color: #ffffff;
}
.btn-whatsapp:hover {
  background-color: var(--whatsapp-hover);
  color: #ffffff;
}

.btn-outline {
  border: 2px solid var(--accent-color);
  color: var(--accent-color);
  background: transparent;
}
.btn-outline:hover {
  background-color: var(--accent-color);
  color: #ffffff;
}

.btn-block {
  width: 100%;
}

/* Header & Navigation */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-white);
  box-shadow: var(--shadow-sm);
  height: var(--header-height);
  display: flex;
  align-items: center;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.brand-info {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.nav-link {
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  position: relative;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-color);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background-color: var(--accent-color);
  border-radius: var(--radius-full);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.header-call-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  min-height: 40px;
}

.hamburger-btn {
  display: none;
  width: 42px;
  height: 42px;
  padding: 8px;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.hamburger-line {
  width: 100%;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 2px;
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.hamburger-btn.active .hamburger-line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger-btn.active .hamburger-line:nth-child(2) {
  opacity: 0;
}
.hamburger-btn.active .hamburger-line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Navigation Overlay */
.mobile-nav {
  display: none;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.6);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-normal), visibility var(--transition-normal);
}

.mobile-nav.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav-panel {
  background-color: var(--bg-white);
  width: 80%;
  max-width: 320px;
  height: 100%;
  margin-right: auto;
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform var(--transition-normal);
  box-shadow: -4px 0 15px rgba(0, 0, 0, 0.15);
}

.mobile-nav.open .mobile-nav-panel {
  transform: translateX(0);
}

.mobile-nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.mobile-nav-item a {
  display: block;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-dark);
  border-radius: var(--radius-sm);
  background-color: var(--bg-light);
}

.mobile-nav-item a:hover, .mobile-nav-item a.active {
  background-color: var(--accent-light);
  color: var(--accent-hover);
}

/* Hero Section */
.hero {
  position: relative;
  background-color: var(--primary-color);
  color: var(--text-light);
  padding: 3.5rem 0;
  overflow: hidden;
}

.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(234, 88, 12, 0.15), transparent 70%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 750px;
}

.hero-badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background-color: rgba(234, 88, 12, 0.2);
  border: 1px solid var(--accent-color);
  color: #ffedd5;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero-title {
  color: #ffffff;
  margin-bottom: 1rem;
}

.hero-description {
  color: #e2e8f0;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Sections */
.section {
  padding: 4rem 0;
}

.section-bg-white {
  background-color: var(--bg-white);
}

.section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.section-subtitle {
  color: var(--accent-color);
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

/* Cards & Grid */
.grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}

.card {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.card-icon {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-light);
  color: var(--accent-color);
  border-radius: var(--radius-md);
  font-size: 1.5rem;
  margin-bottom: 1.25rem;
}

/* Gallery Grid (Mobile-First 2 Columns) */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: 1rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background-color: #cbd5e1;
  box-shadow: var(--shadow-sm);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-normal);
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.2) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1rem;
  color: #ffffff;
  pointer-events: none;
}

.gallery-overlay h3 {
  color: #ffffff;
  font-size: 1rem;
  margin-bottom: 0.25rem;
  white-space: normal;
}

.gallery-overlay p {
  color: #e2e8f0;
  font-size: 0.8rem;
  margin: 0;
  white-space: normal;
}

/* Pricing Table */
.pricing-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
}

.price-card {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.price-card.featured {
  border: 2px solid var(--accent-color);
  box-shadow: var(--shadow-lg);
}

.price-badge {
  position: absolute;
  top: -12px;
  left: 50%;
  transform: translateX(-50%);
  background-color: var(--accent-color);
  color: #ffffff;
  padding: 0.25rem 1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 700;
}

.price-header {
  text-align: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

.price-amount {
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--primary-color);
}

.price-amount span {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted);
}

.price-features {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex-grow: 1;
}

.price-features li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-dark);
}

.price-features li::before {
  content: '✓';
  color: var(--success-color);
  font-weight: bold;
}

/* Calculator Form Box */
.calc-box {
  background-color: var(--bg-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  max-width: 700px;
  margin: 0 auto;
}

.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-light);
  color: var(--text-dark);
  outline: none;
  transition: border-color var(--transition-fast);
}

.form-control:focus {
  border-color: var(--accent-color);
  background-color: #ffffff;
}

.calc-result-box {
  background-color: var(--primary-color);
  color: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-md);
  text-align: center;
  margin-top: 1.5rem;
}

.calc-result-val {
  font-size: 2rem;
  font-weight: 800;
  color: #ffedd5;
  margin: 0.5rem 0;
}

/* FAQ Accordion */
.faq-accordion {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background-color: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.faq-question {
  width: 100%;
  padding: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--primary-color);
  text-align: right;
  background: none;
}

.faq-icon {
  font-size: 1.25rem;
  transition: transform var(--transition-fast);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-normal), padding var(--transition-normal);
  padding: 0 1.25rem;
  background-color: var(--bg-light);
}

.faq-item.active .faq-answer {
  padding: 1rem 1.25rem 1.25rem;
  max-height: 300px;
}

/* Floating CTAs */
.floating-contact-right {
  position: fixed;
  bottom: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 998;
}

.floating-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 1.5rem;
  transition: transform var(--transition-fast), filter var(--transition-fast);
}

.floating-btn:hover {
  transform: scale(1.1);
  color: #ffffff;
}

.floating-btn.whatsapp {
  background-color: var(--whatsapp-color);
}

.floating-btn.call {
  background-color: var(--accent-color);
}

.floating-scroll-left {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--transition-fast), visibility var(--transition-fast);
}

.floating-scroll-left.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-top-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--primary-color);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  font-size: 1.2rem;
  border: 1px solid var(--border-dark);
}

.scroll-top-btn:hover {
  background-color: var(--accent-color);
}

/* Footer */
.footer {
  background-color: var(--primary-dark);
  color: #94a3b8;
  padding-top: 4rem;
  margin-top: auto;
  border-top: 4px solid var(--accent-color);
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin-bottom: 3rem;
}

.footer-column h3 {
  color: #ffffff;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  position: relative;
  padding-bottom: 0.5rem;
}

.footer-column h3::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 40px;
  height: 2px;
  background-color: var(--accent-color);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.9rem;
}

.footer-links a:hover {
  color: var(--accent-color);
  padding-right: 4px;
}

.seo-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.seo-tag {
  background-color: var(--primary-color);
  color: #e2e8f0;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-bottom {
  background-color: #080c14;
  padding: 1.5rem 0;
  text-align: center;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  color: #94a3b8;
  font-size: 0.85rem;
}

.dev-credit {
  color: #cbd5e1;
  font-weight: 600;
}

.dev-credit a {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Responsive Media Queries */
@media (max-width: 991px) {
  .nav-menu {
    display: none;
  }
  .hamburger-btn {
    display: flex;
  }
}

@media (max-width: 768px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .gallery-item {
    aspect-ratio: 1 / 1;
  }
  .gallery-overlay {
    padding: 0.5rem;
  }
  .gallery-overlay h3 {
    font-size: 0.85rem;
  }
  .gallery-overlay p {
    font-size: 0.7rem;
  }
  .brand-subtitle {
    display: none;
  }
  .header-call-btn span {
    display: none;
  }
  .header-call-btn {
    padding: 0.5rem 0.75rem;
  }
}

@media (max-width: 480px) {
  .hero-ctas .btn {
    width: 100%;
  }
  .floating-btn {
    width: 46px;
    height: 46px;
    font-size: 1.3rem;
  }
  .scroll-top-btn {
    width: 40px;
    height: 40px;
  }
}
