/* ============================================================
   DENTAL EXPERTS CLINIC — HEADER CSS
   ============================================================ */

/* ── Variables (inherit from global) ──────────────────────── */
:root {
  --hdr-navy:    #001f3f;
  --hdr-gold:    #f5c518;
  --hdr-gold-dk: #c99800;
  --hdr-white:   #ffffff;
  --hdr-cream:   #f9f7f0;
  --hdr-trans:   all .22s ease;
}

/* ── Top bar ───────────────────────────────────────────────── */
.header-topbar {
  background: var(--hdr-navy);
  padding: 7px 0;
  font-size: .8rem;
}
.header-topbar .container { display: flex; justify-content: space-between; align-items: center; }
.topbar-left  { display: flex; gap: 20px; }
.topbar-left a, .topbar-right .award-badge {
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: color .2s;
}
.topbar-left a:hover { color: var(--hdr-gold); }
.award-badge { font-size: .75rem; color: var(--hdr-gold) !important; font-weight: 600; }

/* ── Main header row ──────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--hdr-white); box-shadow: 0 2px 12px rgba(0,0,0,.1); }

.header-main { background: var(--hdr-white); position: relative; }

.header-inner {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 0;
}

/* ── Logo ─────────────────────────────────────────────────── */
.header-logo { flex-shrink: 0; }
.header-logo a { display: flex; align-items: center; text-decoration: none; }
.header-logo img { height: 54px; width: auto; display: block; }
.text-logo {
  display: flex; align-items: center; gap: 10px; text-decoration: none;
}
.logo-s {
  width: 44px; height: 44px; border-radius: 10px;
  background: linear-gradient(135deg, var(--hdr-navy), #003d80);
  color: var(--hdr-gold); font-weight: 900; font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.text-logo strong { display: block; font-size: .85rem; color: var(--hdr-navy); line-height: 1.1; }
.text-logo span   { display: block; font-size: .65rem; color: #888; letter-spacing: .1em; }

/* ── Desktop Nav ──────────────────────────────────────────── */
.header-nav {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.nav-link {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  font-size: .875rem; font-weight: 600;
  color: var(--hdr-navy); text-decoration: none;
  white-space: nowrap;
  transition: var(--hdr-trans);
  border-radius: 6px;
}
.nav-link:hover { color: var(--hdr-gold-dk); background: rgba(0,31,63,.04); }

.nav-arrow { font-size: 1.40rem; opacity: .6; }

/* ── Dropdown (Clinic) ────────────────────────────────────── */
.has-dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 200px; background: var(--hdr-white);
  border-radius: 10px; box-shadow: 0 8px 32px rgba(0,31,63,.15);
  border-top: 3px solid var(--hdr-gold);
  list-style: none; padding: 8px 0; margin: 0;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 200;
}
.has-dropdown:hover .dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.dropdown-menu li a {
  display: block; padding: 9px 18px;
  font-size: .875rem; color: var(--hdr-navy);
  text-decoration: none; transition: var(--hdr-trans);
}
.dropdown-menu li a:hover { background: var(--hdr-cream); color: var(--hdr-gold-dk); padding-left: 24px; }

/* ── Mega menu (Our Treatments) ───────────────────────────── */
.has-megamenu { position: static; }
.mega-menu {
  position: absolute; left: 0; right: 0;
  top: 100%;
  background: var(--hdr-white);
  box-shadow: 0 12px 40px rgba(0,31,63,.15);
  border-top: 3px solid var(--hdr-gold);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 200;
}
.has-megamenu:hover .mega-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.mega-menu-inner {
  display: flex; padding: 24px 32px; gap: 0;
  max-width: 1200px; margin: 0 auto;
}
.mega-col {
  flex: 1; padding: 0 20px;
  border-right: 1px solid rgba(0,31,63,.07);
}
.mega-col:last-child { border-right: none; }
.mega-col-title {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--hdr-navy);
  padding-bottom: 7px; margin: 0 0 8px;
  border-bottom: 2px solid var(--hdr-gold);
}
.mega-col-title.mt-2 { margin-top: 16px; }
.mega-col ul { list-style: none; padding: 0; margin: 0; }
.mega-col ul li a {
  display: block; padding: 5px 0;
  font-size: .83rem; color: #444;
  text-decoration: none; transition: var(--hdr-trans);
}
.mega-col ul li a:hover { color: var(--hdr-navy); padding-left: 6px; }
.mega-view-all {
  display: inline-block;
  background: var(--hdr-navy); color: var(--hdr-white) !important;
  padding: 7px 16px; border-radius: 20px;
  font-size: .78rem; font-weight: 700; text-decoration: none;
  transition: var(--hdr-trans);
}
.mega-view-all:hover { background: var(--hdr-gold-dk); }

/* ── Desktop CTA ──────────────────────────────────────────── */
.header-cta {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
}
.btn-call {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--hdr-gold), var(--hdr-gold-dk));
  color: var(--hdr-navy); font-weight: 700; font-size: .85rem;
  padding: 9px 20px; border-radius: 30px; text-decoration: none;
  white-space: nowrap; transition: var(--hdr-trans);
  box-shadow: 0 3px 12px rgba(245,197,24,.3);
}
.btn-call:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(245,197,24,.4); }
.btn-whatsapp {
  width: 38px; height: 38px; border-radius: 50%;
  background: #25d366; display: flex; align-items: center; justify-content: center;
  text-decoration: none; flex-shrink: 0; transition: var(--hdr-trans);
  box-shadow: 0 2px 10px rgba(37,211,102,.35);
}
.btn-whatsapp img { width: 40px; height: 40px; }
.btn-whatsapp:hover { transform: translateY(-2px) scale(1.08); }

/* ── Action Bar ───────────────────────────────────────────── */
.header-actions {
  background: var(--hdr-cream);
  border-top: 1px solid rgba(0,31,63,.1);
  padding: 8px 0;
}
.action-buttons { display: flex; justify-content: center; }
.btn-appointment-solo {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, var(--hdr-gold), var(--hdr-gold-dk));
  color: var(--hdr-navy) !important; font-weight: 700; font-size: .92rem;
  padding: 10px 34px; border-radius: 30px; text-decoration: none;
  box-shadow: 0 4px 14px rgba(201,152,0,.3);
  transition: transform .2s ease, box-shadow .2s ease;
  border: none; cursor: pointer;
}
.btn-appointment-solo:hover {
  transform: translateY(-2px);
  box-shadow: 0 7px 22px rgba(201,152,0,.4);
}

/* ── Hamburger button ─────────────────────────────────────── */
.mobile-toggle {
  display: none;              /* hidden on desktop */
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px; height: 40px;
  border: none; background: transparent; cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  flex-shrink: 0;
  margin-left: auto;          /* pushes it to the far right */
}
.mobile-toggle span {
  display: block;
  width: 24px; height: 2px;
  background: var(--hdr-navy);
  border-radius: 2px;
  transition: transform .3s ease, opacity .3s ease;
  transform-origin: center;
}
.mobile-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.mobile-toggle.active span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.mobile-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Close button inside nav panel ───────────────────────── */
.nav-close-btn { display: none; }

/* ── Floating contacts ────────────────────────────────────── */
.floating-contacts {
  position: fixed; right: 18px; bottom: 90px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 900;
}
.float-btn {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; box-shadow: 0 4px 14px rgba(0,0,0,.2);
  transition: var(--hdr-trans);
}
.float-btn:hover { transform: translateY(-3px); }
.float-whatsapp { background: #25d366; }
.float-email    { background: var(--hdr-navy); }
.float-btn img  { width: 50px; height: 50px; }

/* ============================================================
   MOBILE (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {

  /* Top bar hidden on mobile */
  .header-topbar { display: none; }

  /* Header row */
  .header-inner {
    padding: 10px 0;
    gap: 0;
  }

  /* Logo keeps normal size */
  .header-logo img { height: 44px; }

  /* Desktop CTA hidden */
  .header-cta { display: none; }

  /* Hamburger visible, pushed to far right */
  .mobile-toggle {
    display: flex;
    margin-left: auto;    /* KEY: pushes to far right regardless of flex siblings */
    order: 99;            /* always last */
  }

  /* ── Slide-in nav drawer ────────────────────── */
  .header-nav {
    position: fixed;
    top: 0; left: -100%;
    width: 78%; max-width: 300px;
    height: 100dvh;           /* full viewport height */
    background: var(--hdr-white);
    z-index: 10000;           /* above everything */
    overflow-y: auto;
    padding: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.18);
    transition: left .3s cubic-bezier(.4,0,.2,1);
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
  }
  .header-nav.open { left: 0; }

  /* Close × button at top of nav drawer */
  .nav-close-btn {
    display: flex;
    align-items: center; justify-content: flex-end;
    width: 100%; padding: 16px 18px;
    background: var(--hdr-navy); border: none; cursor: pointer;
    color: var(--hdr-white); font-size: 1.2rem; font-weight: 700;
    flex-shrink: 0;
  }
  .nav-close-btn:hover { background: #002a5c; }

  /* Nav list */
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 0;
  }
  .nav-item { border-bottom: 1px solid rgba(0,31,63,.07); }

  .nav-link {
    padding: 14px 20px;
    font-size: .95rem;
    justify-content: space-between;
    border-radius: 0;
  }
  .nav-link:hover { background: rgba(0,31,63,.04); }

  /* Arrow inside nav-link on mobile */
  .nav-arrow {
    display: inline-block;
    transition: transform .25s ease;
    font-size: 1.1rem;
  }
  .has-dropdown.open > .nav-link .nav-arrow,
  .has-megamenu.open > .nav-link .nav-arrow {
    transform: rotate(180deg);
  }

  /* ── Mobile dropdown (Clinic) ─────────────── */
  .has-dropdown { position: static; }
  .dropdown-menu {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none;
    border-left: 3px solid var(--hdr-gold);
    margin: 0 0 4px 20px;
    padding: 4px 0;
    border-radius: 0;
    max-height: 0; overflow: hidden;
    transition: max-height .3s ease;
  }
  .has-dropdown.open .dropdown-menu { max-height: 400px; }
  .dropdown-menu li a {
    padding: 9px 16px;
    font-size: .875rem;
  }
  .dropdown-menu li a:hover { padding-left: 22px; }

  /* ── Mobile mega menu (Our Treatments) ────── */
  .has-megamenu { position: static; }
  .mega-menu {
    position: static;
    opacity: 1; visibility: visible; transform: none;
    box-shadow: none; border: none;
    border-left: 3px solid var(--hdr-gold);
    background: transparent;
    margin: 0 0 4px 20px;
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  .has-megamenu.open .mega-menu { max-height: 1400px; }
  .mega-menu-inner {
    flex-direction: column; padding: 8px 0; gap: 0;
  }
  .mega-col {
    border-right: none;
    border-bottom: 1px solid rgba(0,31,63,.07);
    padding: 8px 12px;
  }
  .mega-col:last-child { border-bottom: none; }
  .mega-col-title { font-size: .68rem; }
  .mega-col ul li a { padding: 5px 0; font-size: .83rem; }
  .mega-view-all { font-size: .78rem; padding: 6px 14px; }

  /* Action bar */
  .btn-appointment-solo { padding: 9px 22px; font-size: .88rem; }

  /* Floating contacts move up when mobile bottom bar present */
  .floating-contacts { bottom: 80px; right: 12px; }
  .float-btn { width: 44px; height: 44px; }
}


