/* ==================================== */
/* 1. Estilos Globales y Contenedores */
/* ==================================== */

main {
  /* Se mantiene la estructura Flexbox para centrar el contenido */
  display: flex;
  flex-direction: column; 
  justify-content: center;
  align-items: center; 
  min-height: 100vh;
  margin-top: 50px; /* Offset para el navbar fixed-top */
  padding: 4rem 1rem;
  background: linear-gradient(135deg, var(--arena-suave), var(--sal-marina));
  animation: fadeIn 0.8s ease;
}

/* ... (Estilos de .form-wrapper si aplican en otras páginas) */


/* ==================================== */
/* 2. Filtros (Categorías) */
/* ==================================== */

.filtro-categorias {
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
}

/* Integración con las clases de Bootstrap usadas en JS (btn-outline-secondary) */
.filtro-categorias button {
  padding: 0.5rem 1rem;
  border-radius: 50px;
  /* Sobrescribe el borde de Bootstrap para usar la variable de color */
  border: 1.5px solid var(--turquesa-pastel); 
  background: #fff;
  color: var(--turquesa-pastel);
  font-weight: 600;
  transition: all 0.3s ease;
}

.filtro-categorias button:hover,
.filtro-categorias button.active {
  /* Aplica los colores de la clase .active personalizada */
  background-color: var(--turquesa-pastel);
  color: #fff;
}

.filtro-categorias button.active {
  box-shadow: 0 0 0 2px rgba(110, 191, 195, 0.3);
}

/* ==================================== */
/* 3. Cards de Servicios (Estilos unificados con Products) */
/* ==================================== */

.services-grid {
  /* Mantenemos el grid base, ajustando el minmax para que sea similar a products */
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); 
  gap: 2rem;
  max-width: 1200px; /* Heredado de #product-list */
  margin: 0 auto; /* Heredado de #product-list */
  padding: 2rem 0; /* Aseguramos padding */
}

.service-card {
  position: relative;
  width: 100%;
  max-width: 350px; /* Heredado de #product-list .card */
  height: 450px; /* Heredado de #product-list .card */
  border-radius: 15px;
  overflow: hidden;
  /* Sombra del producto (más prominente) */
  box-shadow: 0 8px 20px rgba(110, 191, 195, 0.2); 
  cursor: pointer;
  /* Transiciones del producto */
  transition: transform 0.4s ease, box-shadow 0.4s ease; 
  background: #fff;
}

/* Hover de la card - UNIFICADO */
.service-card:hover {
  transform: translateY(-8px); /* Heredado de product */
  box-shadow: 0 12px 30px rgba(110, 191, 195, 0.35); /* Heredado de product */
}

/* IMAGEN DE LA CARD - MODIFICADO */
.service-image {
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  position: absolute; /* Aseguramos que cubra toda la card */
  top: 0;
  left: 0;
  /* Transiciones y filtro del producto */
  transition: transform 0.4s ease, filter 0.4s ease; 
  filter: brightness(1);
}

/* Oscurecer y escalar imagen en hover - UNIFICADO */
.service-card:hover .service-image {
  transform: scale(1.08); 
  filter: brightness(50%);
}

/* INFORMACIÓN DE LA CARD (OVERLAY) - MODIFICADO */
.service-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  /* Degradado del producto (más claro y suave) */
  background: linear-gradient(135deg, rgba(215, 236, 235, 0.95) 0%, rgba(184, 227, 232, 0.95) 50%, rgba(110, 191, 195, 0.95) 100%);
  color: #4A4A4A; /* Gris Humo para mejor contraste */
  opacity: 0;
  transition: opacity 0.4s ease; /* Transición del producto */
  text-align: center;
  padding: 1.5rem;
  z-index: 10;
  overflow-y: auto; 
  backdrop-filter: none; /* Eliminamos backdrop-filter si usamos un gradiente opaco */
}

/* Muestra la información al hacer hover - UNIFICADO */
.service-card:hover .service-overlay {
  opacity: 1;
}

/* TEXTOS DE LA CARD - NUEVOS ESTILOS */
.service-overlay h3 {
  font-size: 1.4rem; /* Heredado de .card-title */
  font-weight: 700;
  margin-bottom: 0.8rem;
  color: #4A4A4A; /* Gris Humo */
  text-shadow: 0 1px 2px rgba(255,255,255,0.5);
  line-height: 1.3;
}

.service-overlay p {
  /* Estilo general de .card-text (descripción) */
  font-size: 0.9rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
  color: #4A4A4A; /* Gris Humo */
  max-height: 120px;
  overflow-y: auto;
  padding: 0 0.5rem;
}

/* Scrollbar personalizado (copiado de product.css) */
.service-overlay p::-webkit-scrollbar {
  width: 5px;
}
.service-overlay p::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
}
.service-overlay p::-webkit-scrollbar-thumb {
  background: rgba(110, 191, 195, 0.6);
  border-radius: 10px;
}

.service-info {
  /* Estilo de precio/duración (simulando .text-success) */
  font-size: 1.4rem; 
  font-weight: 700;
  margin-top: 0.5rem; /* Ajuste manual */
  margin-bottom: 0.8rem;
  color: #6EBFC3; /* Turquesa Pastel */
}


/* Botón de Agendar - UNIFICADO con .card-actions button */
.btn-agendar {
  background: #6EBFC3; /* Turquesa Pastel */
  color: white;
  border: none;
  padding: 0.8rem 2rem; /* Heredado de product */
  border-radius: 10px; /* Heredado de product */
  font-weight: 700;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
  margin-top: 1rem; /* Separación del texto */
}

.btn-agendar:hover {
  background: #EBD2EC; /* Lila Pastel (Hover de product) */
  color: #4A4A4A; /* Gris Humo */
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(235, 210, 236, 0.4);
}

.btn-agendar:active {
  transform: translateY(0);
}

/* ==================================== */
/* 4. Estados, Mensajes y Utilidades (sin cambios, mantienen su funcionalidad) */
/* ==================================== */
/* ... */

/* ==================================== */
/* 6. Media Queries (Ajustadas a los nuevos tamaños de card) */
/* ==================================== */

@media (max-width: 576px) {
  main {
    padding: 2rem 1rem;
  }

  .form-wrapper {
    padding: 2rem 1rem;
  }

  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .service-card {
    height: 380px; /* Heredado de product @ 576px */
    min-height: auto; 
  }

  /* Ajustes de tipografía heredados de product @ 768px */
  .service-overlay h3 {
    font-size: 1.3rem; 
  }
  
  .service-overlay p,
  .service-info {
    font-size: 0.9rem;
  }

  .service-info {
    font-size: 1.1rem; /* Heredado de .text-success @ 768px */
  }

  .btn-agendar {
    font-size: 0.9rem; /* Heredado de button @ 768px */
    padding: 0.7rem 1.5rem; /* Heredado de button @ 768px */
  }


  .filtro-categorias {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 0 1rem;
  }

  .filtro-categorias button {
    width: 100%;
    font-size: 1rem;
    padding: 0.6rem 1rem;
  }
}