/* ════════════════════════════════
   NAVBAR
════════════════════════════════ */
:root {
  --dark: #1a1a1a;
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  direction: rtl;
}

.navbar-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 40px;
  gap: 20px;
}

.navbar-mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}

.navbar-mobile-toggle span {
  width: 22px;
  height: 2px;
  background: #1a1a1a;
  border-radius: 2px;
  transition: all 0.3s;
}

.navbar-mobile-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.navbar-mobile-toggle.active span:nth-child(2) {
  opacity: 0;
}

.navbar-mobile-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(8px, -8px);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.navbar-user-actions {
  display: flex;
  align-items: center;
  gap: 2px; /* Reduced space between user greeting and icons */
}

.nav-logo-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  text-decoration: none;
}

.logo-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 3px;
}

.nav-logo-home-tag {
  font-size: 8px;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: 2px;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  line-height: 1;
  opacity: 0.85;
  margin-left: 2px;
}

.nav-logo-main {
  font-family: 'Tajawal', sans-serif;
  font-size: 28px;
  font-weight: 900;
  color: var(--orange);
  letter-spacing: -1.5px;
  line-height: 1;
}

.nav-logo-main .t-letter {
  color: var(--dark);
}

.nav-logo-sub {
  font-size: 7px;
  letter-spacing: 1.5px;
  color: #aaa;
  font-weight: 400;
  display: block;
  text-transform: uppercase;
  margin-top: 2px;
  text-align: center;
}

.search-bar {
  flex: 1 !important;
  max-width: 620px !important;
  position: relative !important;
}

.search-bar input {
  width: 100% !important;
  padding: 8px 44px 8px 16px !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  font-family: 'Cairo', sans-serif !important;
  font-size: 13px !important;
  background: var(--light-gray, #f7f7f7) !important;
  outline: none !important;
  direction: rtl !important;
  color: var(--dark) !important;
}

.search-bar input::placeholder {
  color: #bbb;
}

.search-bar .search-icon {
  position: absolute !important;
  right: 14px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 15px !important;
  height: 15px !important;
  stroke: #bbb !important;
  fill: none !important;
  stroke-width: 2 !important;
  pointer-events: none !important;
}

.nav-icons {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.nav-icons svg {
  width: 20px;
  height: 20px;
  cursor: pointer;
  stroke: var(--dark);
  fill: none;
  stroke-width: 1.6;
  transition: stroke 0.2s;
}

.nav-icons svg:hover {
  stroke: var(--orange);
}

.cart-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: var(--orange);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--white);
  font-family: 'Cairo', sans-serif;
}

.language-dropdown {
  position: relative;
  display: flex;
  align-items: center;
  height: 20px;
  cursor: pointer;
}

.language-dropdown svg {
  width: 20px;
  height: 20px;
  stroke: var(--dark);
  fill: none;
  stroke-width: 1.6;
  transition: stroke 0.2s;
}

.language-dropdown:hover svg {
  stroke: var(--orange);
}

.language-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px;
  min-width: 140px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.language-dropdown:hover .language-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-option {
  margin: 0;
}

.language-link {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  background: none;
  border: none;
  color: var(--dark);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
}

.language-link:hover {
  background: var(--light);
  color: var(--orange);
}

.language-link .flag {
  font-size: 16px;
}

.user-dropdown {
  position: relative;
  cursor: pointer;
}

.user-greeting {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--dark);
  padding: 8px 12px;
  border-radius: 6px;
  transition: all 0.2s;
  user-select: none;
}

.user-greeting:hover {
  background: var(--light);
  color: var(--orange);
}

.user-greeting .dropdown-arrow {
  width: 12px;
  height: 12px;
  stroke: var(--dark);
  fill: none;
  stroke-width: 2;
  transition: transform 0.2s;
}

.user-dropdown:hover .user-greeting .dropdown-arrow {
  transform: rotate(180deg);
}

.user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 0;
  min-width: 180px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.user-dropdown:hover .user-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--dark);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}

.user-menu-item:hover {
  background: var(--light);
  color: var(--orange);
}

.user-menu-item svg {
  width: 16px;
  height: 16px;
  stroke: var(--dark);
  fill: none;
  stroke-width: 1.8;
  flex-shrink: 0;
}

.user-menu-item:hover svg {
  stroke: var(--orange);
}

.user-menu-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

.user-menu-button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  color: var(--dark);
  font-family: 'Cairo', sans-serif;
  font-size: 13px;
  font-weight: 500;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: right;
}

.user-menu-button:hover {
  background: var(--light);
  color: #dc3545;
}

.user-menu-button:hover svg {
  stroke: #dc3545;
}

.navbar-bottom {
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: center;
  padding: 0 40px;
}

.nav-links {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 0;
}

.nav-links li a {
  display: block;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  padding: 10px 22px;
  position: relative;
  transition: color 0.2s;
}

.nav-links li a:hover {
  color: var(--orange);
}

.nav-links li a.active {
  color: var(--orange);
}

.nav-links li a.active::before {
  content: '•';
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--orange);
  font-size: 10px;
}

@media (max-width: 900px) {
  .navbar-top {
    padding: 8px 20px;
    gap: 12px;
  }

  .search-bar {
    max-width: 300px;
  }

  .navbar-bottom {
    padding: 0 20px;
  }

  .nav-links li a {
    padding: 10px 12px;
    font-size: 12px;
  }
}

@media (max-width: 768px) {
  .navbar-mobile-toggle {
    display: flex;
  }

  .navbar-top {
    padding: 8px 16px;
    gap: 8px;
  }

  .navbar-right {
    gap: 12px;
  }

  .nav-icons {
    gap: 8px;
  }

  .language-dropdown {
    height: 18px;
  }

  .language-dropdown svg {
    width: 18px;
    height: 18px;
  }

  .search-bar {
    max-width: 150px;
    display: none;
  }

  .search-bar.mobile-visible {
    display: flex;
    position: absolute;
    top: 56px;
    left: 16px;
    right: 16px;
    width: calc(100% - 32px);
  }

  .user-greeting {
    font-size: 12px;
    padding: 6px 8px;
  }

  .user-menu {
    min-width: 160px;
    left: 0;
  }

  .user-menu-item {
    padding: 8px 12px;
    font-size: 12px;
  }

  .user-menu-button {
    padding: 8px 12px;
    font-size: 12px;
  }

  .navbar-bottom {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    border-top: 1px solid var(--border);
    padding: 0;
  }

  .navbar-bottom.mobile-visible {
    max-height: 300px;
    padding: 0 20px;
  }

  .nav-links {
    flex-direction: column;
  }

  .nav-links li a {
    padding: 12px 22px;
    font-size: 13px;
  }

  .nav-logo-home-tag {
    display: none;
  }
}

@media (max-width: 600px) {
  .navbar-top {
    padding: 8px 12px;
  }

  .navbar-right {
    gap: 8px;
  }

  .nav-icons {
    gap: 6px;
  }

  .nav-icons svg {
    width: 16px;
    height: 16px;
  }

  .language-dropdown {
    height: 16px;
  }

  .language-dropdown svg {
    width: 16px;
    height: 16px;
  }

  .search-bar {
    max-width: 120px;
  }

  .user-greeting {
    font-size: 11px;
    padding: 4px 6px;
  }

  .user-menu {
    min-width: 140px;
    left: 0;
  }

  .user-menu-item {
    padding: 6px 10px;
    font-size: 11px;
  }

  .user-menu-button {
    padding: 6px 10px;
    font-size: 11px;
  }

  .nav-logo-sub {
    display: none;
  }

  .logo-row {
    gap: 2px;
  }

  .nav-logo-main {
    font-size: 20px;
  }
}
