/* =========================================
   header.css - Full Premium Zenith Header
   Client: Jawed Habib
   ========================================= */

/* =========================================
   1. TOPBAR (Red Theme & High Visibility)
   ========================================= */
.jh-topbar {
  position: absolute; 
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  background-color: var(--color-primary); /* Jawed Habib Signature Red */
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  z-index: 1001;
  box-sizing: border-box;
}

.jh-topbar-inner {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  box-sizing: border-box;
}

.jh-topbar-section {
  display: flex;
  align-items: center;
  gap: 12px;
}

.jh-topbar-section.left { justify-content: flex-start; }
.jh-topbar-section.right { justify-content: flex-end; }
.jh-topbar-section.center { justify-content: center; overflow: hidden; }

/* Enhanced Icon Visibility */
.jh-topbar-section a {
  color: #ffffff; /* Pure white for maximum contrast */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px; /* Touch-friendly circular housing */
  height: 28px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.12); /* Subtle glow housing */
  transition: all 0.3s ease;
  text-decoration: none;
}

.jh-topbar-section svg {
  width: 15px;
  height: 15px;
  stroke-width: 2.2; /* Thicker lines for readability */
}

/* Eye-catching Hover State */
.jh-topbar-section a:hover {
  background-color: #ffffff;
  color: var(--color-primary);
  transform: scale(1.1);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

/* Text Slider */
.jh-text-slider {
  width: 300px;
  overflow: hidden;
  position: relative;
  white-space: nowrap;
}

.jh-slider-track {
  display: inline-flex;
  gap: 40px;
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
  animation: scrollText 20s linear infinite;
}

@keyframes scrollText {
  0% { transform: translateX(100%); }
  100% { transform: translateX(-100%); }
}


/* =========================================
   2. MAIN ZENITH HEADER (Morphing Pill)
   ========================================= */
.jh-zenith {
  position: fixed;
  top: 40px; /* Starts exactly below the 40px topbar */
  left: 0;
  width: 100%;
  z-index: 1000;
  padding: var(--space-m) 0;
  pointer-events: none; /* Let clicks pass through empty outer areas */
  transition: top 0.7s cubic-bezier(0.65, 0, 0.05, 1), 
              padding 0.7s cubic-bezier(0.65, 0, 0.05, 1);
  box-sizing: border-box;
}

.jh-zenith-inner {
  pointer-events: auto; /* Re-enable clicks */
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--space-xl);
  background-color: transparent;
  border-radius: var(--border-radius-pill);
  transition: all 0.7s cubic-bezier(0.65, 0, 0.05, 1);
  box-sizing: border-box;
  
  /* Initial Transparent Theme */
  --zenith-text: var(--color-white);
  --zenith-hover: var(--color-gray-200);
  --zenith-btn-border: rgba(255, 255, 255, 0.3);
}

/* --- SCROLLED STATE: Premium Glass Pill --- */
.jh-zenith.is-floating {
  top: 0; /* Snaps to absolute top */
  padding: var(--space-xs) var(--space-s);
}

.jh-zenith.is-floating .jh-zenith-inner {
  max-width: 960px; /* Snaps inward */
  padding: var(--space-xs) var(--space-m);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px); /* Glassmorphism */
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 40px rgba(196, 18, 26, 0.08); /* Luxurious red shadow */
  border: var(--border-width) solid rgba(196, 18, 26, 0.06);
  
  /* Swap to Red Theme on White */
  --zenith-text: var(--color-primary);
  --zenith-hover: var(--color-primary-dark);
  --zenith-btn-border: rgba(196, 18, 26, 0.2);
}

/* --- Layout Flanks & Brand --- */
.jh-flank {
  display: flex;
  align-items: center;
  gap: var(--space-l);
}

.left-flank { justify-content: flex-start; }
.right-flank { justify-content: flex-end; }

.jh-center-brand {
  display: flex;
  justify-content: center;
  padding: 0 var(--space-m);
}

.jh-logo {
  height: clamp(48px, 4.5vw, 64px);
  width: auto;
  transition: height 0.7s cubic-bezier(0.65, 0, 0.05, 1);
}

.jh-zenith.is-floating .jh-logo {
  height: clamp(34px, 3.5vw, 42px);
}


/* =========================================
   3. DESKTOP LINKS & BUTTONS
   ========================================= */
.jh-nav-item {
  color: var(--zenith-text);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  position: relative;
  padding: var(--space-3xs) 0;
  transition: color var(--transition-normal);
}

/* Center-expanding hairline underline */
.jh-nav-item::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 1px;
  background-color: var(--zenith-hover);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  transform: translateX(-50%);
  opacity: 0;
}

.jh-nav-item:hover { color: var(--zenith-hover); }
.jh-nav-item:hover::after { width: 100%; opacity: 1; }

/* CTA Button */
.jh-btn-book {
  display: flex;
  align-items: center;
  gap: var(--space-2xs);
  color: var(--zenith-text);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-decoration: none;
  border: var(--border-width) solid var(--zenith-btn-border);
  padding: 8px 16px 8px 20px;
  border-radius: var(--border-radius-pill);
  transition: all var(--transition-normal);
}

.jh-arrow {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-normal);
}

.jh-btn-book:hover {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
}

.jh-btn-book:hover .jh-arrow {
  transform: translateX(3px);
}


/* =========================================
   4. INNOVATIVE MORPHING TOGGLE
   ========================================= */
.jh-morph-toggle {
  all: unset;
  display: none; /* Hidden on Desktop */
  cursor: pointer;
  align-items: center;
  gap: 12px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 40px; /* Pill Shape */
  padding: 8px 18px 8px 22px;
  color: var(--zenith-text);
  transition: all 0.5s cubic-bezier(0.65, 0, 0.05, 1);
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

/* Adjust colors when the header floats (white pill) */
.jh-zenith.is-floating .jh-morph-toggle {
  background-color: rgba(196, 18, 26, 0.05); 
  border-color: rgba(196, 18, 26, 0.15);
}

.jh-morph-toggle:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.jh-zenith.is-floating .jh-morph-toggle:hover {
  background-color: rgba(196, 18, 26, 0.1);
}

/* The "MENU" Text */
.jh-morph-text {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 2px;
  transition: all 0.4s cubic-bezier(0.65, 0, 0.05, 1);
  white-space: nowrap;
  opacity: 1;
  width: 42px; /* Fixed width for smooth collapse */
}

/* The Asymmetric Lines Container */
.jh-morph-icon {
  width: 22px;
  height: 14px;
  position: relative;
}

.jh-m-line {
  position: absolute;
  height: 2px;
  background-color: currentColor;
  border-radius: 2px;
  transition: all 0.4s cubic-bezier(0.65, 0, 0.05, 1);
}

.jh-m-line.top {
  top: 0;
  left: 0;
  width: 100%;
}

.jh-m-line.bottom {
  bottom: 0;
  right: 0;
  width: 65%; /* Elegant staggered look */
}

/* --- ACTIVE STATE: Morph Pill to Circle --- */
.jh-morph-toggle.is-active {
  gap: 0;
  padding: 12px; /* Collapses into a perfect circle */
  background-color: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--color-white);
  box-shadow: 0 4px 15px rgba(196, 18, 26, 0.3);
}

/* Shrink and hide text */
.jh-morph-toggle.is-active .jh-morph-text {
  width: 0;
  opacity: 0;
  transform: translateX(-10px);
}

/* Rotate lines to X */
.jh-morph-toggle.is-active .jh-m-line.top {
  top: 6px;
  width: 100%;
  transform: rotate(45deg);
}

.jh-morph-toggle.is-active .jh-m-line.bottom {
  bottom: 6px;
  width: 100%;
  transform: rotate(-45deg);
}


/* =========================================
   5. MOBILE SLIDE-OUT DRAWER
   ========================================= */
.jh-mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%; /* Hidden off-screen by default */
  width: 100%;
  max-width: 350px;
  height: 100vh;
  background-color: var(--color-white);
  z-index: 999; /* Below the header */
  transition: right 0.5s cubic-bezier(0.65, 0, 0.05, 1);
  padding: 100px var(--space-xl) var(--space-xl); 
  box-shadow: -10px 0 40px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.jh-mobile-drawer.is-open { right: 0; }

.jh-drawer-inner {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
}

.jh-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-m);
}

.jh-mobile-link {
  color: var(--color-black);
  font-family: var(--font-body);
  font-size: var(--h5-size);
  text-decoration: none;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 2px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
  padding-bottom: var(--space-xs);
  transition: color var(--transition-fast);
}

.jh-mobile-link:hover { color: var(--color-primary); }


/* =========================================
   6. RESPONSIVE LAYOUT RULES (No Cutoffs)
   ========================================= */
@media (max-width: 991px) {
  .left-flank, .desktop-only { display: none; }
  
  /* Topbar Mobile */
  .jh-topbar-inner { padding: 0 var(--space-m); }
  .jh-text-slider { width: 150px; } /* Fits nicely between icons on mobile */
  
  /* Header Mobile */
  .jh-zenith-inner {
    grid-template-columns: 1fr auto; /* Force 2 columns */
    padding: var(--space-s) var(--space-m);
    gap: var(--space-m);
    width: 100%;
  }
  
  .jh-center-brand {
    justify-content: flex-start;
    padding: 0;
  }
  
  .right-flank {
    width: auto;
    flex: 1;
    justify-content: flex-end;
  }
  
  .jh-morph-toggle {
    display: inline-flex; /* Activates the morphing toggle on mobile */
    margin-left: auto; /* Pushes nicely to the right edge */
  }
}