/**
 * Landing Navbar – logo, categories dropdown, about, contact, language, login, sign up.
 * RTL, mobile drawer. Uses hero.css variables.
 */

/* ----- Layout ----- */
.landing-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end; /* Push links to left since logo is absolute */
  padding: 0 8%; /* Remove vertical padding */
  gap: 1rem;
  flex-wrap: wrap;
  position: relative; /* Anchor for absolute logo */
  min-height: 80px; /* Ensure minimum height for links */
}

.landing-nav .brand-logo {
  position: absolute;
  top: 0;
  right: 8%; /* Align with container padding */
  z-index: 100;
}

.landing-nav .brand-logo .logo-img {
  height: 160px;
  max-height: 160px; /* Prevent logo from growing without limit on large PC viewports */
  width: auto;
  max-width: 280px;
  display: block;
  object-fit: contain;
  transition: height 0.3s ease;
}

.landing-nav .nav-links {
  order: 2;
  display: flex;
  align-items: center;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.landing-nav .nav-actions {
  order: 3;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.landing-nav .mobile-menu-btn {
  order: 4;
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-dark, #1a1a1a);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.landing-nav .mobile-menu-btn:hover {
  background: rgba(0, 0, 0, 0.1);
}

.landing-nav .mobile-menu-btn[aria-expanded="true"] {
  background: var(--primary-red, #ff6b00);
  color: #fff;
}

/* ----- Links ----- */
.landing-nav .nav-link {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark, #1a1a1a);
  transition: color 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.5rem 0;
}

.landing-nav .nav-link:hover {
  color: var(--primary-red, #ff6b00);
}

.landing-nav .nav-dropdown-trigger .fa-chevron-down {
  font-size: 0.7rem;
  transition: transform 0.2s ease;
}

.landing-nav .nav-dropdown-wrap:hover .fa-chevron-down,
.landing-nav .nav-dropdown-wrap:focus-within .fa-chevron-down {
  transform: rotate(180deg);
}

/* ----- Dropdown ----- */
.landing-nav .nav-dropdown-wrap {
  position: relative;
}

.landing-nav .nav-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.25rem;
  min-width: 280px;
  padding: 0.5rem 0;
  background: #fff;
  border-radius: 16px;
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(0, 0, 0, 0.06);
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0.2s ease;
}

.landing-nav .nav-dropdown-wrap:hover .nav-dropdown,
.landing-nav .nav-dropdown-wrap:focus-within .nav-dropdown,
.landing-nav .nav-dropdown-wrap[data-open="true"] .nav-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.landing-nav .nav-dropdown[hidden] {
  display: block !important;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.landing-nav .nav-dropdown-wrap:hover .nav-dropdown[hidden],
.landing-nav .nav-dropdown-wrap:focus-within .nav-dropdown[hidden],
.landing-nav .nav-dropdown-wrap[data-open="true"] .nav-dropdown[hidden] {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.landing-nav .nav-dropdown-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.75rem 1rem;
  margin: 0 0.25rem;
  border-radius: 12px;
  color: var(--text-dark, #1a1a1a);
  transition:
    background 0.2s ease,
    color 0.2s ease;
  text-align: right;
}

.landing-nav .nav-dropdown-item:hover {
  background: rgba(255, 107, 0, 0.08);
  color: var(--primary-red, #ff6b00);
}

.landing-nav .nav-dropdown-title {
  font-weight: 700;
  font-size: 0.95rem;
}

.landing-nav .nav-dropdown-desc {
  font-size: 0.8rem;
  color: var(--text-grey, #555);
}

.landing-nav .nav-dropdown-item:hover .nav-dropdown-desc {
  color: inherit;
  opacity: 0.9;
}

/* ----- Language ----- */
.landing-nav .lang-form {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.landing-nav .lang-label {
  color: var(--text-grey, #555);
  cursor: pointer;
  font-size: 1rem;
}

.landing-nav .lang-select {
  padding: 0.4rem 0.5rem;
  border-radius: 10px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  background: #fff;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-dark, #1a1a1a);
  cursor: pointer;
  font-family: inherit;
}

.landing-nav .lang-select:hover,
.landing-nav .lang-select:focus {
  border-color: var(--primary-red, #ff6b00);
  outline: none;
}

/* ----- Action buttons ----- */
.landing-nav .btn-nav {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.9rem;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease;
  white-space: nowrap;
}

.landing-nav .btn-nav-login {
  background: transparent;
  border: 2px solid var(--text-dark, #1a1a1a);
  color: var(--text-dark, #1a1a1a);
}

.landing-nav .btn-nav-login:hover {
  background: var(--text-dark, #1a1a1a);
  color: #fff;
}

.landing-nav .btn-nav-signup {
  background: var(--primary-red, #ff6b00);
  color: #fff;
  border: 2px solid transparent;
  box-shadow: 0 4px 14px rgba(255, 107, 0, 0.35);
}

.landing-nav .btn-nav-signup:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(255, 107, 0, 0.4);
  background: #e55f00;
  color: #fff;
}

/* ----- Prevent horizontal overflow when mobile menu is open ----- */
html.nav-mobile-open,
body.nav-mobile-open {
  overflow: hidden !important;
  overflow-x: hidden !important;
  max-width: 100% !important;
}

/* ----- Mobile overlay: full viewport, no overflow ----- */
.nav-mobile-overlay {
  position: fixed;
  inset: 0;
  top: 0;
  right: 0;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  max-width: 100vw;
  max-height: 100vh;
  max-height: 100dvh;
  background: rgba(0, 0, 0, 0.4);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease;
  overflow: hidden;
}

.nav-mobile-overlay[aria-hidden="false"] {
  opacity: 1;
  visibility: visible;
}

.nav-mobile-overlay[hidden] {
  display: none !important;
}

.nav-mobile-inner {
  position: absolute;
  top: 0;
  right: 0;
  width: min(320px, 85vw);
  height: 100%;
  background: #fff;
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  box-shadow: -8px 0 32px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
}

.nav-mobile-inner a {
  padding: 0.75rem 1rem;
  border-radius: 12px;
  font-weight: 600;
  color: var(--text-dark, #1a1a1a);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.nav-mobile-inner a:hover {
  background: rgba(255, 107, 0, 0.1);
  color: var(--primary-red, #ff6b00);
}

.nav-mobile-subtitle {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-grey, #555);
  margin-top: 0.75rem;
  padding: 0 1rem;
}

.nav-mobile-cat {
  padding-right: 1.5rem !important;
}

.nav-mobile-lang {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.nav-mobile-lang select {
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  font-size: 1rem;
  font-family: inherit;
}

.nav-mobile-inner .btn-nav-login,
.nav-mobile-inner .btn-nav-signup {
  margin-top: 0.5rem;
  text-align: center;
}

.nav-mobile-inner .btn-nav-signup {
  background: var(--primary-red, #ff6b00);
  color: #fff;
  border: none;
}

.nav-mobile-close {
  position: absolute;
  top: max(1rem, env(safe-area-inset-top));
  left: max(1rem, env(safe-area-inset-left));
  right: auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-dark, #1a1a1a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  z-index: 1;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.nav-mobile-close:hover {
  background: rgba(0, 0, 0, 0.1);
}

[dir="rtl"] .nav-mobile-close {
  left: auto;
  right: max(1rem, env(safe-area-inset-right));
}

/* ----- Mobile/tablet: full-screen menu (same breakpoint as burger), no side drawer, no overflow ----- */
@media (max-width: 991px) {
  .nav-mobile-overlay {
    display: flex;
    align-items: stretch;
    justify-content: stretch;
  }

  .nav-mobile-overlay[hidden] {
    display: none !important;
  }

  .nav-mobile-inner {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    max-height: 100vh !important;
    max-height: 100dvh !important;
    min-height: 0;
    padding: max(4rem, calc(44px + 1rem + env(safe-area-inset-top)))
      max(1.5rem, env(safe-area-inset-right))
      max(1.5rem, env(safe-area-inset-bottom))
      max(1.5rem, env(safe-area-inset-left));
    box-shadow: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
  }
}

/* ----- Responsive: hide nav links & actions, show hamburger ----- */
@media (max-width: 991px) {
  .landing-nav .nav-links,
  .landing-nav .nav-actions {
    display: none;
  }

  .landing-nav {
    padding: 0 5%;
    justify-content: space-between;
    align-items: center;
    flex-wrap: nowrap;
    min-height: 70px;
  }

  .landing-nav .brand-logo {
    position: relative;
    right: auto;
    top: auto;
    order: 1;
    flex-shrink: 0;
  }

  .landing-nav .brand-logo .logo-img {
    height: 90px;
  }

  .landing-nav .mobile-menu-btn {
    display: flex;
    order: 2;
    margin-inline-start: auto;
    flex-shrink: 0;
  }
}

/* ----- Phone: smaller logo for tight screens ----- */
@media (max-width: 767px) {
  .landing-nav .brand-logo .logo-img {
    height: 70px;
  }
}

/* ----- Desktop: ensure dropdown doesn’t get cut ----- */
@media (min-width: 992px) {
  .landing-nav .nav-dropdown {
    min-width: 300px;
  }
}
