.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  border-radius: 9999px;
  background-color: var(--f7-ios-primary);
  color: #ffffff;
  transition: all 0.2s ease;
  cursor: default;
  max-width: 100%;
  white-space: nowrap;
}

.services-grid-header {
  padding-top: 1rem;
  padding-bottom: 1.75rem;
  margin-top: 4rem;
  text-align: center;
}

.services-grid-header.light {
  color: var(--f7-color-white);
}

.services-grid-header.light .services-title {
  opacity: 0.95;
  color: var(--f7-color-white);
}

.services-grid-header.light .services-subtitle {
  opacity: 0.90;
  color: var(--f7-color-white);
}

.services-title {
  font-size: 2.75rem;
  margin-top: 1rem;
}

.services-subtitle {
  font-size: 1.25rem;
  margin-top: 1rem;
  font-family: 'Garamond';
}

.grid-services {
  padding: 1.5rem 0;
  padding-bottom: 5rem;
}

/* ==============================================
   TARJETAS - ESTILO ALDEA XUX
   La imagen domina la tarjeta
   ============================================== */

.grid-services .card {
  display: flex;
  flex-direction: column;
  background-color: var(--xux-bg-card);
  border-radius: 28px;
  border: none;
  box-shadow: var(--xux-shadow-sm);
  transition: var(--xux-transition);
  overflow: hidden;
  height: 100%;

  outline: 1px solid var(--xux-border-light);
  outline-offset: -1px;
}

.grid-services .card:hover {
  transform: translateY(-8px);
  box-shadow: var(--xux-shadow-hover);
  outline-color: var(--xux-verde-claro);
}

/* ==============================================
   IMAGEN - LA PROTAGONISTA
   Mucho más altura para que la naturaleza respire
   ============================================== */

.grid-services .card-header {
  opacity: 0;
  display: block;
  width: 100%;
  height: 380px;
  object-fit: cover;
  transition: transform 1.5s ease, opacity 0.6s ease;

  filter: brightness(1) contrast(1.02);
}

.grid-services .card-header-overlay:after {
  content: "";
  inset: 0;
  position: absolute;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.95) 100%);
}

.grid-services .card-header-overlay:before {
  content: "";
  inset: 0;
  position: absolute;
  pointer-events: none;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.66) 100%);
}

.grid-services .card-header[src]:not([src*="white.webp"]) {
  opacity: 1;
}

/* Efecto de acercamiento lento al hacer hover - invita a explorar */
.grid-services .card:hover .card-header {
  transform: scale(1.05);
  filter: brightness(1.02) contrast(1.05);
}

/* ==============================================
   CONTENIDO - COMPACTO PERO ELEGANTE
   La imagen es la estrella, el texto acompaña
   ============================================== */

.grid-services .card-content {
  padding: 1.5rem 1.5rem 1.75rem !important;
  background: var(--xux-bg-card);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

/* Título - Inspirador y calmado */
.grid-services .card-title {
  font-size: 1.6rem;
  font-weight: 480;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #000000;
  margin-bottom: 0.65rem;
  padding-bottom: 0.65rem;

  /* Línea orgánica sutil */
  border-bottom: 2px solid var(--xux-beige-arena);
  transition: border-color 0.3s ease;
  /* font-family: 'Garamond'; */
}

.grid-services .card:hover .card-title {
  border-bottom-color: var(--xux-naranja-calido);
}

/* Descripción - Sensorial y breve */
.grid-services .card-content p {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--xux-texto-claro);
  margin: 0;
  font-weight: 350;

  /* Máximo 3 líneas para no competir con la imagen */
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Viñeta orgánica estilo Aldea Xux */
.grid-services .card-content p::before {
  content: "🌿 ";
  opacity: 0.65;
  font-size: 0.9em;
  margin-right: 2px;
}

/* ==============================================
   RESPONSIVE - La imagen siempre predomina
   ============================================== */

/* Desktop grandes - Imagen aún más imponente */
@media (min-width: 1200px) {
  .grid-services .card-header {
    height: 420px;
  }
}

/* Tablets */
@media (max-width: 992px) and (min-width: 641px) {
  .grid-services .card-header {
    height: 320px;
  }

  .grid-services .card-title {
    font-size: 1.45rem;
  }
}

/* Móviles - La imagen sigue siendo la protagonista */
@media (max-width: 640px) {
  .grid-services .card-header {
    height: 260px;
  }

  .grid-services .card-content {
    padding: 1.25rem 1.25rem 1.5rem !important;
  }

  .grid-services .card-title {
    font-size: 1.35rem;
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .grid-services .card-content p {
    font-size: 0.9rem;
    -webkit-line-clamp: 2;
    /* Más compacto en móvil */
  }
}

/* Móviles pequeños */
@media (max-width: 480px) {
  .grid-services .card-header {
    height: 240px;
  }
}

/* ==============================================
   LAZY LOADING - Transición suave al cargar
   ============================================== */

.grid-services .card-header.opacity-0 {
  opacity: 0;
}

.grid-services .card-header:not(.opacity-0) {
  opacity: 1;
}

/* Efecto de carga progresiva - textura selva */
.grid-services .card-header[src*="white.webp"] {
  background: linear-gradient(135deg,
      var(--xux-beige-arena) 0%,
      var(--xux-verde-claro) 50%,
      var(--xux-beige-arena) 100%);
  background-size: 200% 200%;
  animation: xuxLoadingShimmer 1.8s ease-in-out infinite;
}

@keyframes xuxLoadingShimmer {
  0% {
    background-position: 0% 0%;
  }

  50% {
    background-position: 100% 100%;
  }

  100% {
    background-position: 0% 0%;
  }
}

/* ==============================================
   ANIMACIONES DE ENTRADA
   Respira, estás en Aldea Xux
   ============================================== */

@keyframes xuxFadeUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid-services .card {
  animation: xuxFadeUp 0.7s ease forwards;
  opacity: 0;
}

.grid-services .card:nth-child(1) {
  animation-delay: 0.05s;
}

.grid-services .card:nth-child(2) {
  animation-delay: 0.15s;
}

.grid-services .card:nth-child(3) {
  animation-delay: 0.25s;
}

.grid-services .card:nth-child(4) {
  animation-delay: 0.35s;
}

.grid-services .card {
  opacity: 1;
}

/* ==============================================
   DETALLE ESPECIAL - CTA INTEGRADO (OPCIONAL)
   Por si quieres añadir un llamado a la acción sutil
   ============================================== */

.grid-services .card-content::after {
  content: "Descubre más →";
  display: block;
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 450;
  color: var(--xux-naranja-calido);
  opacity: 0;
  transform: translateX(-8px);
  transition: var(--xux-transition);
  letter-spacing: 0.3px;
}

.grid-services .card:hover .card-content::after {
  opacity: 1;
  transform: translateX(0);
}

/* ==============================================
   PREFERENCIAS DE MOVIMIENTO REDUCIDO
   ============================================== */

@media (prefers-reduced-motion: reduce) {

  .grid-services .card,
  .grid-services .card-header,
  .grid-services .card-content::after {
    animation: none;
    transition: none;
    transform: none;
  }

  .grid-services .card-header[src*="white.webp"] {
    animation: none;
  }
}