
/* ========================================
   HERO SECTION
   ======================================== */

.hero-portafolio {
  background-color: #f5f5f5;
  background-image: url('./../../img/Banner-Pagina-06.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: white;
  padding: 0;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  margin: 0;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

/* Sobrescribir el contenedor dentro del hero para ancho completo */
.hero-portafolio .container {
  max-width: 100%;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Patrón decorativo de fondo */
.hero-portafolio::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.3));
  opacity: 1;
  pointer-events: none;
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 20px 80px;
  width: 100%;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7);
}

.hero-portafolio h1 {
  font-size: 3.5rem;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -1px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.7), 0 0 10px rgba(0, 0, 0, 0.5);
}

.hero-subtitle {
  font-size: 1.3rem;
  opacity: 0.95;
  font-weight: 300;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.7), 0 0 8px rgba(0, 0, 0, 0.5);
}

/* ========================================
   SECTION HEADERS
   ======================================== */

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-tag {
  display: inline-block;
  background: var(--primary);
  color: white;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.section-header h2 {
  font-size: 2.5rem;
  color: var(--text);
  margin-bottom: 15px;
  font-weight: 600;
}

.section-description {
  color: var(--muted);
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

/* ========================================
   PORTAFOLIO GRID
   ======================================== */

.portafolio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 35px;
  margin-top: 40px;
}

.portafolio-card {
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.portafolio-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
  border-color: var(--primary);
}

/* ========================================
   IMAGEN DEL PORTAFOLIO
   ======================================== */

.portafolio-imagen {
  position: relative;
  width: 100%;
  height: 400px;
  overflow: hidden;
  background: var(--alt);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Imagen del proyecto */
.proyecto-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  transition: transform 0.3s ease;
  display: block;
}

/* Placeholder cuando la imagen no carga */
.proyecto-img[src*="proyecto1.jpg"],
.proyecto-img[src*="proyecto2.jpg"],
.proyecto-img[src*="proyecto3.jpg"] {
  background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
}

/* Efecto de zoom al hacer hover */
.portafolio-card:hover .proyecto-img {
  transform: scale(1.05);
}

/* Overlay que aparece al hacer hover */
.portafolio-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.portafolio-card:hover .portafolio-overlay {
  opacity: 1;
}

.overlay-text {
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Estilo cuando la imagen no existe (muestra placeholder con gradiente) */
.proyecto-img[alt]:after {
  content: attr(alt);
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 1.2rem;
  font-weight: 600;
  text-align: center;
  white-space: nowrap;
  opacity: 0.9;
}

/* ========================================
   CONTENIDO DEL PORTAFOLIO
   ======================================== */

.portafolio-content {
  padding: 30px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.portafolio-categoria {
  display: inline-block;
  background: var(--alt);
  color: var(--primary);
  padding: 5px 12px;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

.portafolio-content h3 {
  font-size: 1.5rem;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 600;
  line-height: 1.3;
}

.portafolio-content p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 25px;
  font-size: 1rem;
  flex: 1;
}

/* ========================================
   BOTÓN DEL PORTAFOLIO
   ======================================== */

.btn-portafolio {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--primary);
  color: white;
  padding: 12px 24px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  align-self: flex-start;
}

.btn-portafolio:hover {
  background: #1e5f8c;
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(47, 125, 179, 0.3);
}

.btn-portafolio svg {
  transition: transform 0.3s ease;
}

.btn-portafolio:hover svg {
  transform: translateX(3px);
}

/* ========================================
   ESTADÍSTICAS
   ======================================== */

.stats-portafolio {
  background: var(--primary) !important;
  color: white;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
  text-align: center;
}

.stat-item {
  padding: 20px;
}

.stat-number {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 10px;
  display: block;
  color: var(--accent);
}

.stat-label {
  font-size: 1.1rem;
  opacity: 0.95;
  font-weight: 500;
}

/* ========================================
   CALL TO ACTION
   ======================================== */

.cta-portafolio {
  background: linear-gradient(135deg, var(--primary) 0%, #1e5f8c 100%) !important;
  color: white;
}

.cta-content {
  text-align: center;
  padding: 40px 0;
}

.cta-content h2 {
  font-size: 2.5rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.cta-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  opacity: 0.95;
}

.btn-cta {
  display: inline-block;
  background: white;
  color: var(--primary);
  padding: 15px 40px;
  border-radius: var(--radius);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: all 0.3s ease;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.btn-cta:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
  background: var(--accent);
  color: white;
}

/* ========================================
   NAVEGACIÓN ACTIVA
   ======================================== */

nav a.active {
  color: var(--primary) !important;
  font-weight: 600 !important;
}

/* ========================================
   ANIMACIONES
   ======================================== */

/* Fade In */
.fade-in {
  opacity: 0;
  animation: fadeIn 1s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
  }
}

/* Slide Up */
.slide-up {
  opacity: 0;
  transform: translateY(30px);
}

.slide-up.visible {
  animation: slideUp 0.8s ease forwards;
}

@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Fade In Delay */
.fade-in-delay {
  opacity: 0;
  transform: translateY(20px);
}

.fade-in-delay.visible {
  animation: fadeInDelay 0.6s ease forwards;
}

@keyframes fadeInDelay {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (min-width: 1920px) {
  .hero-portafolio {
    min-height: 600px;
    background-size: cover;
  }
}

@media (min-width: 1400px) and (max-width: 1919px) {
  .hero-portafolio {
    min-height: 550px;
  }
}

@media (max-width: 1024px) {
  .hero-portafolio {
    min-height: 420px;
    background-size: cover;
  }

  .hero-portafolio h1 {
    font-size: 2.8rem;
  }


  .portafolio-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
  }
  .portafolio-imagen{
    height: 350px;
  }

  .portafolio-imagen {
    height: 350px;
  }

  .section-header h2 {
    font-size: 2.2rem;
  }
}

@media (max-width: 768px) {
  .hero-portafolio {
    min-height: 350px;
    background-size: cover;
  }

  .hero-content {
    padding: 80px 20px 60px;
  }

  .hero-portafolio h1 {
    font-size: 2.2rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .section-header h2 {
    font-size: 2rem;
  }

  .section-description {
    font-size: 1rem;
  }

  .portafolio-grid {
    grid-template-columns: 1fr;
  }
  .portafolio-imagen{
    height: 300px;
  }

  .portafolio-imagen {
    height: 300px;
  }

  .cta-content h2 {
    font-size: 2rem;
  }

  .cta-content p {
    font-size: 1.1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
  }

  .stat-number {
    font-size: 2.5rem;
  }

  .portafolio-content {
    padding: 25px;
  }

  nav {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero-portafolio {
    min-height: 280px;
    background-size: cover;
    background-position: center center;
  }

  .hero-content {
    padding: 60px 15px 40px;
  }

  .hero-portafolio h1 {
    font-size: 1.8rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .section-header h2 {
    font-size: 1.6rem;
  }

  .section-tag {
    font-size: 0.75rem;
    padding: 5px 12px;
  }

  .portafolio-content {
    padding: 20px;
  }

  .portafolio-content h3 {
    font-size: 1.3rem;
  }

  .cta-content h2 {
    font-size: 1.6rem;
  }

  .btn-cta {
    padding: 12px 30px;
    font-size: 1rem;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .stat-number {
    font-size: 2rem;
  }

  .portafolio-imagen {
    height: 250px;
  }

  .proyecto-icono {
    font-size: 3rem;
  }
}

/* ========================================
   MEJORAS DE ACCESIBILIDAD
   ======================================== */

/* Focus visible para navegación por teclado */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Reducir movimiento para usuarios con preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
