/* ── brands.css — Brands Showcase Section (3-Row Infinite Marquee) ── */

#brands-section {
  position: relative;
  width: 100%;
  padding: 46px 0 48px;
  background: transparent;
  overflow: hidden;
  z-index: 20;
  isolation: isolate;
  scroll-margin-top: 70px;
}


/* Ambient glow */
#brands-section::after {
  content: '';
  position: absolute;
  bottom: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 75%;
  height: 55%;
  background: radial-gradient(ellipse, rgba(16, 185, 129, 0.05) 0%, transparent 70%);
  filter: blur(60px);
  pointer-events: none;
}

/* ── Section Badge Pill (Matches Hero tag-chip) ── */
.brands-badge-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.brands-badge-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .04em;
  padding: 6px 14px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.28);
  color: var(--ink-2);
  border: 1px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03), inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all .2s ease;
  cursor: default;
}

.brands-badge-pill:hover {
  background: rgba(255, 255, 255, 0.48);
  border-color: rgba(16, 185, 129, 0.4);
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.8);
  transform: translateY(-1px);
}

body.dark .brands-badge-pill {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: #e2ede8;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

body.dark .brands-badge-pill:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  border-color: rgba(0, 255, 165, 0.4);
  box-shadow: 0 4px 16px rgba(0, 255, 165, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}

body.lang-ar .brands-badge-pill,
html[lang="ar"] .brands-badge-pill {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', 'Thmanyah Sans', sans-serif !important;
  font-weight: 600;
  letter-spacing: 0;
}

/* ── Section Title ── */
.brands-title {
  text-align: center;
  font-family: 'Inter', 'Outfit', sans-serif;
  font-size: clamp(1.7rem, 3.2vw, 2.4rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
  padding: 0 24px;
  line-height: 1.2;
}

.brands-title .brands-accent {
  color: #059669;
}

body.dark .brands-title {
  color: #ffffff;
}

body.dark .brands-title .brands-accent {
  color: #34d399;
}

/* Arabic font override — Thmanyah (same font as Anes in hero) */
body.lang-ar .brands-title {
  font-family: var(--pf-text-face), 'Thmanyah Serif Text', 'Thmanyah Sans', sans-serif;
  direction: rtl;
  unicode-bidi: isolate;
  letter-spacing: 0;
  line-height: 1.4;
  font-feature-settings: "swsh" 1, "salt" 1, "calt" 1, "ss01" 1;
}

body.lang-ar .brands-title .brands-accent {
  font-family: inherit;
  direction: rtl;
  unicode-bidi: isolate;
  font-feature-settings: "swsh" 1, "salt" 1, "calt" 1, "ss01" 1;
}

/* ── Vertical Stage & Track (3 Rows Visible, Stepped Transition) ── */
.brands-vertical-stage {
  position: relative;
  width: 100%;
  max-width: 1380px;
  margin: 0 auto;
  overflow: hidden;
  /* Extra top/bottom padding so the mask fade never clips any logo */
  padding: 16px 16px;
  /* Mask fades only in the outermost 10% — keeps the 3 visible rows fully crisp */
  mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 10%, black 90%, transparent 100%);
}

.brands-vertical-track {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  will-change: transform;
}

/* ── Grid Row (Contains 5 Logos per Row, Centered) ── */
.brands-grid-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(52px, 7.5vw, 110px);
  width: 100%;
  flex-shrink: 0;
}

/* ── Brand Logo Item (Strict Container & Premium Micro-Interactions) ── */
.brand-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: clamp(120px, 10vw, 164px);
  height: clamp(72px, 6.5vw, 96px);
  flex: 0 0 clamp(120px, 10vw, 164px);
  padding: 6px 10px;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.brand-card:hover {
  transform: scale(1.15);
  background: transparent;
  border: none;
  box-shadow: none;
}

body.dark .brand-card,
body.dark .brand-card:hover {
  background: transparent;
  border: none;
  box-shadow: none;
}

/* ── Brand Logo Images — Dark Green of "Lahmar" (#07191b/#102c2a) in Light Mode, White in Dark Mode ── */
.brand-card img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  /* Light (Morning) Mode: The Deep Dark Green (#07191b / #102C2A) of "Lahmar" */
  filter: brightness(0) saturate(100%) invert(8%) sepia(35%) saturate(1400%) hue-rotate(135deg) brightness(88%) contrast(102%);
  opacity: 0.88;
  transition: filter 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.brand-card:hover img {
  opacity: 1;
  filter: brightness(0) saturate(100%) invert(18%) sepia(50%) saturate(1800%) hue-rotate(135deg) brightness(98%) drop-shadow(0 4px 18px rgba(7, 25, 27, 0.4));
  transform: scale(1.05);
}

/* Dark (Night) Mode: Pure Crisp White Filter */
body.dark .brand-card img {
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

body.dark .brand-card:hover img {
  opacity: 1;
  filter: brightness(0) invert(1) drop-shadow(0 0 14px rgba(255, 255, 255, 0.7)) drop-shadow(0 0 26px rgba(0, 255, 165, 0.35));
  transform: scale(1.05);
}

/* ── Responsive (5 Logos / Row Balanced Across Breakpoints) ── */
@media (max-width: 992px) {
  .brands-vertical-stage {
    max-width: 980px;
  }
  .brand-card {
    width: 104px;
    height: 64px;
    flex: 0 0 104px;
    padding: 6px;
  }
  .brands-vertical-track {
    gap: 10px;
  }
  .brands-grid-row {
    gap: clamp(28px, 5vw, 56px);
  }
}

@media (max-width: 640px) {
  .brands-vertical-stage {
    padding: 8px 8px;
    max-width: 100%;
  }
  .brand-card {
    width: clamp(56px, 16vw, 72px);
    height: clamp(40px, 10vw, 50px);
    flex: 0 0 clamp(56px, 16vw, 72px);
    padding: 3px;
  }
  .brands-vertical-track {
    gap: 8px;
  }
  .brands-grid-row {
    gap: clamp(12px, 3.5vw, 22px);
  }
}

/* ── Brand Info Popup (cursor-following tooltip) ── */
#brand-popup {
  position: fixed;
  z-index: 9999;
  pointer-events: none !important;
  border-radius: 14px;
  overflow: hidden;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.32),
    0 2px 12px rgba(0, 0, 0, 0.18),
    0 0 0 1px rgba(255, 255, 255, 0.06);
  background: #0a1a1a;
  max-width: 340px;
  width: 340px;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.92) translateY(6px);
  transition:
    opacity 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    transform 0.22s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.22s ease;
  will-change: transform, opacity, visibility;
}

#brand-popup.brand-popup--visible {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

#brand-popup-img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

body.dark #brand-popup {
  background: #071212;
  box-shadow:
    0 8px 40px rgba(0, 0, 0, 0.55),
    0 2px 12px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(52, 211, 153, 0.08);
}

