/* layout.css */

/* HEADER */
.header {
  position: sticky;
  top: 10px;
  width: min(1000px, calc(100% - 32px));
  min-height: 64px;
  margin: 10px auto 0;
  padding: 0;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  box-shadow: var(--shadow-card);
  z-index: var(--z-header);
  display: flex;
  align-items: center;
  transition: all var(--transition-normal);
}
.header.scrolled {
  background: var(--glass-bg);
  border-color: var(--glass-border);
  padding: 0;
  box-shadow: var(--shadow-sm);
}

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

@media (max-width: 767px) {
  .header > .container {
    grid-template-columns: minmax(0, 1fr) auto !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .header-logo,
  .header-actions {
    min-width: 0;
  }

  .header-logo img {
    max-width: 100%;
    height: 40px !important;
  }

  .header-actions {
    gap: 8px;
  }

  .breadcrumb-wrapper {
    padding-left: 16px;
    padding-right: 16px;
    overflow-wrap: anywhere;
  }
}

@media (min-width: 768px) {
  .header > .container {
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) !important;
  }
}

.header-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}
.header-logo img {
  height: 40px;
  width: auto;
  border-radius: 4px;
}
.header-logo-text {
  font-family: var(--font-heading);
  font-weight: var(--font-extrabold);
  font-size: var(--text-xl);
  line-height: 1.1;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.header-logo-text span:first-child {
  font-size: inherit;
  letter-spacing: normal;
}

.header-nav {
  display: none;
  gap: 24px;
  align-items: center;
  justify-content: center;
}
@media (min-width: 768px) { .header-nav { display: flex; } }

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-t);
  font-weight: 600;
  font-size: 0.95rem;
  position: relative;
  padding: 4px 0;
  transition: color var(--t-fast);
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 2px;
  background: var(--blue);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--t-normal);
  box-shadow: var(--glow-blue);
}
.nav-link:hover { color: var(--blue); }
.nav-link:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}
.nav-link.active { color: var(--red); }
.nav-link.active::after {
  background: var(--red);
  box-shadow: var(--glow-red);
  transform: scaleX(1);
}

/* ========================================
   ACTIONS & MOBILE MENU
   ======================================== */
.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-4);
}

.mobile-menu-btn {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  color: var(--text-t);
  font-size: 1.5rem;
  cursor: pointer;
}
.menu-lines,
.menu-lines::before,
.menu-lines::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.menu-lines { position: relative; }
.menu-lines::before,
.menu-lines::after { content: ''; position: absolute; left: 0; }
.menu-lines::before { top: -7px; }
.menu-lines::after { top: 7px; }
@media (min-width: 768px) { .mobile-menu-btn { display: none; } }

.mobile-menu {
  position: fixed;
  top: 84px; left: 16px; right: 16px;
  max-width: 1000px;
  margin: 0 auto;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-lg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transform: translateY(-100%);
  opacity: 0;
  pointer-events: none;
  transition: all var(--t-normal);
  z-index: calc(var(--z-header) - 1);
  box-shadow: var(--shadow-lg);
}
.mobile-menu.open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.mobile-menu .nav-link {
  font-size: 1.25rem;
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border-t);
}

/* ========================================
   BREADCRUMBS
   ======================================== */
.breadcrumb-wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: var(--space-6) var(--space-6) 0;
  font-size: 0.9rem;
  font-weight: 500;
}
.breadcrumb-wrapper a {
  color: var(--muted-t);
}
.breadcrumb-wrapper span {
  color: var(--text-t);
  font-weight: 700;
}

/* ========================================
   MAIN CONTENT & PAGE TRANSITION
   ======================================== */
.main-content {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  right: 40px;
  background-color: #25d366;
  color: #FFF;
  border-radius: 50px;
  text-align: center;
  font-size: 30px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.35);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  animation: whatsappEnter 700ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.whatsapp-float::before {
  content: "";
  position: absolute;
  inset: -7px;
  border: 2px solid rgba(37, 211, 102, 0.5);
  border-radius: inherit;
  pointer-events: none;
  animation: whatsappPulse 2.8s ease-out 1.2s infinite;
}
.whatsapp-float:hover {
  color: #fff;
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 12px 30px rgba(37, 211, 102, 0.5);
}
.whatsapp-float:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 4px;
}
.whatsapp-float .fa-whatsapp {
  font-size: 30px;
  line-height: 1;
}

@media (max-width: 480px) {
  .whatsapp-float {
    right: 18px;
    bottom: 20px;
    width: 52px;
    height: 52px;
  }
  .whatsapp-float .fa-whatsapp {
    font-size: 27px;
  }
}

.page-transition {
  opacity: 1;
  transition: opacity 0.3s ease-in-out;
}
.page-transition.loading {
  opacity: 0;
}

/* FOOTER */
.footer {
  background-color: var(--surface-color);
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-16);
  padding-bottom: var(--space-6);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
  margin-bottom: var(--space-10);
}
.footer-col h4 {
  font-size: var(--text-lg);
  margin-bottom: var(--space-4);
  color: var(--text-primary);
}
.footer-col p {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  line-height: var(--leading-loose);
}
.footer-col ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.footer-col ul a {
  color: var(--text-secondary);
  font-size: var(--text-sm);
  transition: color var(--transition-fast);
}
.footer-col ul a:hover {
  color: var(--color-primary);
}

.footer-social {
  display: flex;
  gap: var(--space-4);
}
.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: var(--surface-color-2);
  color: var(--text-primary);
  font-size: var(--text-lg);
  transition: all var(--transition-fast);
}
.footer-social a:hover {
  background: var(--color-primary);
  color: white;
  box-shadow: var(--shadow-glow-primary);
  transform: translateY(-2px);
}

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-6);
  text-align: center;
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* GRIDS */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

/* FLEX UTILITIES */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}
.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.flex-col {
  display: flex;
  flex-direction: column;
}

/* SECTION */
.section {
  padding-block: var(--space-16);
}
.section-header {
  margin-bottom: var(--space-12);
}

/* RESPONSIVE LAYOUTS */
@media (min-width: 768px) {
  .header-nav {
    display: flex;
  }
  .mobile-menu-btn {
    display: none;
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .section {
    padding-block: var(--space-24);
  }
}

@media (min-width: 1024px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr 1fr;
  }
}

@media (max-width: 767px) {
  .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .section {
    padding-block: var(--space-12);
  }
  .header-logo-text {
    font-size: var(--text-lg);
  }
}
