:root {
  /* Palette */
  --primary-gold: #c5a059;
  --secondary-teal: #004e59;
  --text-color: #333333;
  --white: #ffffff;

  /* Overlay */
  --hero-overlay: rgba(248, 245, 240, 0.4);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Tajawal", sans-serif;
  background: radial-gradient(circle at center, #fffbf0 0%, #f3eedd 100%);
  color: var(--text-color);
  line-height: 1.7;
  overflow-x: hidden;
  position: relative;
  direction: rtl; /* Explicitly set direction although HTML has dir="rtl" */
}

/* --- Background Pattern Overlay --- */
body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: radial-gradient(#c5a059 1px, transparent 1px);
  background-size: 20px 20px;
  opacity: 0.05;
  z-index: -2;
  pointer-events: none;
}

a {
  text-decoration: none;
  color: inherit;
  transition: 0.3s;
}

ul {
  list-style: none;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 40px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
    box-shadow: 0 4px 6px rgba(197, 160, 89, 0.25);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 10px 20px rgba(197, 160, 89, 0.4);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 4px 6px rgba(197, 160, 89, 0.25);
  }
}

.animate-up {
  animation-duration: 0.8s;
  animation-fill-mode: both;
  animation-name: fadeInUp;
}

.pulse-btn {
  animation: pulse 3s infinite ease-in-out;
}

.pulse-btn:hover {
  animation-play-state: paused;
}

.delay-1 {
  animation-delay: 0.2s;
}
.delay-2 {
  animation-delay: 0.4s;
}
.delay-3 {
  animation-delay: 0.6s;
}

/* --- Components --- */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 16px;
}

.btn {
  display: inline-block;
  padding: 14px 38px;
  font-size: 1.1rem;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 4px 6px rgba(197, 160, 89, 0.25);
}

.btn-gold {
  background-color: var(--primary-gold);
  color: var(--white);
}

.btn-gold:hover {
  background-color: #b08d4b;
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(197, 160, 89, 0.3);
}

/* --- Navbar --- */
.navbar {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(15px);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.04);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 8px 0;
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 8px; /* Tighter spacing */
  text-decoration: none;
}

.logo img {
  height: 55px; /* Slightly reduced for better proportion */
  width: auto;
  display: block;
  transition: height 0.3s;
}

.logo-text {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--secondary-teal);
  line-height: 1; /* Fix vertical alignment */
  padding-top: 2px; /* Visual center adjustment */
}

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

.nav-links a {
  color: var(--secondary-teal);
  font-weight: 700;
  font-size: 1.05rem;
  position: relative;
  padding: 5px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-gold);
  transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.nav-links a:hover::after {
  width: 100%;
}

.mobile-menu-btn {
  display: none;
  font-size: 1.8rem;
  color: var(--secondary-teal);
  cursor: pointer;
  z-index: 1002;
}

/* --- Hero Section --- */
.hero {
  position: relative;
  background:
    linear-gradient(
      to left,
      rgba(251, 249, 244, 0.9),
      rgba(251, 249, 244, 0.6)
    ),
    url("../images/hero_background.jpg");
  background-size: cover;
  background-position: center;
  height: 90vh;
  min-height: 650px;
  display: flex;
  align-items: center;
  overflow: hidden;
  z-index: 1;
}

/* Decorative Blob */
.hero::before {
  content: "";
  position: absolute;
  top: 10%;
  right: 10%;
  width: 450px;
  height: 450px;
  background-color: rgba(197, 160, 89, 0.12);
  border-radius: 50% 40% 60% 30% / 30% 50% 40% 60%;
  filter: blur(80px);
  z-index: -1;
  animation: float 12s ease-in-out infinite;
}

@keyframes float {
  0% {
    transform: translate(0, 0) rotate(0deg);
  }
  50% {
    transform: translate(-30px, 30px) rotate(8deg);
  }
  100% {
    transform: translate(0, 0) rotate(0deg);
  }
}

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

.hero h1 {
  color: var(--secondary-teal);
  font-size: clamp(2.5rem, 5vw, 4.2rem);
  line-height: 1.3;
  margin-bottom: 1.2rem;
  font-weight: 800;
}

.hero-subtitle-en {
  font-family: "Arial", sans-serif;
  font-size: 1rem;
  color: var(--secondary-teal);
  letter-spacing: 1.5px;
  margin-bottom: 2rem;
  text-transform: uppercase;
  font-weight: 700;
  display: block;
  opacity: 0.9;
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.45rem);
  color: #4a4a4a;
  margin-bottom: 3rem;
  font-weight: 500;
  max-width: 650px;
  line-height: 1.8;
}

/* --- Section Common --- */
.section-padding {
  padding: 100px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 70px;
}

.section-title h2 {
  color: var(--secondary-teal);
  font-size: 2.8rem;
  font-weight: 800;
  position: relative;
  display: inline-block;
  padding-bottom: 18px;
}

.section-title h2::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 4px;
  background-color: var(--primary-gold);
  border-radius: 2px;
}

/* --- About --- */
.about-content {
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.about-text {
  text-align: center;
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  color: #555;
  line-height: 2;
}

/* --- Services --- */
.services-section {
  position: relative;
  overflow: hidden;
}

.services-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("../images/pharma-stock.jpg");
  background-size: cover;
  background-position: center;
  opacity: 0.05;
  z-index: -1;
}

.services-grid {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 40px;
}

.service-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 60px 40px;
  border-radius: 20px;
  text-align: center;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-top: 6px solid var(--primary-gold);

  /* Sizing */
  flex: 1 1 320px;
  max-width: 480px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.08);
  background: rgba(255, 255, 255, 0.98);
}

.service-icon {
  /* font-size: 4.5rem; Removed as we are using images */
  /* color: var(--secondary-teal); Removed */
  margin-bottom: 25px;
  transition: transform 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 140px; /* Space for images */
}

.service-img {
  width: 130px;
  height: 130px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid var(--primary-gold);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  padding: 3px; /* Gap between border and image */
  background-color: white;
  transition: all 0.3s;
}

.service-card:hover .service-img {
  transform: scale(1.05) rotate(3deg);
  box-shadow: 0 8px 20px rgba(197, 160, 89, 0.3);
  border-color: var(--secondary-teal);
}

/* .service-card:hover .service-icon {
  transform: scale(1.1); Removed, animating image directly
} */

.service-card h3 {
  color: var(--secondary-teal);
  font-size: 1.8rem;
  margin-bottom: 18px;
  font-weight: 700;
}

.service-card p {
  color: #666;
  font-size: 1.2rem;
  line-height: 1.8;
}

/* --- Contact --- */
.contact-section {
  background-color: var(--secondary-teal);
  position: relative;
  overflow: hidden;
}

.contact-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23C5A059' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 1;
}

.contact-section .section-title h2 {
  color: var(--primary-gold);
}

.contact-section .section-title h2::after {
  background-color: var(--white);
}

.contact-form {
  max-width: 750px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  padding: 60px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  z-index: 2;
}

.form-group {
  margin-bottom: 30px;
  position: relative;
}

.form-label {
  display: block;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 18px 20px;
  border-radius: 10px;
  border: 2px solid transparent;
  background-color: rgba(255, 255, 255, 0.95);
  font-family: "Tajawal", sans-serif;
  font-size: 1.1rem;
  transition: all 0.3s;
}

.form-input:focus {
  box-shadow: 0 0 0 4px rgba(197, 160, 89, 0.2);
  background-color: var(--white);
  border-color: var(--primary-gold);
  transform: translateY(-2px);
}

textarea.form-input {
  height: 160px;
  resize: vertical;
}

.contact-form button[type="submit"] {
  transition: all 0.3s ease;
  width: 100%;
  max-width: 250px;
}

.contact-form button[type="submit"]:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* --- Footer --- */
footer {
  background-color: #00252b;
  color: rgba(255, 255, 255, 0.7);
  padding: 80px 0 40px;
  text-align: center;
}

.footer-logo {
  margin-bottom: 20px;
}

.footer-logo img {
  height: 140px;
  display: block;
  margin: 0 auto;
  filter: brightness(0) invert(1);
  opacity: 0.95;
}

.footer-contact {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-bottom: 50px;
  flex-wrap: wrap;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
  font-size: 1.2rem;
  color: var(--white);
}

.contact-item a {
  color: var(--white);
  position: relative;
}

.contact-item a::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--primary-gold);
  transition: width 0.3s;
}

.contact-item a:hover::after {
  width: 100%;
}

.contact-item a:hover {
  color: var(--primary-gold);
}

.contact-item i {
  font-size: 1.8rem;
  color: var(--primary-gold);
  margin-bottom: 5px;
}

.copyright {
  font-size: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 30px;
  margin-top: 20px;
  display: inline-block;
  width: 100%;
  max-width: 700px;
}

/* --- Responsive --- */
@media (max-width: 900px) {
  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-text {
    text-align: center;
    order: 1;
  }
  .about-image {
    order: 2;
  }
}

@media (max-width: 850px) {
  .mobile-menu-btn {
    display: block;
  }

  .logo img {
    height: 70px;
  }

  .logo-text {
    display: none; /* Hide text on mobile to save space if needed */
  }

  .nav-links {
    position: absolute; /* Using absolute as requested */
    top: 100%; /* Start right below navbar */
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    padding: 40px 30px;
    text-align: center;

    display: flex;
    flex-direction: column;
    gap: 25px;

    /* Animation fix */
    transform: translateY(-150%); /* Start hidden above/behind */
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid var(--primary-gold);
  }

  .nav-links.active {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  .nav-links a {
    font-size: 1.5rem;
    display: block;
  }
}

@media (max-width: 600px) {
  .logo img {
    height: 60px; /* Adjusted based on previous mobile logo size request 80px might be too big now with flex text */
  }

  .logo-text {
    font-size: 1.1rem;
    display: block;
  }

  .navbar {
    padding: 12px 0;
  }

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

  .hero h1 {
    font-size: 2.8rem;
  }

  .hero-subtitle-en {
    margin: 0 auto 1.5rem auto;
  }

  .hero p {
    margin-left: auto;
    margin-right: auto;
    font-size: 1.1rem;
  }

  .section-padding {
    padding: 70px 0;
  }

  .contact-form {
    padding: 30px 20px;
  }

  .service-card {
    padding: 40px 25px;
  }
}

/* --- Products Carousel --- */
.products-section {
  background-color: #fdfdfd;
  position: relative;
}

.carousel-wrapper {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 50px; /* Space for arrows */
}

.carousel-container {
  overflow: hidden;
  width: 100%;
  padding: 20px 0; /* Space for shadows */
}

.carousel-track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  gap: 30px;
}

.product-card {
  flex: 0 0 calc(33.333% - 20px); /* 3 items per slide minus gap adjustment */
  background: white;
  border-radius: 15px;
  padding: 30px 20px;
  text-align: center;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(197, 160, 89, 0.2);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(197, 160, 89, 0.15);
  border-color: var(--primary-gold);
}

.product-img-box {
  width: 180px;
  height: 180px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-img-box img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.1));
  transition: transform 0.4s ease;
}

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

.product-card h3 {
  color: var(--secondary-teal);
  font-size: 1.3rem;
  margin-bottom: 10px;
  font-weight: 700;
}

.product-card p {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
}

/* Carousel Controls */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--white);
  color: var(--secondary-teal);
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: 2px solid var(--secondary-teal);
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all 0.3s;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.carousel-btn:hover {
  background-color: var(--secondary-teal);
  color: var(--white);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  right: 0;
}

.next-btn {
  left: 0;
}

/* Dots */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.dot {
  width: 12px;
  height: 12px;
  background-color: #ddd; /* Light gray */
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s;
}

.dot.active {
  background-color: var(--primary-gold);
  transform: scale(1.2);
}

/* Responsive */
@media (max-width: 900px) {
  .product-card {
    flex: 0 0 calc(50% - 15px); /* 2 items per slide */
  }
}

@media (max-width: 600px) {
  .product-card {
    flex: 0 0 100%; /* 1 item per slide */
  }

  .carousel-wrapper {
    padding: 0 30px;
  }

  .carousel-btn {
    width: 35px;
    height: 35px;
    font-size: 1rem;
  }

  .product-img-box {
    width: 150px;
    height: 150px;
  }
}


/* --- See More & Extra Grid --- */
.see-more-container {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

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

.btn-outline-gold:hover {
  background-color: var(--primary-gold);
  color: var(--white);
  transform: translateY(-3px);
}

.extra-products-grid {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 25px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid rgba(0,0,0,0.05);
  animation: fadeIn 0.8s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.extra-item {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0,0,0,0.05);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform 0.3s;
}

.extra-item:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.extra-item img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 1000 / 707;
  object-fit: cover;
}

@media (max-width: 600px) {
  .extra-products-grid {
    grid-template-columns: repeat(auto-fill, minmax(100%, 1fr)); /* Full width on mobile */
  }
}


/* --- Footer Info Grid --- */
.footer-info-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 40px;
    margin-bottom: 40px;
    text-align: right;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
}

.footer-info-group {
    flex: 1;
    min-width: 280px;
    background: rgba(255,255,255,0.03);
    padding: 25px 30px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
}

.footer-group-title {
    color: var(--primary-gold);
    font-size: 1.25rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(197, 160, 89, 0.2);
    padding-bottom: 12px;
    font-weight: 700;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding: 6px 0;
}

.info-item:last-child {
    margin-bottom: 0;
}

.icon-box {
    width: 36px;
    height: 36px;
    background: rgba(197, 160, 89, 0.08);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-gold);
    font-size: 1rem;
    flex-shrink: 0;
}

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

.info-label {
    font-size: 0.8rem;
    color: rgba(255,255,255,0.5);
    margin-bottom: 2px;
}

.info-value {
    color: var(--white);
    font-size: 0.95rem;
    font-weight: 500;
}

.info-value[href]:hover {
    color: var(--primary-gold);
}

@media (max-width: 768px) {
    .footer-info-container {
        gap: 20px;
        flex-direction: column;
    }
    .footer-info-group {
        width: 100%;
        min-width: unset;
    }
}

/* --- LTR Support (English Version) --- */
html[dir="ltr"] body {
    direction: ltr;
    text-align: left;
}

html[dir="ltr"] .nav-links a::after {
    left: 0;
    right: auto;
}

html[dir="ltr"] .footer-info-container {
    text-align: left;
}

html[dir="ltr"] .prev-btn {
    left: 0;
    right: auto;
}

html[dir="ltr"] .next-btn {
    right: 0;
    left: auto;
}

html[dir="ltr"] .carousel-btn i {
    transform: scaleX(-1);
}

html[dir="ltr"] .contact-form {
    text-align: left;
}

html[dir="ltr"] .service-card {
    direction: ltr;
}
