/* ============================================================
   Header — hdr-* class system
   RTL/LTR: set via dir attribute on <header> element
   ============================================================ */

/* ─── Base ─── */
.hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: 80px;
  background: transparent;
  transition:
    background 0.35s ease,
    height 0.35s ease,
    box-shadow 0.35s ease;
}

.hdr--sticky {
  background: var(--clr-navy-deeper);
  height: 64px;
  box-shadow: 0 2px 24px rgba(0, 0, 0, 0.22);
}

/* ─── Nav row ─── */
.hdr-nav {
  display: flex;
  align-items: center;
  height: 80px;
  gap: 24px;
  transition: height 0.35s ease;
}

.hdr--sticky .hdr-nav {
  height: 64px;
}

/* ─── Logo ─── */
.hdr-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  line-height: 0;
  margin-inline-end: 12px;
  transition: opacity 0.2s;
}

.hdr-logo:hover {
  opacity: 0.85;
}

.hdr-logo img {
  height: 66px;
  width: auto;
  transition: height 0.3s ease;
  filter: drop-shadow(0 2px 14px rgba(0, 0, 0, 0.35));
}

.hdr--sticky .hdr-logo {
  padding: 4px 14px 4px 10px;
}

.hdr--sticky .hdr-logo img {
  height: 50px;
}

/* ─── Desktop nav links ─── */
.hdr-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 38px;
  flex: 1;
  justify-content: center;
}

.hdr-links li a {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  position: relative;
  padding-bottom: 4px;
  transition: color 0.2s;
  white-space: nowrap;
}

.hdr-links li a::after {
  content: "";
  position: absolute;
  bottom: 0;
  inset-inline-start: 0;
  width: 100%;
  height: 2px;
  background: var(--clr-orange);
  transform: scaleX(0);
  transform-origin: inset-inline-start center;
  transition: transform var(--trans-normal);
}

.hdr-links li a:hover,
.hdr-links li.active a {
  color: var(--clr-orange);
  text-decoration: none;
}

.hdr-links li a:hover::after,
.hdr-links li.active a::after {
  transform: scaleX(1);
}

/* ─── Right-side actions cluster ─── */
.hdr-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-inline-start: auto;
  flex-shrink: 0;
}

/* ─── CTA button (Login / Sign Up) ─── */
.hdr-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--grad-orange);
  color: var(--clr-white) !important;
  font-size: 14px;
  font-weight: 600;
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  text-decoration: none !important;
  white-space: nowrap;
  transition:
    opacity 0.2s,
    transform var(--trans-fast);
}

.hdr-cta:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.hdr-cta--block {
  width: 100%;
  justify-content: center;
}

/* ─── Language switcher ─── */
.hdr-lang {
  position: relative;
}

.hdr-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  cursor: pointer;
  color: var(--clr-white);
  transition:
    background 0.2s,
    border-color 0.2s;
}

.hdr-lang-btn:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.3);
}

.hdr-lang-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  inset-inline-end: 0;
  padding-top: 8px; /* bridges the gap so hover isn't broken */
  background: transparent;
  z-index: 300;
}

.hdr-lang-dropdown-inner {
  background: var(--clr-white);
  border-radius: 10px;
  box-shadow: var(--shadow-card-hover);
  min-width: 110px;
  overflow: hidden;
}

.hdr-lang:hover .hdr-lang-dropdown {
  display: block;
}

.hdr-lang-option {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--clr-text-base);
  text-align: start;
  transition:
    background var(--trans-fast),
    color var(--trans-fast);
}

.hdr-lang-option:hover,
.hdr-lang-option.active {
  background: var(--clr-orange-faint);
  color: var(--clr-orange);
}

/* ─── Currency switcher (desktop only) ─── */
.hdr-currency {
  display: flex;
  align-items: center;
}

/* ─── Hamburger button ─── */
.hdr-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 40px;
  height: 40px;
  padding: 8px;
  flex-shrink: 0;
}

.hdr-burger span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--clr-white);
  border-radius: 2px;
  transition:
    transform var(--trans-normal),
    opacity 0.2s ease;
  transform-origin: center;
}

.hdr-burger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hdr-burger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hdr-burger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ─── User avatar button ─── */
.hdr-user-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.28);
  cursor: pointer;
  background: none;
  padding: 0;
  transition: border-color 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdr-user-btn::after {
  display: none !important; /* hide Bootstrap caret */
}

.hdr-user-btn:hover {
  border-color: var(--clr-orange);
}

.hdr-user-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

/* ─── User dropdown ─── */
.hdr-user-dropdown {
  inset-inline-end: 0 !important;
  inset-inline-start: auto !important;
  min-width: 210px;
  border: none;
  border-radius: var(--radius-md) !important;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.16) !important;
  padding: 0 !important;
  overflow: hidden;
  margin-top: 8px !important;
}

.hdr-user-info {
  padding: 14px 16px;
  background: var(--clr-bg-muted);
  border-bottom: 1px solid var(--clr-border-off);
}

.hdr-user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-text-heading);
  line-height: 1.3;
}

.hdr-user-email {
  font-size: 12px;
  color: var(--clr-text-secondary);
  margin-top: 2px;
  word-break: break-all;
}

.hdr-user-menu {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.hdr-user-menu li a,
.hdr-user-menu li button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-text-base);
  text-decoration: none;
  border: none;
  background: none;
  cursor: pointer;
  text-align: start;
  transition:
    background var(--trans-fast),
    color var(--trans-fast);
}

.hdr-user-menu li a:hover,
.hdr-user-menu li button:hover {
  background: var(--clr-bg-soft);
  color: var(--clr-orange);
  text-decoration: none;
}

.hdr-user-menu li.logout a,
.hdr-user-menu li.logout button {
  color: var(--clr-error);
}

.hdr-user-menu li.logout a:hover,
.hdr-user-menu li.logout button:hover {
  background: var(--clr-error-bg);
  color: var(--clr-error);
}

/* Stores list */
.hdr-stores {
  max-height: 160px;
  overflow-y: auto;
  border-top: 1px solid var(--clr-border-off);
  border-bottom: 1px solid var(--clr-border-off);
}

.hdr-store-item {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--clr-text-base);
  cursor: pointer;
  border: none;
  background: none;
  text-align: start;
  transition:
    background var(--trans-fast),
    color var(--trans-fast);
}

.hdr-store-item:hover,
.hdr-store-item.active {
  background: var(--clr-orange-faint);
  color: var(--clr-orange);
}

/* ─── Mobile drawer ─── */
.hdr-drawer {
  position: fixed;
  top: 0;
  inset-inline-end: -100%;
  width: min(300px, 88vw);
  height: 100vh;
  z-index: 1100;
  transition: inset-inline-end 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
}

.hdr-drawer.is-open {
  inset-inline-end: 0;
}

.hdr-drawer-inner {
  width: 100%;
  height: 100%;
  background: var(--clr-navy-deeper);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
  overflow-y: auto;
}

/* Drawer header row: logo + close button */
.hdr-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

/* Close (X) button */
.hdr-drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  flex-shrink: 0;
  transition:
    background 0.2s,
    color 0.2s,
    border-color 0.2s;
}

.hdr-drawer-close:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--clr-white);
}

/* User info strip in drawer */
.hdr-drawer-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.hdr-drawer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.hdr-drawer-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hdr-drawer-user-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--clr-white);
  line-height: 1.3;
}

.hdr-drawer-user-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 1px;
  word-break: break-all;
}

/* Drawer nav links */
.hdr-drawer-links {
  list-style: none;
  margin: 0;
  padding: 6px 0;
  flex: 1;
}

.hdr-drawer-links li a {
  display: flex;
  align-items: center;
  padding: 13px 24px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  border-inline-start: 3px solid transparent;
  transition:
    color var(--trans-fast),
    background var(--trans-fast),
    border-color var(--trans-fast),
    padding-inline-start var(--trans-fast);
}

.hdr-drawer-links li a:hover {
  color: var(--clr-orange);
  background: rgba(255, 108, 44, 0.06);
  padding-inline-start: 28px;
}

.hdr-drawer-links li.active a {
  color: var(--clr-orange);
  background: rgba(255, 108, 44, 0.08);
  border-inline-start-color: var(--clr-orange);
  padding-inline-start: 28px;
  font-weight: 600;
}

/* ─── Settings section (currency + language in drawer) ─── */
.hdr-drawer-settings {
  padding: 4px 0 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.hdr-drawer-settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 20px;
}

.hdr-drawer-settings-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.45);
  text-transform: uppercase;
  letter-spacing: 0.6px;
  flex-shrink: 0;
}

/* Currency button inside drawer */
.hdr-drawer-settings-row .btn.mx-3 {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.hdr-drawer-settings-row .btn-outline-light {
  font-size: 12px !important;
  font-weight: 700 !important;
  padding: 5px 11px !important;
  border-radius: 8px !important;
}

/* Language pill buttons inside drawer */
.hdr-drawer-lang-opts {
  display: flex;
  gap: 6px;
}

.hdr-drawer-lang-opt {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition:
    background 0.2s,
    border-color 0.2s,
    color 0.2s;
}

.hdr-drawer-lang-opt.active {
  background: rgba(255, 108, 44, 0.14);
  border-color: var(--clr-orange);
  color: var(--clr-orange);
}

.hdr-drawer-lang-opt:not(.active):hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--clr-white);
}

/* Drawer footer */
.hdr-drawer-footer {
  padding: 16px 20px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.hdr-drawer-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 11px 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--clr-error-light);
  font-size: 14px;
  font-weight: 600;
  text-align: start;
}

/* Backdrop — hidden until drawer opens */
.hdr-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.52);
  backdrop-filter: blur(2px);
  z-index: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.hdr-drawer.is-open .hdr-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* ─── Utility: hide on mobile ─── */
.hdr-hide-mobile {
  display: inline-flex;
}

/* ─── Responsive ─── */
@media (max-width: 991px) {
  .hdr-links {
    display: none;
  }

  .hdr-hide-mobile {
    display: none !important;
  }

  .hdr-burger {
    display: flex;
  }
  .hdr-hide-mobile {
    display: none !important;
  }
}

@media (max-width: 767px) {
  /* Solid background on mobile — no hero behind it */
  .hdr {
    background: linear-gradient(135deg, #0a1333 0%, #0e1d45 60%, #12224e 100%);
    height: 64px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.35);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  .hdr-nav {
    height: 64px;
    padding: 0 4px;
    gap: 8px;
  }

  .hdr--sticky {
    height: 58px;
    box-shadow: 0 3px 24px rgba(0, 0, 0, 0.4);
  }

  .hdr--sticky .hdr-nav {
    height: 58px;
  }

  /* Push actions to the end */
  .hdr-logo {
    margin-inline-end: auto;
  }

  .hdr-logo img {
    height: 40px;
  }

  .hdr--sticky .hdr-logo img {
    height: 34px;
  }

  .hdr-actions {
    gap: 8px;
  }

  /* Language button */
  .hdr-lang-btn {
    padding: 6px 10px;
    border-radius: 8px;
    gap: 4px;
  }

  /* Hamburger */
  .hdr-burger {
    width: 38px;
    height: 38px;
    padding: 8px;
    border-radius: 8px;
    gap: 5px;
  }
}

@media (max-width: 575px) {
  .hdr-actions {
    gap: 8px;
  }

  .hdr-lang-btn {
    padding: 6px 8px;
  }
}
