/* ==========================================================================
   HEADER STYLES - REFACTORED
   Organized by component with mobile-first approach
   ========================================================================== */

/* ==========================================================================
   1. BASE HEADER STYLES
   ========================================================================== */
header {
  width: 100%;
  position: absolute;
  letter-spacing: 1.2px;
  z-index: 10;
  padding-top: 1em;
}

#header {
  width: 100%;
  position: absolute;
  background: transparent;
}

#header a {
  color: var(--body-color);
}

body.template-homepage #header a {
  color: #fff;
}

.header_wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 60px;
  flex-wrap: nowrap;
}

/* Header variations */
@media (max-width: 1000px) {
  .header {
    background: #1a1f3a !important;
  }
}

/* Header pages variant (for interior pages) */
.header_pages #header {
  background: #1e2457;
  box-shadow: 0 5px 8px rgb(48 80 117 / 20%);
}

.header_pages #header a {
  color: var(--body-color);
}

/* ==========================================================================
   2. LOGO STYLES
   ========================================================================== */
.navLogo {
  display: flex;
  align-items: center;
  color: var(--body-color);
  font-size: 1.9em;
  font-weight: 700;
}

body.template-homepage .navLogo {
  color: #fff;
}

.navLogo img {
  width: 73px;
  padding: 0;
}

.navLogo a {
  display: flex;
  background: none;
  align-items: center;
  padding: 0px;
  color: #fff;
}

/* Logo responsive */
@media screen and (max-width: 1300px) {
  .navLogo {
    font-size: 1.6em;
  }
  .navLogo img {
    width: 58px;
  }
}

@media screen and (max-width: 1000px) {
  .navLogo {
    font-size: 1.4em !important;
  }
  .navLogo img {
    width: 50px !important;
  }
}

/* ==========================================================================
   3. DESKTOP NAVIGATION
   ========================================================================== */
.desktop-nav {
  display: flex;
  align-items: center;
  flex: 1;
  justify-content: center;
  height: 60px;
}

.desktop-menu {
  display: flex;
  align-items: center;
  flex-direction: row;
  justify-content: center;
  padding: 0;
  margin: 0;
  height: 100%;
  list-style: none;
}

.desktop-menu li {
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  height: 100%;
}

.desktop-menu a {
  color: #fff;
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-transform: uppercase;
  padding: 8px 16px;
  text-decoration: none;
  letter-spacing: 0.5px;
  border-radius: 4px;
}

.desktop-menu a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
}

/* Desktop navigation responsive */
@media screen and (max-width: 1400px) {
  .desktop-menu a {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

@media screen and (max-width: 1300px) {
  .desktop-menu a {
    font-size: 0.8rem;
    padding: 6px 10px;
letter-spacing: 0.3px;
  }
}

/* Header pages - desktop menu */
.header_pages #header .desktop-menu a {
  color: var(--body-color);
}

/* Desktop navigation responsive */
@media screen and (max-width: 1400px) {
  .desktop-menu li {
    padding: 0.4em 0.1em;
  }
  .desktop-menu a {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

@media screen and (max-width: 1300px) {
  .desktop-menu li {
    padding: 0.4em 0.15em;
  }
  .desktop-menu a {
    font-size: 0.9rem;
    padding: 6px 5px;
    letter-spacing: 0.3px;
  }
}

@media screen and (max-width: 1200px) {
    .desktop-menu a {
    font-size: 0.8rem;
    padding: 6px 5px;
    letter-spacing: 0.3px;
  }
}
@media screen and (max-width: 1000px) {
  .desktop-menu,
  .desktop-nav,
  .desktop-actions {
    display: none !important;
  }
}

/* ==========================================================================
   4. DESKTOP ACTIONS (Phone + CTA Button)
   ========================================================================== */
.desktop-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.desktop-actions .phone {
  color: var(--body-color);
  text-decoration: none;
  font-weight: 600;
  white-space: nowrap;
  text-align: center;
}

#header .desktop-actions .call_back {
  color: #fff;
  background: #FE2979;
  border: 2px solid #FE2979;
  padding: 5px 10px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  transition: all 0.3s ease;
  display: block;
}

#header .desktop-actions .call_back:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 0 4px rgba(254, 41, 121, 0.2);
  animation: pulse-border-pink 1.5s infinite;
}

@keyframes pulse-border-pink {
  0% {
    box-shadow: 0 0 0 0 rgba(254, 41, 121, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(254, 41, 121, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(254, 41, 121, 0);
  }
}

body.template-homepage .desktop-actions .call_back {
  color: #fff;
  border-color: #fff;
}

body.template-homepage .desktop-actions .call_back:hover {
  color: #fff;
  background: #FE2979;
  border-color: #FE2979;
  animation: pulse-border-pink 1.5s infinite;
}

@keyframes pulse-border-white {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.6);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(255, 255, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0);
  }
}

body.template-homepage .desktop-actions .phone {
  color: #fff;
}

/* Header pages variant */
.header_pages #header .desktop-actions .phone,
.header_pages #header .desktop-actions .call_back {
  color: var(--button-bg-color);
}

.header_pages #header .desktop-actions .call_back {
  border-color: var(--button-bg-color);
}

/* Desktop actions responsive */
@media screen and (max-width: 1000px) {
  .desktop-actions {
    display: none !important;
  }
}

/* ==========================================================================
   5. HAMBURGER MENU TRIGGER
   ========================================================================== */
.navTrigger {
  display: none;
  cursor: pointer;
  width: 32px;
  height: 24px;
  position: relative;
  right: 10px;
  top: 0;
  bottom: 0;
  background: none;
  border: none;
  padding: 0;
}

.navTrigger .hamburger-line {
  background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
  border-radius: 2px;
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  position: absolute;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#header .navTrigger .hamburger-line {
  background: linear-gradient(135deg, #fff 0%, #e0e0e0 100%);
}

/* Header pages variant */
.header_pages #header .navTrigger .hamburger-line {
  background: linear-gradient(135deg, #2d3561 0%, #3d4175 100%) !important;
}

/* Hamburger line positions */
.navTrigger .hamburger-line:nth-child(1) {
  top: 0;
  transform-origin: center;
}

.navTrigger .hamburger-line:nth-child(2) {
  top: 50%;
  transform: translateY(-50%);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.navTrigger .hamburger-line:nth-child(3) {
  bottom: 0;
  transform-origin: center;
}

/* Active state (X shape) */
.navTrigger.active .hamburger-line:nth-child(1) {
  top: 50%;
  transform: translateY(-50%) rotate(45deg);
}

.navTrigger.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(-10px);
}

.navTrigger.active .hamburger-line:nth-child(3) {
  bottom: 50%;
  transform: translateY(50%) rotate(-45deg);
}

/* Show hamburger on mobile */
@media screen and (max-width: 1000px) {
  .navTrigger {
    display: block;
    margin-right: 15px;
  }
}

/* ==========================================================================
   6. MOBILE MENU WRAPPER & OVERLAY
   ========================================================================== */
.mobile-menu-wrapper {
  display: none;
}

@media screen and (max-width: 1000px) {
  .mobile-menu-wrapper {
    display: block;
  }
}

.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 998;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   7. MOBILE MENU CONTAINER
   ========================================================================== */
.mobile-menu-container {
  position: fixed;
  right: 0;
  top: 0;
  height: 100vh;
  width: 100%;
  max-width: 340px;
  background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 50%, #3d4175 100%);
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.mobile-menu-container.active {
  transform: translateX(0);
}

/* ==========================================================================
   8. MOBILE MENU HEADER
   ========================================================================== */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.03);
}

.mobile-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  font-size: 1.5em;
  font-weight: 700;
}

.mobile-logo img {
  width: 50px;
  height: auto;
}

.mobile-menu-close {
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #fff;
}

.mobile-menu-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.mobile-menu-close:active {
  transform: rotate(90deg) scale(0.95);
}

/* ==========================================================================
   9. MOBILE MENU NAVIGATION
   ========================================================================== */
.mobile-menu-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-menu-list li {
  padding: 0;
  width: 100%;
  margin: 0;
}

.mobile-menu-list li a {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 1rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
  border-left: 3px solid transparent;
}

.mobile-menu-list li a:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-left-color: #5c9e47;
}

.mobile-menu-list li a:active {
  background: rgba(92, 158, 71, 0.2);
}

.menu-icon {
  width: 24px;
  text-align: center;
  font-size: 1.1em;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.mobile-menu-list li a:hover .menu-icon {
  color: #5c9e47;
}

/* Mobile menu scrollbar styling */
@media (max-width: 1000px) {
  .nav_menu {
    -webkit-overflow-scrolling: touch;
  }

  .nav_menu::-webkit-scrollbar {
    width: 6px;
  }

  .nav_menu::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
  }

  .nav_menu::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
  }

  .nav_menu::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
  }
}

/* ==========================================================================
   10. MOBILE CONTACTS SECTION
   ========================================================================== */
.mobile-contacts-section {
  padding: 24px;
  margin: 16px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
}

.mobile-contacts-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.mobile-contact-link {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  text-decoration: none;
  color: #fff;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.mobile-contact-link:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(4px);
}

.mobile-contact-link:active {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-contact-link:last-child {
  margin-bottom: 0;
}

.contact-icon {
  width: 20px;
  text-align: center;
  color: #5c9e47;
  font-size: 1.1em;
}

/* ==========================================================================
   11. MOBILE MENU FOOTER (CTA Button)
   ========================================================================== */
.mobile-menu-footer {
  padding: 20px 16px;
  margin-top: 8px;
}

.mobile_cta_button {
  display: block;
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #5c9e47 0%, #4a8a38 100%);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(92, 158, 71, 0.3);
  border: none;
}

.mobile_cta_button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(92, 158, 71, 0.4);
  background: linear-gradient(135deg, #6ab552 0%, #5a9a44 100%);
}

.mobile_cta_button:active {
  transform: translateY(0);
  box-shadow: 0 2px 10px rgba(92, 158, 71, 0.3);
}

/* ==========================================================================
   12. MOBILE PHONE ICON (Top right on mobile)
   ========================================================================== */
.mobile_phone_top {
  display: none;
}

@media screen and (max-width: 1000px) {
  #header a{
    color: #fff;
  }
  .mobile_phone_top {
    display: flex;
    align-items: center;
    margin: 0 10px 0 10px;
  }

  .mobile_phone_top a {
    color: #fff;
    font-size: 20px;
    transition: all 0.3s ease;
  }

  .mobile_phone_top a:hover {
    color: #5c9e47;
    transform: scale(1.1);
  }
}

/* ==========================================================================
   13. OLD NAV_MENU (Legacy - for backward compatibility)
   ========================================================================== */
.nav_menu {
  position: fixed;
  right: 0px;
  height: 100vh;
  top: 0;
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  max-width: 340px;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  background: linear-gradient(135deg, #1a1f3a 0%, #2d3561 50%, #3d4175 100%);
  z-index: 999;
  overflow-y: auto;
  display: none;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

.nav_menu-active {
  transform: translateX(0%);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.4);
}

.nav_menu a:hover::after,
.nav_menu a:focus::after {
  opacity: 0;
  width: 0;
}

/* ==========================================================================
   14. ACCESSIBILITY IMPROVEMENTS
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .nav_menu,
  .mobile-menu-overlay,
  .navTrigger .hamburger-line,
  .mobile-menu-close,
  .mobile-contact-link,
  .mobile_cta_button {
    transition: none;
  }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
  .nav_menu {
    padding-bottom: max(0px, env(safe-area-inset-bottom));
  }
}

/* ==========================================================================
   15. PHONE TOP (Legacy)
   ========================================================================== */
.phone_top {
  display: flex;
  flex-direction: column;
  font-weight: 600;
  margin: 0 0 20px 0;
}

.phone {
  color: #fff;
}

.call_back {
  text-align: center;
  border: 1px solid;
}

.call_back:hover {
  color: #ffff;
}

@media screen and (max-width: 1190px) {
  .phone_top {
    display: none;
  }
}

/* ==========================================================================
   16. ANIMATIONS (for menu)
   ========================================================================== */
@keyframes navLinkFadeIn {
  from {
    opacity: 0;
    transform: translateX(50px);
  }
  to {
    opacity: 1;
    transform: translateX(0px);
  }
}

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

/* ==========================================================================
   17. RESPONSIVE BREAKPOINTS SUMMARY
   - Desktop: > 1190px (default)
   - Tablet: <= 1190px (shows mobile menu)
   - Large desktop: > 1400px (adjusts menu padding)
   - Medium desktop: <= 1400px (reduces menu items padding)
   - Small desktop: <= 1300px (reduces logo size)
   ========================================================================== */
