/* Variables / colores para tema claro / oscuro */
:root {
  --bg-color: #ffffff;
  --text-color: #333333;
  --header-bg: #f4f4f4;
  --card-bg: #ffffff;
  --footer-bg: #2c3e50;
  --footer-text: #ffffff;
}

/* Cuando está activo modo noche: cambian variables */
body.dark-mode {
  --bg-color: #121212;
  --text-color: #e0e0e0;
  --header-bg: #1e1e1e;
  --card-bg: #1e1e1e;
  --footer-bg: #111111;
  --footer-text: #cccccc;
}

body {
  margin: 0;
  background-color: var(--bg-color);
  color: var(--text-color);
  font-family: Arial, sans-serif;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: background-color 0.3s, color 0.3s;
}

header {
  text-align: center;
  padding: 20px;
  background: var(--header-bg);
}
h1 { margin: 0; }

/* Toggle switch CSS */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 10px 20px;
  background: var(--header-bg);
}
.theme-switch {
  display: inline-block;
  height: 24px;
  position: relative;
  width: 50px;
  margin-right: 10px;
}
.theme-switch input {
  display: none;
}
.slider-switch {
  background-color: #ccc;
  border-radius: 34px;
  cursor: pointer;
  height: 100%;
  position: relative;
  transition: background-color 0.2s;
  width: 100%;
}
.slider-switch::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 4px;
  top: 3px;
  background-color: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
input:checked + .slider-switch {
  background-color: #66bb6a;
}
input:checked + .slider-switch::before {
  transform: translateX(26px);
}

/* Slider de imágenes */
.slider {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
}
.slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
  height: 100%;
  width: 200%;
}
.slide {
  min-width: 100%;
  height: 100%;
  box-sizing: border-box;
}
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}
.slider-nav {
  position: absolute;
  top: 50%;
  width: 100%;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.slider-nav button {
  pointer-events: all;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  font-size: 2rem;
  padding: 0 15px;
  cursor: pointer;
}

/* Servicios / tarjetas */
.services {
  padding: 40px 20px;
  flex: 1;
  background: var(--bg-color);
}
.services h2 { text-align: center; }
.services-container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.service-card {
  width: 200px;
  margin: 15px;
  text-align: center;
  cursor: pointer;
  background: var(--card-bg);
  border-radius: 8px;
  overflow: hidden;
  transition: background-color 0.3s;
}
.service-card img {
  width: 100%;
  object-fit: cover;
}
.service-card h3 {
  margin: 10px 0;
}

/* Modal */
.service-detail {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.8);
  display: flex; justify-content: center; align-items: center;
  padding: 20px;
  opacity: 0; visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  z-index: 1000;
}
.service-detail.show {
  opacity: 1; visibility: visible;
}
.detail-content {
  background: var(--card-bg);
  color: var(--text-color);
  padding: 20px;
  max-width: 500px;
  width: 100%;
  border-radius: 8px;
  position: relative;
  text-align: center;
  transform: scale(0.9);
  transition: transform 0.4s ease;
}
.service-detail.show .detail-content {
  transform: scale(1);
}
.detail-content img {
  max-width: 100%;
  border-radius: 4px;
}
.close-button {
  position: absolute;
  top: 10px; right: 10px;
  cursor: pointer;
  font-size: 1.2rem;
  background: #ccc; border: none; padding: 5px 10px; border-radius: 4px;
}

/* Footer con contacto y redes */
.footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 30px 20px;
  text-align: left;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px;
}
.footer-section { flex: 1 1 250px; }
.footer h3 { margin-top: 0; font-size: 1.3rem; }
.footer .contact-info p,
.footer .contact-info a {
  margin: 5px 0;
  color: var(--footer-text);
  text-decoration: none;
  display: flex;
  align-items: center;
}
.footer .contact-info i { margin-right: 8px; }
.social-icons { display: flex; gap: 15px; margin-top: 10px; }
.social-icons a {
  color: var(--footer-text);
  font-size: 1.5rem;
  text-decoration: none;
  transition: transform 0.3s, color 0.3s;
}
.social-icons a:hover {
  transform: scale(1.2);
  color: #1abc9c;
}

/* Responsivo */
@media (max-width: 600px) {
  .services-container {
    flex-direction: column;
    align-items: center;
  }
  .service-card {
    width: 90%;
  }
  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}
