/* ===================================================
   SHARED.CSS — Sistema de diseno compartido Grupo Amulek
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text, #1A1A1A);
  background: var(--white, #FFFFFF);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

ul, ol {
  list-style: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

/* --- CSS Custom Properties (defaults, overridden per page) --- */
:root {
  --primary: #1B4FA0;
  --primary-dark: #0D2E6E;
  --primary-light: #4A90D9;
  --accent: #1B4FA0;
  --accent-light: #4A90D9;
  --bg-alt: #F4F6F9;
  --bg-footer: #0A1F4E;
  --text: #1A1A1A;
  --text-muted: #5A6270;
  --white: #FFFFFF;

  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Montserrat', sans-serif;

  --nav-height: 80px;
  --container-max: 1280px;
  --section-pad-y: clamp(3rem, 6vw, 6rem);
  --section-pad-x: clamp(1rem, 4vw, 2rem);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-pill: 100px;

  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --shadow-nav: 0 2px 20px rgba(0,0,0,0.06);

  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Typography --- */
.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.7;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--section-pad-x);
}

.section {
  padding: var(--section-pad-y) 0;
}

.section-header {
  text-align: center;
  margin-bottom: clamp(2rem, 4vw, 3.5rem);
}

.section-header .section-subtitle {
  margin-left: auto;
  margin-right: auto;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.875rem 2rem;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: var(--radius-pill);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
  cursor: pointer;
  white-space: nowrap;
}

.btn:hover {
  transform: scale(1.02);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent, var(--primary));
  color: var(--white);
}

.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border: 2px solid var(--white);
}

.btn-outline:hover {
  background: var(--white);
  color: var(--primary);
}

.btn-outline-dark {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline-dark:hover {
  background: var(--primary);
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-body {
  padding: 1.5rem;
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
  color: rgba(255,255,255,0.8);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: var(--white);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), background var(--transition-fast);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: rgba(255,255,255,0.5);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  border-color: var(--accent, var(--primary-light));
  background: rgba(255,255,255,0.15);
}

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select option {
  background: var(--primary-dark, #0D2E6E);
  color: var(--white);
}

.form-light .form-input,
.form-light .form-textarea,
.form-light .form-select {
  background: var(--white);
  color: var(--text);
  border-color: #ddd;
}

.form-light .form-input::placeholder,
.form-light .form-textarea::placeholder {
  color: #999;
}

.form-light .form-label {
  color: var(--text);
}

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.filter-pill {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 0.85rem;
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--primary);
  color: var(--white);
}

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  text-align: center;
  padding: 3rem 0;
}

.stat-item .stat-number {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-item .stat-label {
  font-size: 0.85rem;
  opacity: 0.7;
  font-weight: 500;
}

/* ===================================================
   NAVBAR
   =================================================== */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  transition: box-shadow var(--transition-base), background var(--transition-base);
}

.navbar.scrolled {
  box-shadow: var(--shadow-nav);
}

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

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  z-index: 1001;
  flex-shrink: 0;
}

.nav-logo-icon {
  width: 36px;
  height: 36px;
}

.nav-logo span {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.nav-logo .logo-sub {
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  font-weight: 600;
  font-size: 0.9rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent, var(--primary));
  transition: width var(--transition-base);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Group Selector Pills */
.group-pills {
  display: flex;
  gap: 0.25rem;
  background: rgba(0,0,0,0.06);
  border-radius: var(--radius-pill);
  padding: 0.2rem;
}

.group-pill {
  padding: 0.35rem 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.group-pill:hover {
  color: var(--text);
}

.group-pill.active {
  background: var(--primary);
  color: var(--white);
  box-shadow: var(--shadow-sm);
}

/* Nav CTA */
.nav-cta {
  padding: 0.5rem 1.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-pill);
  background: var(--accent, var(--primary));
  color: var(--white);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-cta:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  padding: 4px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: currentColor;
  transition: transform var(--transition-base), opacity var(--transition-fast);
  display: block;
}

.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Drawer */
.nav-drawer {
  display: none;
}

/* ===================================================
   FOOTER
   =================================================== */
.footer {
  padding: 4rem 0 2rem;
  color: rgba(255,255,255,0.8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer-brand .footer-logo {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--white);
  margin-bottom: 1rem;
  display: block;
}

.footer-brand p {
  font-size: 0.875rem;
  line-height: 1.7;
  max-width: 30ch;
  opacity: 0.7;
}

.footer-col h4 {
  color: var(--white);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-col ul li {
  margin-bottom: 0.6rem;
}

.footer-col ul li a {
  font-size: 0.875rem;
  opacity: 0.7;
  transition: opacity var(--transition-fast);
}

.footer-col ul li a:hover {
  opacity: 1;
}

.footer-grupo-tag {
  display: inline-block;
  font-size: 0.65rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-pill);
  background: rgba(255,255,255,0.1);
  margin-left: 0.25rem;
  vertical-align: middle;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  opacity: 0.5;
}

.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all var(--transition-fast);
}

.footer-social a:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.4);
}

.footer-social svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* ===================================================
   CONTACT SECTION (shared structure)
   =================================================== */
.contact-section .contact-grid,
.cta-section .contact-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: start;
}

.contact-info-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.contact-icon svg {
  width: 20px;
  height: 20px;
}

.contact-info-item h4 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  margin-bottom: 0.2rem;
}

.contact-info-item p {
  font-size: 0.9rem;
  opacity: 0.75;
}

/* ===================================================
   TESTIMONIALS (shared structure)
   =================================================== */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.testimonial-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.testimonial-quote {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  position: relative;
  padding-top: 1.5rem;
}

.testimonial-quote::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 24px;
  background: var(--primary);
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M0 24V12.8C0 4.48 5.12 0.64 12.8 0l1.28 3.2C9.28 4.16 7.36 7.04 7.36 12.8H12.8V24H0zm17.92 0V12.8c0-8.32 5.12-12.16 12.8-12.8l1.28 3.2c-4.8.96-6.72 3.84-6.72 9.6h5.44V24h-12.8z'/%3E%3C/svg%3E") no-repeat center;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 24'%3E%3Cpath d='M0 24V12.8C0 4.48 5.12 0.64 12.8 0l1.28 3.2C9.28 4.16 7.36 7.04 7.36 12.8H12.8V24H0zm17.92 0V12.8c0-8.32 5.12-12.16 12.8-12.8l1.28 3.2c-4.8.96-6.72 3.84-6.72 9.6h5.44V24h-12.8z'/%3E%3C/svg%3E") no-repeat center;
  opacity: 0.15;
}

.testimonial-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.testimonial-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
}

.testimonial-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
}

.testimonial-role {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ===================================================
   SCROLL REVEAL ANIMATIONS
   =================================================== */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-slow), transform var(--transition-slow);
}

.reveal-stagger.revealed > * {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.revealed > *:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.revealed > *:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.revealed > *:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.revealed > *:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.revealed > *:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.revealed > *:nth-child(6) { transition-delay: 0.5s; }

/* Scroll indicator for hero */
.scroll-indicator {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.6);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.scroll-indicator::after {
  content: '';
  width: 1px;
  height: 40px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.6), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.3; transform: scaleY(0.6); }
  50% { opacity: 1; transform: scaleY(1); }
}

/* ===================================================
   REDUCED MOTION
   =================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal, .reveal-stagger > * {
    opacity: 1;
    transform: none;
  }

  html {
    scroll-behavior: auto;
  }
}

/* ===================================================
   RESPONSIVE — TABLET (768px+)
   =================================================== */
@media (min-width: 768px) {
  .stats-row {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

  .contact-section .contact-grid,
  .cta-section .contact-grid {
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
  }
}

/* ===================================================
   RESPONSIVE — DESKTOP (1024px+)
   =================================================== */
@media (min-width: 1024px) {
  .testimonials-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

/* ===================================================
   RESPONSIVE — LARGE (1440px+)
   =================================================== */
@media (min-width: 1440px) {
  :root {
    --container-max: 1340px;
    --section-pad-y: 7rem;
  }
}

/* ===================================================
   RESPONSIVE — MOBILE (< 768px)
   =================================================== */
@media (max-width: 767px) {
  .nav-links,
  .group-pills-desktop,
  .nav-cta-desktop {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 360px;
    height: 100vh;
    height: 100dvh;
    background: var(--white, #fff);
    z-index: 999;
    padding: calc(var(--nav-height) + 1rem) 1.5rem 2rem;
    transition: right var(--transition-base);
    overflow-y: auto;
    display: block;
  }

  .nav-drawer.open {
    right: 0;
    box-shadow: -10px 0 40px rgba(0,0,0,0.15);
  }

  .nav-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-bottom: 2rem;
  }

  .nav-drawer-links a {
    display: block;
    padding: 0.75rem 0;
    font-weight: 600;
    font-size: 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.06);
  }

  .nav-drawer .group-pills {
    flex-direction: column;
    background: var(--bg-alt, #F4F6F9);
    padding: 0.5rem;
    border-radius: var(--radius-md);
  }

  .nav-drawer .group-pill {
    padding: 0.6rem 1rem;
    text-align: center;
  }

  .nav-drawer .nav-cta-mobile {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 1.5rem;
    padding: 0.75rem;
    border-radius: var(--radius-pill);
    background: var(--accent, var(--primary));
    color: var(--white);
    font-weight: 600;
  }

  .nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-base);
  }

  .nav-overlay.open {
    opacity: 1;
    pointer-events: auto;
  }

  .contact-section .contact-grid,
  .cta-section .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
}
