* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-color: #8A2BE2;
  --primary-dark: #6A0DAD;
  --primary-light: #E6D4FF;
  --secondary-color: #FF6B6B;
  --secondary-dark: #FF5252;
  --accent-color: #4ECDC4;
  --accent-dark: #26A69A;
  --background-light: #FFFBF5;
  --background-white: #FFFFFF;
  --text-dark: #333333;
  --text-medium: #666666;
  --text-light: #888888;
  --shadow-light: rgba(138, 43, 226, 0.1);
  --shadow-medium: rgba(138, 43, 226, 0.15);
  --border-color: #F0E6FF;
  --success-color: #4CAF50;
  --whatsapp-color: #25D366;
  --whatsapp-dark: #128C7E;
}

body {
  font-family: Poppins, sans-serif;
  background: var(--background-light);
  color: var(--text-dark);
  line-height: 1.6;
}

header {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  text-align: center;
  padding: 30px 20px;
  box-shadow: 0 4px 20px var(--shadow-medium);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
  background-size: 30px 30px;
  opacity: 0.1;
  z-index: 0;
}

.logo-container {
  display: flex;
  align-items: center; /* Centra verticalmente el logo con el texto */
  justify-content: center; /* Centra todo el grupo en la pantalla */
  gap: 15px; /* Espacio entre el logo y el texto */
  margin-bottom: 20px;
}

.texto-header {
  display: flex;
  flex-direction: column; /* Apila el título y subtítulo verticalmente */
  align-items: flex-start; /* Alinea el texto a la izquierda respecto al logo */
  text-align: left;
}

.logo-container h1 {
  margin: 0; /* Quita márgenes por defecto para pegarlo al subtítulo */
  line-height: 1.1; /* Ajusta la altura de línea */
  font-size: 1.8rem; /* Ajusta según necesites */
}

.subtitulo {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  opacity: 0.9;
}

@media (max-width: 600px) {
  .logo-container {
    flex-direction: column; /* En celular, pone el logo arriba del texto */
    text-align: center;
  }
  
  .texto-header {
    align-items: center; /* Centra el texto en celular */
  }
}

.logo-img {
  width: 270px;
  height: 270px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid white;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: rotate(10deg);
}

header h1 {
  font-size: 2.4em;
  margin: 0;
  font-weight: 700;
  letter-spacing: -0.5px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

header p {
  font-size: 1.2em;
  margin-top: 10px;
  opacity: 0.95;
  font-weight: 300;
  position: relative;
  z-index: 1;
}

.botones-header {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
  position: relative;
  z-index: 1;
}

.whatsapp-btn, .cotizacion-btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s;
  border: none;
  cursor: pointer;
  font-size: 16px;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
}

.whatsapp-btn::before, .cotizacion-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: 0.5s;
}

.whatsapp-btn:hover::before, .cotizacion-btn:hover::before {
  left: 100%;
}

.whatsapp-btn {
  background: var(--whatsapp-color);
  color: white;
}

.whatsapp-btn:hover {
  background: var(--whatsapp-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.3);
}

.cotizacion-btn {
  background: var(--secondary-color);
  color: white;
}

.cotizacion-btn:hover {
  background: var(--secondary-dark);
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.3);
}

main {
  padding: 30px 20px;
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  gap: 30px;
}

.galeria-principal {
  flex: 1;
  width: 100%;
}

@media (min-width: 768px) {
  .menu-hamburguesa {
    display: none;
  }

  .filtros-desktop {
    width: 280px;
    background: var(--background-white);
    padding: 25px;
    border-radius: 20px;
    box-shadow: 0 8px 30px var(--shadow-light);
    position: sticky;
    top: 30px;
    height: fit-content;
    border: 1px solid var(--border-color);
  }

  .filtros-desktop h2 {
    color: var(--primary-color);
    font-size: 1.6em;
    margin-bottom: 25px;
    text-align: center;
    position: relative;
    padding-bottom: 15px;
  }

  .filtros-desktop h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 3px;
  }

  .botones-filtros {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  main {
    display: flex;
    gap: 40px;
    padding: 40px 30px;
  }
  
  .galeria-principal {
    flex: 1;
    min-width: 0;
  }
}

@media (max-width: 767px) {
  main {
    flex-direction: column;
  }

  .filtros-desktop {
    display: none;
  }

  .menu-hamburguesa {
    margin-bottom: 25px;
  }

  .hamburger {
    background: var(--primary-light);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 12px 25px;
    border-radius: 50px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.3s;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 auto;
  }

  .hamburger:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: scale(1.05);
  }

  .menu-filtros {
    display: none;
    background: var(--background-white);
    padding: 20px;
    border-radius: 20px;
    box-shadow: 0 8px 30px var(--shadow-light);
    margin-top: 15px;
    border: 1px solid var(--border-color);
  }

  .menu-filtros.active {
    display: block;
    animation: slideDown 0.3s ease;
  }

  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .menu-filtros h3 {
    color: var(--primary-color);
    font-size: 1.4em;
    margin-bottom: 20px;
    text-align: center;
    font-weight: 600;
  }

  .menu-filtros .filtro-btn {
    width: 100%;
    margin-bottom: 12px;
  }
}

section {
  margin-bottom: 50px;
}

h2 {
  color: var(--primary-color);
  text-align: center;
  font-size: 2.4em;
  margin-bottom: 30px;
  position: relative;
  font-weight: 700;
}

h2::after {
  content: "";
  display: block;
  width: 80px;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
  margin: 20px auto;
  border-radius: 2px;
}

.filtro-btn {
  background: var(--background-white);
  color: var(--text-dark);
  border: 2px solid var(--border-color);
  padding: 14px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filtro-btn:hover {
  background: linear-gradient(135deg, var(--primary-light), #ffffff);
  border-color: var(--primary-color);
  transform: translateX(5px);
  box-shadow: 0 4px 15px var(--shadow-light);
}

.filtro-btn.activo {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  border-color: var(--primary-color);
  transform: translateX(5px);
  box-shadow: 0 6px 20px var(--shadow-medium);
}

.filtro-btn.activo::after {
  content: "✓";
  font-weight: bold;
  margin-left: auto;
  font-size: 1.2em;
}

.categoria {
  margin-bottom: 40px;
  padding: 30px;
  background: var(--background-white);
  border-radius: 20px;
  box-shadow: 0 8px 30px var(--shadow-light);
  border: 1px solid var(--border-color);
}

.categoria:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px var(--shadow-medium);
}

.categoria.oculta {
  display: none !important;
}

.categoria:not(.oculta) {
  display: block !important;
  opacity: 1;
  transform: translateY(0);
  animation: fadeInUp 0.6s ease;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.categoria h3 {
  color: var(--primary-color);
  font-size: 1.8em;
  margin-bottom: 25px;
  text-align: center;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--primary-light);
  font-weight: 600;
  position: relative;
}

.categoria h3::before {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: var(--accent-color);
}

.galeria-contenido {
  display: grid;
  gap: 20px;
}

@media (max-width: 479px) {
  .galeria-contenido {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .galeria-contenido {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .galeria-contenido {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 1024px) and (max-width: 1399px) {
  .galeria-contenido {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
}

@media (min-width: 1400px) {
  .galeria-contenido {
    grid-template-columns: repeat(5, 1fr);
    gap: 22px;
  }
}

.galeria-item {
  cursor: pointer;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: relative;
  aspect-ratio: 1/1;
  background: var(--background-white);
}

.galeria-item:hover {
  transform: scale(1.05);
  box-shadow: 0 15px 35px rgba(138, 43, 226, 0.2);
}

/* CORREGIDO: Imagen visible por defecto */
.galeria-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1; /* SIEMPRE VISIBLE */
  transition: transform 0.5s ease;
}

.galeria-item:hover img {
  transform: scale(1.1);
}

/* CORREGIDO: El overlay "Ver" solo aparece al hover */
.galeria-item::after {
  content: "👁️ Ver";
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.8);
  background: rgba(138, 43, 226, 0.9);
  color: white;
  padding: 10px 20px;
  border-radius: 50px;
  font-size: 0.9em;
  font-weight: 600;
  opacity: 0; /* OCULTO POR DEFECTO */
  transition: all 0.3s;
  z-index: 3;
  pointer-events: none;
}

.galeria-item:hover::after {
  opacity: 1; /* VISIBLE AL HOVER */
  transform: translate(-50%, -50%) scale(1);
}

/* ============================================
   OVERLAY DE DESCRIPCIÓN
   ============================================ */
.description-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0.7), transparent);
  padding: 40px 15px 15px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
  pointer-events: none;
}

.galeria-item:hover .description-overlay {
  opacity: 1;
}

.description-overlay p {
  color: white;
  font-size: 0.85em;
  line-height: 1.4;
  margin: 0;
  text-align: center;
  font-weight: 500;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.5);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.loading {
  text-align: center;
  padding: 40px;
  color: var(--primary-color);
  grid-column: 1 / -1;
  font-style: italic;
  font-size: 1.1em;
}

#form-cotizacion {
  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 25px;
  background: var(--background-white);
  border-radius: 20px;
}

#form-cotizacion input, #form-cotizacion textarea {
  width: 100%;
  padding: 15px;
  margin-bottom: 5px;
  border-radius: 10px;
  border: 2px solid var(--border-color);
  font-size: 16px;
  transition: all 0.3s;
  background: var(--background-light);
  color: var(--text-dark);
}

#form-cotizacion input:focus, #form-cotizacion textarea:focus {
  border-color: var(--primary-color);
  outline: none;
  background: white;
  box-shadow: 0 0 0 3px var(--primary-light);
}

#form-cotizacion input::placeholder, #form-cotizacion textarea::placeholder {
  color: var(--text-light);
}

#form-cotizacion button {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: white;
  border: none;
  padding: 18px;
  border-radius: 50px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  margin-top: 10px;
  letter-spacing: 0.5px;
}

#form-cotizacion button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

#msg {
  margin-top: 20px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  padding: 15px;
  border-radius: 10px;
  background: var(--background-light);
}

footer {
  text-align: center;
  padding: 30px;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
  color: white;
  margin-top: 60px;
  position: relative;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

footer p {
  position: relative;
  z-index: 1;
  opacity: 0.9;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.modal-content {
  background: var(--background-white);
  padding: 30px;
  border-radius: 25px;
  max-width: 90%;
  max-height: 90vh;
  position: relative;
  overflow-y: auto;
}

@keyframes modalAppear {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.modal-content img {
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;
  border-radius: 15px;
}

.modal-description {
  background: var(--background-light);
  padding: 20px;
  border-radius: 15px;
  margin: 20px 0;
  border-left: 4px solid var(--primary-color);
}

.modal-description h3 {
  margin: 0 0 10px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-description p {
  margin: 0;
  color: var(--text-dark);
  line-height: 1.6;
}

.modal-content h2 {
  color: var(--primary-color);
  text-align: center;
  margin-bottom: 25px;
  font-size: 2em;
}

.modal-actions {
  display: flex;
  gap: 15px;
  margin-top: 30px;
  width: 100%;
  justify-content: center;
  flex-wrap: wrap;
}

.modal-actions button, .modal-actions a {
  padding: 12px 25px;
  border-radius: 50px;
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
  font-size: 16px;
  transition: all 0.3s;
  border: none;
  text-align: center;
  min-width: 200px;
}

.modal-actions .whatsapp-btn {
  background: linear-gradient(135deg, var(--whatsapp-color), var(--whatsapp-dark));
  color: white;
}

.modal-actions .whatsapp-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.3);
}

.modal-actions .cotizacion-btn {
  background: linear-gradient(135deg, var(--secondary-color), var(--secondary-dark));
  color: white;
}

.modal-actions .cotizacion-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.3);
}

.close, .close-cotizacion {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 35px;
  color: var(--text-light);
  cursor: pointer;
  z-index: 1001;
  transition: color 0.3s;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}

.close:hover, .close-cotizacion:hover {
  color: var(--primary-color);
  background: var(--primary-light);
}

::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: var(--background-light);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(var(--primary-color), var(--accent-color));
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(var(--primary-dark), var(--accent-dark));
}

.galeria-contenido {
  transform: translateZ(0);
}

.galeria-item {
  will-change: transform;
  backface-visibility: hidden;
}

/* VIDEOS */
.galeria-item video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.galeria-item[data-tipo="video"]::after {
  content: "🎬 Ver Video";
}

.galeria-item[data-tipo="video"]::before {
  content: "🎬";
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 2;
}

#modal-video {
  display: none;
}

#modal-video video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 10px;
}