/* Header Component Fix Styles */
/* Ensures proper fade-in and mobile navigation */

/* Header fade-in effect - ensure it stays at top */
.header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 9999 !important; /* Increased z-index to ensure it's always on top */
  background-color: #F5F5EC !important; /* ivory */
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1) !important;
  transform: translateZ(0); /* Create stacking context */
  backface-visibility: hidden; /* Prevent flickering */
}

.header.nav-initialized {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.header.nav-initialized.loaded {
  opacity: 1;
}

/* Mobile navigation improvements - fix z-index issues */
.mobile-nav-overlay {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(0, 0, 0, 0.5) !important;
  z-index: 40 !important;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-nav-overlay.active {
  opacity: 1 !important;
  visibility: visible !important;
}

.mobile-nav-menu {
  position: fixed !important;
  top: 0 !important;
  right: 0 !important;
  height: 100vh !important;
  width: 320px !important;
  max-width: 85vw !important;
  background-color: #F5F5EC !important; /* ivory */
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15) !important;
  z-index: 50 !important;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;
}

.mobile-nav-header {
  flex-shrink: 0 !important;
}

.mobile-nav-content {
  flex: 1 !important;
  overflow-y: auto !important;
  display: flex !important;
  flex-direction: column !important;
  min-height: 0 !important;
}

.mobile-nav-links {
  flex: 1 !important;
}

.mobile-nav-footer {
  flex-shrink: 0 !important;
  margin-top: auto !important;
  padding: 1.5rem !important;
  border-top: 1px solid rgba(138, 155, 135, 0.3) !important;
  background-color: rgba(245, 245, 236, 0.95) !important;
}

/* Social media icons in mobile menu */
.mobile-nav-social {
  margin-top: 1rem !important;
  display: flex !important;
  justify-content: center !important;
  gap: 1.5rem !important;
}

.mobile-nav-social a {
  background-color: rgba(138, 155, 135, 0.2) !important;
  border-radius: 50% !important;
  width: 3rem !important;
  height: 3rem !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  color: #6B7C68 !important;
  transition: all 0.3s ease !important;
  text-decoration: none !important;
}

.mobile-nav-social a:hover {
  background-color: rgba(138, 155, 135, 0.4) !important;
  transform: scale(1.1) !important;
  color: #8A9B87 !important;
}

.mobile-nav-social i {
  font-size: 1.25rem !important;
  line-height: 1 !important;
  width: 1.25rem !important;
  height: 1.25rem !important;
  text-align: center !important;
}

/* Ensure FontAwesome icons display properly and hide any fallback text */
.mobile-nav-social .fab,
.mobile-nav-social .fas {
  font-family: "Font Awesome 6 Brands", "Font Awesome 6 Free", "FontAwesome" !important;
  font-weight: 400 !important;
  font-style: normal !important;
  text-transform: none !important;
  speak: never !important;
}

.mobile-nav-social .fas {
  font-weight: 900 !important;
}

/* Hide any text content that might appear as fallback */
.mobile-nav-social i:empty:before {
  content: "" !important;
}

/* Specific icon fixes */
.mobile-nav-social .fa-facebook-f:before { content: "\f39e" !important; }
.mobile-nav-social .fa-instagram:before { content: "\f16d" !important; }
.mobile-nav-social .fa-whatsapp:before { content: "\f232" !important; }

.mobile-nav-menu.active {
  transform: translateX(0) !important;
}

/* Hamburger button - ensure it's always visible */
.hamburger {
  position: relative !important;
  z-index: 60 !important;
  background: rgba(168, 184, 165, 0.2) !important; /* sage-green-light with opacity */
  border-radius: 8px !important;
  width: 48px !important;
  height: 48px !important;
  display: flex !important;
  flex-direction: column !important;
  justify-content: center !important;
  align-items: center !important;
  transition: all 0.3s ease;
}

.hamburger:hover {
  background: rgba(168, 184, 165, 0.3) !important;
}

.hamburger .hamburger-line {
  display: block !important;
  width: 24px !important;
  height: 2px !important;
  background: #6B7C68 !important; /* sage-green-dark */
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: 1.5px 0 !important;
}

/* Show hamburger on mobile only */
@media (max-width: 767px) {
  .hamburger {
    display: flex !important;
  }
}

@media (min-width: 768px) {
  .hamburger {
    display: none !important;
  }
  
  .mobile-nav-overlay,
  .mobile-nav-menu {
    display: none !important;
  }
}

/* Body scroll lock */
body.nav-open {
  overflow: hidden !important;
  position: fixed !important;
  width: 100% !important;
  top: 0 !important;
  left: 0 !important;
}

/* Component loading states */
#header-container {
  min-height: 80px; /* Prevent layout shift during loading */
  /* Don't set position - it breaks sticky child elements */
}

#header-container[data-component="header"]:empty::after {
  content: "Loading header...";
  display: block;
  text-align: center;
  padding: 20px;
  color: #8A9B87;
  font-size: 14px;
}

/* Treatment filter fixes - IMPORTANT FOR SERVICES FILTERING */
.filter-btn {
  transition: all 0.3s ease;
  cursor: pointer;
  padding: 0.75rem 1.5rem;
  border: 2px solid #8A9B87;
  background: transparent;
  color: #8A9B87;
  border-radius: 25px;
  font-weight: 500;
  margin: 0.25rem;
}

.filter-btn:hover {
  background-color: rgba(138, 155, 135, 0.1);
  transform: translateY(-2px);
}

.filter-btn.active {
  background-color: #8A9B87 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(138, 155, 135, 0.3);
}

/* Treatment cards - ensure they respond to filters */
.treatment-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: block;
}

.treatment-card.fade-in {
  opacity: 1;
  transform: translateY(0);
}

.treatment-card:not(.fade-in) {
  opacity: 0.5;
  transform: translateY(10px);
}

/* Hide filtered items */
.treatment-card.hidden {
  display: none !important;
}

.treatment-card:not(.hidden) {
  display: block !important;
}

/* Responsive logo sizing */
@media (max-width: 640px) {
  .header-logo img {
    height: 4rem !important; /* 64px */
  }
}

@media (min-width: 641px) and (max-width: 768px) {
  .header-logo img {
    height: 5rem !important; /* 80px */
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .header-logo img {
    height: 6rem !important; /* 96px */
  }
}

@media (min-width: 1025px) {
  .header-logo img {
    height: 8rem !important; /* 128px */
  }
}

/* Button ripple effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple:before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transition: width 0.6s, height 0.6s;
  transform: translate(-50%, -50%);
  z-index: 0;
}

.btn-ripple:hover:before {
  width: 300px;
  height: 300px;
}

.btn-ripple * {
  position: relative;
  z-index: 1;
}

/* Ensure component containers don't cause layout shifts */
[data-component] {
  display: block;
}

[data-component]:empty {
  visibility: hidden;
}

[data-component]:not(:empty) {
  visibility: visible;
}

/* Fix for component loading flicker */
.header-loading {
  opacity: 0;
  pointer-events: none;
}

.header-loaded {
  opacity: 1;
  pointer-events: auto;
}

/* Ensure proper focus management */
.mobile-nav-link:focus,
.nav-link:focus,
.btn-primary:focus {
  outline: 2px solid #8A9B87;
  outline-offset: 2px;
}

/* Animation for reveal elements */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.revealed {
  animation: fadeInUp 0.6s ease forwards;
}

/* Smooth transitions for all interactive elements */
a, button, .btn, .filter-btn, .mobile-nav-link, .nav-link {
  transition: all 0.3s ease;
}

/* Loading states for better UX */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.loading-pulse {
  animation: pulse 1.5s ease-in-out infinite;
}

/* Footer component container */
#footer-container {
  margin-top: auto;
}

#footer-container[data-component="footer"]:empty::after {
  content: "Loading footer...";
  display: block;
  text-align: center;
  padding: 20px;
  color: #8A9B87;
  font-size: 14px;
}

/* Fix for fixed header - ensure parent containers work properly */
html, body {
  overflow-x: hidden;
  overflow-y: auto !important; /* Allow vertical scroll */
  height: auto !important; /* Don't restrict height */
}

/* Remove body padding - not needed */
body {
  padding-top: 0 !important;
}

/* Ensure main content doesn't interfere with fixed header */
main, .main-content, #main {
  position: relative;
  z-index: 1;
} 