/* Shared navbar overrides to keep the main navigation right-aligned and complete across pages. */
body .nav,
body .site-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 12px;
  padding: 10px 16px;
  background: rgba(20, 49, 78, 0.96);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  font-family: 'Cairo', Tahoma, Arial, sans-serif;
  justify-content: flex-start;
  direction: rtl;
  overflow: visible;
  padding-left: 16px;
  min-height: 58px;
  height: auto;
  flex-wrap: wrap;
  align-items: center;
  align-content: flex-start;
  row-gap: 10px;
}

body .brand,
body .site-nav-brand {
  color: #fff;
  font-size: 0.98rem;
  font-weight: 800;
  text-decoration: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 240px;
  max-width: 100%;
  white-space: normal;
  text-align: right;
  line-height: 1.35;
  order: 1;
}

body .brand::before,
body .site-nav-brand::before {
  content: "";
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 8px;
  background: #ffffff url('../logo.png') center center / 84% no-repeat;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
}

body .menu,
body .site-nav-menu {
  display: flex;
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-start;
  overflow: visible;
  scrollbar-width: thin;
  order: 3;
  align-self: stretch;
}

body .menu a,
body .site-nav-menu a {
  color: #fff;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 700;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 10px;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  flex: 0 1 auto;
  min-height: 42px;
  height: auto;
  padding: 10px 14px;
  white-space: normal;
  line-height: 1.35;
  text-align: center;
  max-width: 100%;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

body .menu a:hover,
body .menu a:focus-visible,
body .site-nav-menu a:hover,
body .site-nav-menu a:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.34);
  outline: none;
}

body .menu a.current,
body .site-nav-menu a.current {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.42);
}

a.permission-pending,
body .menu a.permission-pending,
body .site-nav-menu a.permission-pending {
  opacity: 0.58;
}

a[href*="global-layers.php"]:not(.permission-resolved),
a[href*="global_layers.php"]:not(.permission-resolved),
a[href*="custom-parts.php"]:not(.permission-resolved),
a[href*="custom_parts.php"]:not(.permission-resolved),
a[href*="cabinet/"]:not(.permission-resolved),
a[href*="door/"]:not(.permission-resolved),
a[href*="glass door/"]:not(.permission-resolved),
a[href*="glass%20door/"]:not(.permission-resolved),
a[href*="integral-door/"]:not(.permission-resolved),
a[href*="offset-door/"]:not(.permission-resolved),
a[href*="parts/"]:not(.permission-resolved),
a[href*="decor/"]:not(.permission-resolved),
a[href*="view_orders.php"]:not(.permission-resolved) {
  visibility: hidden;
}

a.permission-hidden,
body .menu a.permission-hidden,
body .site-nav-menu a.permission-hidden,
.card.permission-hidden,
.hero-link.permission-hidden {
  display: none !important;
}

a.permission-disabled,
body .menu a.permission-disabled,
body .site-nav-menu a.permission-disabled,
.card.permission-disabled,
.hero-link.permission-disabled {
  opacity: 0.42;
  filter: grayscale(0.22);
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none;
}

.card.permission-disabled .go,
.hero-link.permission-disabled,
a.permission-disabled .go {
  color: #94a3b8 !important;
}

body .auth-nav-slot {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
  align-items: center;
  white-space: nowrap;
  position: static;
  z-index: 2;
  flex-wrap: wrap;
  order: 2;
}

body .auth-nav-slot a {
  font-family: inherit;
  color: #fff;
  text-decoration: none;
  height: 34px;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
  line-height: 1;
  flex: 0 0 auto;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.auth-link-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #f59e0b;
  color: #17324b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

body .auth-nav-slot a:hover,
body .auth-nav-slot a:focus-visible {
  background: rgba(255, 255, 255, 0.15);
  outline: none;
}

body .nav > .auth-nav-slot,
body .site-nav > .auth-nav-slot {
  margin-inline-start: 8px;
}

body .auth-user-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  body .nav,
  body .site-nav {
    padding-top: 10px;
    padding-bottom: 10px;
    padding-left: 16px;
  }

  body .nav .brand,
  body .site-nav .site-nav-brand {
    flex-basis: 240px;
  }

  body .nav .menu,
  body .site-nav .site-nav-menu {
    justify-content: flex-start;
  }

  body .nav .menu a,
  body .site-nav .site-nav-menu a {
    flex: 1 1 170px;
  }

  body .nav .auth-nav-slot,
  body .site-nav .auth-nav-slot {
    padding-inline-start: 0;
    margin-inline-start: 0;
  }
}

@media (max-width: 768px) {
  body .nav,
  body .site-nav {
    position: static;
    height: auto;
    min-height: 50px;
    padding-top: 8px;
    padding-bottom: 8px;
    padding-left: 12px;
    gap: 8px;
    row-gap: 8px;
    align-items: center;
  }

  body .brand,
  body .site-nav-brand {
    flex: 1 1 100%;
    max-width: none;
    line-height: 1.4;
  }

  body .nav .auth-nav-slot,
  body .site-nav .auth-nav-slot {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding-inline-start: 0;
    padding-bottom: 2px;
    margin-inline-start: 0;
    scrollbar-width: thin;
  }

  body .menu,
  body .site-nav-menu {
    width: 100%;
    flex: 1 1 100%;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    align-self: auto;
    padding-bottom: 2px;
    -webkit-overflow-scrolling: touch;
  }

  body .nav .menu a,
  body .site-nav .site-nav-menu a {
    flex: 0 0 auto;
    min-width: max-content;
    max-width: none;
    min-height: 38px;
    padding: 8px 12px;
    white-space: nowrap;
  }
}
