/* ============================================
   ECOYDES A.C. — LAYOUT CSS
   Header, Footer, Navigation, Grids
   ============================================ */

/* ─── HEADER ─── */
:root {
  --header-height: 56px;
}

@media (min-width: 768px) {
  :root {
    --header-height: 88px;
  }
}

@media (min-width: 1024px) {
  :root {
    --header-height: 96px;
  }
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  min-height: var(--header-height);
  z-index: 1000;
  display: flex;
  align-items: center;
  background: transparent;
  padding: 0.5rem 0;
}

.site-header.scrolled .logo,
.site-header.scrolled .main-nav,
.site-header.scrolled .hamburger {
  background: rgba(20, 61, 37, 0.96);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: rgba(20, 61, 37, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0.4rem 0.9rem;
  border-radius: 50px;
  transition: background var(--transition);
}

.logo__img {
  height: 44px;
  width: auto;
}

.logo__name {
  font-size: 1rem;
}

.logo__tagline {
  font-size: 0.55rem;
}

.logo__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.logo__name {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--white);
}

.logo__tagline {
  font-family: var(--font-body);
  font-size: 0.6rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-light);
}

/* Desktop Nav */
.main-nav {
  display: none;
  background: rgba(20, 61, 37, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 0 1.5rem;
  border-radius: 50px;
  transition: background var(--transition);
}

.main-nav__list {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.main-nav__link {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.8);
  position: relative;
  padding: 0.5rem 0;
  transition: color var(--transition-fast);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.main-nav__link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--green-light);
  transition: width var(--transition);
  border-radius: 1px;
}

.main-nav__link:hover,
.main-nav__link:focus-visible,
.main-nav__link[aria-current="page"] {
  color: var(--white);
}

.main-nav__link:hover::after,
.main-nav__link:focus-visible::after,
.main-nav__link[aria-current="page"]::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  padding: 0;
  z-index: 1002;
  border-radius: 50%;
  background: rgba(20, 61, 37, 0.88);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: background var(--transition);
}

.hamburger:focus-visible {
  outline: 3px solid var(--green-light);
  outline-offset: 2px;
}

.hamburger__line {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--white);
  transition: transform var(--transition), opacity var(--transition);
  border-radius: 1px;
}

.hamburger.active .hamburger__line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger__line:nth-child(2) {
  opacity: 0;
}

.hamburger.active .hamburger__line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* Mobile Nav Sheet */
.mobile-nav-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(10, 25, 16, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.mobile-nav-backdrop.active {
  opacity: 1;
  pointer-events: all;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: 0;
  width: min(85vw, 320px);
  height: 100%;
  background: var(--cream);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  padding: 5rem 0 2rem;
  transform: translateX(100%);
  transition: transform var(--transition);
  box-shadow: -8px 0 32px rgba(20, 61, 37, 0.18);
}

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

.mobile-nav__close {
  position: absolute;
  top: 0.875rem;
  right: 0.875rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--green-pale);
  border: 1px solid var(--gray-200);
  border-radius: 50%;
  color: var(--green-dark);
  font-size: 1.35rem;
  cursor: pointer;
  transition: background var(--transition-fast), transform var(--transition-fast);
}

.mobile-nav__close:hover,
.mobile-nav__close:focus-visible {
  background: var(--green-light);
  transform: rotate(90deg);
}

.mobile-nav__link {
  font-family: var(--font-body);
  font-size: 1.05rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--green-dark);
  transition: background var(--transition-fast), color var(--transition-fast);
  min-height: 56px;
  display: flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-bottom: 1px solid var(--gray-200);
}

.mobile-nav__link:hover,
.mobile-nav__link:focus-visible,
.mobile-nav__link[aria-current="page"] {
  background: var(--green-pale);
  color: var(--green);
}

/* ─── FOOTER ─── */
.site-footer {
  background: var(--green-dark);
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 4rem 0 2rem;
}

.footer-grid {
  display: grid;
  gap: 2.5rem;
}

.footer-brand__img {
  height: 56px;
  width: auto;
  margin-bottom: 1rem;
}

.footer-brand__name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--white);
}

.footer-brand__tagline {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--green-light);
  margin-bottom: 1rem;
}

.footer-brand__desc {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.65);
  line-height: 1.7;
  max-width: 280px;
}

.footer-socials {
  display: flex;
  gap: 1rem;
  margin-top: 1.25rem;
}

.footer-socials a {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.footer-socials a:hover,
.footer-socials a:focus-visible {
  border-color: var(--green-light);
  color: var(--green-light);
  background: rgba(255,255,255,0.08);
  transform: translateY(-2px);
}

.footer-heading {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--white);
  margin-bottom: 1.25rem;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links a {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.65);
  transition: color var(--transition-fast);
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--green-light);
}

.footer-contact p {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.65);
  margin-bottom: 0.5rem;
}

.footer-contact a {
  color: rgba(255,255,255,0.75);
  transition: color var(--transition-fast);
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
  color: var(--green-light);
}

.footer-newsletter__text {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  margin-bottom: 1rem;
  max-width: 260px;
}

.footer-newsletter__form {
  display: flex;
  gap: 0.5rem;
}

.footer-newsletter__form input {
  flex: 1;
  min-width: 0;
  padding: 0.75rem 1rem;
  font-family: var(--font-body);
  font-size: var(--text-small);
  color: var(--text-dark);
  background: var(--white);
  border: 2px solid transparent;
  border-radius: 6px;
}

.footer-newsletter__form input:focus {
  border-color: var(--green-light);
  box-shadow: 0 0 0 3px rgba(217, 242, 198, 0.25);
  outline: none;
}

.footer-newsletter__form button {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 48px;
}

.footer-newsletter__feedback {
  margin-top: 0.75rem;
  font-size: var(--text-small);
  min-height: 1.2em;
}

.footer-newsletter__feedback.success {
  color: var(--green-light);
}

.footer-newsletter__feedback.error {
  color: #ffb8b8;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  margin-top: 3rem;
  padding-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
  text-align: center;
}

.footer-bottom p {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.05em;
}

.footer-legal {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.footer-legal a,
.footer-legal span {
  font-size: var(--text-small);
  color: rgba(255,255,255,0.45);
}

.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--green-light);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── RESPONSIVE GRIDS ─── */
@media (max-width: 1023px) {
  body.nav-open {
    overflow: hidden;
  }

  .site-header {
    background: rgba(20, 61, 37, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    padding: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
  }

  .site-header .container {
    padding: 0 1rem;
  }

  .site-header.scrolled .logo,
  .site-header.scrolled .hamburger {
    background: transparent;
  }

  .logo {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 6px 0;
    border-radius: 0;
  }

  .hamburger {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-radius: 0;
    width: 44px;
    height: 44px;
  }

  .mobile-nav {
    gap: 1rem;
    padding: 5rem 1.5rem 2rem;
    justify-content: flex-start;
    overflow-y: auto;
  }

  .footer-grid {
    gap: 2rem;
  }

  main > section:first-child:not(.hero-slider):not(.page-hero) {
    padding-top: calc(var(--header-height) + 1.5rem);
  }
}

@media (min-width: 768px) {
  .logo {
    gap: 0.75rem;
    padding: 0.5rem 1.2rem;
  }

  .logo__name {
    font-size: 1.15rem;
  }

  .logo__tagline {
    font-size: 0.6rem;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .logo__img {
    height: 72px;
  }

  .logo {
    padding: 8px 0;
  }
}

@media (min-width: 1024px) {
  .logo__img {
    height: 80px;
  }

  .main-nav {
    display: flex;
    align-items: center;
    min-height: calc(80px + 1rem);
  }

  .hamburger {
    display: none;
  }

  .mobile-nav,
  .mobile-nav-backdrop {
    display: none;
  }

  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr 1fr;
  }
}

/* ─── WHATSAPP FLOAT BUTTON ─── */
.whatsapp-float {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  width: 56px;
  height: 56px;
  background: #25D366;
  color: #ffffff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
  z-index: 999;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.whatsapp-float svg {
  width: 28px;
  height: 28px;
  fill: currentColor;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .whatsapp-float {
    bottom: 1.5rem;
    right: 1.5rem;
    width: 64px;
    height: 64px;
  }

  .whatsapp-float svg {
    width: 32px;
    height: 32px;
  }
}
