/* ============================================
   Om Automobile — dropdown.css
   Mega-menu dropdown styles
   ============================================ */

/* ---------- Dropdown panel ---------- */
.dropdown {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  min-width: 560px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.03);
  display: flex;
  gap: 0;
  padding: 1.4rem;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
}

/* Narrow variant — for accessories & service (no wide CTA) */
.dropdown.dropdown--narrow {
  min-width: 420px;
}

/* Active (shown) */
.nav-item.dropdown-open > .dropdown {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

/* Tiny arrow pointing up */
.dropdown::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 13px;
  height: 13px;
  background: #121212;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---------- Column ---------- */
.dropdown-col {
  flex: 1;
  padding: 0 1rem;
  border-right: 1px solid rgba(255, 255, 255, 0.07);
}

.dropdown-col:last-of-type {
  border-right: none;
}

/* Column heading */
.dropdown-heading {
  font-size: 10px;
  font-weight: 700;
  color: #555;
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* ---------- Dropdown link ---------- */
.dropdown-link {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.18s ease;
  margin-bottom: 2px;
}

.dropdown-link:hover {
  background: rgba(255, 255, 255, 0.05);
}

.dropdown-link:hover strong {
  color: #E63012;
}

.dropdown-icon {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
  width: 22px;
  text-align: center;
}

.dropdown-link span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown-link strong {
  font-size: 13.5px;
  font-weight: 600;
  color: #e0e0e0;
  transition: color 0.18s ease;
  line-height: 1.2;
}

.dropdown-link small {
  font-size: 11.5px;
  color: #666;
  font-weight: 400;
  line-height: 1.3;
}

/* ---------- CTA panel inside dropdown ---------- */
.dropdown-cta {
  flex-shrink: 0;
  width: 180px;
  background: rgba(230, 48, 18, 0.07);
  border: 1px solid rgba(230, 48, 18, 0.15);
  border-radius: 10px;
  padding: 1.1rem 1rem;
  margin-left: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-self: flex-start;
}

.dropdown-cta-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
}

.dropdown-cta-sub {
  font-size: 11.5px;
  color: #777;
  line-height: 1.5;
  flex: 1;
}

.dropdown-cta-btn {
  display: inline-block;
  margin-top: 6px;
  background: #E63012;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
  transition: background 0.2s ease, transform 0.1s;
  white-space: nowrap;
}

.dropdown-cta-btn:hover { background: #c0270f; }
.dropdown-cta-btn:active { transform: scale(0.97); }

/* ---------- Focus-visible accessibility ---------- */
.dropdown-link:focus-visible,
.nav-link:focus-visible,
.btn-book:focus-visible {
  outline: 2px solid #E63012;
  outline-offset: 2px;
}

/* ---------- Keep dropdown on correct side near edges ---------- */
.nav-item:last-child .dropdown,
.nav-item:nth-last-child(2) .dropdown {
  left: auto;
  right: 0;
  transform: translateX(0) translateY(10px);
}

.nav-item:last-child.dropdown-open .dropdown,
.nav-item:nth-last-child(2).dropdown-open .dropdown {
  transform: translateX(0) translateY(0);
}

.nav-item:last-child .dropdown::before,
.nav-item:nth-last-child(2) .dropdown::before {
  left: auto;
  right: 24px;
  transform: rotate(45deg);
}

/* ---------- Mobile responsive dropdown ---------- */
@media (max-width: 860px) {
    /* Hide dropdown panels by default inside the header on small screens
      to avoid floating panels appearing beside the hamburger. They will
      only show inside the slide-in mobile menu when `.nav-links.mobile-open` is active. */
    .nav-links .dropdown { display: none; }

  .dropdown {
    position: static !important;
    transform: none !important;
    opacity: 1 !important;
    visibility: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    min-width: auto !important;
    pointer-events: all !important;
    display: none;
    flex-direction: column;
    gap: 0;
  }

  /* Only show dropdowns when the mobile nav panel is open */
  .nav-links.mobile-open .nav-item.dropdown-open .dropdown {
    display: flex !important;
  }

  .dropdown::before {
    display: none !important;
  }

  .dropdown-col {
    border-right: none;
    padding: 8px 1.4rem 8px 2.8rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
  }

  .dropdown-col:last-of-type {
    border-bottom: none;
  }

  .dropdown-heading {
    margin-top: 4px;
    margin-bottom: 6px;
  }

  .dropdown-link {
    padding: 10px 0 !important;
    border-radius: 0;
    margin-bottom: 0 !important;
  }

  .dropdown-cta {
    width: auto !important;
    margin: 12px 1.4rem !important;
    background: rgba(230, 48, 18, 0.08) !important;
    border: 1px solid rgba(230, 48, 18, 0.2) !important;
  }

  .dropdown-cta-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .dropdown-col {
    padding: 8px 1rem 8px 2rem !important;
  }

  .dropdown-cta {
    margin: 12px 1rem !important;
  }
}
