/* ============================================
   NAVBAR STYLES - Complete from UPLOAD IAM
   ============================================ */

/* 1. Header Topbar */
.topbar--fullbleed {
  position: relative;
  overflow: hidden;
  background: #00aeef;
  min-height: 36px;
  z-index: 10;
}

/* Lekukan Capsule/Tab Style - 100% Match */
.topbar--fullbleed::before,
.topbar--fullbleed::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  background: rgba(255, 255, 255, 0.15);
  pointer-events: none;
  z-index: 1;
}

.topbar--fullbleed::before {
  left: 0;
  border-radius: 0 50px 50px 0;
}

.topbar--fullbleed::after {
  right: 0;
  border-radius: 50px 0 0 50px;
}

.topbar__inner {
  max-width: var(--container-max-width, 1320px);
  margin: 0 auto;
  padding: 8px var(--container-padding, 24px);
  font-size: 0.85rem;
  color: var(--white, #ffffff);
  font-weight: 500;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 5;
}

.topbar-spacer {
  display: none;
}

/* CTA in topbar - override default cta-phone styles */
.cta-phone-topbar {
  position: relative !important;
  right: auto !important;
  background: rgba(255, 255, 255, 0.15) !important;
  border: 1px solid rgba(255, 255, 255, 0.3) !important;
  border-radius: 24px;
  padding: 4px 16px 4px 4px !important;
  flex-shrink: 0;
  z-index: 10;
  margin-left: 12px;
}

.cta-phone-topbar:hover {
  background: rgba(255, 255, 255, 0.25) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cta-phone-topbar .cta-label {
  color: rgba(255, 255, 255, 0.85) !important;
}

.cta-phone-topbar .cta-number {
  color: #ffffff !important;
}

.topbar-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--white, #ffffff);
  font-weight: 700;
  text-decoration: none;
  transition: all 0.2s ease;
  margin-left: 8px;
}

.topbar-cta:hover {
  text-decoration: underline;
  color: var(--white, #ffffff);
  opacity: 0.9;
}

/* Topbar Wave Decorations */
.topbar-wave-left,
.topbar-wave-right {
  position: absolute;
  top: 0;
  height: 100%;
  z-index: 2;
  pointer-events: none;
}

.topbar-wave-left {
  left: 0;
}

.topbar-wave-right {
  right: 0;
}

.topbar-wave-left svg,
.topbar-wave-right svg {
  height: 100%;
  width: auto;
  display: block;
}

/* ============================================
   NAVBAR
   ============================================ */
#navbar {
  background: var(--white, #ffffff);
  position: relative;
  z-index: 100;
  width: 100%;
}

/* ============================================
   HEADER MAIN - 2 Row Structure
   ============================================ */
.header-main {
  padding: 12px 0 0 0;
  background: transparent;
  position: relative;
  z-index: 50;
}

.header-main .container {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* ROW 1: Logo | Kategori Button | Search Center | Social Right */
.header-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 0px;
  padding-left: 0;
  padding-right: 0;
  position: relative;
  z-index: 55;
  width: 100%;
}

/* Logo + Tagline Group - Far Left */
.header-brand {
  display: flex;
  align-items: center;
  gap: 28px;
  font-family: var(--font-heading, sans-serif);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-cyan, #00aeef);
  text-decoration: none;
  flex-shrink: 0;
}

.header-brand img {
  height: 40px;
  width: auto;
}

/* Tagline - Desktop: inside nav row, absolute left */
.header-tagline-desktop {
  font-family: "Plus Jakarta Sans", sans-serif;
  font-size: 0.85rem !important;
  letter-spacing: 0em;
  color: #1f2937;
  font-weight: 700;
  line-height: 1.3 !important;
  white-space: nowrap;
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  padding: 0;
  z-index: 56;
}

/* Tagline - Mobile: hidden on desktop */
.header-tagline-mobile {
  display: none;
}

/* Global Search - Stretches Between Kategori btn and Social Icons */
.header-search-stretch {
  flex: 1 1 0%;
  min-width: 0;
  height: 44px !important;
  position: relative;
  margin: 0;
}

.header-search-stretch form {
  width: 100% !important;
  height: 100% !important;
  margin: 0 !important;
}

.header-search-stretch .search-input-wrapper {
  width: 100% !important;
  height: 44px !important;
  max-height: 44px !important;
}

.header-search-stretch .search-input {
  width: 100% !important;
  height: 44px !important;
  box-sizing: border-box !important;
}

/* Header Actions Group (Stack Social + CTA) */
.header-social-icons {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.social-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary-cyan, #00aeef);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: var(--cyan-600, #0891b2);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.3);
}

/* ============================================
   ROW 2: NAVBAR - White BG, Black Text
   ============================================ */
.header-navbar-inner {
  background: transparent;
  padding: 0;
  margin-top: -8px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-top: none;
  border-bottom: none;
  position: relative;
  width: 100%;
}

/* Navbar Links Container */
.navbar-nav-main {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 50px;
  /* flex: 1; Removed to prevent offset calculation */
  justify-content: center;
}

.navbar-nav-main li {
  position: relative;
}

/* Navbar Links - Black Text, White BG */
.nav-link-main {
  display: block;
  padding: 10px 0;
  font-family: var(--font-heading, sans-serif);
  font-weight: 600;
  font-size: 1rem;
  color: #1f2937;
  text-decoration: none;
  position: relative;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Hover Animation - Popup Effect */
.nav-link-main:hover {
  color: var(--primary-cyan, #00aeef);
  transform: translateY(-3px);
}

/* Animated Underline on Hover */
.nav-link-main::after {
  content: "";
  position: absolute;
  bottom: 6px;
  left: 50%;
  transform: translateX(-50%) scaleX(0);
  width: 100%;
  height: 3px;
  background: var(--primary-cyan, #00aeef);
  border-radius: 2px;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link-main:hover::after {
  transform: translateX(-50%) scaleX(1);
}

.nav-link-main.active {
  color: var(--primary-cyan, #00aeef);
  font-weight: 700;
}

.nav-link-main.active::after {
  transform: translateX(-50%) scaleX(1);
}

/* ============================================
   PHONE CTA - Design Spec Implementation
   ============================================ */
.cta-phone {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 20px 8px 8px;
  background: #f0f9ff;
  border-radius: 24px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid #e0f2fe;
  /* Absolute positioning to prevent shifting the centered nav */
  position: absolute;
  right: 0;
  white-space: nowrap;
}

.cta-phone:hover {
  background: #e0f2fe;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.2);
}

.cta-phone-icon {
  position: relative;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}

.cta-phone-icon svg {
  display: block;
  transition: transform 0.3s ease;
}

.cta-phone:hover .cta-phone-icon svg {
  transform: rotate(-10deg) scale(1.05);
}

.cta-phone-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  /* Restored gap per UPLOAD IAM reference */
}

.cta-phone-text .cta-label {
  font-size: 0.75rem;
  color: #6b7280;
  font-weight: 500;
  line-height: 1;
  font-family: var(--font-body);
  /* Poppins for label */
}

.cta-phone-text .cta-number {
  font-size: 0.95rem;
  color: #1f2937;
  font-weight: 700;
  line-height: 1;
  margin-top: 0;
  font-family: var(--font-heading);
  /* Plus Jakarta Sans for number */
}

/* ============================================
   NAV SEARCH
   ============================================ */
#navSearchContainer,
.header-search {
  flex: 1;
  max-width: 900px;
  margin: 0 32px;
  position: relative;
  overflow: visible;
  z-index: 100;
  display: flex;
  align-items: center;
  align-self: center;
  height: 44px;
}

/* Wrapper for input to hold icon - safely targeted */
.search-input-wrapper {
  position: relative !important;
  width: 100%;
  display: block !important;
  height: 44px !important;
  max-height: 44px !important;
}

.search-dropdown {
  position: absolute;
  top: 40px !important;
  left: 0;
  right: 0;
  margin-top: 0 !important;
  width: 100%;
  background: var(--white, #ffffff);
  border-radius: 0 0 12px 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--gray-200, #e5e7eb);
  border-top: none;
  overflow: hidden;
  z-index: 99999;
}

.search-input,
#globalSearchInput {
  width: 100%;
  height: 44px;
  padding: 0 46px 0 20px;
  border: 1px solid var(--gray-300, #d1d5db);
  border-radius: 999px;
  font-family: var(--font-body, sans-serif);
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: var(--gray-50, #f9fafb);
  color: var(--gray-900, #111827);
}

.search-input:focus,
#globalSearchInput:focus {
  outline: none;
  border-color: var(--primary-cyan, #00aeef);
  background: var(--white, #ffffff);
  box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.1);
}

.header-search-icon,
.search-icon {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray-500, #6b7280);
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.search-dropdown.hidden {
  display: none;
}

.search-item {
  padding: 12px 16px;
  cursor: pointer;
  transition: background 0.2s;
  border-bottom: 1px solid var(--gray-50, #f9fafb);
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: var(--cyan-50, #ecfeff);
}

.search-item-name {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--gray-900, #111827);
}

.search-item-price {
  font-size: 0.85rem;
  color: var(--primary-cyan, #00aeef);
}

.search-item-empty {
  padding: 16px;
  text-align: center;
  color: var(--gray-600, #4b5563);
  font-size: 0.9rem;
}

/* Autocomplete highlight for matched prefix/substring */
.ac-hi {
  color: #0d6efd;
  font-weight: 600;
}

/* ============================================
   MOBILE MENU MODAL
   ============================================ */
.mobile-menu-modal {
  position: fixed;
  top: 0;
  left: -100%;
  width: 280px;
  height: 100vh;
  background: white;
  z-index: 9999;
  transition: left 0.3s ease;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
}

.mobile-menu-modal.active {
  left: 0;
}

.menu-modal-header {
  padding: 20px;
  border-bottom: 1px solid var(--gray-200, #e5e7eb);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.menu-modal-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--gray-900, #111827);
  margin: 0;
}

.menu-close-btn {
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--gray-600, #4b5563);
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
}

.menu-close-btn:hover {
  color: var(--gray-900, #111827);
}

.menu-modal-content {
  padding: 0;
}

.menu-modal-content ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.menu-modal-content ul li {
  border-bottom: 1px solid var(--gray-100, #f3f4f6);
}

.menu-modal-content .nav-link {
  display: block;
  padding: 16px 20px;
  color: var(--gray-700, #374151);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s;
}

.menu-modal-content .nav-link:hover,
.menu-modal-content .nav-link.active {
  background: var(--cyan-50, #ecfeff);
  color: var(--primary-cyan, #00aeef);
  border-left: 4px solid var(--primary-cyan, #00aeef);
  padding-left: 16px;
}

/* Menu Overlay */
.menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  display: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ============================================
   RESPONSIVE - MOBILE/TABLET
   ============================================ */
@media (max-width: 768px) {
  .topbar-wave-left svg,
  .topbar-wave-right svg {
    opacity: 0.3;
    height: 80%;
  }

  .topbar__inner {
    padding: 12px var(--container-padding, 24px);
  }

  .topbar--fullbleed {
    text-align: center;
  }

  #navSearchContainer {
    margin: 0;
    width: 100%;
    margin-bottom: 12px;
    max-width: none;
    order: 3;
  }

  .header-row-top {
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
  }

  .header-brand {
    order: 1;
    gap: 6px;
    flex-direction: column;
    align-items: flex-start;
    flex-shrink: 0;
  }

  .header-brand img {
    height: 32px;
  }

  .header-tagline {
    display: block !important;
    position: static !important;
    height: auto !important;
    top: auto !important;
    font-size: 0.5rem !important;
    line-height: 1.3 !important;
    max-width: 100px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
    padding: 0;
  }

  .header-search-stretch {
    order: 3;
    width: 100%;
    max-width: none;
    min-width: 0;
    margin: 8px 0 0 0;
  }

  /* Social icons - 2 row grid for mobile */
  .header-social-icons {
    order: 2;
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 4px !important;
  }

  .header-social-icons .social-icon {
    width: 24px !important;
    height: 24px !important;
  }

  .header-social-icons .social-icon svg,
  .header-social-icons .social-icon i {
    width: 12px !important;
    height: 12px !important;
    font-size: 12px !important;
  }

  .header-navbar-inner {
    display: none;
  }

  .navbar-nav-main {
    display: none;
  }

  .cta-phone,
  .cta-phone-topbar {
    display: none !important;
  }

  .topbar-spacer {
    display: none;
  }

  .topbar__inner {
    justify-content: center;
  }

  .header-tagline-desktop {
    display: none !important;
  }

  .header-tagline-mobile {
    display: block !important;
    position: static !important;
    order: 2;
    width: 100%;
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    line-height: 1.4 !important;
    white-space: normal;
    overflow: visible;
    color: #1f2937;
    margin: 4px 0 2px 0;
    padding: 0;
  }
}

@media (min-width: 769px) {
  .mobile-menu-modal,
  .menu-overlay {
    display: none !important;
  }
}