/* styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  direction: rtl; /* Arabic Right-to-Left */
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-color);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

ul {
  list-style: none;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 3vw, 2.5rem); }

p {
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Subtle continuous animations */
@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
  100% { transform: translateY(0px); }
}

@keyframes pulseGlow {
  0% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(227, 6, 19, 0); }
  100% { box-shadow: 0 0 0 0 rgba(227, 6, 19, 0); }
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.hero-content {
  animation: heroFadeIn 1.2s cubic-bezier(0.165, 0.84, 0.44, 1) forwards;
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(30px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Utility Classes */
.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 5rem 0;
}

.text-center { text-align: center; }
.text-primary { color: var(--primary); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-4 { gap: 2rem; }
.gap-6 { gap: 3rem; }

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 700;
  font-size: 1.1rem;
  cursor: pointer;
  border: none;
  outline: none;
  transition: var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--bg-color);
  box-shadow: 0 4px 15px rgba(227, 6, 19, 0.3);
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 8px 25px rgba(227, 6, 19, 0.5);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: var(--bg-color);
}

.btn-glass {
  background: var(--glass-bg);
  color: var(--text-main);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Glassmorphism Cards */
.card-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: var(--transition);
}

.card-glass:hover {
  transform: translateY(-8px);
  border-color: rgba(227, 6, 19, 0.4);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(227, 6, 19, 0.2);
}

/* --- Animations --- */
.fade-in-up {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease-out, transform 0.8s cubic-bezier(0.165, 0.84, 0.44, 1);
  will-change: opacity, transform;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

.delay-100 { transition-delay: 100ms; }
.delay-200 { transition-delay: 200ms; }
.delay-300 { transition-delay: 300ms; }
.delay-400 { transition-delay: 400ms; }

/* Header & Nav */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 1.5rem 0;
  transition: var(--transition);
}

@media (max-width: 768px) {
  .header {
    padding: 1rem 0;
  }
}

.header.scrolled {
  padding: 1rem 0;
  background: rgba(11, 14, 20, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo i {
  color: var(--primary);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2.5rem;
}

.nav-link {
  font-weight: 500;
  font-size: 1.1rem;
  position: relative;
  padding-bottom: 0.25rem;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: var(--transition);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

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

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-main);
}

@media (max-width: 1024px) {
  .nav-links.desktop {
    display: none;
  }
  .menu-toggle {
    display: block;
  }
}

/* Mobile Menu */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 1000;
  padding: 5rem 2rem;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.mobile-menu.open {
  right: 0;
}

.mobile-menu .nav-link {
  display: block;
  font-size: 1.2rem;
  border-bottom: 1px solid var(--border);
  padding-bottom: 1rem;
}

.close-menu {
  position: absolute;
  top: 1.5rem;
  left: 1.5rem;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
}
.close-menu:hover { color: var(--text-main); }

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Badges / Tags */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.875rem;
  font-weight: 700;
  background: rgba(227, 6, 19, 0.1);
  color: var(--primary);
  border: 1px solid rgba(227, 6, 19, 0.3);
}

/* Animations */
.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Footer layout */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 4rem 0 2rem;
  margin-top: 5rem;
}

.footer-grid {
  display: grid;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-col h4 {
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
  color: var(--text-main);
  position: relative;
  display: inline-block;
}

.footer-col h4::after {
  content: '';
  position: absolute;
  bottom: -0.5rem;
  right: 0;
  width: 40px;
  height: 2px;
  background: var(--primary);
}

.footer-links li {
  margin-bottom: 0.75rem;
}

.footer-links a {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-links a:hover {
  color: var(--primary);
  transform: translateX(-5px);
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
}

.social-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: var(--transition);
}

.social-btn:hover {
  background: var(--primary);
  color: var(--bg-color);
  transform: translateY(-3px);
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 1rem 1.5rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-family);
  font-size: 1rem;
  transition: var(--transition);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(227, 6, 19, 0.1);
}

textarea.form-control {
  min-height: 120px;
  resize: vertical;
}

/* Floating WhatsApp / Towing Button */
.floating-action {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  z-index: 99;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.float-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #fff;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
}

.float-whatsapp {
  background: #25D366;
}
.float-whatsapp:hover {
  background: #1DA851;
  transform: scale(1.1);
}

.float-towing {
  background: var(--primary);
  color: var(--bg-color);
}
.float-towing:hover {
  background: var(--primary-hover);
  transform: scale(1.1);
}

/* Tooltip */
.float-btn::before {
  content: attr(data-tooltip);
  position: absolute;
  right: calc(100% + 15px);
  top: 50%;
  transform: translateY(-50%) translateX(10px);
  background: var(--surface);
  color: var(--text-main);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: var(--transition);
  border: 1px solid var(--border);
}

.float-btn:hover::before {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

/* Center Details Responsive Badges - Sleek Rectangular Layout */
.center-brand-badge {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 140px;
  height: 100px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text-main);
  font-size: 0.95rem;
  gap: 8px;
  text-align: center;
  flex-shrink: 0;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.center-brand-badge:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  background: rgba(227, 6, 19, 0.05);
}

@media (min-width: 768px) {
  .center-brand-badge {
    width: 160px;
    height: 110px;
    font-size: 1.1rem;
  }
}

/* Ensure flex containers wrap properly on mobile */
.flex-wrap {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: center;
}
