/* =========================================
   Header — Navbar, Drawer & MegaMenu
   ========================================= */

.c-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  z-index: 1000;
  transition:
    background 0.4s ease,
    backdrop-filter 0.4s ease,
    box-shadow 0.4s ease;
}

.c-header--transparent {
  background: transparent;
}

.c-header--scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
}

.c-header__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--desktop-px);
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.c-header__logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
  z-index: 1001;
}

.c-header__logo-img {
  height: 75px;
  width: auto;
  display: block;
}
.c-header.c-header--transparent .c-header__logo-img {
  filter: brightness(0) invert(1);
}
.c-header.c-header--transparent.c-header--scrolled .c-header__logo-img {
  filter: none;
}
/* Nav */
.c-header__nav {
  display: flex;
  align-items: center;
  gap: 2.5rem;
  height: 100%;
  list-style: none;
}

.c-header__nav li {
  display: flex;
  align-items: center;
  height: 100%;
}

.c-header__link {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-white);
  transition: color 0.2s;
  position: relative;
  font-family: var(--font-heading);
}

.c-header--scrolled .c-header__link {
  color: var(--text-secondary);
}

.c-header__link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -5px;
  width: 0;
  height: 2px;
  background: var(--color-primary);
  transition: width 0.25s ease;
  border-radius: 2px;
}

.c-header__link:hover {
  color: var(--color-primary);
}
.c-header__link:hover::after {
  width: 100%;
}

.c-header__link--active {
  color: var(--color-primary);
}
.c-header__link--active::after {
  width: 100%;
}

/* Actions */
.c-header__actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.c-header__search-btn {
  background: transparent;
  border: 2px solid rgba(255, 255, 255, 0.3);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.c-header--scrolled .c-header__search-btn {
  color: var(--text-primary);
  border-color: rgba(0, 0, 0, 0.1);
}

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

/* Hamburger */
.c-header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 4px;
  z-index: 1001;
}

.c-header__hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-white);
  border-radius: 2px;
  transition:
    transform 0.3s,
    opacity 0.3s;
}

.c-header--scrolled .c-header__hamburger span {
  background: var(--text-primary);
}

.c-header__hamburger.is-open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.c-header__hamburger.is-open span:nth-child(2) {
  opacity: 0;
}

.c-header__hamburger.is-open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.c-header__drawer {
  display: none;
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(20px);
  padding: 1.5rem 2rem 2rem;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--gray-mid);
  z-index: 999;
  transform: translateY(-10px);
  opacity: 0;
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
}

.c-header__drawer.is-open {
  display: flex;
  transform: translateY(0);
  opacity: 1;
}

.c-header__drawer a {
  text-decoration: none;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--gray-mid);
  font-family: var(--font-heading);
}

.c-header__drawer .btn-outline {
  margin-top: 0.5rem;
  width: fit-content;
  display: inline-flex;
}

/* Mega Menu */
.c-header__has-mega {
  position: relative;
}

.c-header__mega-trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.c-header__mega-arrow {
  transition: transform 0.25s ease;
}

.c-header__has-mega:hover .c-header__mega-arrow,
.c-header__has-mega.is-open .c-header__mega-arrow {
  transform: rotate(180deg);
}

.c-mega-menu {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.1);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition:
    opacity 0.25s ease,
    visibility 0.25s ease,
    transform 0.25s ease;
  pointer-events: none;
}

.c-header__has-mega:hover .c-mega-menu,
.c-header__has-mega.is-open .c-mega-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.c-mega-menu__inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 2.5rem var(--desktop-px);
  display: flex;
  gap: 0;
  justify-content: center;
}

.c-mega-menu__col-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 1rem;
  font-family: var(--font-heading);
}

.c-mega-menu__categories {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  gap: 1.25rem;
}

.c-mega-menu__cat-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.c-mega-menu__cat-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.c-mega-menu__cat-item:hover {
  background: rgba(16, 117, 189, 0.05);
}

.c-mega-menu__cat-icon {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  background: rgba(16, 117, 189, 0.08);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  font-size: 0.9rem;
}

.c-mega-menu__cat-item strong {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.c-mega-menu__cat-item em {
  display: block;
  font-size: 0.75rem;
  font-style: normal;
  color: var(--gray-text);
  margin-top: 0.1rem;
}

.c-mega-menu__divider {
  width: 1px;
  background: rgba(0, 0, 0, 0.07);
  margin: 0 2rem;
  flex-shrink: 0;
}

.c-mega-menu__featured {
  flex: 0 0 300px;
}

.c-mega-menu__featured-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.c-mega-menu__feat-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.625rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 0, 0, 0.05);
  text-decoration: none;
  transition: all 0.3s ease;
  background: #f9fafb;
}

.c-mega-menu__feat-card:hover {
  border-color: var(--color-primary);
  background: var(--color-white);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

.c-mega-menu__feat-img {
  width: 68px;
  height: 52px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}

.c-mega-menu__feat-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.c-mega-menu__feat-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  background: var(--color-primary);
  color: var(--color-white);
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  margin-bottom: 0.3rem;
}

.c-mega-menu__feat-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.c-mega-menu__feat-sub {
  font-size: 0.72rem;
  color: var(--gray-text);
  margin-top: 0.15rem;
}

.c-mega-menu__view-all {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-primary);
  text-decoration: none;
  transition: gap 0.2s;
  font-family: var(--font-heading);
}

.c-mega-menu__view-all:hover {
  gap: 0.65rem;
}

/* Search Overlay */
.c-search-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
}

.c-search-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.c-search-overlay__inner {
  width: 100%;
  max-width: 700px;
  padding: 0 2rem;
}

.c-search-overlay__box {
  position: relative;
  display: flex;
  align-items: center;
  border-bottom: 2px solid rgba(0, 0, 0, 0.1);
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.c-search-overlay__icon {
  color: var(--color-primary);
  margin-right: 1rem;
  flex-shrink: 0;
}

.c-search-overlay__input {
  flex: 1;
  background: transparent;
  border: none;
  font-size: clamp(1.5rem, 2vw, 2.5rem);
  font-weight: 700;
  color: var(--text-primary);
  outline: none;
  font-family: var(--font-heading);
}

.c-search-overlay__input::placeholder {
  color: rgba(0, 0, 0, 0.2);
}

.c-search-overlay__close {
  background: transparent;
  border: none;
  color: var(--text-primary);
  cursor: pointer;
  padding: 0.5rem;
  transition:
    transform 0.3s ease,
    color 0.3s ease;
}

.c-search-overlay__close:hover {
  transform: rotate(90deg);
  color: var(--color-primary);
}

.c-search-overlay__suggestions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.c-search-overlay__suggest-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.4);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-heading);
}

.c-search-overlay__suggestions a {
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.c-search-overlay__suggestions a:hover {
  color: var(--color-primary);
}

/* Float Sidebar */
.c-float-sidebar {
  position: fixed;
  right: 20px;
  bottom: 50%;
  transform: translateY(50%);
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.c-float-sidebar__btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 52px;
  height: 52px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  color: var(--color-white);
  border-radius: 14px;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease,
    box-shadow 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 1.1rem;
}

.c-float-sidebar__btn--phone {
  background-color: var(--color-primary);
}
.c-float-sidebar__btn--email {
  background-color: #0891b2;
}
.c-float-sidebar__btn--whatsapp {
  background-color: #10b981;
}
.c-float-sidebar__btn--top {
  background-color: var(--color-white);
  color: var(--text-secondary);
  border: 1px solid #e5e7eb;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s ease;
}
.c-float-sidebar__btn--top.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.c-float-sidebar__btn:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.c-float-sidebar__label {
  font-size: 0.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1;
}

@media (max-width: 768px) {
  .c-header__inner {
    gap: 2rem;
    padding: 0 var(--mobile-px);
  }
  .c-header__actions {
    margin-left: auto;
  }
  .c-search-overlay__inner {
    padding: 0 1rem;
  }
  .c-header__nav {
    display: none;
  }
  .c-header__actions .btn-outline {
    display: none;
  }
  .c-header__hamburger {
    display: flex;
  }
  .c-float-sidebar {
    right: 12px;
    bottom: 80px;
    top: auto;
    transform: none;
    gap: 8px;
  }
  .c-float-sidebar__btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 0.95rem;
  }
  .c-search-overlay__close {
    margin-left: 1rem;
  }
  .c-search-overlay__input {
    width: 80%;
  }
}
