/* ============================================
   Casa Hogar Geriátrico Divina Esperanza
   Hoja de estilos principal
   ============================================ */

:root {
  --color-primary: #0F9B8E;
  --color-primary-dark: #0b7a70;
  --color-primary-light: #5fc7ba;
  --color-secondary: #2E8B3D;
  --color-accent: #2E6DA4;
  --color-whatsapp: #25D366;
  --color-whatsapp-dark: #1da851;
  --color-bg: #F7FAF9;
  --color-bg-alt: #EDF6F4;
  --color-white: #FFFFFF;
  --color-text: #2C2C2A;
  --color-text-light: #55564f;
  --color-border: #dfe9e6;

  --font-base: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;

  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --shadow-sm: 0 2px 8px rgba(44, 44, 42, 0.08);
  --shadow-md: 0 6px 24px rgba(44, 44, 42, 0.12);
  --shadow-lg: 0 18px 48px rgba(15, 155, 142, 0.18);

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --transition: 0.35s var(--ease);

  --header-height: 78px;
  --container-width: 1180px;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-base);
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

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

ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4, p {
  margin: 0 0 1rem 0;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

section {
  padding: 64px 0;
  position: relative;
}

.section-heading {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 42px auto;
}

.section-heading h2 {
  font-size: 2.1rem;
  color: var(--color-primary-dark);
}

.section-heading p {
  font-size: 1.15rem;
  color: var(--color-text-light);
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 8px;
  position: relative;
  padding-left: 22px;
}

.eyebrow::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-secondary);
}

/* ============================================
   SCROLL REVEAL ANIMATIONS
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

.reveal-zoom {
  opacity: 0;
  transform: scale(0.92);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-zoom.in-view {
  opacity: 1;
  transform: scale(1);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-left.in-view {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(32px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.reveal-right.in-view {
  opacity: 1;
  transform: translateX(0);
}

/* Stagger helper delays for grids */
.stagger > * {
  transition-delay: calc(var(--stagger-index, 0) * 0.08s);
}

/* ============================================
   BUTTONS
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 30px;
  border-radius: 50px;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  isolation: isolate;
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.25);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
  z-index: -1;
}

.btn:hover::after {
  transform: scaleX(1);
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:active {
  transform: translateY(-1px) scale(0.98);
}

.btn svg {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  transition: transform 0.3s var(--ease);
}

.btn:hover svg {
  transform: rotate(-8deg) scale(1.1);
}

.btn-whatsapp {
  background: var(--color-whatsapp);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn-whatsapp:hover {
  background: var(--color-whatsapp-dark);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45);
}

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

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

.btn-large {
  padding: 20px 40px;
  font-size: 1.2rem;
}

/* ============================================
   HEADER
   ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--color-white);
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, height 0.3s ease;
}

.site-header.scrolled {
  box-shadow: 0 8px 30px rgba(44, 44, 42, 0.14);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  transition: transform 0.25s var(--ease);
}

.brand:hover {
  transform: translateY(-1px);
}

.brand img {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--color-bg-alt);
  transition: border-color 0.25s ease, transform 0.25s ease;
}

.brand:hover img {
  border-color: var(--color-primary);
  transform: rotate(-6deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 1.05rem;
  color: var(--color-primary-dark);
}

.brand-text span {
  font-size: 0.8rem;
  color: var(--color-text-light);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-links {
  display: flex;
  gap: 28px;
}

.nav-links a {
  position: relative;
  font-weight: 600;
  font-size: 1rem;
  color: var(--color-text);
  padding: 6px 2px;
  display: inline-block;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background: var(--color-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--color-primary-dark);
}

.nav-links a:hover::after,
.nav-links a[aria-current="page"]::after {
  transform: scaleX(1);
}

.header-cta {
  display: flex;
  align-items: center;
  gap: 16px;
}

.btn-whatsapp-header {
  background: var(--color-whatsapp);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s ease;
}

.btn-whatsapp-header svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s var(--ease);
}

.btn-whatsapp-header:hover {
  background: var(--color-whatsapp-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.4);
}

.btn-whatsapp-header:hover svg {
  transform: rotate(-10deg) scale(1.15);
}

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  transition: background 0.2s ease;
}

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

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  margin: 0 auto;
  background: var(--color-primary-dark);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   DECORATIVE BLOBS + KEYFRAMES
   ============================================ */
@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -24px) scale(1.06); }
  66% { transform: translate(-16px, 14px) scale(0.96); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulseRing {
  0% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
  70% { box-shadow: 0 0 0 16px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}

@keyframes heroSlide {
  0%, 28% { opacity: 1; }
  33%, 95% { opacity: 0; }
  100% { opacity: 1; }
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(40px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
  animation: floatBlob 14s ease-in-out infinite;
}

.blob-1 {
  width: 320px;
  height: 320px;
  background: var(--color-primary-light);
  top: -80px;
  right: -60px;
}

.blob-2 {
  width: 260px;
  height: 260px;
  background: var(--color-accent);
  bottom: -60px;
  left: -40px;
  animation-delay: 3s;
  opacity: 0.2;
}

.blob-3 {
  width: 200px;
  height: 200px;
  background: var(--color-secondary);
  top: 30%;
  left: 45%;
  animation-delay: 6s;
  opacity: 0.15;
}

/* ============================================
   HERO
   ============================================ */
.hero {
  background: linear-gradient(135deg, var(--color-bg-alt) 0%, var(--color-bg) 60%);
  padding: 60px 0 70px 0;
  overflow: hidden;
  position: relative;
}

.hero .container {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 48px;
  align-items: center;
  position: relative;
  z-index: 1;
}

.hero-copy .eyebrow {
  color: var(--color-accent);
}

.hero-copy h1 {
  font-size: 2.7rem;
  line-height: 1.15;
  color: var(--color-primary-dark);
  animation: fadeIn 0.8s var(--ease) both;
}

.hero-copy .subtitle {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--color-secondary);
}

.hero-copy .lead {
  font-size: 1.15rem;
  color: var(--color-text-light);
  margin-bottom: 28px;
}

.hero-image {
  position: relative;
  border-radius: var(--radius-lg);
  min-height: 380px;
}

.hero-slideshow {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-slideshow::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  border: 6px solid var(--color-white);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  z-index: 3;
}

.hero-slideshow img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  animation: heroSlide 12s infinite;
}

.hero-slideshow img:nth-child(1) { animation-delay: 0s; }
.hero-slideshow img:nth-child(2) { animation-delay: 4s; }
.hero-slideshow img:nth-child(3) { animation-delay: 8s; }

.hero-badge {
  position: absolute;
  bottom: 18px;
  left: 18px;
  z-index: 4;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50px;
  padding: 10px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--color-primary-dark);
  box-shadow: var(--shadow-sm);
  animation: popIn 0.6s var(--ease) 0.4s both;
}

.hero-badge svg {
  width: 20px;
  height: 20px;
  color: var(--color-whatsapp);
}

/* ============================================
   STATS STRIP
   ============================================ */
.stats {
  background: var(--color-white);
  padding: 0;
  margin-top: -34px;
  position: relative;
  z-index: 2;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 30px 20px;
}

.stat-item {
  text-align: center;
  padding: 10px;
  border-right: 1px solid var(--color-border);
}

.stat-item:last-child {
  border-right: none;
}

.stat-number {
  display: block;
  font-size: 2.3rem;
  font-weight: 800;
  color: var(--color-primary-dark);
  line-height: 1.1;
}

.stat-label {
  display: block;
  margin-top: 6px;
  font-size: 0.95rem;
  color: var(--color-text-light);
  font-weight: 600;
}

/* ============================================
   SERVICE CARDS GRID (with images)
   ============================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.service-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  overflow: hidden;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

.service-media {
  position: relative;
  height: 150px;
  overflow: hidden;
}

.service-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.service-card:hover .service-media img {
  transform: scale(1.12);
}

.service-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 155, 142, 0) 40%, rgba(11, 46, 42, 0.35) 100%);
}

.service-icon {
  width: 54px;
  height: 54px;
  margin: -27px auto 12px auto;
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--color-bg-alt);
  transition: transform 0.35s var(--ease), background 0.35s ease, color 0.35s ease;
}

.service-card:hover .service-icon {
  background: var(--color-primary);
  color: #fff;
  transform: scale(1.1) rotate(-8deg);
}

.service-icon svg {
  width: 26px;
  height: 26px;
}

.service-body {
  padding: 0 20px 26px 20px;
}

.service-card h3 {
  font-size: 1.08rem;
  color: var(--color-primary-dark);
  margin-bottom: 8px;
}

.service-card p {
  font-size: 0.95rem;
  color: var(--color-text-light);
  margin-bottom: 0;
}

/* ============================================
   TRUST STRIP
   ============================================ */
.trust-strip {
  background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 36px 0;
}

.trust-strip .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.trust-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 1.4rem;
  font-weight: 700;
}

.trust-heading svg {
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  animation: floatBlob 6s ease-in-out infinite;
}

.trust-details {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  font-size: 1.05rem;
}

.trust-details a {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  transition: transform 0.25s var(--ease);
}

.trust-details a:hover {
  transform: translateY(-2px);
  text-decoration: underline;
}

.trust-details svg {
  width: 20px;
  height: 20px;
}

/* ============================================
   CLOSING CTA
   ============================================ */
.closing-cta {
  background: var(--color-bg-alt);
  text-align: center;
  padding: 76px 0;
  position: relative;
  overflow: hidden;
}

.closing-cta h2 {
  font-size: 2.1rem;
  color: var(--color-primary-dark);
}

.closing-cta p {
  font-size: 1.2rem;
  color: var(--color-text-light);
  margin-bottom: 30px;
}

/* ============================================
   PAGE HERO (banner for interior pages)
   ============================================ */
.page-hero {
  background: linear-gradient(120deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  padding: 58px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.page-hero h1 {
  font-size: 2.3rem;
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  animation: fadeIn 0.7s var(--ease) both;
}

.page-hero p {
  font-size: 1.15rem;
  opacity: 0.95;
  max-width: 640px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ============================================
   FLIP CARDS DE SERVICIOS (servicios.html)
   Grid fijo de filas y columnas, tarjetas con
   volteo 3D al pasar el cursor o al tocar.
   ============================================ */
.flip-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 340px;
  gap: 26px;
}

.flip-card {
  perspective: 1400px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.7s var(--ease);
  transform-style: preserve-3d;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.flip-card:hover .flip-card-inner,
.flip-card.flipped .flip-card-inner {
  transform: rotateY(180deg);
  box-shadow: var(--shadow-lg);
}

.flip-front,
.flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.flip-front {
  background-size: cover;
  background-position: center;
}

.flip-front::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 46, 42, 0.05) 30%, rgba(11, 46, 42, 0.88) 100%);
}

.flip-front-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 20px;
  z-index: 1;
  color: #fff;
}

.flip-front .service-icon {
  margin: 0 0 12px 0;
  background: rgba(255, 255, 255, 0.92);
  transition: transform 0.4s var(--ease);
}

.flip-card:hover .flip-front .service-icon {
  transform: scale(1.1) rotate(-8deg);
}

.flip-front-content h3 {
  font-size: 1.15rem;
  margin-bottom: 4px;
  color: #fff;
}

.flip-hint {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 600;
  color: #d7ece8;
  opacity: 0.9;
}

.flip-hint svg {
  width: 15px;
  height: 15px;
}

.flip-back {
  background: linear-gradient(150deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: #fff;
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 30px 26px;
}

.flip-back .service-icon {
  margin: 0 0 16px 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

.flip-back h3 {
  color: #fff;
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.flip-back p {
  font-size: 0.96rem;
  color: #e3f4f0;
  margin-bottom: 0;
  line-height: 1.55;
}

.flip-number {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-primary-dark);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ============================================
   NOSOTROS
   ============================================ */
.values-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.value-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 28px;
  border-top: 4px solid var(--color-primary);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

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

.value-card h3 {
  color: var(--color-primary-dark);
  font-size: 1.2rem;
}

.mission-vision {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
  margin-bottom: 50px;
}

.mv-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius-lg);
  padding: 34px;
  transition: transform 0.3s var(--ease);
}

.mv-card:hover {
  transform: translateY(-4px);
}

.mv-card h3 {
  color: var(--color-secondary);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
}

.mv-card h3 svg {
  width: 26px;
  height: 26px;
}

.team-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.team-card {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: 0 0 22px 0;
  text-align: center;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}

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

.team-photo {
  height: 170px;
  overflow: hidden;
  position: relative;
}

.team-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.team-card:hover .team-photo img {
  transform: scale(1.1);
}

.team-card h4 {
  margin: 18px 0 4px 0;
  color: var(--color-primary-dark);
}

.team-card span {
  color: var(--color-text-light);
  font-size: 0.9rem;
}

/* ============================================
   INSTALACIONES / GALLERY
   ============================================ */
.gallery-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.filter-btn {
  background: var(--color-white);
  border: 2px solid var(--color-border);
  color: var(--color-text-light);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 10px 22px;
  border-radius: 50px;
  transition: all 0.25s var(--ease);
}

.filter-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary-dark);
}

.filter-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  border: none;
  padding: 0;
  background: none;
  aspect-ratio: 4 / 3;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease), opacity 0.3s ease;
}

.gallery-item.hidden {
  display: none;
}

.gallery-item:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s var(--ease);
}

.gallery-item:hover img {
  transform: scale(1.08);
}

.gallery-zoom-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  color: var(--color-primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.gallery-zoom-icon svg {
  width: 18px;
  height: 18px;
}

.gallery-item:hover .gallery-zoom-icon {
  opacity: 1;
  transform: scale(1);
}

.gallery-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 14px;
  background: linear-gradient(0deg, rgba(0,0,0,0.7), transparent);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
}

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 23, 0.92);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 30px;
}

.lightbox.open {
  display: flex;
  animation: fadeIn 0.25s ease;
}

.lightbox-content {
  max-width: 900px;
  max-height: 86vh;
  width: 100%;
  text-align: center;
}

.lightbox-content img {
  max-width: 100%;
  max-height: 74vh;
  margin: 0 auto;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 40px rgba(0,0,0,0.5);
  animation: popIn 0.3s var(--ease);
}

.lightbox-caption {
  color: #fff;
  margin-top: 16px;
  font-size: 1.05rem;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.25s ease, transform 0.25s ease;
}

.lightbox-close svg,
.lightbox-prev svg,
.lightbox-next svg {
  width: 24px;
  height: 24px;
}

.lightbox-close {
  top: 24px;
  right: 24px;
}

.lightbox-prev {
  left: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
  background: var(--color-primary);
}

.lightbox-prev:hover { transform: translateY(-50%) scale(1.08); }
.lightbox-next:hover { transform: translateY(-50%) scale(1.08); }

/* ============================================
   CONTACTO
   ============================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 34px;
  align-items: start;
}

.contact-card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: 34px;
  box-shadow: var(--shadow-sm);
}

.contact-row {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
  transition: transform 0.25s var(--ease);
}

.contact-row:hover {
  transform: translateX(4px);
}

.contact-row:last-child {
  margin-bottom: 0;
}

.contact-row .icon-badge {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--color-bg-alt);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease, transform 0.3s var(--ease);
}

.contact-row:hover .icon-badge {
  background: var(--color-primary);
  color: #fff;
  transform: rotate(-8deg);
}

.contact-row .icon-badge svg {
  width: 24px;
  height: 24px;
}

.contact-row h4 {
  margin-bottom: 4px;
  color: var(--color-primary-dark);
  font-size: 1.05rem;
}

.contact-row p {
  margin-bottom: 0;
  color: var(--color-text-light);
}

.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.map-wrap iframe {
  width: 100%;
  height: 420px;
  border: 0;
  display: block;
}

.contact-photo-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 24px;
}

.contact-photo-strip img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s var(--ease);
}

.contact-photo-strip img:hover {
  transform: scale(1.05) translateY(-3px);
}

/* ============================================
   FLOATING WHATSAPP BUTTON + BACK TO TOP
   ============================================ */
.wa-float {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 300;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: var(--color-whatsapp);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.5);
  transition: transform 0.25s var(--ease);
  animation: pulseRing 2.6s infinite;
}

.wa-float:hover {
  transform: scale(1.1) rotate(6deg);
}

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

.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 96px;
  z-index: 299;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-white);
  color: var(--color-primary-dark);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease, background 0.25s ease;
}

.back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.back-to-top:hover {
  background: var(--color-primary);
  color: #fff;
}

.back-to-top svg {
  width: 22px;
  height: 22px;
}

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: #143b37;
  color: #d7e7e4;
  padding: 50px 0 24px 0;
  margin-top: 40px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 34px;
  margin-bottom: 30px;
}

.footer-brand {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.footer-brand img {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  flex-shrink: 0;
}

.footer-brand strong {
  color: #fff;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 6px;
}

.footer-brand p {
  font-size: 0.92rem;
  color: #b9d0cc;
  margin-bottom: 4px;
}

.footer-col h4 {
  color: #fff;
  font-size: 1rem;
  margin-bottom: 14px;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col a {
  color: #b9d0cc;
  font-size: 0.95rem;
  transition: color 0.2s ease, padding-left 0.2s ease;
}

.footer-col a:hover {
  color: #fff;
  padding-left: 4px;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.12);
  padding-top: 20px;
  text-align: center;
  font-size: 0.85rem;
  color: #93aca8;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .flip-grid {
    grid-template-columns: repeat(2, 1fr);
    grid-auto-rows: 320px;
  }

  .hero .container {
    grid-template-columns: 1fr;
  }

  .hero-image {
    order: -1;
  }

  .mission-vision {
    grid-template-columns: 1fr;
  }

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

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

  .stat-item:nth-child(2) {
    border-right: none;
  }

  .stat-item {
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 18px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 10px 20px 20px 20px;
    box-shadow: var(--shadow-md);
    transform: translateY(-8px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    max-height: 80vh;
    overflow-y: auto;
  }

  .main-nav.open {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }

  .nav-links {
    flex-direction: column;
    gap: 0;
  }

  .nav-links a {
    padding: 14px 4px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-links a::after {
    display: none;
  }

  .header-cta {
    margin-top: 14px;
  }

  .btn-whatsapp-header {
    justify-content: center;
    width: 100%;
  }

  .hamburger {
    display: flex;
  }

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

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

  .trust-strip .container {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .back-to-top {
    right: 84px;
    width: 42px;
    height: 42px;
  }

  .flip-grid {
    grid-auto-rows: 300px;
  }
}

@media (max-width: 480px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

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

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

  .flip-grid {
    grid-template-columns: 1fr;
    grid-auto-rows: 290px;
  }

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

  .stat-item {
    border-right: none;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .page-hero h1 {
    font-size: 1.7rem;
  }

  section {
    padding: 46px 0;
  }

  .brand-text span {
    display: none;
  }

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

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
