/* ==========================================================================
   FRESH — Mega Menu (שירותים dropdown)
   15 services, 5 categories, CTA banner per panel.
   Large service cards, readable CTA button.
   ========================================================================== */

/* --- Container --- */
.mega-menu {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  width: 1100px;
  max-width: calc(100vw - 2rem);
  background: #111111;
  border: 1px solid rgba(200,168,78,0.1);
  border-radius: 14px;
  box-shadow: 0 25px 70px rgba(0,0,0,0.55), 0 0 0 1px rgba(0,0,0,0.2);
  z-index: 1001;
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s 0.35s;
}

/* Invisible bridge: covers the gap between nav item and dropdown
   so the mouse doesn't leave the hover zone while moving down */
.mega-menu::before {
  content: '';
  position: absolute;
  top: -30px;
  left: 0;
  right: 0;
  height: 30px;
  background: transparent;
}

.nav-links > li.has-mega:hover > .mega-menu,
.nav-links > li.has-mega.mega-open > .mega-menu {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0s;
}

/* --- Two-panel body --- */
.mega-body {
  display: flex;
  direction: rtl;
  min-height: 480px;
}

/* --- Right panel: Category sidebar (170px) --- */
.mega-cats {
  width: 170px;
  flex-shrink: 0;
  background: rgba(200,168,78,0.03);
  border-left: 1px solid rgba(200,168,78,0.1);
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
}

.mega-cat {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: none;
  border: none;
  border-right: 3px solid transparent;
  color: #8a8578;
  font-family: 'Heebo', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-align: right;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease, border-color 0.25s ease;
  white-space: nowrap;
}

.mega-cat:hover {
  color: #c8a84e;
  background: rgba(200,168,78,0.04);
}

.mega-cat.active {
  color: #c8a84e;
  border-right-color: #c8a84e;
  background: rgba(200,168,78,0.06);
  font-weight: 700;
}

/* "All services" link at bottom of sidebar */
.mega-all-link {
  display: block;
  margin-top: auto;
  padding: 16px 24px;
  color: #c8a84e;
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
  border-top: 1px solid rgba(200,168,78,0.1);
  transition: opacity 0.2s;
}

.mega-all-link:hover {
  opacity: 0.75;
}

.mega-all-link::after {
  display: none !important;
}

/* Override .nav-links a color for all mega menu links */
.nav-links .mega-menu a {
  color: inherit;
}

/* --- Left panel: Services + CTA --- */
.mega-panel {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Service grid per category */
.mega-svc-grid {
  display: none;
  padding: 28px 36px;
  flex: 1;
  flex-direction: column;
}

.mega-svc-grid.active {
  display: flex;
  animation: megaFadeIn 0.3s ease;
}

@keyframes megaFadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Category heading inside panel */
.mega-cat-heading {
  color: #c8a84e;
  font-size: 0.8rem;
  font-weight: 700;
  margin: 0 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(200,168,78,0.08);
  letter-spacing: 2px;
}

/* --- Service items grid --- */
.mega-svc-items {
  display: grid;
  gap: 14px;
}

.mega-svc-items.cols-2 {
  grid-template-columns: repeat(2, 1fr);
}

.mega-svc-items.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== Service card — LARGE, prominent ===== */
.mega-svc-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 22px 24px;
  border-radius: 14px;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.mega-svc-item:hover {
  background: rgba(200,168,78,0.05);
  border-color: rgba(200,168,78,0.15);
}

/* No underline on hover */
.mega-svc-item::after {
  display: none !important;
}

/* Icon box — 52x52 */
.mega-svc-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(200,168,78,0.1);
  border-radius: 12px;
}

.mega-svc-icon svg {
  width: 24px;
  height: 24px;
  stroke: #c8a84e;
  stroke-width: 1.5;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Remove nested .service-icon styling inside mega menu */
.mega-svc-icon .service-icon {
  width: 24px;
  height: 24px;
  background: none;
  border: none;
  clip-path: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mega-svc-icon .service-icon svg {
  width: 100%;
  height: 100%;
  color: #c8a84e;
}

/* Service text — LARGE, readable */
.mega-svc-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mega-svc-name {
  color: #f0ebe0;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 6px;
}

.mega-svc-desc {
  color: #8a8578;
  font-size: 0.85rem;
  font-weight: 400;
  line-height: 1.6;
}

/* ===== CTA Banner — READABLE button ===== */
.mega-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: auto;
  padding: 20px 24px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(200,168,78,0.08) 0%, rgba(200,168,78,0.03) 100%);
  border: 1px solid rgba(200,168,78,0.15);
}

.mega-cta-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mega-cta-title {
  color: #c8a84e;
  font-size: 1rem;
  font-weight: 700;
}

.mega-cta-desc {
  color: #8a8578;
  font-size: 0.85rem;
}

/* Force btn-primary styles inside mega menu — identical to header "דברו איתנו" */
.mega-menu .btn-primary.mega-cta-btn {
  background: var(--gold) !important;
  color: var(--bg-primary) !important;
  clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 100%, 12px 100%) !important;
  padding: 0.95rem 2.2rem !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  border: none !important;
  text-decoration: none !important;
  white-space: nowrap;
}

.mega-menu .btn-primary.mega-cta-btn:hover {
  background: var(--gold-light) !important;
  color: var(--bg-primary) !important;
  transform: translateY(-2px);
}

/* ==========================================================================
   MOBILE — collapse to simple list
   ========================================================================== */
@media (max-width: 1024px) {
  .mega-menu {
    position: static;
    width: 100%;
    min-height: 0;
    transform: none;
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    border: none;
    border-radius: 0;
    background: rgba(255,255,255,0.03);
    box-shadow: none;
    padding: 0;
    display: none;
    overflow: visible;
  }

  .mega-menu::before {
    display: none;
  }

  .has-mega.mega-open > .mega-menu {
    display: block;
  }

  .mega-body {
    flex-direction: column;
    min-height: 0;
  }

  .mega-cats {
    display: none;
  }

  .mega-panel {
    padding: 0;
  }

  .mega-svc-grid {
    display: block;
    padding: 0.5rem 0 0.5rem 1rem;
    animation: none;
  }

  .mega-cat-heading {
    font-size: 0.8rem;
    padding: 0.5rem 0.8rem 0.25rem;
    margin: 0;
    border: none;
    letter-spacing: 1px;
  }

  .mega-svc-items {
    display: block;
  }

  .mega-svc-item {
    padding: 0.5rem 0.8rem;
    border: none;
    border-radius: 0;
  }

  .mega-svc-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .mega-svc-icon svg {
    width: 16px;
    height: 16px;
  }

  .mega-svc-name {
    font-size: 0.9rem;
    margin-bottom: 0;
  }

  .mega-svc-desc {
    display: none;
  }

  .mega-cta {
    display: none;
  }

  .mega-all-link {
    display: none;
  }
}
