/**
 * Financieras Grid - Estilos mejorados para la sección de financiación
 * AKT Via Motos - www.aktviamotos.com
 */

/* Sección de Financiación */
.section--financiacion {
  background: linear-gradient(135deg, #f8fafc 0%, #e0f2fe 100%);
  position: relative;
  overflow: hidden;
  padding: 80px 0;
}

.section--financiacion::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #E20613 0%, #003e88 50%, #ffd700 100%);
}

.section--financiacion::after {
  content: '';
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(0, 62, 136, 0.05) 0%, transparent 70%);
  border-radius: 50%;
  top: -100px;
  right: -100px;
  pointer-events: none;
}

.section--financiacion .section__header {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto 60px;
  text-align: center;
}

.section--financiacion .section__title {
  font-size: 48px;
  font-weight: 900;
  margin-bottom: 20px;
  color: white;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.section--financiacion .section__subtitle {
  font-size: 20px;
  color: white;
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto;
}

/* Grid de Financieras con tarjetas flip - DESKTOP */
.financieras-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
  z-index: 1;
  padding: 20px 0;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.6s ease;
}

.financieras-grid.expanded {
  max-height: none;
}

/* Ocultar tarjetas extra en desktop */
.financieras-grid:not(.expanded) financiera-card:nth-child(n+4) {
  display: none;
}

/* Animaciones de entrada para las tarjetas */
.financieras-grid financiera-card {
  animation: fadeInUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) backwards;
}

.financieras-grid financiera-card:nth-child(1) { animation-delay: 0.1s; }
.financieras-grid financiera-card:nth-child(2) { animation-delay: 0.15s; }
.financieras-grid financiera-card:nth-child(3) { animation-delay: 0.2s; }
.financieras-grid financiera-card:nth-child(4) { animation-delay: 0.25s; }
.financieras-grid financiera-card:nth-child(5) { animation-delay: 0.3s; }
.financieras-grid financiera-card:nth-child(6) { animation-delay: 0.35s; }
.financieras-grid financiera-card:nth-child(7) { animation-delay: 0.4s; }
.financieras-grid financiera-card:nth-child(8) { animation-delay: 0.45s; }
.financieras-grid financiera-card:nth-child(9) { animation-delay: 0.5s; }
.financieras-grid financiera-card:nth-child(10) { animation-delay: 0.55s; }
.financieras-grid financiera-card:nth-child(11) { animation-delay: 0.6s; }
.financieras-grid financiera-card:nth-child(12) { animation-delay: 0.65s; }

/* Botón Ver Más - DESKTOP */
.btn-ver-mas-financieras {
  display: block;
  margin: 40px auto 0;
  padding: 16px 40px;
  background: linear-gradient(135deg, #E20613 0%, #b6050f 100%);
  color: white;
  border: none;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(226, 6, 19, 0.3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  overflow: hidden;
}

.btn-ver-mas-financieras::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-ver-mas-financieras:hover::before {
  width: 300px;
  height: 300px;
}

.btn-ver-mas-financieras:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(226, 6, 19, 0.4);
}

.btn-ver-mas-financieras:active {
  transform: translateY(-1px);
}

.btn-ver-mas-financieras span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.btn-ver-mas-financieras svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.btn-ver-mas-financieras.expanded svg {
  transform: rotate(180deg);
}

.btn-ver-mas-financieras.hidden {
  display: none;
}

/* Badge de información */
.financieras-info-badge {
  background: white;
  border-radius: 16px;
  padding: 24px;
  margin-top: 40px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border: 2px solid #e2e8f0;
  text-align: center;
}

.financieras-info-badge h3 {
  font-size: 20px;
  font-weight: 700;
  color: #003e88;
  margin-bottom: 12px;
}

.financieras-info-badge p {
  font-size: 15px;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 20px;
}

.financieras-info-badge .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: #E20613;
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.financieras-info-badge .btn:hover {
  background: #b6050f;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(226, 6, 19, 0.3);
}

/* Animaciones */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive - TABLET Y MÓVIL: CARRUSEL */
@media (max-width: 1024px) {
  .financieras-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 20px;
    padding: 20px 10px;
    max-height: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: #E20613 #e2e8f0;
  }

  .financieras-grid::-webkit-scrollbar {
    height: 8px;
  }

  .financieras-grid::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 10px;
  }

  .financieras-grid::-webkit-scrollbar-thumb {
    background: #E20613;
    border-radius: 10px;
  }

  .financieras-grid::-webkit-scrollbar-thumb:hover {
    background: #b6050f;
  }

  .financieras-grid financiera-card {
    min-width: 320px;
    max-width: 320px;
    flex-shrink: 0;
    scroll-snap-align: center;
  }

  .financieras-grid:not(.expanded) financiera-card:nth-child(n+4) {
    display: block;
  }

  .btn-ver-mas-financieras {
    display: none;
  }

  /* Indicadores de carrusel móvil */
  .financieras-carousel-indicators {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
  }

  .carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #cbd5e1;
    transition: all 0.3s ease;
  }

  .carousel-indicator.active {
    width: 24px;
    border-radius: 4px;
    background: #E20613;
  }
}

@media (max-width: 768px) {
  .section--financiacion {
    padding: 50px 0;
  }

  .section--financiacion .section__title {
    font-size: 32px;
    color: white;
  }

  .section--financiacion .section__subtitle {
    font-size: 16px;
    color: white;
  }

  .financieras-grid financiera-card {
    min-width: 280px;
    max-width: 280px;
  }
}

@media (max-width: 480px) {
  .section--financiacion .section__title {
    font-size: 28px;
    color: white;
  }

  .section--financiacion .section__subtitle {
    font-size: 15px;
    color: white;
  }

  .financieras-grid {
    padding: 20px 5px;
  }

  .financieras-grid financiera-card {
    min-width: calc(100vw - 40px);
    max-width: calc(100vw - 40px);
  }
}

/* Modo oscuro (si se implementa en el futuro) */
@media (prefers-color-scheme: dark) {
  .section--financiacion {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  }

  .section--financiacion .section__title {
    color: white;
  }

  .section--financiacion .section__subtitle {
    color: white;
  }

  .financieras-info-badge {
    background: #1e293b;
    border-color: #334155;
  }

  .financieras-info-badge h3 {
    color: #60a5fa;
  }

  .financieras-info-badge p {
    color: #94a3b8;
  }
}

/* Accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .financieras-grid financiera-card {
    animation: none;
  }

  .financieras-grid financiera-card:hover {
    transform: none;
  }

  .section--financiacion::after {
    animation: none;
  }
}

/* Print styles */
@media print {
  .section--financiacion {
    background: white;
    padding: 20px 0;
  }

  .section--financiacion::before,
  .section--financiacion::after {
    display: none;
  }

  .financieras-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
  }
}

