/**
 * PEC Header & Navigation - Prakasam Engineering College
 */

/* ========== WRAPPER: absolute over hero; sticky after 1s scroll ========== */
.pec-header-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.pec-header-wrapper > * {
  pointer-events: auto;
}

/* Sticky: fixed at top, white background, top bar hidden, slide-down animation */
.pec-header-wrapper.pec-header-sticky {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 2px 16px rgba(0,0,0,0.08);
  animation: pecHeaderSlideDown 0.5s ease forwards;
}

@keyframes pecHeaderSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0.95;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* When sticky: hide top bar smoothly */
.pec-header-wrapper.pec-header-sticky .pec-topbar {
  max-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  margin: 0;
  overflow: hidden;
  opacity: 0;
  border-bottom-width: 0;
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease, border 0.3s ease;
}

.pec-topbar {
  transition: max-height 0.4s ease, padding 0.4s ease, opacity 0.3s ease, border 0.3s ease;
}

.pec-header-wrapper.pec-header-sticky .pec-header {
  background: transparent;
}

.pec-header-wrapper.pec-header-sticky .pec-logo img {
  filter: none;
}

.pec-header-wrapper.pec-header-sticky .pec-nav-list {
  background: transparent;
  border-color: transparent;
  padding: 0;
}

.pec-header-wrapper.pec-header-sticky .pec-nav-item > a {
  color: #31353D;
}

.pec-header-wrapper.pec-header-sticky .pec-nav-item > a:hover {
  color: #be0000;
}

.pec-header-wrapper.pec-header-sticky .pec-btn-apply {
  background: #be0000;
  border-color: #be0000;
  color: #fff;
}

.pec-header-wrapper.pec-header-sticky .pec-btn-apply:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

.pec-header-wrapper.pec-header-sticky .pec-mobile-toggle {
  background: #fff;
  border-color: #ddd;
  color: #31353D;
}

.pec-header-wrapper.pec-header-sticky .pec-mobile-toggle:hover {
  background: #f5f5f5;
  color: #be0000;
  border-color: #ccc;
}

/* Mega menu: no sticky top override – uses top: 100% of header so no gap */

/* ========== TOP BAR ========== */
.pec-topbar {
  background: transparent;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  max-height: 80px;
  overflow: visible;
}

.pec-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1320px;
  margin: 0 auto;
  padding: 8px 15px;
  padding-left: 15px;
  padding-right: 15px;
}

.pec-topbar-left {
  flex: 1;
  min-width: 0;
}

/* Top bar – Latest News slider (left) */
.pec-topbar-news {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 100%;
}

.pec-topbar-news-label {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pec-red, #be0000);
  flex-shrink: 0;
}

.pec-topbar-news-slider-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.pec-topbar-news-prev,
.pec-topbar-news-next {
  width: 28px;
  height: 28px;
  padding: 0;
  border: none;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.06);
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.2s, color 0.2s;
}

.pec-topbar-news-prev:hover,
.pec-topbar-news-next:hover {
  background: var(--pec-red, #be0000);
  color: #fff;
}

.pec-topbar-news-prev i,
.pec-topbar-news-next i {
  font-size: 10px;
}

.pec-topbar-news-swiper {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.pec-topbar-news-swiper .swiper-slide {
  height: auto;
  display: flex;
  align-items: center;
}

.pec-topbar-news-link {
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  text-decoration: none;
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.pec-topbar-news-link:hover {
  color: var(--pec-red, #be0000);
}

@media (max-width: 991px) {
  .pec-topbar-news {
    display: none;
  }
}

.pec-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.pec-topbar-quick-link {
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  padding: 4px 10px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.pec-topbar-quick-link:hover {
  color: #be0000;
  background: rgba(0,0,0,0.05);
}

.pec-topbar-quick-links {
  display: none;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  margin-right: 12px;
}

@media (min-width: 992px) {
  .pec-topbar-quick-links {
    display: flex;
  }
}

.pec-offcanvas-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.pec-offcanvas-quick-link {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}

.pec-offcanvas-quick-link:hover {
  color: var(--pec-red, #be0000);
}

.pec-topbar-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
}

@media (min-width: 992px) {
  .pec-topbar-list {
    display: flex;
    align-items: center;
    gap: 4px;
  }
}

.pec-topbar-item {
  position: relative;
  margin: 0;
}

.pec-topbar-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 12px;
  font-size: 15px;
  font-weight: 500;
  color: #1a1a1a;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s, background 0.2s;
  font-family: inherit;
}

.pec-topbar-link:hover {
  color: #be0000;
  background: rgba(0,0,0,0.05);
}

.pec-topbar-arrow {
  font-size: 10px;
  transition: transform 0.2s;
}

.pec-topbar-dropdown.is-open .pec-topbar-arrow {
  transform: rotate(180deg);
}

.pec-topbar-sub {
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 200px;
  margin: 0;
  padding: 8px 0;
  list-style: none;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border-radius: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 1002;
}

.pec-topbar-dropdown.is-open .pec-topbar-sub {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.pec-topbar-sub li {
  margin: 0;
}

.pec-topbar-sub a {
  display: block;
  padding: 8px 16px;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.pec-topbar-sub a:hover {
  background: #f5f5f5;
  color: #be0000;
}

.pec-btn-login {
  display: inline-flex;
  align-items: center;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 4px;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pec-topbar .pec-btn-login {
  color: #fff;
  background: #be0000;
  border-color: #be0000;
}

.pec-topbar .pec-btn-login:hover {
  background: #1a1a1a;
  border-color: #1a1a1a;
  color: #fff;
}

/* ========== HEADER BAR (transparent) ========== */
.pec-header {
  position: relative;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.pec-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 42px 0;
  max-width: 1320px;
  margin: 0 auto;
  padding-left: 15px;
  padding-right: 15px;
}

.pec-header-wrapper.pec-header-sticky .pec-header-inner {
  padding: 12px 0;
}

.pec-logo a {
  display: block;
}

.pec-logo img {
  max-height: 75px;
  width: auto;
  display: block;
}

/* White logo on transparent header (visible over hero) */
.pec-header-wrapper .pec-logo img {
  /*filter: brightness(0) invert(1);*/
}

/* ========== DESKTOP NAV ========== */
.pec-nav-wrap {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pec-nav {
  display: none;
}

@media (min-width: 992px) {
  .pec-nav {
    display: block;
  }

  .pec-nav-list {
    list-style: none;
    margin: 0;
    padding: 0 6px;
    min-height: 44px;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: var(--pec-radius, 16px);
  }

  .pec-nav-item {
    position: static;
    margin: 0;
  }

  .pec-nav-item > a {
    display: flex;
    align-items: center;
    padding: 0 14px;
    min-height: 44px;
    font-size: 17px;
    font-weight: 700;
    color: #be0000;
    text-decoration: none;
    transition: color 0.2s;
  }

  .pec-nav-item > a:hover {
    color: #1a1a1a;
  }

  .pec-nav-item.has-dropdown > a .pec-arrow {
    margin-left: 4px;
    font-size: 10px;
    opacity: 0.8;
  }

  /* Desktop: hide flattened sub (used only in mobile offcanvas) */
  .pec-nav .pec-sub {
    display: none;
  }

  /* Apply Now button (transparent header style) */
  .pec-btn-apply {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 20px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background: var(--pec-red, #be0000);
    border: 1px solid var(--pec-red, #be0000);
    border-radius: var(--pec-radius, 16px);
    text-decoration: none;
    transition: background 0.2s, border-color 0.2s;
    white-space: nowrap;
  }

  .pec-btn-apply:hover {
    background: var(--pec-black, #1a1a1a);
    border-color: var(--pec-black, #1a1a1a);
    color: #fff;
  }

  /* ========== MEGA MENU (desktop) – flush under header, no gap ========== */
  .pec-mega {
    position: absolute;
    top: 100%;
    left: 50%;
    width: 100%;
    max-width: 1200px;
    margin-left: 0;
    transform: translateX(-50%) translateY(-10px);
    background: #fff;
    box-shadow: 0 10px 40px rgba(0,0,0,0.12);
    border-radius: 6px;
    padding: 24px 20px;
    z-index: 9998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
    box-sizing: border-box;
  }

  .pec-nav-item.has-dropdown.is-open .pec-mega,
  .pec-mega.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) translateY(0);
  }

  .pec-mega-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 24px 32px;
  }

  .pec-mega-col {
    min-width: 180px;
    flex: 1 1 0;
  }

  .pec-mega-heading {
    font-size: 17px;
    font-weight: 600;
    color: #31353D;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #eee;
  }

  .pec-mega-links {
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .pec-mega-links li {
    margin: 0;
  }

  .pec-mega-links a {
    display: flex;
    align-items: center;
    padding: 6px 0;
    font-size: 15px;
    color: #555;
    text-decoration: none;
    transition: color 0.2s, padding-left 0.2s;
  }

  .pec-mega-links a:hover {
    color: #be0000;
    padding-left: 4px;
  }

  .pec-mega-links a .pec-link-icon {
    flex-shrink: 0;
    width: 18px;
    margin-right: 8px;
    font-size: 10px;
    color: #be0000;
  }
}

/* ========== MOBILE: Hamburger (transparent header) ========== */
.pec-mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: 4px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.pec-mobile-toggle:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-color: rgba(255,255,255,0.8);
}

/* Hero starts from top: first section has no margin */
.pec-hero-from-top {
  margin-top: 0 !important;
  padding-top: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
}

.pec-hero-from-top .container {
  padding-top: 120px;
  padding-bottom: 40px;
}

/* ========== HERO SECTION (bar overlays banner) ========== */
.pec-hero-section {
  position: relative;
}

/* Bar over top of banner: absolute, same background as former header */
.pec-banner-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  height: 286px;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, #fff 0%, rgba(255, 255, 255, 0.5) 50%, transparent 100%);
}

/* Light red overlay over banner (theme red tint) - inside carousel so it sits above slides but below arrows/indicators */
#pecHeroSlider .pec-hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--pec-red-overlay, rgba(190, 0, 0, 0.08));
}

@media (min-width: 992px) {
  .pec-mobile-toggle {
    display: none;
  }
}

/* Mobile: smaller Apply Now button */
@media (max-width: 991px) {
  .pec-btn-apply {
    display: inline-flex !important;
    align-items: center;
    gap: 4px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    background: var(--pec-red, #be0000);
    border: 1px solid var(--pec-red, #be0000);
    border-radius: var(--pec-radius, 16px);
    text-decoration: none;
    white-space: nowrap;
  }

  .pec-btn-apply i {
    font-size: 10px;
  }
}

/* ========== MOBILE: Offcanvas ========== */
.pec-offcanvas-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.pec-offcanvas-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.pec-offcanvas {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 320px;
  height: 100vh;
  background: #fff;
  z-index: 10001;
  box-shadow: -4px 0 20px rgba(0,0,0,0.1);
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pec-offcanvas.is-open {
  transform: translateX(0);
}

.pec-offcanvas-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.pec-offcanvas-logo img {
  max-height: 40px;
  width: auto;
}

.pec-offcanvas-close {
  padding: 8px;
  border: none;
  background: none;
  color: #333;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.pec-offcanvas-close:hover {
  color: #be0000;
}

/* Single scrollable area: topbar + menu + footer scroll together */
.pec-offcanvas-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.pec-offcanvas-menu {
  padding: 16px 0;
}

.pec-offcanvas .pec-nav-list {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.pec-offcanvas .pec-nav-item {
  border-bottom: 1px solid #eee;
}

.pec-offcanvas .pec-nav-item > a,
.pec-offcanvas .pec-nav-item > .pec-nav-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  font-size: 15px;
  color: #31353D;
  text-decoration: none;
  transition: background 0.2s, color 0.2s;
}

.pec-offcanvas .pec-nav-item > a:hover,
.pec-offcanvas .pec-nav-item > .pec-nav-toggle:hover {
  background: #f8f9fa;
  color: #be0000;
}

.pec-offcanvas .pec-nav-item > .pec-nav-toggle {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.pec-offcanvas .pec-nav-item.has-dropdown > a .pec-arrow,
.pec-offcanvas .pec-nav-item.has-dropdown > .pec-nav-toggle .pec-arrow {
  transition: transform 0.2s;
  font-size: 12px;
}

.pec-offcanvas .pec-nav-item.has-dropdown.is-expanded > a .pec-arrow,
.pec-offcanvas .pec-nav-item.has-dropdown.is-expanded > .pec-nav-toggle .pec-arrow {
  transform: rotate(180deg);
}

/* Mobile: sub-menu (mega content flattened) */
.pec-offcanvas .pec-sub {
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.pec-offcanvas .pec-nav-item.has-dropdown.is-expanded .pec-sub {
  max-height: 2000px;
}

.pec-offcanvas .pec-sub li {
  margin: 0;
}

.pec-offcanvas .pec-sub a {
  display: flex;
  align-items: center;
  padding: 10px 20px 10px 36px;
  font-size: 14px;
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #eee;
  transition: background 0.2s, color 0.2s;
}

.pec-offcanvas .pec-sub a:last-child {
  border-bottom: none;
}

.pec-offcanvas .pec-sub a:hover {
  background: #fff;
  color: #be0000;
}

.pec-offcanvas .pec-sub a .pec-link-icon {
  margin-right: 10px;
  font-size: 10px;
  color: #be0000;
}

.pec-offcanvas-footer {
  padding: 20px;
  border-top: 1px solid #eee;
}

.pec-offcanvas-footer .pec-offcanvas-title {
  font-size: 12px;
  font-weight: 600;
  color: #999;
  text-transform: uppercase;
  margin: 0 0 12px 0;
}

.pec-offcanvas-footer a {
  display: block;
  padding: 4px 0;
  font-size: 14px;
  color: #555;
  text-decoration: none;
}

.pec-offcanvas-footer a:hover {
  color: #be0000;
}

.pec-offcanvas-social {
  margin-top: 16px;
  display: flex;
  gap: 12px;
}

.pec-offcanvas-social a {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  background: #f0f0f0;
  border-radius: 50%;
  color: #555;
  font-size: 16px;
}

.pec-offcanvas-social a:hover {
  background: #be0000;
  color: #fff;
}

.pec-offcanvas-social .pec-icon-x {
  width: 18px;
  height: 18px;
  object-fit: contain;
  display: block;
}

.pec-offcanvas-social a:hover .pec-icon-x {
  filter: brightness(0) invert(1);
}

/* Hide desktop mega in offcanvas */
.pec-offcanvas .pec-mega {
  display: none !important;
}

/* ========== MOBILE OFFCANVAS: Top bar section ========== */
.pec-offcanvas-topbar {
  padding: 12px 20px;
  border-bottom: 1px solid #eee;
  background: #f8f9fa;
}

.pec-offcanvas-quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}

.pec-offcanvas-quick-links a {
  font-size: 13px;
  font-weight: 600;
  color: #be0000;
  text-decoration: none;
}

.pec-offcanvas-quick-links a:hover {
  text-decoration: underline;
}

.pec-offcanvas-topbar-group {
  margin-bottom: 8px;
}

.pec-offcanvas-topbar-group:last-of-type {
  margin-bottom: 12px;
}

.pec-offcanvas-topbar-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 0;
  font-size: 14px;
  font-weight: 600;
  color: #31353D;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: color 0.2s;
}

.pec-offcanvas-topbar-title:hover {
  color: #be0000;
}

.pec-offcanvas-topbar-title i {
  font-size: 12px;
  transition: transform 0.2s;
}

.pec-offcanvas-topbar-group.is-expanded .pec-offcanvas-topbar-title i {
  transform: rotate(180deg);
}

.pec-offcanvas-topbar-links {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.pec-offcanvas-topbar-group.is-expanded .pec-offcanvas-topbar-links {
  max-height: 300px;
}

.pec-offcanvas-topbar-links li {
  margin: 0;
}

.pec-offcanvas-topbar-links a {
  display: block;
  padding: 8px 0 8px 12px;
  font-size: 13px;
  color: #555;
  text-decoration: none;
  border-bottom: none;
}

.pec-offcanvas-topbar-links a:hover {
  color: #be0000;
}

.pec-btn-login-mobile {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 20px;
  font-size: 14px;
  color: #fff !important;
  background: #be0000;
  border: none !important;
  border-radius: 4px;
  text-align: center;
}

.pec-btn-login-mobile:hover {
  background: #1a1a1a;
  color: #fff !important;
}
