/* ============================================
   REVIVER FISIOTERAPIA — Custom Styles
   Paleta: Dourado + Neutros Quentes
   ============================================ */

/* ---- Base ---- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  overflow-x: hidden;
}

::selection {
  background-color: rgba(212, 152, 46, 0.15);
  color: #7d4a20;
}

/* ---- Header States ---- */
#header {
  background: transparent;
}

#header.scrolled {
  background: rgba(250, 249, 247, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 1px 3px rgba(71, 62, 56, 0.06), 0 4px 20px rgba(71, 62, 56, 0.04);
}

/* Header logo/text colors change on scroll */
.header-logo-text {
  color: #ffffff;
}
.header-logo-sub {
  color: rgba(255, 255, 255, 0.7);
}

#header.scrolled .header-logo-text {
  color: #473e38;
}
#header.scrolled .header-logo-sub {
  color: #998571;
}

/* Nav links */
.nav-link {
  color: rgba(255, 255, 255, 0.85);
}
.nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

#header.scrolled .nav-link {
  color: #665749;
}
#header.scrolled .nav-link:hover {
  color: #b87a22;
  background: rgba(212, 152, 46, 0.08);
}

/* Mobile menu button */
#mobile-menu-btn {
  color: white;
}
#header.scrolled #mobile-menu-btn {
  color: #473e38;
}

/* ---- Hamburger Icon ---- */
.hamburger-icon {
  width: 22px;
  height: 16px;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hamburger-icon span {
  display: block;
  width: 100%;
  height: 2px;
  background: currentColor;
  border-radius: 2px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform-origin: center;
}

.hamburger-icon.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.hamburger-icon.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.hamburger-icon.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---- Mobile Menu ---- */
.mobile-menu-closed {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu-open {
  max-height: 600px;
  transition: max-height 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-nav-link {
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.mobile-menu-open .mobile-nav-link {
  opacity: 1;
  transform: translateY(0);
}

.mobile-menu-open .mobile-nav-link:nth-child(1) { transition-delay: 0.05s; }
.mobile-menu-open .mobile-nav-link:nth-child(2) { transition-delay: 0.1s; }
.mobile-menu-open .mobile-nav-link:nth-child(3) { transition-delay: 0.15s; }
.mobile-menu-open .mobile-nav-link:nth-child(4) { transition-delay: 0.2s; }
.mobile-menu-open .mobile-nav-link:nth-child(5) { transition-delay: 0.25s; }
.mobile-menu-open .mobile-nav-link:nth-child(6) { transition-delay: 0.3s; }
.mobile-menu-open .mobile-nav-link:nth-child(7) { transition-delay: 0.35s; }

/* ---- Scroll Animations ---- */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger animation delays for children */
.animate-on-scroll:nth-child(2) { transition-delay: 0.1s; }
.animate-on-scroll:nth-child(3) { transition-delay: 0.15s; }
.animate-on-scroll:nth-child(4) { transition-delay: 0.2s; }
.animate-on-scroll:nth-child(5) { transition-delay: 0.25s; }
.animate-on-scroll:nth-child(6) { transition-delay: 0.3s; }
.animate-on-scroll:nth-child(7) { transition-delay: 0.35s; }
.animate-on-scroll:nth-child(8) { transition-delay: 0.4s; }

/* ---- WhatsApp Float ---- */
#whatsapp-float {
  animation: float-bounce 3s ease-in-out infinite;
}

@keyframes float-bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

#whatsapp-float:hover {
  animation: none;
}

/* ---- Form Focus Styles ---- */
input:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(212, 152, 46, 0.1);
}

/* ---- Custom Scrollbar ---- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: #faf9f7;
}

::-webkit-scrollbar-thumb {
  background: #e0d8cd;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #c8bcac;
}

/* ---- Responsive Adjustments ---- */
@media (max-width: 640px) {
  .animate-on-scroll {
    transform: translateY(20px);
  }

  #whatsapp-float {
    bottom: 1rem;
    right: 1rem;
    width: 3.5rem;
    height: 3.5rem;
  }

  #whatsapp-float svg {
    width: 1.75rem;
    height: 1.75rem;
  }
}

/* ---- Active nav link ---- */
.nav-link-active {
  color: #b87a22 !important;
  background: rgba(212, 152, 46, 0.08);
}

#header:not(.scrolled) .nav-link-active {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.15);
}

/* ---- Print ---- */
@media print {
  #header,
  #whatsapp-float,
  #mobile-menu {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
  }
}
