/* Variables de colores */
:root {
  --color-primary: #2c5530; /* Verde oscuro */
  --color-secondary: #8b4513; /* Marrón oscuro */
  --color-accent: #90ee90; /* Verde claro */
  --color-background: #f5f5dc; /* Beige claro */
  --color-text: #333333; /* Gris oscuro */
  --color-white: #ffffff;
}

/* Reset y estilos base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-background);
}

/* Navegación */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background-color: var(--color-white);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--color-primary);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--color-text);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links a:hover {
  color: var(--color-primary);
}

/* Hero Section */
.hero {
  height: 100vh;
  background:
    linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)),
    url("images/piscina2.jpeg");
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--color-white);
  padding: 0 1rem;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 1rem;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Botones */
.btn {
  display: inline-block;
  padding: 1rem 2rem;
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
  border-radius: 2em;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: var(--color-secondary);
}

/* Carrusel */
.carrusel {
  padding: 4rem 2rem;
  background-color: var(--color-white);
}

.carrusel h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 2rem;
}

.carrusel-container {
  position: relative;
  max-width: 1200px;
  width: 100%;
  height: 600px; /* Altura fija para el contenedor */
  margin: 0 auto;
  overflow: hidden;
  border-radius: 2em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.carrusel-slide {
  display: flex;
  transition: transform 0.5s ease;
  height: 100%;
}

/* When using <picture> wrappers, ensure they behave like the images did: full-width
   flex children that don't shrink. This fixes the 'striped' layout caused by
   picture elements collapsing to their intrinsic width. */
.carrusel-slide picture {
  min-width: 100%;
  width: 100%;
  height: 100%;
  display: block;
  flex-shrink: 0;
}

.carrusel-slide picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.carrusel-slide img {
  min-width: 100%;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Mantiene la proporción de la imagen */
  cursor: pointer;
  transition: transform 0.3s ease;
  flex-shrink: 0; /* Evita que las imágenes se compriman */
}

.carrusel-slide img:hover {
  transform: scale(1.02);
}

.prev-btn,
.next-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background-color: rgba(0, 0, 0, 0.5);
  color: var(--color-white);
  border: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

.prev-btn:hover,
.next-btn:hover {
  background-color: rgba(0, 0, 0, 0.8);
  transform: translateY(-50%) scale(1.1);
}

.prev-btn {
  left: 20px;
}

.next-btn {
  right: 20px;
}

/* Ajustes responsive para el carrusel */
@media (max-width: 768px) {
  .carrusel-container {
    height: 400px; /* Altura más pequeña en móviles */
  }

  .prev-btn,
  .next-btn {
    width: 40px;
    height: 40px;
  }
}

/* Sobre Nosotros */
.sobre-nosotros {
  padding: 4rem 2rem;
  background-color: var(--color-background);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

.sobre-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
}

.sobre-imagen img {
  width: 100%;
  border-radius: 2em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Servicios */
.servicios {
  padding: 4rem 2rem;
  background-color: var(--color-white);
}

.servicios h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 3rem;
}

.servicios-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.servicio-card {
  text-align: center;
  padding: 2rem;
  background-color: var(--color-background);
  border-radius: 2em;
  transition: transform 0.3s ease;
}

.servicio-card:hover {
  transform: translateY(-5px);
}

.servicio-card i {
  font-size: 2.5rem;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* Formulario */
.formulario {
  padding: 2rem 2rem;
  background-color: var(--color-background);
}

.form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  border-radius: 2em;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

/* Mensaje de ventajas de reserva */
.reserva-ventajas {
  background: linear-gradient(
    90deg,
    rgba(46, 117, 50, 0.06),
    rgba(140, 69, 19, 0.03)
  );
  border: 1px solid rgba(46, 117, 50, 0.08);
  padding: 1rem 1.25rem;
  border-radius: 1.25rem;
  margin-bottom: 1rem;
  color: #234726;
  font-weight: 500;
}

.reserva-ventajas a {
  color: var(--color-primary);
  text-decoration: underline;
}

.reserva-ventajas a:hover {
  color: var(--color-secondary);
}

/* WhatsApp floating action button */
.whatsapp-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: #25d366;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.25);
  z-index: 2000;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.whatsapp-fab:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.32);
}

.whatsapp-fab i {
  font-size: 22px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  color: #333;
  font-weight: 500;
  font-size: 0.95rem;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #e1e1e1;
  border-radius: 2em;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: #f8f9fa;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: #2e7d32;
  outline: none;
  box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
  background: white;
}

.form-group input:hover,
.form-group textarea:hover {
  border-color: #2e7d32;
}

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

button.btn {
  background-color: #2e7d32;
  color: white;
  padding: 14px 28px;
  border: none;
  border-radius: 2em;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  text-transform: uppercase;
  letter-spacing: 1px;
}

button.btn:hover {
  background-color: #1b5e20;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.mensaje-formulario {
  padding: 1rem;
  margin-bottom: 2rem;
  border-radius: 2em;
  font-weight: 500;
  text-align: center;
  animation: slideDown 0.4s ease;
}

@keyframes slideDown {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.formulario h2 {
  text-align: center;
  margin-bottom: 1rem;
  color: #333;
  font-size: 2.2rem;
}

/* Estilos específicos para los inputs de tipo number */
input[type="number"] {
  appearance: textfield;
  -webkit-appearance: textfield;
  -moz-appearance: textfield;
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Estilos para el contenedor principal */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1001;
}

.modal-content {
  max-width: 90%;
  max-height: 90vh;
  margin: auto;
  display: block;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.close {
  position: absolute;
  right: 25px;
  top: 10px;
  color: var(--color-white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* Footer */
footer {
  /* background-color: var(--color-primary); */
  background:
    linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)),
    url("images/foto11.jpeg");
  background-size: cover;
  background-position: center;
  color: var(--color-white);
  padding: 3rem 2rem 1rem;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.footer-section h3 {
  margin-bottom: 1rem;
}

/* Contacto en footer: imagen + enlace telefónico */
.contact-image {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.footer-phone-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-white);
  background: rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0.75rem;
  border-radius: 1rem;
  text-decoration: none;
  font-weight: 600;
}

.footer-phone-link i {
  font-size: 1rem;
}

.footer-phone-link:hover {
  background: rgba(0, 0, 0, 0.25);
}

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

.social-links a {
  color: var(--color-white);
  font-size: 1.5rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  text-align: center;
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }

  .sobre-content {
    grid-template-columns: 1fr;
  }

  .nav-links {
    display: none;
  }
}

/* Ubicación */
.ubicacion {
  padding: 2rem 2rem;
  background-color: var(--color-background);
}

.ubicacion h2 {
  text-align: center;
  color: var(--color-primary);
  margin-bottom: 3rem;
}

.ubicacion-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.mapa-container {
  width: 100%;
  height: 400px;
  border-radius: 2em;
  overflow: hidden;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#map {
  width: 100%;
  height: 100%;
}

.direccion-info {
  padding: 2rem;
  background-color: var(--color-white);
  border-radius: 2em;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.direccion-info h3 {
  color: var(--color-primary);
  margin-bottom: 1rem;
}

.direccion-info p {
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.direccion-info i {
  color: var(--color-secondary);
  width: 20px;
}

.horarios {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #eee;
}

/* Responsive para la sección de ubicación */
@media (max-width: 768px) {
  .ubicacion-content {
    grid-template-columns: 1fr;
  }

  .mapa-container {
    height: 300px;
  }
}

/* Estilos para el marcador personalizado del mapa */
.custom-div-icon {
  background: transparent;
  border: none;
}

.custom-div-icon i {
  font-size: 24px;
  color: var(--color-primary);
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

/* Ajustes para el popup del mapa */
.leaflet-popup-content-wrapper {
  border-radius: 2em;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
  margin: 8px;
}

.leaflet-popup-tip {
  background: white;
}

.error-message {
  color: #f44336;
  font-size: 0.85rem;
  margin-top: 0.25rem;
  display: block;
  min-height: 1.2em;
}

.form-group input.error {
  border-color: #f44336;
}

/* Estilos para el calendario iCal */
.ical-calendar {
  margin-top: 1.5rem;
  background: linear-gradient(180deg, #ffffff, #fbfbfb);
  padding: 1rem;
  border-radius: 1rem;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.ical-calendar h3 {
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}
.ical-note {
  font-size: 0.95rem;
  color: #666;
  margin-bottom: 0.5rem;
}
.ical-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.6rem;
}
.ical-legend {
  display: flex;
  gap: 1rem;
  align-items: center;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
}
.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}
.legend-dot.available {
  background: #c8e6c9;
  border: 1px solid #81c784;
}
.legend-dot.occupied {
  background: #ffcccb;
  border: 1px solid #f44336;
}
.legend-dot.selected {
  background: #bbdefb;
  border: 1px solid #1e88e5;
}
.ical-months {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}
.ical-month {
  width: 380px;
  background: transparent;
}
.ical-month.single {
  max-width: 520px;
}
.ical-month-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.ical-month-title h4 {
  margin: 0;
  font-size: 1.3rem;
  color: #2e7d32;
}
/* Nav placed above month and centered */
.ical-nav-above {
  display: flex;
  justify-content: center;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
.ical-nav-above .btn {
  width: 44px;
  height: 44px;
  border-radius: 8px;
}
.ical-nav-above .btn.small {
  width: 44px;
  height: 44px;
  padding: 0;
}
.ical-nav-above .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.ical-controls .btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}
.ical-month table {
  width: 100%;
  border-collapse: collapse;
}
.ical-month th {
  text-align: center;
  font-weight: 700;
  padding: 8px 0;
  font-size: 0.95rem;
  color: #444;
}
.ical-month td {
  width: 14.28%;
  height: 44px;
  text-align: center;
  padding: 6px 4px;
  border-radius: 8px;
}
.ical-month td.other-month {
  color: #c0c0c0;
}
.ical-month td.available {
  background: rgba(46, 125, 50, 0.08);
  color: #0b6b2b;
}
.ical-month td.occupied {
  background: rgba(244, 67, 54, 0.12);
  color: #b71c1c;
  font-weight: 700;
}
.ical-error {
  margin-top: 0.5rem;
  color: #b71c1c;
  font-weight: 600;
}

/* Controles y selección */
.ical-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.ical-controls {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.ical-controls .btn {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--color-primary);
  color: var(--color-white);
  border: none;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.06);
}
.ical-controls .btn:hover {
  transform: translateY(-2px);
}
.btn.small {
  padding: 0.5rem 0.7rem;
  font-size: 0.95rem;
  border-radius: 0.5rem;
}
.btn.small.outline {
  background: var(--color-white);
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
}
.ical-actions label[for="ical-file"] {
  display: none;
}
.ical-filename {
  display: none;
}
.ical-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0.5rem 0 1rem 0;
}
.ical-actions .btn {
  padding: 0.4rem 0.6rem;
  font-size: 0.9rem;
}
.ical-actions-right {
  display: flex;
  align-items: center;
}
.ical-actions-right .btn {
  padding: 0.25rem 0.6rem;
  font-size: 0.85rem;
  border-radius: 0.6rem;
  background: var(--color-white);
  color: var(--color-secondary);
  border: 2px solid var(--color-secondary);
}
.ical-actions-right .btn:hover {
  background: var(--color-secondary);
  color: var(--color-white);
}

.ical-month td.selected {
  outline: 2px solid #1565c0;
  background: #bbdefb;
  color: #063359;
  font-weight: 800;
}
.ical-month td.in-range {
  background: rgba(46, 125, 50, 0.12);
}
.ical-month td.too-short {
  opacity: 0.55;
  cursor: not-allowed;
  box-shadow: none;
}
.ical-month td[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
}
.ical-month td[role="button"] {
  cursor: pointer;
}

@media (max-width: 900px) {
  .ical-month {
    width: 100%;
  }
  .ical-months {
    flex-direction: column;
  }
  .ical-legend-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
  }
}

/* Mobile tweaks for calendar to make it compact and responsive */
@media (max-width: 480px) {
  .ical-calendar {
    padding: 0.6rem;
    margin-left: -0.5rem; /* visually align inside narrow container */
    margin-right: -0.5rem;
  }
  .ical-legend-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
  }
  .ical-legend {
    order: 1;
  }
  .ical-actions-right {
    order: 2;
    display: block;
    justify-content: flex-start;
    width: 100%;
  }
  .ical-actions-right .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.82rem;
    width: 100%;
    text-align: center;
    box-sizing: border-box;
  }

  .ical-month.single {
    max-width: 100%;
  }
  .ical-month {
    width: 100%;
  }
  .ical-month-title h4 {
    font-size: 1.15rem;
  }
  .ical-nav-above {
    margin-top: 0.4rem;
  }
  .ical-nav-above .btn {
    width: 36px;
    height: 36px;
  }
  .ical-controls {
    display: none;
  }

  .ical-month th {
    font-size: 0.82rem;
    padding: 6px 0;
  }
  .ical-month td {
    height: 36px;
    padding: 4px 2px;
    border-radius: 6px;
  }
  .ical-month td.available,
  .ical-month td.occupied {
    font-size: 0.95rem;
  }

  .ical-calendar h3 {
    font-size: 1.2rem;
  }
  .legend-item {
    font-size: 0.88rem;
  }
}

@media (max-width: 360px) {
  .ical-nav-above .btn {
    width: 32px;
    height: 32px;
  }
  .ical-month td {
    height: 32px;
    font-size: 0.88rem;
  }
  .ical-calendar {
    padding: 0.5rem;
  }
}

/* Ensure the 'Seleccionado' legend item wraps to its own line on very small screens */
@media (max-width: 480px) {
  .ical-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
  }
  .ical-legend .legend-item {
    flex: 0 0 auto;
  }
  .ical-legend .legend-item:nth-child(3) {
    flex-basis: 100%;
    order: 2;
    margin-top: 0.25rem;
  }
  .ical-legend .legend-item:nth-child(1),
  .ical-legend .legend-item:nth-child(2) {
    order: 1;
  }
}
