/* ============================================================
   nav.css – Co-Operative Hospital Kattappana
   TWO-ROW NAVBAR:
   Row 1 (top-bar)  – quick links left | social icons right
   Row 2 (main-bar) – logo left | nav center | actions right
   UPDATED: CIMS colors, typography and favicon-ready logo image
   ============================================================ */

/* ── BASE RESET ── */
*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: var(--font-primary, "Raleway", Arial, sans-serif);
}

/* ============================================================
   HEADER WRAPPER
   ============================================================ */
.site-header {
  background-color: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 12px rgba(5, 28, 92, 0.06);
  transition: box-shadow 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 4px 24px rgba(5, 28, 92, 0.12);
}

/* ============================================================
   ROW 1 – TOP BAR
   ============================================================ */
.top-bar {
  background-color: #f6faff;
  border-bottom: 1px solid #dfe8ff;
  padding: 7px 0;
}

.top-bar-nav {
  display: flex;
  align-items: center;
  gap: 0;
}

.top-bar-link {
  font-family: var(--font-primary, "Raleway", Arial, sans-serif);
  font-size: 0.72rem;
  font-weight: 400;
  color: #000000;
  text-decoration: none;
  padding: 0 14px;
  border-right: 1px solid #dfe8ff;
  line-height: 1;
  white-space: nowrap;
  transition: color 0.2s;
}

.top-bar-link:first-child {
  padding-left: 0;
}

.top-bar-link:last-child {
  border-right: none;
}

.top-bar-link:hover {
  color: #6edb5e;
}

.top-bar-emergency {
  color: #051c5c;
  font-weight: 500;
}

.top-bar-emergency:hover {
  color: #6edb5e;
}

.top-bar-socials {
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-bar-social {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #051c5c;
  font-size: 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  transition: color 0.2s, background-color 0.2s;
}

.top-bar-social:hover {
  color: #051c5c;
  background-color: #e9ffe7;
}

/* ============================================================
   ROW 2 – MAIN BAR
   ============================================================ */
.main-bar {
  background-color: #ffffff;
  padding: 0;
}

.main-bar .container {
  padding-top: 14px;
  padding-bottom: 14px;
}

/* ── LOGO ── */
.header-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  line-height: 1;
}

.logo-img-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  max-width: 210px;
}

.logo-img {
  display: block;
  width: auto;
  max-width: 100%;
  height: 54px;
  object-fit: contain;
}

/* Optional old logo text support */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.logo-name {
  font-family: "Raleway", "Raleway", Arial, sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #051c5c;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.logo-location {
  font-family: var(--font-primary, "Raleway", Arial, sans-serif);
  font-size: 0.67rem;
  font-weight: 400;
  color: #3f75ed;
  letter-spacing: 0.04em;
}

/* ── DESKTOP NAV LINKS ── */
.desktop-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.desktop-nav .nav-link {
  font-family: "Raleway", "Raleway", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #051c5c;
  padding: 8px 13px;
  border-radius: 4px;
  text-decoration: none;
  position: relative;
  transition: color 0.22s ease, background-color 0.22s ease;
}

.desktop-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 3px;
  left: 13px;
  right: 13px;
  height: 2px;
  background-color: #6edb5e;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.22s ease;
}

.desktop-nav .nav-link:hover {
  color: #6edb5e;
  background-color: #e9ffe7;
}

.desktop-nav .nav-link:hover::after,
.desktop-nav .nav-link.active::after {
  transform: scaleX(1);
}

.desktop-nav .nav-link.active {
  color: #3f75ed;
}

/* ── EMERGENCY BUTTON ── */
.emergency-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: "Raleway", "Raleway", Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #051c5c;
  background-color: #6edb5e;
  border: none;
  border-radius: 6px;
  padding: 9px 16px;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.25s, transform 0.2s, color 0.25s;
}

.emergency-btn:hover {
  background-color: #051c5c;
  color: #ffffff;
  transform: translateY(-1px);
}

.emergency-btn i {
  font-size: 0.82rem;
}

/* ============================================================
   HAMBURGER – nav-icon1 pattern
   ============================================================ */
#nav-icon1 {
  width: 26px;
  height: 20px;
  position: relative;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: 0.4s ease-in-out;
  transition: 0.4s ease-in-out;
}

#nav-icon1 span {
  display: block;
  position: absolute;
  height: 2px;
  width: 100%;
  background-color: #051c5c;
  border-radius: 3px;
  opacity: 1;
  left: 0;
  -webkit-transform: rotate(0deg);
  transform: rotate(0deg);
  -webkit-transition: 0.25s ease-in-out;
  transition: 0.25s ease-in-out;
}

#nav-icon1 span:nth-child(1) {
  top: 0;
}

#nav-icon1 span:nth-child(2) {
  top: 9px;
}

#nav-icon1 span:nth-child(3) {
  top: 18px;
}

#nav-icon1.open span:nth-child(1) {
  top: 9px;
  -webkit-transform: rotate(135deg);
  transform: rotate(135deg);
}

#nav-icon1.open span:nth-child(2) {
  opacity: 0;
  left: -26px;
}

#nav-icon1.open span:nth-child(3) {
  top: 9px;
  -webkit-transform: rotate(-135deg);
  transform: rotate(-135deg);
}

/* ============================================================
   MOBILE MENU DRAWER
   ============================================================ */
.mobile-menu {
  background-color: #ffffff;
  border-top: 1px solid #dfe8ff;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.mobile-menu.open {
  max-height: 520px;
  padding-bottom: 12px;
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  padding: 6px 16px 0;
}

.mobile-link {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-primary, "Raleway", Arial, sans-serif);
  font-size: 0.9rem;
  font-weight: 400;
  color: #000000;
  padding: 13px 14px;
  border-radius: 6px;
  text-decoration: none;
  border-bottom: 1px solid #dfe8ff;
  transition: background-color 0.2s, color 0.2s;
}

.mobile-link:last-child {
  border-bottom: none;
}

.mobile-link i {
  color: #3f75ed;
  font-size: 1rem;
  width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.mobile-link:hover {
  background-color: #e9ffe7;
  color: #051c5c;
}

.mobile-link.active {
  color: #051c5c;
  font-weight: 500;
  background-color: #e9ffe7;
}

.mobile-link.emergency-mobile {
  color: #051c5c;
  font-weight: 500;
  margin-top: 4px;
  background-color: #e9ffe7;
  border-bottom: none;
}

.mobile-link.emergency-mobile i {
  color: #6edb5e;
}

.mobile-link.emergency-mobile:hover {
  background-color: #6edb5e;
  color: #051c5c;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1199px) {
  .desktop-nav .nav-link {
    font-size: 0.7rem;
    padding: 8px 9px;
    letter-spacing: 0.06em;
  }

  .logo-img-wrap {
    max-width: 180px;
  }

  .logo-img {
    height: 50px;
  }
}

@media (max-width: 991px) {
  .main-bar .container {
    padding-top: 12px;
    padding-bottom: 12px;
  }

  .main-bar .row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
  }

  .main-bar .col-auto:first-child {
    flex: 0 1 auto;
    min-width: 0;
  }

  .main-bar .col-auto.d-flex.align-items-center.gap-3 {
    flex: 0 0 auto;
    margin-left: auto;
    justify-content: flex-end;
    gap: 12px !important;
  }

  .header-logo {
    margin-right: auto;
    max-width: 180px;
  }

  .logo-img-wrap {
    max-width: 180px;
  }

  .logo-img {
    height: 46px;
  }

  #nav-icon1 {
    margin-left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

@media (max-width: 575px) {
  .top-bar {
    padding: 6px 0;
  }

  .top-bar-link {
    font-size: 0.66rem;
    padding: 0 8px;
  }

  .top-bar-link:nth-child(2) {
    display: none;
  }

  .top-bar-social {
    width: 24px;
    height: 24px;
    font-size: 0.78rem;
  }

  .main-bar .container {
    padding-top: 10px;
    padding-bottom: 10px;
  }

  .header-logo {
    max-width: 145px;
  }

  .logo-img-wrap {
    max-width: 145px;
  }

  .logo-img {
    height: 40px;
  }

  .emergency-btn {
    padding: 8px 10px;
    font-size: 0.68rem;
  }
}

@media (max-width: 375px) {
  .header-logo {
    max-width: 125px;
  }

  .logo-img-wrap {
    max-width: 125px;
  }

  .logo-img {
    height: 36px;
  }

  .emergency-btn {
    padding: 7px 9px;
  }

  .main-bar .col-auto.d-flex.align-items-center.gap-3 {
    gap: 9px !important;
  }
}
