/* ========================================
   PHILMARINE Custom Mobile Navigation
   Premium slide-in right menu + accordion
   ======================================== */

.phm-burger {
  display: none;
  position: relative;
  z-index: 1001;
  width: 42px;
  height: 42px;
  padding: 0;
  border: none;
  background: rgba(0, 163, 232, 0.06);
  border-radius: 10px;
  cursor: pointer;
  outline: none;
  flex-shrink: 0;
  transition: background 0.25s;
}

.phm-burger:hover {
  background: rgba(0, 163, 232, 0.14);
}

.phm-burger span {
  display: block;
  width: 20px;
  height: 2.5px;
  margin: 5px auto;
  background: #0a2540;
  border-radius: 3px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.phm-burger.active span:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
  background: #00a3e8;
}

.phm-burger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.phm-burger.active span:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
  background: #00a3e8;
}

/* Overlay backdrop */
.phm-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1100;
  background: rgba(10, 37, 64, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.phm-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Off-canvas menu panel */
.phm-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  max-width: 85vw;
  height: 100%;
  z-index: 1200;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(10, 37, 64, 0.2);
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px 0 0 20px;
}

.phm-panel.open {
  transform: translateX(0);
}

/* Panel header with gradient */
.phm-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px 18px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #0a2540 0%, #1a3a5c 100%);
  position: relative;
  overflow: hidden;
}

.phm-panel-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -30%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 163, 232, 0.15) 0%, transparent 70%);
  pointer-events: none;
}

.phm-panel-header .phm-logo {
  height: 34px;
  width: auto;
  filter: brightness(0) invert(1);
}

.phm-panel-header .phm-close {
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s, transform 0.25s;
  backdrop-filter: blur(4px);
}

.phm-panel-header .phm-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.phm-panel-header .phm-close svg {
  width: 18px;
  height: 18px;
  stroke: #fff;
  stroke-width: 2.5;
  stroke-linecap: round;
  fill: none;
}

/* Scrollable nav area */
.phm-nav-wrap {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 0;
  -webkit-overflow-scrolling: touch;
}

.phm-nav-wrap::-webkit-scrollbar {
  width: 3px;
}

.phm-nav-wrap::-webkit-scrollbar-track {
  background: transparent;
}

.phm-nav-wrap::-webkit-scrollbar-thumb {
  background: rgba(0, 163, 232, 0.3);
  border-radius: 10px;
}

/* Navigation list */
.phm-nav {
  list-style: none;
  margin: 0;
  padding: 0;
}

.phm-nav > li {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.phm-nav > li:last-child {
  border-bottom: none;
}

.phm-nav a {
  display: flex;
  align-items: center;
  padding: 15px 24px;
  font-family: 'Montserrat', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #1a1a2e;
  text-decoration: none;
  transition: background 0.2s, color 0.2s, padding-left 0.2s;
  position: relative;
  letter-spacing: 0.02em;
}

.phm-nav a:hover {
  background: rgba(0, 163, 232, 0.05);
  color: #00a3e8;
  padding-left: 30px;
}

/* Accordion toggle indicator */
.phm-nav .phm-has-children > a {
  padding-right: 52px;
}

.phm-nav .phm-has-children > a::after {
  content: '';
  position: absolute;
  right: 22px;
  top: 50%;
  width: 9px;
  height: 9px;
  border-right: 2px solid #b0b8c5;
  border-bottom: 2px solid #b0b8c5;
  transform: translateY(-65%) rotate(45deg);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s;
}

.phm-nav .phm-has-children > a:hover::after {
  border-color: #00a3e8;
}

.phm-nav .phm-has-children > a.open::after {
  transform: translateY(-30%) rotate(-135deg);
  border-color: #00a3e8;
}

/* Sub-menu (accordion) */
.phm-nav .phm-sub-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(0, 0, 0, 0.02);
  position: relative;
}

.phm-nav .phm-sub-menu::before {
  content: '';
  position: absolute;
  left: 30px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(0, 163, 232, 0.15);
  border-radius: 2px;
}

.phm-nav .phm-sub-menu.open {
  max-height: 600px;
}

.phm-nav .phm-sub-menu a {
  padding: 12px 24px 12px 46px;
  font-size: 13px;
  font-weight: 400;
  color: #555;
  position: relative;
}

.phm-nav .phm-sub-menu a::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: #fff;
  border: 2px solid rgba(0, 163, 232, 0.3);
  border-radius: 50%;
  transform: translateY(-50%);
  transition: border-color 0.25s, background 0.25s;
}

.phm-nav .phm-sub-menu a:hover {
  color: #00a3e8;
  background: rgba(0, 163, 232, 0.04);
}

.phm-nav .phm-sub-menu a:hover::before {
  border-color: #00a3e8;
  background: #00a3e8;
}

/* Panel footer with gradient buttons */
.phm-panel-footer {
  padding: 18px 22px 22px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: linear-gradient(180deg, #ffffff 0%, rgba(0, 163, 232, 0.02) 100%);
}

.phm-panel-footer .phm-btn {
  display: block;
  width: 100%;
  padding: 14px 16px;
  border-radius: 10px;
  font-family: 'Montserrat', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
}

.phm-panel-footer .phm-btn-primary {
  background: linear-gradient(135deg, #00a3e8 0%, #0088c7 100%);
  color: #fff;
  box-shadow: 0 4px 15px rgba(0, 163, 232, 0.3);
}

.phm-panel-footer .phm-btn-primary:hover {
  background: linear-gradient(135deg, #0095d4 0%, #0078b5 100%);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 163, 232, 0.4);
}

.phm-panel-footer .phm-btn-outline {
  background: transparent;
  color: #0a2540;
  border: 1.5px solid #0a2540;
  box-shadow: none;
}

.phm-panel-footer .phm-btn-outline:hover {
  background: #0a2540;
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(10, 37, 64, 0.15);
}

/* Prevent body scroll when menu is open */
body.phm-no-scroll {
  overflow: hidden;
}

/* Animate nav items on open */
.phm-panel.open .phm-nav > li {
  animation: phmFadeIn 0.4s ease forwards;
  opacity: 0;
}

.phm-panel.open .phm-nav > li:nth-child(1) { animation-delay: 0.05s; }
.phm-panel.open .phm-nav > li:nth-child(2) { animation-delay: 0.10s; }
.phm-panel.open .phm-nav > li:nth-child(3) { animation-delay: 0.15s; }
.phm-panel.open .phm-nav > li:nth-child(4) { animation-delay: 0.20s; }
.phm-panel.open .phm-nav > li:nth-child(5) { animation-delay: 0.25s; }
.phm-panel.open .phm-nav > li:nth-child(6) { animation-delay: 0.30s; }
.phm-panel.open .phm-nav > li:nth-child(7) { animation-delay: 0.35s; }
.phm-panel.open .phm-nav > li:nth-child(8) { animation-delay: 0.40s; }
.phm-panel.open .phm-nav > li:nth-child(9) { animation-delay: 0.45s; }
.phm-panel.open .phm-nav > li:nth-child(10) { animation-delay: 0.50s; }

@keyframes phmFadeIn {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Responsive: show burger on mobile */
@media (max-width: 991px) {
  .header-bottomarea .container {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  .header-bottomarea .header-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-left: 16px;
    padding-right: 8px;
  }

  .in-navigation {
    display: none !important;
  }

  .mobile-menu-wrapper {
    display: none !important;
  }

  .phm-burger {
    display: block;
  }
}
