/**
 * ====================================================================
 * SLIDER.CSS - Estilos Unificados para Carrossel
 * ====================================================================
 */

/* =====================================================
   CONTAINER DO SLIDER
   ===================================================== */
.structure-slider {
  width: 100%;
  overflow: hidden;
  padding: 40px 0;
  background-color: #f9f9f9;
  position: relative;
  user-select: none;
}

/* Gradiente nas bordas para efeito fade */
.structure-slider::before,
.structure-slider::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 100px;
  z-index: 2;
  pointer-events: none;
}

.structure-slider::before {
  left: 0;
  background: linear-gradient(to right, #f9f9f9, transparent);
}

.structure-slider::after {
  right: 0;
  background: linear-gradient(to left, #f9f9f9, transparent);
}

/* =====================================================
   TRACK (FAIXA QUE SE MOVE)
   ===================================================== */
.slider-track {
  display: flex;
  width: max-content;
  gap: 25px;
  will-change: transform;
  transition: none; /* JS controla o movimento */
  cursor: grab;
}

.slider-track:active {
  cursor: grabbing;
}

/* =====================================================
   SLIDES INDIVIDUAIS
   ===================================================== */
.slide {
  flex: 0 0 auto;
  width: 400px;
  height: 280px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  background: #fff;
  transform: translateZ(0); /* GPU acceleration */
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
  position: relative;
}

.slide:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  z-index: 3;
}

.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: auto;
  cursor: zoom-in;
  user-select: none;
  -webkit-user-drag: none;
}

/* =====================================================
   LIGHTBOX (MODAL PARA ZOOM)
   ===================================================== */
.lightbox-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  z-index: 10001;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-modal.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  box-shadow: 0 0 50px rgba(0, 0, 0, 0.5);
  transform: scale(0.9);
  transition: transform 0.3s ease;
  border: 3px solid #f28e3f; /* Cor padrão - será sobrescrita por cada site */
}

.lightbox-modal.active .lightbox-content {
  transform: scale(1);
}

.lightbox-close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: #ffffff;
  font-size: 45px;
  font-weight: 300;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
}

.lightbox-close:hover {
  color: #f28e3f; /* Cor padrão */
  transform: rotate(90deg);
}

/* =====================================================
   CORES POR SITE (LIGHTBOX BORDER)
   ===================================================== */
.site-goiascal .lightbox-content {
  border-color: #f3b722; /* Amarelo Goiascal */
}

.site-goiasfiller .lightbox-content {
  border-color: #a88f4f; /* Dourado Goiasfiller */
}

.site-primacal .lightbox-content {
  border-color: #eccc60; /* Dourado Primacal */
}

.site-agrocal .lightbox-content {
  border-color: #f28e3f; /* Laranja Agrocal */
}

.site-goiascal .lightbox-close:hover {
  color: #f3b722;
}

.site-goiasfiller .lightbox-close:hover {
  color: #a88f4f;
}

.site-primacal .lightbox-close:hover {
  color: #eccc60;
}

.site-agrocal .lightbox-close:hover {
  color: #f28e3f;
}

/* =====================================================
   RESPONSIVIDADE
   ===================================================== */

/* Tablet */
@media (max-width: 768px) {
  .slider-track {
    gap: 15px;
  }

  .slide {
    width: 320px;
    height: 220px;
  }

  .lightbox-close {
    top: 15px;
    right: 15px;
    font-size: 35px;
    width: 40px;
    height: 40px;
  }

  .lightbox-content {
    max-width: 95%;
    max-height: 80%;
  }
}

/* Mobile */
@media (max-width: 480px) {
  .structure-slider {
    padding: 30px 0;
  }

  .slider-track {
    gap: 12px;
  }

  .slide {
    width: 280px;
    height: 200px;
  }

  /* Remover gradientes nas bordas em mobile */
  .structure-slider::before,
  .structure-slider::after {
    display: none;
  }
}

/* =====================================================
   ACESSIBILIDADE
   ===================================================== */

/* Focar com teclado */
.slide:focus {
  outline: 3px solid #f28e3f;
  outline-offset: 2px;
}

/* Reduzir movimento para usuários que preferem */
@media (prefers-reduced-motion: reduce) {
  .slider-track,
  .slide,
  .lightbox-modal,
  .lightbox-content {
    transition: none !important;
    animation: none !important;
  }
}

/* =====================================================
   LOADING STATE (OPCIONAL)
   ===================================================== */
.slide img:not([src]) {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}
