/* ============================================
   BRANDS HUB & CASE STUDY STYLES
   ============================================ */

/* ---- FILTER BAR ---- */
.brands-filter-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  padding: var(--space-4) 0;
  position: sticky;
  top: var(--header-height);
  z-index: 50;
  backdrop-filter: blur(12px);
}

.brands-filter {
  display: flex;
  gap: var(--space-2);
  flex-wrap: wrap;
  align-items: center;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-elevated);
  border: 1.5px solid var(--border-light);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--accent-blue);
  color: var(--accent-blue);
}

.filter-btn.active {
  background: var(--gradient-primary);
  color: white;
  border-color: transparent;
  box-shadow: var(--shadow-accent);
}

/* ---- BRANDS HUB GRID ---- */
.brands-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-5);
}

/* ---- BRAND HUB CARD ---- */
.brand-hub-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-2xl);
  padding: var(--space-6);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: all var(--transition-base);
}

.brand-hub-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--border-accent);
}

.brand-hub-card__bar {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  opacity: 0;
  transition: opacity var(--transition-base);
}

.brand-hub-card:hover .brand-hub-card__bar { opacity: 1; }

.brand-hub-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand-hub-card__logo {
  width: 52px; height: 52px;
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 800;
}

.brand-hub-card__badges { display: flex; gap: var(--space-2); flex-wrap: wrap; justify-content: flex-end; }

.brand-hub-card__market {
  padding: 3px 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

.brand-hub-card__feat {
  padding: 3px 10px;
  background: rgba(37,99,235,0.08);
  border: 1px solid rgba(37,99,235,0.2);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--accent-blue);
}

.brand-hub-card__name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text-primary);
}

.brand-hub-card__name-ar {
  font-family: var(--font-arabic);
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-top: 2px;
}

.brand-hub-card__niche {
  display: inline-block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-elevated);
  padding: 3px 10px;
  border-radius: var(--radius-full);
}

.brand-hub-card__kpis {
  display: flex;
  gap: var(--space-4);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
}

.brand-hub-kpi { flex: 1; text-align: center; }

.brand-hub-kpi__val {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 800;
  line-height: 1.2;
}

.brand-hub-kpi__label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.brand-hub-card__cta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--accent-blue);
  margin-top: auto;
}

/* ============================================
   CASE STUDY PAGE
   ============================================ */

.cs-hero {
  padding: calc(var(--header-height) + var(--space-12)) 0 var(--space-12);
  position: relative;
  overflow: hidden;
}

.cs-hero__bg { position: absolute; inset: 0; background: var(--gradient-mesh); opacity: 0.5; }
.cs-hero .container { position: relative; z-index: 1; }

.cs-hero__breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--space-6);
  text-decoration: none;
}

.cs-hero__breadcrumb:hover { color: var(--accent-blue); }

.cs-hero__header {
  display: flex;
  align-items: flex-start;
  gap: var(--space-6);
  margin-bottom: var(--space-8);
  flex-wrap: wrap;
}

.cs-hero__logo {
  width: 80px; height: 80px;
  border-radius: var(--radius-xl);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  flex-shrink: 0;
}

.cs-hero__meta { flex: 1; }
.cs-hero__name { font-size: clamp(2rem,5vw,3.5rem); font-weight: 800; letter-spacing: -0.03em; margin-bottom: var(--space-2); }
.cs-hero__niche-market { display: flex; gap: var(--space-3); flex-wrap: wrap; margin-bottom: var(--space-4); }

/* KPI Strip */
.cs-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-bottom: var(--space-12);
}

.cs-kpi-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  padding: var(--space-5) var(--space-6);
  text-align: center;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-base);
}

.cs-kpi-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.cs-kpi-card__val {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 800;
  line-height: 1;
  margin-bottom: var(--space-1);
}

.cs-kpi-card__label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* Case Study Layout */
.cs-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: var(--space-10);
  align-items: start;
}

.cs-section { margin-bottom: var(--space-10); }

.cs-section__title {
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-5);
  padding-bottom: var(--space-3);
  border-bottom: 2px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

[lang="ar"] .cs-section__title { font-family: var(--font-arabic); }

.cs-section__title-icon {
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  background: var(--gradient-subtle);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
}

.cs-prose {
  font-size: var(--text-base);
  color: var(--text-secondary);
  line-height: 1.9;
}

[lang="ar"] .cs-prose { font-family: var(--font-arabic); }

.cs-prose p { margin-bottom: var(--space-4); }

.cs-challenges {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.cs-challenge {
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

[lang="ar"] .cs-challenge { font-family: var(--font-arabic); }
.cs-challenge__icon { flex-shrink: 0; font-size: 1.1rem; }

.cs-results-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

.cs-result-item {
  padding: var(--space-5);
  background: var(--bg-elevated);
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-light);
  text-align: center;
}

.cs-result-item__val {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  margin-bottom: 4px;
}

.cs-result-item__label {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 600;
}

/* Sidebar */
.cs-sidebar { position: sticky; top: calc(var(--header-height) + var(--space-6)); }

.cs-info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin-bottom: var(--space-5);
  box-shadow: var(--shadow-sm);
}

.cs-info-card__header {
  padding: var(--space-4) var(--space-5);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-light);
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text-primary);
}

.cs-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-3) var(--space-5);
  border-bottom: 1px solid var(--border-light);
  font-size: var(--text-sm);
}

.cs-info-row:last-child { border-bottom: none; }
.cs-info-row__label { color: var(--text-muted); font-weight: 500; }
.cs-info-row__val { font-weight: 600; color: var(--text-primary); }

.cs-platforms-list { display: flex; flex-wrap: wrap; gap: var(--space-2); padding: var(--space-4) var(--space-5); }
.cs-platform-tag {
  padding: 4px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-secondary);
}

/* Chart bar */
.cs-chart { padding: var(--space-5); }
.cs-chart-bar { margin-bottom: var(--space-4); }
.cs-chart-bar__label { display: flex; justify-content: space-between; font-size: var(--text-xs); font-weight: 600; margin-bottom: 6px; color: var(--text-secondary); }
.cs-chart-bar__track { height: 8px; background: var(--bg-elevated); border-radius: var(--radius-full); overflow: hidden; }
.cs-chart-bar__fill { height: 100%; border-radius: var(--radius-full); background: var(--gradient-primary); transition: width 1s ease; }

/* ---- RESPONSIVE ---- */
@media(max-width:1024px) {
  .cs-layout { grid-template-columns: 1fr; }
  .cs-sidebar { position: static; }
  .brands-hub-grid { grid-template-columns: repeat(2, 1fr); }
  .cs-kpi-strip { grid-template-columns: repeat(2, 1fr); }
}

@media(max-width:640px) {
  .brands-hub-grid { grid-template-columns: 1fr; }
  .cs-kpi-strip { grid-template-columns: repeat(2, 1fr); }
  .cs-results-grid { grid-template-columns: 1fr; }
}
