/* CodeAzed Theme - Main Styles */

* { scroll-behavior: smooth; }

body {
  font-family: 'Cairo', 'Inter', sans-serif;
  margin: 0;
}

html[lang="en"] body,
html[dir="ltr"] body {
  font-family: 'Inter', 'Cairo', sans-serif;
}

/* Language helpers */
.lang-en { display: none; }
html[lang="en"] .lang-ar { display: none; }
html[lang="en"] .lang-en { display: inline; }

/* Modal */
.modal-overlay {
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}
.modal-box {
  transform: scale(0.95) translateY(16px);
  transition: all 0.25s ease;
}
.modal-overlay.active .modal-box {
  transform: scale(1) translateY(0);
}

/* Product image zoom */
.product-card:hover img {
  transform: scale(1.05);
}
.product-card img {
  transition: transform 0.5s ease;
}

/* Fade-in on scroll */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Active nav */
.nav-link.active {
  color: #4F46E5;
  font-weight: 600;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #111827;
  color: white;
  padding: 12px 24px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  z-index: 200;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Back to top */
#backToTop {
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
}

/* Filter buttons */
.filter-btn.active {
  background: #4F46E5 !important;
  color: white !important;
  border-color: #4F46E5 !important;
}

/* Focus visible */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid #4F46E5;
  outline-offset: 2px;
}

/* Typewriter cursor */
.type-cursor {
  display: inline-block;
  color: #4F46E5;
  font-weight: 300;
  animation: blink 0.7s step-end infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* Float animation */
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-float {
  animation: float 3s ease-in-out infinite;
}

/* WhatsApp pulse */
@keyframes pulse-ring {
  0% { transform: scale(0.9); opacity: 0.7; }
  70% { transform: scale(1.15); opacity: 0; }
  100% { transform: scale(0.9); opacity: 0; }
}
.wa-pulse {
  position: relative;
}
.wa-pulse::before {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 9999px;
  background: #25D366;
  animation: pulse-ring 2s infinite;
  z-index: -1;
}

/* Custom logo size */
.custom-logo-link img {
  max-height: 40px;
  width: auto;
}

/* Critical button fallbacks (when Tailwind CDN is slow/blocked) */
.bg-primary-600, [class*="bg-primary-600"] {
  background-color: #4F46E5 !important;
}
.text-primary-600, [class*="text-primary-600"] {
  color: #4F46E5 !important;
}
.text-primary-700 {
  color: #4338CA !important;
}
.bg-primary-50 {
  background-color: #EEF2FF !important;
}
/* Ensure buy box buttons always visible */
a[style*="4338CA"], button[style*="4338CA"] {
  opacity: 1 !important;
  visibility: visible !important;
}

/* ========== Transparent Header ========== */
.caz-header {
  background: transparent;
  border-bottom: 1px solid transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* Default (over hero): readable dark text on light hero */
.caz-header .caz-nav .nav-link {
  color: #374151;
}
.caz-header .caz-nav .nav-link:hover,
.caz-header .caz-nav .nav-link.active {
  color: #4F46E5;
}
.caz-header .caz-lang {
  color: #6b7280;
}
.caz-header .caz-menu-btn {
  color: #374151;
}
.caz-header .caz-logo-text {
  color: #111827;
}
.caz-header .caz-mobile-menu {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Scrolled: glassmorphism solid */
.caz-header.is-scrolled {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  border-bottom-color: rgba(0, 0, 0, 0.06);
  box-shadow: 0 4px 24px -4px rgba(0, 0, 0, 0.08);
}

.caz-header.is-scrolled .caz-nav .nav-link {
  color: #4b5563;
}
.caz-header.is-scrolled .caz-nav .nav-link:hover,
.caz-header.is-scrolled .caz-nav .nav-link.active {
  color: #4F46E5;
}

/* Spacer so content isn't under fixed header on non-front pages */
body:not(.home) .caz-header + *,
body.single .site-content,
body.archive main,
body.page main {
  /* handled per template with pt if needed */
}

/* Front page: hero starts under transparent header */
body.home .caz-header ~ main,
body.home > section:first-of-type {
  /* front-page content follows header in DOM */
}

/* Product / archive pages need top padding for fixed header */
body.single-caz_product main,
body.post-type-archive-caz_product main,
body.single main,
body.page main,
body.blog main {
  padding-top: 5rem;
}

@media (max-width: 767px) {
  .caz-header.is-scrolled {
    background: rgba(255, 255, 255, 0.92);
  }
}
