/* ============================================================
   LAYOUT CSS — RM Solutions Mx
   Estructura principal: header, footer, secciones, grids.
   Controla la disposición global de la plataforma.
   ============================================================ */

/* ---- Header / Navegación Principal ---- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: var(--border-width) solid var(--color-border-light);
  z-index: var(--z-header);
  transition: all var(--transition-base);
}

/* Header con scroll — sombra sutil */
.header--scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow-soft);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-xl);
}

/* Logo en el header */
.header__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.header__logo-img {
  height: 36px;
  width: auto;
}

.header__logo-text {
  font-size: var(--font-size-md);
  font-weight: var(--font-weight-bold);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
}

/* Navegación */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-xl);
}

.nav__link {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  position: relative;
  padding: var(--space-xs) 0;
  transition: color var(--transition-fast);
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background-color: var(--color-text);
  transition: width var(--transition-base);
}

.nav__link:hover,
.nav__link--active {
  color: var(--color-text);
}

.nav__link:hover::after,
.nav__link--active::after {
  width: 100%;
}

/* Botón del menú hamburguesa (móvil) */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 32px;
  height: 32px;
  cursor: pointer;
  z-index: calc(var(--z-header) + 10);
}

.nav-toggle__line {
  width: 22px;
  height: 1.5px;
  background-color: var(--color-text);
  transition: all var(--transition-base);
  transform-origin: center;
}

.nav-toggle__line + .nav-toggle__line {
  margin-top: 6px;
}

/* Estado activo del hamburguesa */
.nav-toggle--active .nav-toggle__line:nth-child(1) {
  transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle--active .nav-toggle__line:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav-toggle--active .nav-toggle__line:nth-child(3) {
  transform: translateY(-7.5px) rotate(-45deg);
}

/* ---- Secciones Generales ---- */
.section {
  padding: var(--space-5xl) 0;
}

.section--alt {
  background-color: var(--color-bg-alt);
}

/* ---- Grid de contenido ---- */
.grid {
  display: grid;
  gap: var(--space-xl);
}

.grid--2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid--4 {
  grid-template-columns: repeat(4, 1fr);
}

/* ---- Footer ---- */
.footer {
  background-color: var(--color-text);
  color: var(--color-text-inverse);
  padding: var(--space-4xl) 0 var(--space-xl);
}

.footer__inner {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-3xl);
  margin-bottom: var(--space-3xl);
}

.footer__brand {
  max-width: 360px;
}

.footer__logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.footer__logo-text {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-inverse);
}

.footer__tagline {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.6);
  line-height: var(--line-height-relaxed);
}

.footer__heading {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.4);
  margin-bottom: var(--space-lg);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer__link {
  font-size: var(--font-size-sm);
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-text-inverse);
}

.footer__bottom {
  border-top: var(--border-width) solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-xl);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: var(--font-size-xs);
  color: rgba(255, 255, 255, 0.4);
}

.footer__social {
  display: flex;
  gap: var(--space-md);
}

.footer__social-link {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-full);
  border: var(--border-width) solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.6);
  transition: all var(--transition-fast);
}

.footer__social-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-text-inverse);
  border-color: rgba(255, 255, 255, 0.3);
}

/* ---- Espaciador del header fijo ---- */
.header-spacer {
  height: var(--header-height);
}
