@import url('https://fonts.googleapis.com/css2?family=Alexandria:wght@400;700&family=Cairo:wght@700&family=Tajawal:wght@700&display=swap');

:root {
  /* Core Colors */
  --primary: #C0392B;
  --primary-hover: #E74C3C;
  --gradient: linear-gradient(135deg, #C0392B, #FF6B6B);
  
  /* Light Mode Variables */
  --bg-color: #FAFAFA;
  --bg-color-alt: #FFFFFF;
  --text-color: #2C3E50;
  --text-muted: #7F8C8D;
  --border-color: #E2E8F0;
  --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  --header-bg: rgba(255, 255, 255, 0.9);
  --header-text: #2C3E50;
  --btn-outline: transparent;
  
  /* Fonts */
  --font-en: 'Alexandria', sans-serif;
  --font-ar: 'Tajawal', sans-serif; /* Setup dynamically in script */
  --font-main: var(--font-en); /* Default */
  
  /* Animations */
  --transition: all 0.3s ease;
  
  /* Spacing & Layout */
  --header-height: 80px;
  --container-width: 1440px;
}

body.dark-mode {
  --bg-color: #121212;
  --bg-color-alt: #1E1E1E;
  --text-color: #F8F9FA;
  --text-muted: #ADB5BD;
  --border-color: #333333;
  --card-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  --header-bg: rgba(18, 18, 18, 0.9);
  --header-text: #F8F9FA;
  --btn-outline: #F8F9FA;
}

html[dir="rtl"] {
  --font-main: var(--font-ar);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background-color: var(--bg-color);
  color: var(--text-color);
  transition: var(--transition);
  font-weight: 700; /* As requested, Bold weight */
  overflow-x: hidden;
  cursor: url('data:image/svg+xml;utf8,<svg width="12" height="12" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg"><circle cx="6" cy="6" r="6" fill="%23C0392B"/></svg>') 6 6, auto;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  margin-bottom: 0.5rem;
}

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

ul {
  list-style: none;
}

/* Layout Utilities */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 80px 0;
}

.text-center {
  text-align: center;
}

/* Header */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: var(--header-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  transition: var(--transition);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.nav-links {
  display: flex;
  gap: 30px;
}

.nav-links a:hover {
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.icon-btn {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 1.2rem;
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}

.icon-btn:hover {
  color: var(--primary);
  transform: scale(1.1);
}

.badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--gradient);
  color: white;
  font-size: 0.7rem;
  padding: 2px 6px;
  border-radius: 10px;
}

html[dir="rtl"] .badge {
  right: auto;
  left: -8px;
}

.admin-btn {
  border: 1px solid var(--text-color);
  padding: 5px 15px;
  border-radius: 20px;
  font-size: 0.9rem;
}

.admin-btn:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

/* Hero Slider */
.hero-slider {
  position: relative;
  width: 100%;
  height: 100vh;
  margin-top: calc(var(--header-height) * -1); /* Goes behind header */
  overflow: hidden;
}

.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1s ease-in-out;
  background-size: cover;
  background-position: center;
}

.slide.active {
  opacity: 1;
}

.slide-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: var(--header-height); /* Offset for header */
  color: white;
  text-align: center;
}

.hero-title {
  font-size: 4rem;
  margin-bottom: 20px;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(30px);
}

.slide.active .hero-title {
  animation: fadeUp 1s ease forwards 0.5s;
}

.hero-subtitle {
  font-size: 1.5rem;
  opacity: 0;
  transform: translateY(30px);
}

.slide.active .hero-subtitle {
  animation: fadeUp 1s ease forwards 0.8s;
}

.slider-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.3);
  color: white;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  padding: 10px 15px;
  border-radius: 5px;
  z-index: 10;
  transition: var(--transition);
}

.slider-nav:hover {
  background: var(--primary);
}

.slider-prev { left: 20px; }
.slider-next { right: 20px; }

html[dir="rtl"] .slider-prev { left: auto; right: 20px; transform: translateY(-50%) rotate(180deg); }
html[dir="rtl"] .slider-next { right: auto; left: 20px; transform: translateY(-50%) rotate(180deg); }

.slider-dots {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 10;
}

.dot {
  width: 12px;
  height: 12px;
  background: rgba(255,255,255,0.5);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.dot.active {
  background: var(--primary);
  transform: scale(1.3);
}

/* Promos Section */
.promo-bar {
  background: var(--gradient);
  color: white;
  padding: 15px 0;
  overflow: hidden;
  white-space: nowrap;
}

.promo-track {
  display: flex;
  gap: 50px;
  animation: scrollText 20s linear infinite;
}

.promo-item {
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

/* Sections Common */
.section-title {
  font-size: 2.5rem;
  margin-bottom: 50px;
  position: relative;
  display: inline-block;
  left: 50%;
  transform: translateX(-50%);
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 0;
  height: 3px;
  background: var(--gradient);
  transition: width 1s ease;
}

.section-title.visible::after {
  width: 100%;
}

/* Product Cards Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

.product-card {
  background: var(--bg-color-alt);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  position: relative;
  box-shadow: var(--card-shadow);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease;
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(30px);
}

.product-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.product-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: 0 10px 25px rgba(192, 57, 43, 0.15);
}

.product-image {
  width: 100%;
  height: 250px;
  object-fit: contain;
  margin-bottom: 20px;
  border-radius: 8px;
}

.product-title {
  font-size: 1.2rem;
  margin-bottom: 5px;
}

.product-author {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.product-price {
  margin-bottom: 15px;
}

.old-price {
  text-decoration: line-through;
  color: var(--text-muted);
  margin-inline-end: 10px;
  font-size: 0.9rem;
}

.new-price {
  color: var(--primary);
  font-size: 1.3rem;
}

.product-rating {
  color: #F1C40F;
  margin-bottom: 20px;
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-add {
  background: var(--gradient);
  color: white;
}

.btn-add:hover {
  box-shadow: 0 0 15px rgba(192, 57, 43, 0.5);
}

.btn-add:active {
  animation: bounce 0.3s;
}

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

.btn-buy:hover {
  background: var(--text-color);
  color: var(--bg-color);
}

.btn-buy:active {
  animation: pulse 0.3s;
}

/* Categories Grid (Visual) */
.categories-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.cat-card {
  position: relative;
  height: 200px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
}

.cat-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.cat-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
  transition: var(--transition);
}

.cat-card:hover .cat-img {
  transform: scale(1.1);
}

.cat-card:hover .cat-overlay {
  background: rgba(192, 57, 43, 0.7);
}

.cat-title {
  font-size: 1.5rem;
  margin-bottom: 5px;
}

.cat-count {
  font-size: 0.9rem;
  opacity: 0.9;
}

/* Videos Section */
.video-container {
  position: relative;
  width: 100%;
  height: 60vh;
  border-radius: 20px;
  overflow: hidden;
  margin-top: 30px;
}

.video-element {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.video-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.3);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  color: white;
}

.play-btn {
  width: 80px;
  height: 80px;
  background: rgba(192, 57, 43, 0.9);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 2rem;
  cursor: pointer;
  transition: var(--transition);
  animation: pulseBtn 2s infinite;
}

.play-btn:hover {
  transform: scale(1.1);
}

/* Two Column Video */
.two-col {
  display: flex;
  align-items: center;
  gap: 50px;
}

.col-half {
  flex: 1;
}

.col-half .video-container {
  height: 400px;
}

/* Payment Methods */
.payment-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 50px;
}

.payment-card {
  background: var(--bg-color-alt);
  padding: 40px 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: var(--card-shadow);
  border: 1px solid var(--border-color);
}

.payment-icon {
  font-size: 3rem;
  color: var(--primary);
  margin-bottom: 20px;
}

/* Footer */
footer {
  background: #111;
  color: #fff;
  padding: 60px 0 20px;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-col h3 {
  color: var(--primary);
  margin-bottom: 20px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a:hover {
  color: var(--primary);
}

.social-icons {
  display: flex;
  gap: 15px;
  font-size: 1.5rem;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* Mobile Adjustments */
.mobile-menu-btn {
  display: none;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
}

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal-content {
  background: var(--bg-color-alt);
  padding: 40px;
  border-radius: 16px;
  width: 90%;
  max-width: 500px;
  position: relative;
  transform: translateY(50px);
  transition: transform 0.3s ease;
  box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.modal-overlay.active .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 15px;
  font-size: 1.5rem;
  cursor: pointer;
  background: none;
  border: none;
  color: var(--text-muted);
}

html[dir="rtl"] .close-modal {
  right: auto;
  left: 15px;
}

/* Animations Keyframes */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes scrollText {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

html[dir="rtl"] @keyframes scrollText {
  from { transform: translateX(0); }
  to { transform: translateX(50%); }
}

@keyframes bounce {
  0% { transform: scale(1); }
  50% { transform: scale(0.95); }
  100% { transform: scale(1); }
}

@keyframes pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.7); }
  70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(192, 57, 43, 0); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

@keyframes pulseBtn {
  0% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0.7); }
  70% { box-shadow: 0 0 0 20px rgba(192, 57, 43, 0); }
  100% { box-shadow: 0 0 0 0 rgba(192, 57, 43, 0); }
}

/* Responsive */
@media (max-width: 1440px) {
  .container { max-width: 1200px; }
}

@media (max-width: 768px) {
  .hero-slider { height: 70vh; }
  .hero-title { font-size: 2.5rem; }
  .two-col { flex-direction: column; }
  .payment-methods { grid-template-columns: 1fr; }
  
  .nav-links {
    position: fixed;
    top: var(--header-height);
    right: -100%;
    width: 250px;
    height: calc(100vh - var(--header-height));
    background: var(--bg-color-alt);
    flex-direction: column;
    padding: 30px;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: var(--transition);
  }
  html[dir="rtl"] .nav-links {
    right: auto;
    left: -100%;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
  }
  .nav-links.active {
    right: 0;
  }
  html[dir="rtl"] .nav-links.active {
    left: 0;
  }
  .mobile-menu-btn {
    display: block;
  }
}

@media (max-width: 375px) {
  .hero-slider { height: 60vh; }
  .hero-title { font-size: 2rem; }
  .section-title { font-size: 2rem; }
  .product-grid { grid-template-columns: 1fr; }
}
