/* --- CSS VARIABLES (THEMING ENGINE) --- */
:root {
  /* Default (Dark Mode) Variables */
  --primary-yellow: #fbc93e;
  --bg-body: #050505;
  --bg-section: #121212;
  --bg-card: #1a1a1a;
  --bg-nav: rgba(5, 5, 5, 0.85);
  --bg-input: #050505;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --border-color: rgba(255, 255, 255, 0.05);
  --gradient-start: #1a1a1a;
  --gradient-end: #050505;
  --shadow-card: none;
}

/* Light Mode Variables - Applied to HTML ELEMENT */
html.light-mode {
  --primary-yellow: #fbc93e;
  --bg-body: #ffffff;
  --bg-section: #f4f4f4;
  --bg-card: #ffffff;
  --bg-nav: rgba(255, 255, 255, 0.9);
  --bg-input: #f9f9f9;
  --text-main: #121212;
  --text-muted: #555555;
  --border-color: rgba(0, 0, 0, 0.1);
  --gradient-start: #f0f0f0;
  --gradient-end: #ffffff;
  --shadow-card: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* --- CUSTOM SCROLLBAR STYLES START --- */
/* Base scrollbar width/height */
::-webkit-scrollbar {
  width: 10px; /* Width of the vertical scrollbar */
}

/* Scrollbar track (the groove/background) */
::-webkit-scrollbar-track {
  background: var(--bg-section); /* Dark track background */
}

/* Scrollbar thumb (the movable handle) */
::-webkit-scrollbar-thumb {
  background: var(--primary-yellow); /* Yellow thumb */
  border-radius: 5px; /* Rounded edges for the thumb */
  border: 2px solid var(--bg-body); /* Slight border to lift it from the track */
}

/* Scrollbar thumb on hover */
::-webkit-scrollbar-thumb:hover {
  background: #e0b02e; /* Slightly darker yellow on hover */
}
/* --- CUSTOM SCROLLBAR STYLES END --- */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* Scroll behavior is managed by JS for the button */
  scroll-behavior: smooth;
}

body {
  font-family: "Cairo", sans-serif;
  background-color: var(--bg-body);
  color: var(--text-main);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* --- ARABIC RTL SUPPORT - Applied to HTML ELEMENT --- */
html.rtl {
  direction: rtl;
  text-align: right;
}

html.rtl .nav-links li {
  margin-left: 0;
  margin-right: 25px;
}

html.rtl .info-item i {
  margin-right: 0;
  margin-left: 15px;
}

html.rtl .btn-outline {
  margin-left: 0;
  margin-right: 15px;
}

/* --- UTILITIES --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.highlight {
  color: var(--primary-yellow);
}

.btn {
  display: inline-block;
  padding: 12px 35px;
  background-color: var(--primary-yellow);
  color: #050505;
  font-weight: 700;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  border: 2px solid var(--primary-yellow);
  cursor: pointer;
}

.btn:hover {
  background-color: transparent;
  color: var(--primary-yellow);
  transform: translateY(-3px);
  box-shadow: 0 10px 20px rgba(251, 201, 62, 0.2);
}

.btn-outline {
  background-color: transparent;
  color: var(--text-main);
  border: 2px solid var(--text-main);
  margin-left: 15px;
}

.btn-outline:hover {
  background-color: var(--text-main);
  color: var(--bg-body);
}

h2 {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header p {
  color: var(--text-muted);
}

/* --- NAVIGATION --- */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--bg-nav);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.3s ease;
}

.nav-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: 1px;
  cursor: pointer; /* Added cursor pointer for interaction */
}

.nav-links {
  display: flex;
  list-style: none;
  align-items: center;
}

.nav-links li {
  margin-left: 25px;
}

.nav-links a {
  color: var(--text-main);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  transition: color 0.3s;
  /* Ensure cursor is a pointer as they are interactive */
  cursor: pointer;
}

.nav-links a:hover {
  color: var(--primary-yellow);
}

/* Action Buttons (Lang & Theme) */
.nav-actions {
  display: flex;
  gap: 10px; /* Separator gap */
  align-items: center;
}

/* Fixed size and centering for uniform button shape */
.action-btn {
  background: transparent;
  border: 1px solid var(--primary-yellow);
  color: var(--primary-yellow);

  /* Fixed dimensions */
  width: 40px;
  height: 40px;
  padding: 0; /* Remove padding */

  border-radius: 50%; /* Make them perfectly circular */
  cursor: pointer;
  font-family: "Cairo", sans-serif;
  font-weight: 700;
  font-size: 0.9rem;
  transition: 0.3s;

  /* Center the icon/text */
  display: flex;
  justify-content: center;
  align-items: center;
}

.action-btn:hover {
  background: var(--primary-yellow);
  color: #050505;
}

.theme-icon {
  font-size: 1rem;
}

/* --- BACK TO TOP BUTTON STYLES --- */
#backToTopBtn {
  display: none; /* Hidden by default */
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 99;
  font-size: 18px;
  border: none;
  outline: none;
  background-color: var(--primary-yellow);
  color: #050505;
  cursor: pointer;
  padding: 15px;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s, transform 0.3s, opacity 0.3s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
  opacity: 0.9;
}

html.light-mode #backToTopBtn {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

#backToTopBtn:hover {
  background-color: #e0b02e; /* Slightly darker yellow on hover */
  transform: scale(1.05);
  opacity: 1;
}
/* RTL adjustment for the button */
html.rtl #backToTopBtn {
  left: 30px;
  right: auto;
}

/* --- HERO SECTION (NEW STYLES) --- */
.hero {
  height: 100vh;
  display: flex;
  align-items: center;
  /* Using a simplified radial gradient for a cleaner look */
  background: radial-gradient(
    circle at 50% 50%,
    var(--gradient-start),
    var(--bg-body)
  );
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

/* Subtle glow/effect for background */
.hero::after {
  content: "";
  position: absolute;
  top: -100px;
  right: -100px;
  width: 400px;
  height: 400px;
  background: var(--primary-yellow);
  filter: blur(200px);
  opacity: 0.08;
  border-radius: 50%;
  z-index: 0; /* Keep it behind the content */
}

.hero-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two-column layout */
  align-items: center;
  gap: 50px;
  padding-top: 60px; /* Space for the fixed nav */
  position: relative;
  z-index: 1;
}

.hero-text {
  max-width: 100%; /* Take full width of its grid cell */
}

.hero h1 {
  /* *** MODIFIED: Decreased font size from 3.8rem to 3.2rem *** */
  font-size: 3.2rem; /* Adjusted for one line display */
  line-height: 1.2;
  margin-bottom: 20px;
  font-weight: 800; /* Extra bold */
}

.hero p {
  font-size: 1.2rem; /* Slightly larger description */
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 550px;
  line-height: 1.5;
}

.hero-actions {
  display: flex;
  gap: 20px;
}

.hero-image {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  height: 450px; /* DECREASED from 500px to 450px */
}

.hero-image-placeholder {
  /* This is the visual element that will draw attention */
  background: var(--bg-card); /* Card color for contrast */
  border: 2px solid var(--primary-yellow);
  border-radius: 20px;
  width: 400px; /* INCREASED from 350px to 400px */
  height: 400px; /* DECREASED from 450px to 400px */

  padding: 0;
  overflow: hidden;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
  /* Animation/effect for visual appeal */
  transform: rotateY(-10deg) rotateX(5deg);
  transition: transform 0.5s ease;
  position: relative; /* Needed for absolute positioning of the overlay */
}

.hero-image-placeholder img {
  width: 100%; /* Take full width of parent */
  height: 100%; /* Take full height of parent */
  object-fit: cover; /* ESSENTIAL: Fills container without stretching, cropping as needed */
  border-radius: 18px; /* Slightly less than parent radius */
}

/* --- NEW HOVER ANIMATION STYLES START --- */
.hero-image-placeholder .hover-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.4); /* Dark overlay */
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  color: var(--primary-yellow);
  font-size: 1.5rem;
  font-weight: 700;
  opacity: 0; /* Start invisible */
  pointer-events: none; /* Allows interaction with elements beneath when invisible */
  transition: opacity 0.3s ease;
  border-radius: 20px;
  z-index: 5; /* Ensure it's above the image */

  /* Apply blur filter on the background (backdrop-filter) */
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.hero-image-placeholder:hover .hover-overlay {
  opacity: 1; /* Fade in on hover */
}

/* Ensure the image itself doesn't zoom/rotate oddly while the overlay is showing */
.hero-image:hover .hero-image-placeholder {
  transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}
/* --- NEW HOVER ANIMATION STYLES END --- */

html.light-mode .hero-image-placeholder {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

/* RTL adjustment for the image tilt */
html.rtl .hero-image-placeholder {
  transform: rotateY(10deg) rotateX(5deg);
}
/* RTL adjustment for hover, using the corrected non-tilted state */
html.rtl .hero-image:hover .hero-image-placeholder {
  transform: rotateY(0deg) rotateX(0deg) scale(1.02);
}

/* --- CATEGORIES --- */
.categories {
  padding: 100px 0;
  background-color: var(--bg-section);
  transition: background 0.3s ease;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
}

.cat-card {
  background: var(--bg-card);
  padding: 40px;
  border-radius: 20px;
  transition: all 0.4s ease;
  border: 1px solid var(--border-color);
  text-align: center;
  box-shadow: var(--shadow-card);
}

.cat-card:hover {
  transform: translateY(-10px);
  border-color: var(--primary-yellow);
}

.cat-card i {
  font-size: 3rem;
  color: var(--primary-yellow);
  margin-bottom: 25px;
}

.cat-card h3 {
  font-size: 1.4rem;
  margin-bottom: 10px;
  color: var(--text-main);
}

.cat-card p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* --- NEW FEATURES / WHY CHOOSE US SECTION --- */
.features-section {
  padding: 100px 0;
  background-color: var(--bg-body); /* Body color contrast */
  transition: background 0.3s ease;
}

.feature-grid {
  display: flex;
  justify-content: space-around;
  gap: 30px;
  flex-wrap: wrap;
  text-align: center;
}

.feature-item {
  max-width: 300px;
  flex-basis: 300px; /* Base width */
  padding: 30px;
  border-radius: 15px;
  background: var(--bg-section);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  transition: all 0.3s ease;
}

.feature-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-yellow);
}

.feature-item i {
  font-size: 3rem;
  color: var(--primary-yellow);
  margin-bottom: 20px;
}

.feature-item h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.feature-item p {
  color: var(--text-muted);
}

/* --- WHOLESALE BANNER --- */
.wholesale-banner {
  padding: 80px 0;
  background: linear-gradient(90deg, #111 0%, #050505 100%);
  border-top: 1px solid #222;
  border-bottom: 1px solid #222;
}

html.light-mode .wholesale-banner {
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
  border-top: 1px solid #ddd;
  border-bottom: 1px solid #ddd;
}

.wholesale-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 30px;
}

.wholesale-text h2 {
  font-size: 2rem;
  color: #fff;
}

html.light-mode .wholesale-text h2 {
  color: #111;
}

.wholesale-text span {
  color: var(--primary-yellow);
}

/* --- CONTACT SECTION --- */
.contact {
  padding: 100px 0;
  background-color: var(--bg-body);
  transition: background 0.3s ease;
}

.contact-wrapper {
  background: var(--bg-section);
  border-radius: 20px;
  padding: 50px;
  border: 1px solid var(--border-color);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  box-shadow: var(--shadow-card);
}

.contact-info h3 {
  margin-bottom: 30px;
}

.info-item {
  display: flex;
  align-items: center;
  margin-bottom: 25px;
  color: var(--text-main);
}

.info-item i {
  width: 45px;
  height: 45px;
  background: rgba(251, 201, 62, 0.1);
  color: var(--primary-yellow);
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  margin-right: 15px;
}

html.rtl .contact .info-item i {
  margin-right: 0;
  margin-left: 15px;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 15px;
  margin-bottom: 20px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  border-radius: 8px;
  font-family: inherit;
  transition: background 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--primary-yellow);
}

/* --- TEXTAREA MIN/MAX HEIGHT FIX --- */
.contact-form textarea {
  min-height: 120px; /* Set minimum height */
  max-height: 200px; /* Set maximum height */
  resize: vertical; /* Allow vertical resizing, constrained by min/max */
}

/* --- FOOTER --- */
footer {
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.9rem;
  background-color: var(--bg-body);
}

/* --- LOADING SCREEN STYLES --- */
#loadingScreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #050505;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loadingScreen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-logo {
  font-size: 2.5rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 20px;
}

.loading-logo .highlight {
  color: #fbc93e;
}

.loading-spinner {
  width: 50px;
  height: 50px;
  border: 5px solid rgba(251, 201, 62, 0.3);
  border-radius: 50%;
  border-top-color: #fbc93e;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-text {
  color: #fbc93e;
  margin-top: 20px;
  font-family: "Cairo", sans-serif;
}

/* Hide content initially */
body {
  opacity: 0;
  transition: opacity 0.3s ease;
}

body.content-loaded {
  opacity: 1;
}

/* --- BULK DESCRIPTION STYLES --- */
.bulk-description {
  color: var(--text-muted);
  margin-top: 10px;
}

/* --- CONTACT SUBMIT BUTTON STYLES --- */
.contact-submit-btn {
  width: 100%;
  border: none;
}

/* --- MEDIA QUERIES --- */
@media (max-width: 1024px) {
  /* Adjust layout for mid-size screens */
  .hero h1 {
    font-size: 3rem;
  }

  .hero-image-placeholder {
    width: 350px; /* INCREASED from 300px to 350px */
    height: 350px; /* DECREASED from 400px to 350px */
  }
}

@media (max-width: 768px) {
  .hero {
    height: auto; /* Allow content to dictate height on mobile */
    padding: 120px 0 60px 0; /* Top padding to clear navbar */
  }
  .hero-wrapper {
    grid-template-columns: 1fr; /* Single column layout on mobile */
    text-align: center;
    gap: 30px;
  }
  .hero h1 {
    font-size: 2.5rem;
  }
  .hero-image {
    height: 320px; /* DECREASED from 350px to 320px */
  }
  .hero-image-placeholder {
    width: 280px; /* INCREASED from 250px to 280px */
    height: 280px; /* DECREASED from 320px to 280px */
    transform: none; /* Remove tilt on mobile */
  }
  .hero-image:hover .hero-image-placeholder {
    transform: none;
  }

  .hero-actions {
    justify-content: center;
    flex-wrap: wrap; /* Allow buttons to wrap */
  }
  .btn-outline {
    margin: 0; /* Remove existing margin-left */
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
  }
  .nav-links li {
    display: none;
  }

  .nav-links li.mobile-actions {
    display: flex;
    margin: 0;
  }

  .hero-content {
    /* text-align: center; - Already handled by .hero-wrapper > text-align */
    margin: 0 auto;
  }

  #backToTopBtn {
    bottom: 20px;
    right: 20px;
  }
  html.rtl #backToTopBtn {
    left: 20px;
    right: auto;
  }
  .feature-item {
    flex-basis: 100%;
    max-width: none;
  }
}
