/* Estilos base y personalizados */

body {
  font-family: "Atkinson Hyperlegible", sans-serif;
}
html {
  scroll-behavior: smooth;
}
.brand-logo:hover {
  transform: scale(1.1);
  filter: none;
}
.section-title {
  @apply text-4xl md:text-5xl font-extrabold mb-4 text-center text-brand-blue-dark dark:text-brand-blue-vibrant;
}
.section-subtitle {
  @apply text-xl md:text-2xl mb-12 max-w-3xl mx-auto text-center text-brand-gray dark:text-gray-400;
}
mark.search-highlight {
  background-color: #fbbf24 !important; /* Amarillo más intenso */
  color: #000000 !important;
  padding: 3px 2px;
  border-radius: 4px;
  font-weight: 700 !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.4) !important;
}
.dark mark.search-highlight {
  background-color: #fcd34d !important; /* Amarillo más brillante */
  color: #000000 !important; /* Negro sólido para máximo contraste */
  font-weight: 700 !important;
  border: 2px solid #f59e0b !important;
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.3) !important;
}
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}
/* Corrección para el menú móvil - posicionamiento */
#mobile-menu {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100vw !important;
  max-width: 100vw !important;
  height: 100vh !important;
  z-index: 9999 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 1rem !important;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}

#mobile-menu:not(.hidden) {
  display: flex !important;
  pointer-events: auto;
  opacity: 1;
}

#mobile-menu-panel {
  width: 92vw !important;
  max-width: 400px !important;
  min-width: 0 !important;
  margin: 0 auto !important;
  border-radius: 18px !important;
  box-sizing: border-box !important;
  max-height: 65vh !important;
  overflow-y: auto !important;
  padding-bottom: 1.5rem !important;
}

.mobile-menu-link {
  position: relative;
  overflow: hidden;
}
.mobile-menu-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}
.mobile-menu-link:hover::before {
  left: 100%;
}
#close-video-modal {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 36px;
  height: 36px;
  z-index: 110;
}

.branch-media-container .map-iframe {
  animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Estilos para navbar fijo */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Efecto de transparencia al hacer scroll */
header.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
}

.dark header.scrolled {
  background-color: rgba(31, 41, 55, 0.95) !important;
}

/* Compensación para enlaces internos */
section[id] {
  scroll-margin-top: 80px;
}

/* Ajuste del z-index para asegurar que esté por encima de todo */
header {
  z-index: 9998 !important;
}

/* Estilos para iconos de redes sociales */
#social-bar-desktop {
  will-change: transform; /* Optimización para evitar saltos */
}
.facebook-bg {
  background-color: #1877f2;
}
.linkedin-bg {
  background-color: #0a66c2;
}
.instagram-bg {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}
.youtube-bg {
  background-color: #ff0000;
}
.x-bg {
  background-color: #000000;
}
.tiktok-bg {
  background-color: #000000;
}

.social-icon:hover,
.social-icon-mobile:hover {
  filter: brightness(1.2);
}

.catalog-family-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.catalog-family-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#map {
  height: 600px;
  width: 100%;
  border-radius: 0.5rem;
}
.gm-style-iw-c {
  border-radius: 8px !important;
}
.gm-style-iw-d {
  overflow: auto !important;
}
.info-window-content {
  font-family: "Atkinson Hyperlegible", sans-serif;
}
.info-window-content h3 {
  font-weight: bold;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.info-window-content ul {
  list-style-position: inside;
  padding-left: 0.5rem;
}

/* Carrusel de Familias - Completamente Responsivo */
.families-carousel {
  position: relative;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 70px; /* Espacio para botones */
  min-height: 250px;
  scroll-behavior: smooth;
}

.families-carousel .swiper-wrapper {
  align-items: stretch;
}

.families-carousel .swiper-slide {
  height: auto;
  display: flex;
  width: 100% !important;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  will-change: transform, opacity;
}

.families-carousel .swiper-slide-active {
  opacity: 1 !important;
  transform: scale(1) !important;
}

.families-carousel .swiper-slide:not(.swiper-slide-active) {
  opacity: 0.7;
  transform: scale(0.95);
}

.family-card {
  position: relative;
  height: 180px;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #f3f4f6;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.family-card:hover {
  border-color: #3b82f6;
  transform: translateY(-4px);
  box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.family-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  position: relative;
  z-index: 1;
}

.family-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.9) 0%,
    rgba(0, 0, 0, 0.5) 70%,
    transparent 100%
  );
  color: white;
  padding: 20px 12px 12px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 2;
}

.family-card:hover .family-overlay {
  opacity: 1;
}

.family-overlay h3 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  text-align: center;
  line-height: 1.3;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
}

/* Botones de navegación - CORREGIDOS PARA POSICIONAMIENTO */
.families-carousel .swiper-button-next,
.families-carousel .swiper-button-prev {
  color: #ffffff;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  width: 50px;
  height: 50px;
  margin-top: -25px;
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(59, 130, 246, 0.4);
  border: 3px solid rgba(255, 255, 255, 0.3);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 1;
  z-index: 20;
  position: absolute;
  top: 50%;
  display: flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.families-carousel .swiper-button-prev {
  left: 15px;
  transform: translateY(-50%);
}

.families-carousel .swiper-button-next {
  right: 15px;
  transform: translateY(-50%);
}

.families-carousel .swiper-button-next:hover,
.families-carousel .swiper-button-prev:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  transform: translateY(-50%) scale(1.1);
  box-shadow: 0 8px 30px rgba(59, 130, 246, 0.6);
}

.families-carousel .swiper-button-next::after,
.families-carousel .swiper-button-prev::after {
  font-size: 16px;
  font-weight: 900;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* RESPONSIVE BREAKPOINTS DETALLADOS */

/* LAPTOP SCREENS OPTIMIZATION (1024px - 1399px) */
@media (min-width: 1024px) and (max-width: 1399px) {
  .families-carousel {
    max-width: 1200px;
    padding: 0 65px;
    min-height: 280px;
    margin: 0 auto;
  }

  .families-carousel .swiper-slide {
    padding: 0 10px;
  }

  .families-carousel .swiper-slide .grid {
    gap: 1.5rem;
    justify-items: center;
  }

  .family-card {
    height: 200px;
    max-width: 180px;
    margin: 0 auto;
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 52px;
    height: 52px;
    margin-top: -26px;
    border-width: 3px;
  }

  .families-carousel .swiper-button-prev {
    left: 10px;
  }

  .families-carousel .swiper-button-next {
    right: 10px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 17px;
  }

  /* Mejorar la visualización del grid en laptops */
  .families-carousel .grid-cols-2 {
    grid-template-columns: repeat(3, 1fr);
  }

  .families-carousel .md\:grid-cols-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .families-carousel .lg\:grid-cols-5 {
    grid-template-columns: repeat(5, 1fr);
  }

  /* Centrar el contenido del slide */
  .families-carousel .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .families-carousel .swiper-slide > .grid {
    width: 100%;
    max-width: 900px;
  }
}

/* DESKTOP SCREENS (1200px - 1399px) */
@media (min-width: 1200px) and (max-width: 1399px) {
  .families-carousel {
    max-width: 1300px;
    padding: 0 70px;
  }

  .family-card {
    height: 220px;
    max-width: 200px;
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 55px;
    height: 55px;
    margin-top: -27px;
  }

  .families-carousel .swiper-slide > .grid {
    max-width: 1000px;
  }
}

/* Extra Large Screens (1400px+) */
@media (min-width: 1400px) {
  .families-carousel {
    max-width: 1400px;
    padding: 0 75px;
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 58px;
    height: 58px;
    margin-top: -29px;
  }

  .families-carousel .swiper-button-prev {
    left: 12px;
  }

  .families-carousel .swiper-button-next {
    right: 12px;
  }
}

/* Medium Screens (768px - 1023px) */
@media (max-width: 1023px) and (min-width: 768px) {
  .families-carousel {
    padding: 0 60px;
    min-height: 220px;
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 48px;
    height: 48px;
    margin-top: -24px;
    border-width: 2px;
  }

  .families-carousel .swiper-button-prev {
    left: 10px;
  }

  .families-carousel .swiper-button-next {
    right: 10px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 15px;
  }

  /* Mostrar 2 cards por slide en tablets */
  .families-carousel .grid-cols-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .families-carousel .md\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .families-carousel .lg\:grid-cols-5 {
    grid-template-columns: repeat(2, 1fr);
  }

  .family-card {
    height: 160px;
    max-width: 280px;
    margin: 0 auto;
  }
}

/* Small-Medium Screens (640px - 767px) */
@media (max-width: 767px) and (min-width: 640px) {
  .families-carousel {
    padding: 0 55px;
    min-height: 280px; /* Aumentado para acomodar cards más grandes */
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 45px;
    height: 45px;
    margin-top: -22px;
  }

  .families-carousel .swiper-button-prev {
    left: 8px;
  }

  .families-carousel .swiper-button-next {
    right: 8px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 14px;
  }

  /* FORZAR 1 card por slide en pantallas pequeñas-medianas */
  .families-carousel .swiper-slide .grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  .families-carousel .swiper-slide .grid .family-card:not(:first-child) {
    display: none !important;
  }

  .family-card {
    height: 250px; /* Aumentado de 200px a 250px */
    max-width: 350px; /* Aumentado de 300px a 350px */
    width: 95%; /* Aumentado de 90% a 95% */
    margin: 0 auto;
  }

  .family-card img {
    object-fit: contain !important; /* Cambio de cover a contain para mostrar imagen completa */
    object-position: center !important;
    background: #f8f9fa; /* Fondo claro para mejor contraste */
  }
}

/* Small Screens (480px - 639px) */
@media (max-width: 639px) and (min-width: 480px) {
  .families-carousel {
    padding: 0 50px;
    min-height: 260px; /* Aumentado para acomodar cards más grandes */
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 42px;
    height: 42px;
    margin-top: -21px;
  }

  .families-carousel .swiper-button-prev {
    left: 6px;
  }

  .families-carousel .swiper-button-next {
    right: 6px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 13px;
  }

  /* FORZAR 1 card por slide en móviles pequeños */
  .families-carousel .swiper-slide .grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  .families-carousel .swiper-slide .grid .family-card:not(:first-child) {
    display: none !important;
  }

  .family-card {
    height: 230px; /* Aumentado de 180px a 230px */
    max-width: 320px; /* Aumentado de 280px a 320px */
    width: 90%; /* Aumentado de 85% a 90% */
    margin: 0 auto;
  }

  .family-card img {
    object-fit: contain !important; /* Cambio de cover a contain para mostrar imagen completa */
    object-position: center !important;
    background: #f8f9fa; /* Fondo claro para mejor contraste */
  }
}

/* Extra Small Screens (320px - 479px) */
@media (max-width: 479px) {
  .families-carousel {
    padding: 0 45px;
    min-height: 240px; /* Aumentado para acomodar cards más grandes */
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 38px;
    height: 38px;
    margin-top: -19px;
    border-width: 2px;
  }

  .families-carousel .swiper-button-prev {
    left: 4px;
  }

  .families-carousel .swiper-button-next {
    right: 4px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 12px;
  }

  /* FORZAR 1 card por slide en móviles extra pequeños */
  .families-carousel .swiper-slide .grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  .families-carousel .swiper-slide .grid .family-card:not(:first-child) {
    display: none !important;
  }

  .family-card {
    height: 210px; /* Aumentado de 160px a 210px */
    max-width: 300px; /* Aumentado de 260px a 300px */
    width: 85%; /* Aumentado de 80% a 85% */
    margin: 0 auto;
  }

  .family-card img {
    object-fit: fill; /* Cambio de cover a contain para mostrar imagen completa */
    object-position: center !important;
    background: #f8f9fa; /* Fondo claro para mejor contraste */
  }

  .family-overlay h3 {
    font-size: 12px;
  }
}

/* Muy pequeñas (menos de 320px) */
@media (max-width: 319px) {
  .families-carousel {
    padding: 0 40px;
    min-height: 220px; /* Aumentado para acomodar cards más grandes */
  }

  .families-carousel .swiper-button-next,
  .families-carousel .swiper-button-prev {
    width: 35px;
    height: 35px;
    margin-top: -17px;
    border-width: 2px;
  }

  .families-carousel .swiper-button-prev {
    left: 2px;
  }

  .families-carousel .swiper-button-next {
    right: 2px;
  }

  .families-carousel .swiper-button-next::after,
  .families-carousel .swiper-button-prev::after {
    font-size: 11px;
  }

  /* FORZAR 1 card por slide en pantallas muy pequeñas */
  .families-carousel .swiper-slide .grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0 !important;
  }

  .families-carousel .swiper-slide .grid .family-card:not(:first-child) {
    display: none !important;
  }

  .family-card {
    height: 190px; /* Aumentado de 140px a 190px */
    max-width: 280px; /* Aumentado de 240px a 280px */
    width: 80%; /* Aumentado de 75% a 80% */
    margin: 0 auto;
  }

  .family-card img {
    object-fit: contain !important; /* Cambio de cover a contain para mostrar imagen completa */
    object-position: center !important;
    background: #f8f9fa; /* Fondo claro para mejor contraste */
  }

  .family-overlay {
    padding: 15px 8px 8px;
  }

  .family-overlay h3 {
    font-size: 11px;
    line-height: 1.2;
  }
}

/* Asegurar que los botones siempre sean visibles */
.families-carousel .swiper-button-next,
.families-carousel .swiper-button-prev {
  visibility: visible !important;
  display: flex !important;
  opacity: 1 !important;
}

/* Estados especiales */
.families-carousel .swiper-button-disabled {
  opacity: 0.4 !important;
  cursor: not-allowed;
}

.families-carousel .swiper-button-disabled:hover {
  transform: translateY(-50%) scale(1) !important;
}

/* Paginación mejorada */
.families-carousel .swiper-pagination {
  bottom: -10px;
  position: relative;
  margin-top: 20px;
}

.families-carousel .swiper-pagination-bullet {
  background: #d1d5db;
  opacity: 0.6;
  width: 12px;
  height: 12px;
  margin: 0 4px;
  transition: all 0.3s ease;
}

.families-carousel .swiper-pagination-bullet-active {
  background: #3b82f6;
  opacity: 1;
  transform: scale(1.3);
}

/* Animación de entrada */
@keyframes buttonSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50%) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translateY(-50%) scale(1);
  }
}

.families-carousel .swiper-button-next,
.families-carousel .swiper-button-prev {
  animation: buttonSlideIn 0.6s ease-out;
}

/* Estilos para carrusel de Marcas */
.brands-carousel .swiper-wrapper {
  transition-timing-function: linear !important;
}
.brands-carousel .swiper-slide {
  width: auto;
}
.brands-carousel img {
  max-height: 50px; /* Aumentado para mejor visibilidad */
  width: auto;
  transition: filter 0.3s ease, transform 0.3s ease;
  border-radius: 8px; /* Bordes redondeados para mejor apariencia */
  padding: 8px; /* Espaciado interno */
}
.dark .brands-carousel img {
  background-color: rgba(255, 255, 255, 0.9); /* Fondo blanco semi-transparente */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Sombra sutil */
}
.brands-carousel img:hover {
  transform: scale(1.1);
}
.dark .brands-carousel img:hover {
  background-color: rgba(255, 255, 255, 1); /* Fondo completamente blanco al hover */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15); /* Sombra más pronunciada */
  filter: none;
}

/* Estilos para dropzone de archivos */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.drop-zone.dragover {
  background-color: #e9f5ff;
  border-color: #0511f2;
}
.dark .drop-zone.dragover {
  background-color: #1e293b;
  border-color: #0511f2;
}
.drop-zone-text {
  color: #6c7073;
}
.dark .drop-zone-text {
  color: #9ca3af;
}

/* Clases utilitarias responsivas adicionales */
.responsive-text {
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.responsive-title {
  font-size: clamp(1.5rem, 5vw, 4rem);
  line-height: 1.2;
}

.responsive-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
}

.responsive-container {
  width: 100%;
  max-width: min(90vw, 1200px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Espaciado fluido */
.fluid-spacing {
  padding: clamp(2rem, 5vw, 6rem) 0;
}

/* Grids responsivos mejorados */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.auto-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* ========== MEDIA QUERIES PARA RESPONSIVIDAD ========== */

/* Móviles (hasta 767px) */
@media screen and (max-width: 767px) {
  .section-title {
    font-size: 1.8rem !important;
  }
  .section-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 95vw !important;
  }
  #close-video-modal {
    top: -2.5rem !important;
    right: 0.5rem !important;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #service-modal-panel {
    max-width: 95vw !important;
    max-height: 90vh !important;
  }
}

/* Tabletas (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .section-title {
    font-size: 2.5rem !important;
  }
  .section-subtitle {
    font-size: 1.125rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 85vw !important;
  }
  #service-modal-panel {
    max-width: 70vw !important;
    max-height: 85vh !important;
  }
}

/* Pantallas de escritorio grandes (HD, 2K) */
@media screen and (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}
/* Variante para títulos principales/hero */
.section-title.hero {
  font-size: clamp(3rem, 8vw, 6rem);
  margin-bottom: 2.5rem;
}

.section-title.hero::after {
  width: 120px;
  height: 6px;
}

/* Variante con efecto de brillo */
.section-title.shine {
  position: relative;
  overflow: hidden;
}

.section-title.shine::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  animation: shine 3s infinite;
  z-index: 1;
}

@keyframes shine {
  0% {
    left: -100%;
  }
  100% {
    left: 100%;
  }
}

/* Animación de entrada */
.section-title.animate-in {
  animation: titleSlideIn 1s ease-out;
}

@keyframes titleSlideIn {
  0% {
    opacity: 0;
    transform: translateY(30px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Estilos base y personalizados */
body {
  font-family: "Atkinson Hyperlegible", sans-serif;
  overflow-x: hidden; /* Prevenir scroll horizontal */
}
html {
  scroll-behavior: smooth;
}
.brand-logo:hover {
  transform: scale(1.1);
  filter: none;
}
.section-title {
  @apply text-4xl md:text-5xl font-extrabold mb-4 text-center text-brand-blue-dark dark:text-brand-blue-vibrant;
}
.section-subtitle {
  @apply text-xl md:text-2xl mb-12 max-w-3xl mx-auto text-center text-brand-gray dark:text-gray-400;
}
mark.search-highlight {
  background-color: #ffdd57;
  color: black;
  padding: 2px 1px;
  border-radius: 3px;
}
.dark mark.search-highlight {
  background-color: #fbbf24;
  color: #111827;
}
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
}
#mobile-menu {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.mobile-menu-link {
  position: relative;
  overflow: hidden;
}
.mobile-menu-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.1),
    transparent
  );
  transition: left 0.5s;
}
.mobile-menu-link:hover::before {
  left: 100%;
}
#close-video-modal {
  position: absolute;
  top: -2.5rem;
  right: 0;
  width: 36px;
  height: 36px;
  z-index: 110;
}

.branch-media-container .map-iframe {
  animation: fadeIn 0.3s ease-in-out;
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Estilos para navbar fijo */
header {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  transition: all 0.3s ease;
}

/* Efecto de transparencia al hacer scroll */
header.scrolled {
  background-color: rgba(255, 255, 255, 0.95) !important;
}

.dark header.scrolled {
  background-color: rgba(31, 41, 55, 0.95) !important;
}

/* Compensación para enlaces internos */
section[id] {
  scroll-margin-top: 80px;
}

/* Ajuste del z-index para asegurar que esté por encima de todo */
header {
  z-index: 9999 !important;
}

/* Estilos para iconos de redes sociales */
#social-bar-desktop {
  will-change: transform; /* Optimización para evitar saltos */
}
.facebook-bg {
  background-color: #1877f2;
}
.linkedin-bg {
  background-color: #0a66c2;
}
.instagram-bg {
  background: linear-gradient(
    45deg,
    #f09433 0%,
    #e6683c 25%,
    #dc2743 50%,
    #cc2366 75%,
    #bc1888 100%
  );
}
.youtube-bg {
  background-color: #ff0000;
}
.x-bg {
  background-color: #000000;
}
.tiktok-bg {
  background-color: #000000;
}

.social-icon:hover,
.social-icon-mobile:hover {
  filter: brightness(1.2);
}

.catalog-family-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.catalog-family-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

#map {
  height: 600px;
  width: 100%;
  border-radius: 0.5rem;
}
.gm-style-iw-c {
  border-radius: 8px !important;
}
.gm-style-iw-d {
  overflow: auto !important;
}
.info-window-content {
  font-family: "Atkinson Hyperlegible", sans-serif;
}
.info-window-content h3 {
  font-weight: bold;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}
.info-window-content ul {
  list-style-position: inside;
  padding-left: 0.5rem;
}

/* Estilos para carrusel de Marcas */
.brands-carousel .swiper-wrapper {
  transition-timing-function: linear !important;
}
.brands-carousel .swiper-slide {
  width: auto;
}
.brands-carousel img {
  max-height: 50px; /* Aumentado para mejor visibilidad */
  width: auto;
  transition: filter 0.3s ease, transform 0.3s ease;
}

.dark .brands-carousel img:hover {
  filter: none;
}

/* Estilos para dropzone de archivos */
.drop-zone {
  border: 2px dashed #ccc;
  border-radius: 0.5rem;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.drop-zone.dragover {
  background-color: #e9f5ff;
  border-color: #0511f2;
}
.dark .drop-zone.dragover {
  background-color: #1e293b;
  border-color: #0511f2;
}
.drop-zone-text {
  color: #6c7073;
}
.dark .drop-zone-text {
  color: #9ca3af;
}

/* Clases utilitarias responsivas adicionales */
.responsive-text {
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.responsive-title {
  font-size: clamp(1.5rem, 5vw, 4rem);
  line-height: 1.2;
}

.responsive-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
}

.responsive-container {
  width: 100%;
  max-width: min(90vw, 1200px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Espaciado fluido */
.fluid-spacing {
  padding: clamp(2rem, 5vw, 6rem) 0;
}

/* Grids responsivos mejorados */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.auto-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* ========== MEDIA QUERIES PARA RESPONSIVIDAD ========== */

/* Móviles (hasta 767px) */
@media screen and (max-width: 767px) {
  .section-title {
    font-size: 1.8rem !important;
  }
  .section-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 95vw !important;
  }
  #close-video-modal {
    top: -2.5rem !important;
    right: 0.5rem !important;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #service-modal-panel {
    max-width: 95vw !important;
    max-height: 90vh !important;
  }
}

/* Tabletas (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .section-title {
    font-size: 2.5rem !important;
  }
  .section-subtitle {
    font-size: 1.125rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 85vw !important;
  }
  #service-modal-panel {
    max-width: 70vw !important;
    max-height: 85vh !important;
  }
}

/* Pantallas de escritorio grandes (HD, 2K) */
@media screen and (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}
/* Estilos mejorados para títulos principales */
.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: #1e40af;
  text-align: center;
  margin-bottom: 1rem;
  letter-spacing: -0.025em;
  line-height: 1.2;
  font-family: "Inter", sans-serif;
}

.section-title.hero {
  font-size: 3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Responsive para títulos */
@media (min-width: 768px) {
  .section-title {
    font-size: 3rem;
  }

  .section-title.hero {
    font-size: 3.5rem;
  }
}

@media (min-width: 1024px) {
  .section-title {
    font-size: 3.5rem;
  }

  .section-title.hero {
    font-size: 4rem;
  }
}

/* Subtítulos */
.section-subtitle {
  font-size: 1.125rem;
  color: #64748b;
  text-align: center;
  margin-bottom: 2rem;
  font-weight: 400;
  line-height: 1.6;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Modo oscuro */
.dark .section-title {
  color: #60a5fa;
}

.dark .section-subtitle {
  color: #94a3b8;
}

/* Responsividad para móviles */
@media screen and (max-width: 767px) {
  .section-title {
    font-size: 2.25rem !important;
    margin-bottom: 1.5rem !important;
    padding: 0.75rem 0;
  }

  .section-title::after {
    width: 60px;
    height: 3px;
  }

  .section-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
}

/* Tabletas */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .section-title {
    font-size: 3rem !important;
  }

  .section-subtitle {
    font-size: 1.25rem !important;
  }
}
/* Estilos para los carruseles de marcas:
/* Estilos para los carruseles de marcas */
.brands-carousel {
  width: 100%;
  overflow: hidden;
}

.brands-carousel .swiper-slide {
  width: auto;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brands-carousel .swiper-slide img {
  max-height: 60px;
  width: auto;
  object-fit: contain;
  transition: all 0.3s ease;
  border-radius: 8px;
  padding: 8px;
}

.dark .brands-carousel .swiper-slide img {
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brands-carousel .swiper-slide img:hover {
  transform: scale(1.05);
}

.dark .brands-carousel .swiper-slide img:hover {
  background-color: rgba(255, 255, 255, 1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}


/* Ancho consistente para marcas en diferentes pantallas */
@media (min-width: 320px) {
  .brands-carousel .swiper-slide {
    width: calc(50% - 7.5px);
  }
}

@media (min-width: 480px) {
  .brands-carousel .swiper-slide {
    width: calc(33.333% - 12px);
  }
}

@media (min-width: 768px) {
  .brands-carousel .swiper-slide {
    width: calc(25% - 15px);
  }
}

@media (min-width: 1024px) {
  .brands-carousel .swiper-slide {
    width: calc(16.666% - 17px);
  }
}

@media (min-width: 1280px) {
  .brands-carousel .swiper-slide {
    width: calc(12.5% - 17.5px);
  }
}

/* Evitar elementos parciales en carruseles de marcas */
.brands-carousel .swiper-wrapper {
  align-items: center;
}
*/ .responsive-text {
  font-size: clamp(0.875rem, 2.5vw, 1.125rem);
}

.responsive-title {
  font-size: clamp(1.5rem, 5vw, 4rem);
  line-height: 1.2;
}

.responsive-subtitle {
  font-size: clamp(1rem, 3vw, 1.5rem);
}

.responsive-container {
  width: 100%;
  max-width: min(90vw, 1200px);
  margin: 0 auto;
  padding: 0 clamp(1rem, 3vw, 2rem);
}

/* Espaciado fluido */
.fluid-spacing {
  padding: clamp(2rem, 5vw, 6rem) 0;
}

/* Grids responsivos mejorados */
.auto-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: clamp(1rem, 3vw, 2rem);
}

.auto-grid-small {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(0.75rem, 2vw, 1.5rem);
}

/* ========== MEDIA QUERIES PARA RESPONSIVIDAD ========== */

/* Móviles (hasta 767px) */
@media screen and (max-width: 767px) {
  .section-title {
    font-size: 1.8rem !important;
  }
  .section-subtitle {
    font-size: 1rem !important;
    margin-bottom: 2rem !important;
  }
  .container {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 95vw !important;
    max-height: 172vw !important;
  }
  #close-video-modal {
    top: -2.5rem !important;
    right: 0.5rem !important;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  #service-modal-panel {
    max-width: 95vw !important;
    max-height: 90vh !important;
  }
}

/* Tabletas (768px - 1023px) */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .section-title {
    font-size: 2.5rem !important;
  }
  .section-subtitle {
    font-size: 1.125rem !important;
  }
  #video-modal-content,
  #info-modal-panel,
  #proveedor-modal-panel {
    max-width: 85vw !important;
  }
  #service-modal-panel {
    max-width: 70vw !important;
    max-height: 85vh !important;
  }
}

/* Pantallas de escritorio grandes (HD, 2K) */
@media screen and (min-width: 1536px) {
  .container {
    max-width: 1536px;
  }
}
/* Mejoras para cards de folletos - Diseño equilibrado */
.folleto-card {
  min-height: 320px;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(229, 231, 235, 0.5);
  backdrop-filter: blur(10px);
}

.folleto-card:hover {
  border-color: rgba(59, 130, 246, 0.3);
}

.folleto-card .relative {
  flex-shrink: 0;
}

/* Contenedor de botones optimizado */
.folleto-card .p-6 {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Espaciado dinámico según número de botones */
.folleto-card .space-y-3 {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: center;
  align-items: stretch;
  min-height: 60px;
}

/* Cards con un solo botón - centrado vertical */
.folleto-card .space-y-3:has(.folleto-btn:only-child) {
  min-height: 50px;
  justify-content: center;
}

/* Cards con dos botones - distribución uniforme */
.folleto-card .space-y-3:has(.folleto-btn:nth-child(2)) {
  min-height: 110px;
  justify-content: space-between;
}

/* Botones mejorados */
.folleto-btn {
  padding: 0.875rem 1rem;
  min-height: 48px;
  border-radius: 0.75rem;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.folleto-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.folleto-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: left 0.5s ease;
}

.folleto-btn:hover::before {
  left: 100%;
}

.folleto-btn-primary {
  background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
}

.folleto-btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(30, 64, 175, 0.4);
}

.folleto-btn-special {
  background: linear-gradient(135deg, #ea580c 0%, #dc2626 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

.folleto-btn-special:hover {
  background: linear-gradient(135deg, #c2410c 0%, #b91c1c 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(234, 88, 12, 0.4);
}

.folleto-btn i {
  font-size: 1.125rem;
}

/* Modo oscuro */
.dark .folleto-card {
  border-color: rgba(75, 85, 99, 0.5);
  background: rgba(31, 41, 55, 0.8);
}

.dark .folleto-card:hover {
  border-color: rgba(96, 165, 250, 0.3);
}

/* Animaciones adicionales */
@keyframes pulse-glow {
  0%,
  100% {
    box-shadow: 0 4px 15px rgba(30, 64, 175, 0.3);
  }
  50% {
    box-shadow: 0 4px 20px rgba(30, 64, 175, 0.5);
  }
}

.folleto-btn-primary:focus {
  animation: pulse-glow 2s infinite;
  outline: none;
}

.folleto-btn-special:focus {
  animation: pulse-glow 2s infinite;
  outline: none;
  box-shadow: 0 4px 15px rgba(234, 88, 12, 0.3);
}

/* Fallback para navegadores sin soporte :has() */
@supports not selector(:has(*)) {
  .folleto-card-single {
    min-height: 300px;
  }
  
  .folleto-card-single .p-6 {
    padding: 1rem;
    justify-content: center;
  }
  
  .folleto-card-single .space-y-3 {
    min-height: 50px;
    justify-content: center;
  }
  
  .folleto-card-double {
    min-height: 340px;
  }
  
  .folleto-card-double .space-y-3 {
    min-height: 110px;
    justify-content: space-between;
  }
}

/* Ajustes específicos para laptops - Folletos por sucursal */
@media screen and (min-width: 1024px) and (max-width: 1440px) {
  .folleto-card {
    min-height: 280px; /* Reducido de 320px */
  }
  
  .folleto-card .relative {
    height: 160px; /* Reducido de 192px (h-48) */
  }
  
  .folleto-card .p-6 {
    padding: 1rem; /* Reducido el padding */
  }
  
  .folleto-btn {
    padding: 0.75rem 0.875rem; /* Padding más compacto */
    min-height: 42px; /* Reducido de 48px */
    font-size: 0.8rem; /* Texto ligeramente más pequeño */
  }
  
  .folleto-card .space-y-3:has(.folleto-btn:only-child) {
    min-height: 45px; /* Reducido para un botón */
  }
  
  .folleto-card .space-y-3:has(.folleto-btn:nth-child(2)) {
    min-height: 95px; /* Reducido para dos botones */
    gap: 0.5rem; /* Menor espacio entre botones */
  }
  
  .folleto-btn i {
    font-size: 1rem; /* Iconos más pequeños */
  }
}

/* Ajustes adicionales para laptops grandes */
@media screen and (min-width: 1441px) and (max-width: 1680px) {
  .folleto-card {
    min-height: 300px; /* Tamaño intermedio */
  }
  
  .folleto-card .relative {
    height: 180px;
  }
  
  .folleto-btn {
    padding: 0.8rem 0.9rem;
    min-height: 45px;
    font-size: 0.85rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .folleto-card {
    min-height: 280px;
  }
  
  .folleto-card .p-6 {
    padding: 1rem;
  }
  
  .folleto-btn {
    padding: 0.75rem;
    font-size: 0.8rem;
    min-height: 44px;
  }
}

@media (max-width: 640px) {
  .folleto-card {
    min-height: 260px;
  }
  
  .folleto-card .space-y-3:has(.folleto-btn:nth-child(2)) {
    min-height: 100px;
  }
  
  .folleto-btn {
    font-size: 0.8rem;
  }

  .folleto-btn i {
    font-size: 1rem;
  }
}

/* Ajustes para pantallas muy pequeñas */
@media (max-width: 480px) {
  #mobile-menu {
    padding: 0.5rem !important;
  }
  
  #mobile-menu-panel {
    max-width: calc(100vw - 1rem) !important;
    width: calc(100vw - 1rem) !important;
  }
}

/* Corrección adicional para el overlay */
#mobile-menu.hidden {
  display: none !important;
}

/* Ajustes específicos para laptops - Tarjetas de Sucursales */
@media screen and (min-width: 768px) and (max-width: 1440px) {
  /* Contenedor de imagen de sucursal mucho más compacto */
  .branch-media-container {
    height: 140px !important; /* Muy reducido de h-64 (256px) */
  }
  
  /* Padding más compacto en las tarjetas */
  .branch-card .p-6 {
    padding: 0.875rem !important; /* Muy reducido */
  }
  
  /* Título más compacto */
  .branch-card h3 {
    font-size: 1.125rem !important; /* Mucho más pequeño */
    margin-bottom: 0.5rem !important; /* Margen mínimo */
    font-weight: 700 !important;
  }
  
  /* Lista de información más compacta */
  .branch-card .space-y-4 {
    gap: 0.5rem !important; /* Muy reducido */
  }
  
  /* Iconos más pequeños */
  .branch-card .w-10.h-10 {
    width: 1.75rem !important; /* Muy reducido */
    height: 1.75rem !important;
    margin-right: 0.75rem !important;
  }
  
  .branch-card .ti {
    font-size: 0.875rem !important; /* Iconos más pequeños */
  }
  
  /* Botón más compacto */
  .branch-card .toggle-map-btn {
    padding: 0.5rem 0.75rem !important; /* Muy compacto */
    margin-top: 0.75rem !important; /* Margen mínimo */
    font-size: 0.8rem !important; /* Texto más pequeño */
  }
  
  /* Texto más compacto */
  .branch-card li span,
  .branch-card li a {
    font-size: 0.8rem !important; /* Texto más pequeño */
    line-height: 1.2 !important;
  }
  
  /* Altura aumentada para mostrar todo el contenido */
  .branch-card {
    min-height: 380px !important; /* Aumentado de 280px a 380px */
    max-height: 380px !important; /* Altura fija aumentada */
  }
  
  /* Optimizar el contenido para que quepa */
  .branch-card .flex-grow {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
  }
}

/* Ajustes específicos para tablets */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .branch-media-container {
    height: 120px !important; /* Aún más compacto en tablets */
  }
  
  .branch-card {
    min-height: 350px !important; /* Aumentado de 260px a 350px */
    max-height: 350px !important;
  }
  
  .branch-card .p-6 {
    padding: 0.75rem !important;
  }
  
  .branch-card h3 {
    font-size: 1rem !important;
    margin-bottom: 0.375rem !important;
  }
  
  .branch-card li span,
  .branch-card li a {
    font-size: 0.75rem !important;
  }
  
  .branch-card .toggle-map-btn {
    padding: 0.375rem 0.5rem !important;
    font-size: 0.75rem !important;
  }
}

/* Ajuste del grid para mostrar más tarjetas por fila */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  /* En tablets: 2 columnas */
  #sucursales .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
  }
}

@media screen and (min-width: 1024px) and (max-width: 1440px) {
  /* En laptops: 2 columnas para mostrar 2x2 */
  #sucursales .grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important; /* Aumentar un poco el gap para mejor distribución */
  }
}

/* Ajustes adicionales para optimizar el espacio vertical */
@media screen and (min-width: 768px) {
  /* Reducir padding de la sección completa */
  #sucursales {
    padding-top: 3rem !important;
    padding-bottom: 3rem !important;
  }
  
  /* Reducir margen del título */
  #sucursales .section-title {
    margin-bottom: 1.5rem !important;
  }
}



/* Mejoras para el modal de búsqueda en tema oscuro - Optimizado para personas mayores */

/* Mejoras para el modal de búsqueda */
#search-modal .dark\:bg-gray-800 {
  background-color: #1f2937 !important;
  border: 2px solid #374151 !important;
}

/* Mejoras para el input de búsqueda en tema oscuro */
.dark #search-input-modal {
  background-color: #111827 !important;
  border: 2px solid #4b5563 !important;
  color: #f9fafb !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}

.dark #search-input-modal:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.3) !important;
  background-color: #000000 !important;
}

.dark #search-input-modal::placeholder {
  color: #d1d5db !important;
  font-weight: 500 !important;
}

/* Icono de búsqueda mejorado */
.dark #search-modal .ti-search {
  color: #d1d5db !important;
  font-size: 1.25rem !important;
}

/* Contador de resultados mejorado */
.dark #search-counter {
  color: #e5e7eb !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

/* Lista de resultados mejorada */
.dark #search-results-list {
  background-color: #111827 !important;
  border: 1px solid #374151 !important;
  border-radius: 8px !important;
  margin-top: 12px !important;
}

/* Items de resultados individuales */
.dark #search-results-list li {
  border-bottom: 1px solid #374151 !important;
}

.dark #search-results-list li:last-child {
  border-bottom: none !important;
}

.dark #search-results-list a {
  color: #f3f4f6 !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  display: block !important;
  text-decoration: none !important;
  line-height: 1.5 !important;
}

.dark #search-results-list a:hover {
  background-color: #1f2937 !important;
  color: #60a5fa !important;
  border-left: 4px solid #60a5fa !important;
}

/* Título del modal mejorado */
.dark #search-modal h3 {
  color: #f9fafb !important;
  font-weight: 700 !important;
  font-size: 18px !important;
}

/* Botón de cerrar mejorado */
.dark #close-search-modal {
  color: #d1d5db !important;
  background-color: #374151 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}
#search-modal .bg-white {
  background: #f8fafc !important;
  border: 1.5px solid #e5e7eb !important;
  box-shadow: 0 6px 32px 0 rgba(30, 64, 175, 0.10), 0 1.5px 4px 0 rgba(0,0,0,0.04) !important;
}
.dark #search-modal .dark\:bg-gray-800 {
  background: #181f2a !important;
  border: 1.5px solid #334155 !important;
  box-shadow: 0 6px 32px 0 rgba(96, 165, 250, 0.13), 0 1.5px 4px 0 rgba(0,0,0,0.10) !important;
}
#search-modal input[type="search"] {
  background: #f1f5f9 !important;
  color: #1e293b !important;
  border: 1.5px solid #cbd5e1 !important;
}
#search-modal input[type="search"]:focus {
  border-color: #0511f2 !important;
  box-shadow: 0 0 0 2px #0511f233 !important;
}
.dark #search-modal input[type="search"] {
  background: #232b39 !important;
  color: #f1f5f9 !important;
  border: 1.5px solid #334155 !important;
}
.dark #search-modal input[type="search"]:focus {
  border-color: #60a5fa !important;
  box-shadow: 0 0 0 2px #60a5fa33 !important;
}
#search-modal .text-brand-gray,
#search-modal .text-brand-black {
  color: #1e293b !important;
}
.dark #search-modal .dark\:text-gray-400,
.dark #search-modal .dark\:text-white {
  color: #f1f5f9 !important;
}
#search-modal .divide-gray-200 {
  border-color: #e5e7eb !important;
}
.dark #search-modal .dark\:divide-gray-700 {
  border-color: #334155 !important;
}
#close-search-modal {
  background: #e5e7eb !important;
  border-radius: 0.5rem !important;
  transition: background 0.2s;
}
#close-search-modal:hover {
  background: #cbd5e1 !important;
}
.dark #close-search-modal {
  background: #232b39 !important;
}
.dark #close-search-modal:hover {
  background: #334155 !important;
}
.dark #close-search-modal:hover {
  color: #ffffff !important;
  background: #334155 !important;
  transform: scale(1.05) !important;
}

/* Mejoras adicionales para accesibilidad */
.dark #search-modal {
  backdrop-filter: blur(12px) !important;
}

/* Scrollbar personalizada para la lista de resultados */
.dark #search-results-list::-webkit-scrollbar {
  width: 8px;
}

.dark #search-results-list::-webkit-scrollbar-track {
  background: #1f2937;
  border-radius: 4px;
}

.dark #search-results-list::-webkit-scrollbar-thumb {
  background: #4b5563;
  border-radius: 4px;
}

.dark #search-results-list::-webkit-scrollbar-thumb:hover {
  background: #6b7280;
}

/* Ajustes para pantallas pequeñas */
@media (max-width: 640px) {
  .dark #search-input-modal {
    font-size: 18px !important; /* Evita zoom en iOS */
  }
  
  .dark #search-results-list a {
    font-size: 16px !important;
    padding: 14px 16px !important;
  }
  
  .dark #search-modal h3 {
    font-size: 20px !important;
  }
}

/* Mejoras para el modal de búsqueda en tema claro - Optimizado para personas mayores */

/* Mejoras para el modal de búsqueda en tema claro */
#search-modal .bg-white {
  background-color: #ffffff !important;
  border: 2px solid #d1d5db !important;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.1) !important;
}

/* Mejoras para el input de búsqueda en tema claro */
#search-input-modal {
  background-color: #f9fafb !important;
  border: 2px solid #9ca3af !important;
  color: #111827 !important;
  font-size: 16px !important;
  font-weight: 500 !important;
}

#search-input-modal:focus {
  border-color: #2563eb !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.3) !important;
  background-color: #ffffff !important;
}

#search-input-modal::placeholder {
  color: #6b7280 !important;
  font-weight: 500 !important;
}

/* Icono de búsqueda mejorado en tema claro */
#search-modal .ti-search {
  color: #4b5563 !important;
  font-size: 1.25rem !important;
}

/* Contador de resultados mejorado en tema claro */
#search-counter {
  color: #374151 !important;
  font-weight: 600 !important;
  font-size: 14px !important;
}

/* Lista de resultados mejorada en tema claro */
#search-results-list {
  background-color: #f9fafb !important;
  border: 1px solid #d1d5db !important;
  border-radius: 8px !important;
  margin-top: 12px !important;
}

/* Items de resultados individuales en tema claro */
#search-results-list li {
  border-bottom: 1px solid #e5e7eb !important;
}

#search-results-list li:last-child {
  border-bottom: none !important;
}

#search-results-list a {
  color: #1f2937 !important;
  font-weight: 500 !important;
  font-size: 14px !important;
  padding: 12px 16px !important;
  display: block !important;
  text-decoration: none !important;
  line-height: 1.5 !important;
}

#search-results-list a:hover {
  background-color: #e5e7eb !important;
  color: #1d4ed8 !important;
  border-left: 4px solid #2563eb !important;
  font-weight: 600 !important;
}

/* Título del modal mejorado en tema claro */
#search-modal h3 {
  color: #111827 !important;
  font-weight: 700 !important;
  font-size: 18px !important;
}

/* Botón de cerrar mejorado en tema claro */
#close-search-modal {
  color: #6b7280 !important;
  background-color: #f3f4f6 !important;
  border-radius: 6px !important;
  transition: all 0.2s ease !important;
}

#close-search-modal:hover {
  color: #111827 !important;
  background-color: #e5e7eb !important;
  transform: scale(1.05) !important;
}

/* Scrollbar personalizada para tema claro */
#search-results-list::-webkit-scrollbar {
  width: 8px;
}

#search-results-list::-webkit-scrollbar-track {
  background: #f3f4f6;
  border-radius: 4px;
}

#search-results-list::-webkit-scrollbar-thumb {
  background: #d1d5db;
  border-radius: 4px;
}

#search-results-list::-webkit-scrollbar-thumb:hover {
  background: #9ca3af;
}

/* Mejoras adicionales para accesibilidad en tema claro */
#search-modal {
  backdrop-filter: blur(12px) !important;
}

/* Estados de enfoque mejorados para tema claro */
#search-modal button:focus,
#search-modal input:focus {
  outline: 2px solid #2563eb !important;
  outline-offset: 2px !important;
}

/* Ajustes para pantallas pequeñas en tema claro */
@media (max-width: 640px) {
  #search-input-modal {
    font-size: 18px !important; /* Evita zoom en iOS */
  }
  
  #search-results-list a {
    font-size: 16px !important;
    padding: 14px 16px !important;
  }
  
  #search-modal h3 {
    font-size: 20px !important;
  }
}
/* Estilos base para .fh5-light-box */
.fh5-light-box {
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  z-index: 99999999 !important;
  margin: 0 !important;
  background: white !important;
  border-radius: 12px !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4) !important;
  overflow: hidden !important;
  /* Tamaño base para desktop */
  width: min(90vw, 900px) !important;
  height: min(85vh, 700px) !important;
  max-width: 90vw !important;
  max-height: 85vh !important;
}

/* Tablets grandes (769px - 1024px) */
@media (max-width: 1024px) and (min-width: 769px) {
  .fh5-light-box {
    width: 95vw !important;
    height: 90vh !important;
    border-radius: 10px !important;
  }
}

/* Tablets y móviles grandes (481px - 768px) */
@media (max-width: 768px) and (min-width: 481px) {
  .fh5-light-box {
    width: 96vw !important;
    height: 92vh !important;
    border-radius: 8px !important;
    top: 50% !important;
    left: 50% !important;
  }
}

/* Móviles medianos (361px - 480px) */
@media (max-width: 480px) and (min-width: 361px) {
  .fh5-light-box {
    width: 98vw !important;
    height: 95vh !important;
    border-radius: 6px !important;
    top: 50% !important;
    left: 50% !important;
  }
}

/* Móviles pequeños (320px - 360px) */
@media (max-width: 360px) and (min-width: 320px) {
  .fh5-light-box {
    width: 99vw !important;
    height: 97vh !important;
    border-radius: 4px !important;
    top: 50% !important;
    left: 50% !important;
  }
}

/* Móviles muy pequeños (menos de 320px) */
@media (max-width: 319px) {
  .fh5-light-box {
    width: 100vw !important;
    height: 100vh !important;
    border-radius: 0 !important;
    top: 50% !important;
    left: 50% !important;
  }
}

/* Orientación landscape en móviles */
@media (max-width: 768px) and (orientation: landscape) {
  .fh5-light-box {
    width: 95vw !important;
    height: 98vh !important;
    border-radius: 6px !important;
  }
}

/* Orientación portrait en móviles */
@media (max-width: 768px) and (orientation: portrait) {
  .fh5-light-box {
    width: 98vw !important;
    height: 95vh !important;
  }
}

/* iPhone SE y dispositivos similares */
@media (max-width: 375px) and (max-height: 667px) {
  .fh5-light-box {
    width: 99vw !important;
    height: 96vh !important;
    border-radius: 4px !important;
  }
}

/* Dispositivos con pantallas muy altas */
@media (max-width: 480px) and (min-height: 800px) {
  .fh5-light-box {
    height: 93vh !important;
  }
}

/* Ajustes para pantallas con notch */
@media (max-width: 480px) {
  .fh5-light-box {
    top: calc(50% + env(safe-area-inset-top, 0px) / 2) !important;
    height: calc(95vh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px)) !important;
  }
}
/* Mejoras de contraste para texto seleccionado */
#search-modal ::selection {
  background-color: #3b82f6 !important;
  color: #ffffff !important;
}

/* Indicador visual para elementos interactivos */
#search-results-list a:focus {
  outline: 2px solid #2563eb !important;
  outline-offset: -2px !important;
  background-color: #dbeafe !important;
}

/* Estilos corregidos para AnyFlip Lightbox */
.fh5-lightbox-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(0, 0, 0, 0.8) !important;
  z-index: 9999 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

.fh5-lightbox-container {
  position: relative !important;
  max-width: calc(100vw - 20px) !important;
  max-height: calc(100vh - 60px) !important;
  margin: 0 !important;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5) !important;
  border-radius: 8px !important;
  overflow: hidden !important;
}

.fh5-lightbox-content {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: 8px !important;
}

.fh5-lightbox-close {
  position: absolute !important;
  top: -40px !important;
  right: 0 !important;
  background: rgba(255, 255, 255, 0.9) !important;
  color: #333 !important;
  border: none !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  font-size: 18px !important;
  font-weight: bold !important;
  cursor: pointer !important;
  z-index: 10000 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
}

.fh5-lightbox-close:hover {
  background: white !important;
  transform: scale(1.1) !important;
}

/* Específico para móviles */
@media (max-width: 768px) {
  .fh5-lightbox-container {
    max-width: calc(100vw - 10px) !important;
    max-height: calc(100vh - 40px) !important;
    border-radius: 6px !important;
  }
  
  .fh5-lightbox-close {
    top: -35px !important;
    right: 5px !important;
    width: 28px !important;
    height: 28px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 480px) {
  .fh5-lightbox-container {
    max-width: calc(100vw - 5px) !important;
    max-height: calc(100vh - 30px) !important;
    border-radius: 4px !important;
  }
  
  .fh5-lightbox-close {
    top: -30px !important;
    right: 2px !important;
    width: 26px !important;
    height: 26px !important;
    font-size: 14px !important;
  }
}

/* Prevenir scroll del body */
body.fh5-lightbox-open {
  overflow: hidden !important;
}

/* Estilos específicos para el iframe dentro del lightbox AnyFlip */
.fh5-light-box iframe {
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  border-radius: inherit !important;
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  background: white !important;
  object-fit: contain !important;
}

/* Contenedor del iframe para mejor control */
.fh5-light-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  justify-content: stretch !important;
}

/* Asegurar que el iframe ocupe todo el espacio disponible */
.fh5-light-box > iframe,
.fh5-light-box iframe:first-child,
.fh5-light-box iframe:only-child {
  flex: 1 1 100% !important;
  min-height: 658px !important;
  min-width: 100% !important;
}

/* Estilos responsivos para el iframe */
@media (max-width: 768px) {
  .fh5-light-box iframe {
    border-radius: 6px !important;
  }
}

@media (max-width: 480px) {
  .fh5-light-box iframe {
    border-radius: 4px !important;
  }
}

@media (max-width: 319px) {
  .fh5-light-box iframe {
    border-radius: 0 !important;
  }
}

/* Prevenir problemas de scroll en el iframe */
.fh5-light-box iframe {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch !important;
}

/* Asegurar que el contenido del iframe se ajuste correctamente */
.fh5-light-box iframe[src*="anyflip"] {
  transform: scale(1) !important;
  transform-origin: center center !important;
}

