/* ===============================================
   GCLA - Sección de Subastas Activas
   Componente Modular - SWIPER.JS MODERNO
   =============================================== */

/* Contenedor Principal de Subastas */
.auctions-section {
  background: linear-gradient(135deg, #f8fafc 0%, #ffffff 100%);
  position: relative;
  padding: 48px 0;
  overflow: hidden;
}

/* Header de la Sección */
.auctions-section .section-header {
  margin-bottom: 48px;
}

/* ===============================================
   SWIPER.JS - CONFIGURACIÓN PERSONALIZADA
   =============================================== */

/* Contenedor principal del Swiper */
.auctions-swiper {
  width: 100%;
  height: auto;
  padding: 20px 0 60px 0; /* Espacio para paginación */
  position: relative;
}

/* Wrapper de slides - Swiper maneja esto automáticamente */
.auctions-swiper .swiper-wrapper {
  align-items: stretch; /* Todas las tarjetas misma altura */
}

/* Slides individuales */
.auctions-swiper .swiper-slide {
  height: auto;
  display: flex;
  justify-content: center;
  align-items: stretch;
}

/* ===============================================
   TARJETAS DE SUBASTA - DISEÑO MODERNO
   =============================================== */

/* Tarjetas de Subasta Individuales */
.auction-card {
  background: #FFFFFF;
  border: 1px solid #E5E7EB;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  width: 100%;
  max-width: 320px;
  height: 100%;
  min-height: 480px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  margin: 0 auto;
}

.auction-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: #10B981;
}

/* Imagen de la Subasta */
.auction-image {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: #F9FAFB;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #E5E7EB; /* Debug border */
}

.auction-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
  display: block;
}

/* Fallback cuando la imagen no carga */
.auction-image img:not([src]),
.auction-image img[src=""],
.auction-image img[src*="undefined"] {
  display: none;
}

.auction-image::after {
  content: "📦";
  font-size: 48px;
  color: #9CA3AF;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  display: none;
}

.auction-image img:not([src]) + .auction-image::after,
.auction-image img[src=""] + .auction-image::after,
.auction-image img[src*="undefined"] + .auction-image::after {
  display: block;
}

.auction-card:hover .auction-image img {
  transform: scale(1.05);
}

/* Badge de Favorito */
.auction-favorite {
  position: absolute;
  top: 12px;
  left: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 2;
  backdrop-filter: blur(8px);
}

.auction-favorite:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
}

.auction-favorite i {
  font-size: 18px;
  color: #6B7280;
  transition: color 0.3s ease;
}

.auction-favorite:hover i,
.auction-favorite.active i {
  color: #EF4444;
}

/* Badge de Estado/Timer */
.auction-status {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(239, 68, 68, 0.95);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(8px);
}

/* Contenido de la Tarjeta */
.auction-content {
  padding: 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.auction-title {
  font-size: 18px;
  font-weight: 700;
  color: #1F2937;
  margin-bottom: 16px;
  line-height: 1.3;
  height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}

.auction-details {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
  flex-grow: 1;
}

.auction-detail {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
}

.auction-detail-label {
  color: #6B7280;
  font-weight: 500;
}

.auction-detail-value {
  color: #1F2937;
  font-weight: 600;
}

/* Precio de la Subasta */
.auction-price {
  font-size: 24px;
  font-weight: 800;
  color: #10B981;
  margin-bottom: 12px;
  text-align: center;
}

/* Participantes */
.auction-participants {
  text-align: center;
  margin-bottom: 20px;
}

.participants-count {
  font-size: 14px;
  color: #6B7280;
  font-weight: 500;
}

/* Botón de Puja */
.auction-btn {
  background: linear-gradient(135deg, #10B981 0%, #059669 100%);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  margin-top: auto;
}

.auction-btn:hover {
  background: linear-gradient(135deg, #059669 0%, #047857 100%);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(16, 185, 129, 0.3);
}

.auction-btn:active {
  transform: translateY(0);
}

/* ===============================================
   CONTROLES DE NAVEGACIÓN SWIPER
   =============================================== */

/* Botones de navegación personalizados */
.auctions-swiper .swiper-button-prev,
.auctions-swiper .swiper-button-next {
  width: 50px;
  height: 50px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(229, 231, 235, 0.5);
}

.auctions-swiper .swiper-button-prev:hover,
.auctions-swiper .swiper-button-next:hover {
  background: rgba(255, 255, 255, 1);
  transform: scale(1.1);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.auctions-swiper .swiper-button-prev::after,
.auctions-swiper .swiper-button-next::after {
  font-size: 18px;
  color: #10B981;
  font-weight: 900;
}

.auctions-swiper .swiper-button-prev {
  left: 20px;
}

.auctions-swiper .swiper-button-next {
  right: 20px;
}

/* Paginación personalizada */
.auctions-swiper .swiper-pagination {
  bottom: 20px;
  position: relative;
  margin-top: 20px;
}

.auctions-swiper .swiper-pagination-bullet {
  width: 12px;
  height: 12px;
  background: rgba(16, 185, 129, 0.3);
  opacity: 1;
  transition: all 0.3s ease;
}

.auctions-swiper .swiper-pagination-bullet-active {
  background: #10B981;
  transform: scale(1.2);
}

/* ===============================================
   RESPONSIVE DESIGN
   =============================================== */

/* Tablets */
@media (max-width: 768px) {
  .auctions-swiper {
    padding: 20px 0 50px 0;
  }
  
  .auction-card {
    max-width: 280px;
    min-height: 450px;
  }
  
  .auction-image {
    height: 180px;
  }
  
  .auction-content {
    padding: 20px;
  }
  
  .auction-title {
    font-size: 16px;
  }
  
  .auction-price {
    font-size: 20px;
  }
  
  .auctions-swiper .swiper-button-prev,
  .auctions-swiper .swiper-button-next {
    width: 40px;
    height: 40px;
  }
  
  .auctions-swiper .swiper-button-prev {
    left: 10px;
  }
  
  .auctions-swiper .swiper-button-next {
    right: 10px;
  }
}

/* Móviles */
@media (max-width: 480px) {
  .auctions-swiper {
    padding: 15px 0 40px 0;
  }
  
  .auction-card {
    max-width: 260px;
    min-height: 420px;
  }
  
  .auction-image {
    height: 160px;
  }
  
  .auction-content {
    padding: 16px;
  }
  
  .auction-title {
    font-size: 15px;
  }
  
  .auction-price {
    font-size: 18px;
  }
  
  .auction-btn {
    padding: 12px 20px;
    font-size: 14px;
  }
  
  .auctions-swiper .swiper-button-prev,
  .auctions-swiper .swiper-button-next {
    width: 35px;
    height: 35px;
  }
  
  .auctions-swiper .swiper-button-prev::after,
  .auctions-swiper .swiper-button-next::after {
    font-size: 14px;
  }
}

/* ===============================================
   ESTADOS ESPECIALES
   =============================================== */

/* Estado vacío */
.no-auctions-message {
  text-align: center;
  padding: 60px 20px;
  color: #6B7280;
  font-size: 18px;
  font-weight: 500;
}

/* Modo de alto contraste */
@media (prefers-contrast: high) {
  .auction-card {
    border-width: 2px;
    border-color: #10B981;
  }
  
  .auction-btn {
    border: 2px solid #10B981;
  }
}

/* Reducir animaciones para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
  .auction-card,
  .auction-btn,
  .auction-favorite,
  .auctions-swiper .swiper-button-prev,
  .auctions-swiper .swiper-button-next {
    transition: none;
  }
  
  .auction-card:hover {
    transform: none;
  }
}
