.gallery-hero {
  position: relative;
  background-color: var(--dark-bg);
  color: var(--text-light);
  padding: 170px 0 80px;
  text-align: center;
  overflow: hidden;
}

.gallery-hero-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
  pointer-events: none;
}

.glow-green {
  background: var(--primary-green);
  top: -180px;
  right: -120px;
}

.glow-red {
  background: var(--primary-red);
  bottom: -220px;
  left: -140px;
}

.gallery-eyebrow {
  display: inline-block;
  padding: 6px 18px;
  border: 1px solid rgba(46, 159, 82, 0.4);
  border-radius: 30px;
  color: var(--primary-green);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 18px;
  position: relative;
  z-index: 1;
}

.gallery-hero h1 {
  position: relative;
  z-index: 1;
  font-size: 2.7rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.gallery-hero h1 span {
  color: var(--primary-green);
}

.gallery-hero p {
  position: relative;
  z-index: 1;
  color: #C9CDD2;
  max-width: 560px;
  margin: 0 auto;
  font-size: 1.05rem;
}

/* ===== قسم بطاقات الشركاء (تصميم مستطيلات بدون تأثير 3D) ===== */

.partners-section {
  background-color: var(--light-bg);
  padding: 90px 0 120px;
}

.partners-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-start;
  gap: 36px;
}

.partner-card {
  width: 320px;
  background: var(--white, #ffffff);
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* شعار الشريك فوق اسمه */
.partner-logo {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #eef0f2;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  flex-shrink: 0;
}

.partner-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
  display: block;
}

.partner-logo img.is-placeholder {
  width: 46%;
  height: 46%;
  padding: 0;
  opacity: 0.4;
}

/* اسم الشريك واضح فوق المستطيل */
.partner-name {
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  color: var(--dark-bg, #1a1a1a);
  margin: 0 0 18px 0;
  line-height: 1.4;
}

/* شبكة 4 صور متساوية داخل البطاقة */
.partner-gallery {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.partner-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 10px;
  display: block;
  background: #eee;
  opacity: 1;
  filter: none;
  cursor: zoom-in;
  transition: transform 0.25s ease;
}

.partner-gallery img:hover {
  transform: scale(1.03);
}

/* زر إظهار المزيد */
.show-more-btn {
  margin-top: 18px;
  width: 100%;
  padding: 11px;
  border-radius: 999px;
  border: 1.5px solid var(--primary-green);
  background: transparent;
  color: var(--primary-green);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.show-more-btn:hover {
  background: var(--primary-green);
  color: #ffffff;
}

.partner-empty {
  text-align: center;
  color: var(--text-muted, #888);
  font-size: 0.9rem;
  padding: 30px 0;
}

/* ===== نافذة تقليب الصور الكبيرة (بدون تأثير 3D) ===== */

.viewer-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(10, 10, 10, 0.85);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.viewer-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

.viewer-modal {
  position: relative;
  width: 100%;
  width: min(92vw, 1200px);
  max-width: 1200px;
  background: var(--white, #ffffff);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.4);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.viewer-overlay.open .viewer-modal {
  transform: scale(1);
}

.viewer-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 60px 16px 20px;
  background: var(--dark-bg, #1a1a1a);
  color: #fff;
}

.viewer-header .viewer-logo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.viewer-header .viewer-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 5px;
}

.viewer-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.viewer-close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
  z-index: 3;
}

.viewer-close:hover {
  background: var(--primary-red);
}

.viewer-stage {
  position: relative;
  background: #111;
  height: min(72vh, 720px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.viewer-stage img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.viewer-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--dark-bg, #1a1a1a);
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, color 0.2s ease;
  z-index: 2;
}

.viewer-nav:hover {
  background: var(--primary-green);
  color: #fff;
}

.viewer-nav:disabled {
  opacity: 0.35;
  cursor: default;
}

.viewer-nav.prev {
  right: 16px;
}

.viewer-nav.next {
  left: 16px;
}

.viewer-counter {
  text-align: center;
  padding: 12px;
  font-size: 0.85rem;
  color: var(--text-muted, #666);
  background: #fafafa;
}

@media (max-width: 640px) {
  .gallery-hero {
    padding: 150px 0 60px;
  }

  .gallery-hero h1 {
    font-size: 2.1rem;
  }

  .partner-card {
    width: 100%;
    max-width: 380px;
  }

  .viewer-stage {
    height: 68vh;
    min-height: 300px;
  }

  .viewer-nav {
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
  }
}

/* ===== نسخة زر اللغة في الشريط العلوي (تظهر فقط على الهاتف) ===== */

.lang-switcher-mobile {
  display: none;
}

@media (max-width: 992px) {
  .lang-switcher-mobile {
    display: flex;
    margin-inline-start: auto;
    margin-inline-end: 10px;
  }

  .header-actions .lang-switcher {
    display: none;
  }
}

/* =========================================================
   تحسينات إضافية للهواتف - صفحة المعرض
   ========================================================= */

@media (max-width: 992px) {
  .lang-switcher-mobile {
    padding: 3px;
  }

  .lang-switcher-mobile button {
    padding: 6px 9px;
    font-size: 0.72rem;
  }

  .partners-grid {
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .lang-switcher-mobile button {
    padding: 5px 7px;
    font-size: 0.68rem;
  }

  .gallery-hero {
    padding: 130px 0 50px;
  }

  .gallery-hero h1 {
    font-size: 1.8rem;
  }

  .gallery-eyebrow {
    font-size: 0.78rem;
    padding: 5px 14px;
  }

  .gallery-hero p {
    font-size: 0.92rem;
  }

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

  .partner-card {
    padding: 18px;
    border-radius: 14px;
  }

  .partner-logo {
    width: 64px;
    height: 64px;
  }

  .partner-name {
    font-size: 1rem;
    margin-bottom: 14px;
  }

  .partner-gallery {
    gap: 8px;
  }

  .show-more-btn {
    padding: 9px;
    font-size: 0.85rem;
  }

  .viewer-header {
    padding: 12px 50px 12px 16px;
  }

  .viewer-header h3 {
    font-size: 0.92rem;
  }

  .viewer-close {
    width: 32px;
    height: 32px;
    top: 10px;
    left: 10px;
  }

  .footer-content {
    padding-bottom: 16px;
    gap: 10px;
  }

  .footer-logo img {
    max-height: 90px;
  }

  .footer-copyright p {
    font-size: 0.82rem;
    text-align: center;
    padding: 0 10px;
  }
}

@media (max-width: 380px) {
  .lang-switcher-mobile {
    gap: 2px;
  }

  .lang-switcher-mobile button {
    padding: 4px 6px;
    font-size: 0.62rem;
  }

  .gallery-hero h1 {
    font-size: 1.55rem;
  }

  .partner-card {
    padding: 14px;
  }

  .partner-gallery {
    gap: 6px;
  }
}
/* تحسين المعرض على الهاتف */
@media (max-width: 768px) {
  .gallery-hero { padding: 120px 0 48px; }
  .gallery-hero h1 { font-size: clamp(1.75rem, 8vw, 2.15rem); line-height: 1.3; }
  .gallery-hero p { font-size: .92rem; line-height: 1.75; padding-inline: 8px; }
  .partners-section { padding: 42px 0 60px; }
  .partners-grid { width: 100%; gap: 18px; }
  .partner-card { width: 100%; max-width: none; padding: 17px; border-radius: 15px; }
  .partner-logo { width: 62px; height: 62px; margin-bottom: 11px; }
  .partner-name { font-size: 1rem; line-height: 1.5; }
  .partner-gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .partner-gallery img { aspect-ratio: 4 / 3; object-fit: contain; background: #f1f1f1; }
  .show-more-btn { min-height: 42px; }

  .viewer-overlay { padding: 8px; }
  .viewer-modal { width: 100%; max-width: none; border-radius: 12px; }
  .viewer-header { min-height: 52px; padding: 9px 48px 9px 12px; }
  .viewer-header .viewer-logo { width: 34px; height: 34px; }
  .viewer-header h3 { font-size: .9rem; line-height: 1.35; }
  .viewer-stage { height: calc(100svh - 125px); min-height: 280px; }
  .viewer-stage img { width: 100%; height: 100%; object-fit: contain; }
  .viewer-nav { width: 34px; height: 34px; font-size: 1rem; }
  .viewer-nav.prev { right: 8px; }
  .viewer-nav.next { left: 8px; }
  .viewer-counter { padding: 8px; font-size: .78rem; }
}
