:root {
  --default-font: "Roboto", system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --heading-font: "Amatic SC", sans-serif;
  --nav-font: "Inter", sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
    Ubuntu, Cantarell, sans-serif;
  background: #f9fafb;
}

.clients-section {
  padding: 80px 20px;
  max-width: 1200px;
  margin: auto;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1a253e;
  margin-bottom: 15px;
}

.section-header p {
  font-size: 1.1rem;
  color: #7f7f90;
  max-width: 600px;
  margin: 0 auto;
}

/* Layout Switcher */
.layout-switcher {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-bottom: 50px;
}

.layout-btn {
  padding: 10px 24px;
  border: 1px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  font-family: var(--nav-font);
}

.layout-btn:hover {
  background: #f3f4f6;
}

.layout-btn.active {
  background: #1a253e;
  color: white;
  border-color: #1a253e;
}

/* Grid Layout */
.clients-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* 4 cards per row */
  gap: 24px; /* space between cards */
  padding: 20px; /* padding around the grid */
  opacity: 1;
  transition: opacity 0.3s ease;
}

.clients-grid.hidden {
  display: none;
}

.client-card {
  background: white;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  overflow: hidden;
  transition: all 0.3s ease;
}

.client-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.client-logo-container {
  aspect-ratio: 4/3;
  background: #f9fafb;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.client-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  transition: all 0.3s ease;
}

.client-card:hover .client-logo {
  filter: grayscale(0%);
  transform: scale(1.05);
}

.client-info {
  padding: 20px;
  text-align: center;
}

.client-info h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1a253e;
  margin-bottom: 5px;
}

.client-info p {
  font-size: 0.85rem;
  color: #7f7f90;
}

/* Marquee Layout */
.clients-marquee {
  overflow: hidden;
  position: relative;
  padding: 20px 0;
}

.clients-marquee.hidden {
  display: none;
}

.marquee-track {
  display: flex;
  gap: 30px;
  animation: marquee 30s linear infinite;
}

.marquee-track:hover {
  animation-play-state: paused;
}

.marquee-item {
  flex-shrink: 0;
  width: 250px;
  height: 160px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.marquee-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.marquee-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  transition: filter 0.3s ease;
}

.marquee-item:hover img {
  filter: grayscale(0%);
}

@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Responsive */
@media (max-width: 768px) {
  .section-header h2 {
    font-size: 2rem;
  }

  .clients-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .marquee-item {
    width: 200px;
    height: 130px;
  }
}

html[dir="rtl"] {
  direction: rtl;
}
html[dir="rtl"] .clients-grid,
html[dir="rtl"] .clients-marquee {
  direction: ltr; /* keep carousel/grid unaffected */
}
