/* ═══════════════════════════════════════
   COMPANIES.CSS — HMC GROUP
═══════════════════════════════════════ */

/* ── PAGE HEADER ── */
.page-header {
  margin-top: 88px;
  height: 280px;
  background: var(--navy);
  display: flex;
  align-items: center;
  padding: 0 80px;
  position: relative;
  overflow: hidden;
}

.page-header-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.page-header-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0,32,88,0.72) 0%, rgba(8,40,120,0.45) 100%);
  z-index: 1;
}

.page-header-content {
  position: relative;
  z-index: 3;
  animation: fadeUp 0.9s ease both;
}

.page-header-h1 {
  font-size: 46px;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 10px;
  line-height: 1.2;
}

.page-header-sub {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  max-width: 520px;
  line-height: 1.7;
}

/* ── COMPANIES SECTION ── */
.companies-section {
  padding: 80px;
  background: var(--off-white);
}

/* ── HEADER ── */
.companies-header {
  text-align: center;
  margin-bottom: 64px;
}

.companies-hmc-logo {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 24px;
  display: block;
}

/* ── GRID — 3 أعمدة ── */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 24px;
}

/* ── الصف الأخير — 4 أعمدة ── */
.companies-grid-last {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ── CARD ── */
.company-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  position: relative;
  cursor: default;
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  overflow: visible;
}

.company-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
  z-index: 10;
}

/* ── LOGO ── */
.company-card-logo {
  width: 150px;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.company-card-logo img {
  max-width: 220px;
  max-height: 140px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* Fallback — نص مباشر بدون مربع */
.logo-fallback-box {
  width: 150px;
  height: 102px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
}

.logo-fallback-box span {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
  line-height: 1.3;
  letter-spacing: -0.02em;
}

/* ── MODAL ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 480px;
  max-width: 90vw;
  box-shadow: 0 24px 80px rgba(8,40,120,0.25);
  overflow: hidden;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
  position: relative;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,0.08);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  z-index: 1;
}

.modal-close:hover { background: rgba(0,0,0,0.15); }

.modal-close svg {
  width: 16px;
  height: 16px;
  color: var(--near-black);
}

.modal-header {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 32px 32px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-logo {
  width: 150px;
  height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  flex-shrink: 0;
  padding: 8px;
}

.modal-logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.modal-logo span {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  text-align: center;
}

.modal-name {
  font-size: 20px;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.3;
}

.modal-body {
  padding: 24px 32px 32px;
}

.modal-desc {
  font-size: 14px;
  color: var(--charcoal);
  line-height: 1.75;
  margin-bottom: 20px;
}

.modal-services {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-services li {
  font-size: 11px;
  font-weight: 600;
  color: var(--navy);
  background: rgba(8,40,120,0.06);
  border: 1px solid rgba(8,40,120,0.15);
  border-radius: 20px;
  padding: 5px 12px;
}