﻿/* --- VARIABLES & RESET --- */
:root {
  --primary-blue: #044bab;
  --primary-dark: #022a61;
  --accent-yellow: #f3d136;
  --text-dark: #333333;
  --text-light: #666666;
  --white: #ffffff;
  --bg-light: #f8f9fa;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Poppins", sans-serif;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-light);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* NAVBAR (Idéntico al Index) */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 5% 0 5%;
  display: flex;
  align-items: flex-start;
  z-index: 1000;
  transition: all 0.4s ease;
  background: transparent;
}

nav.scrolled {
  background: var(--primary-blue);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  padding-bottom: 1rem;
}

.logo {
  display: flex;
  align-items: flex-start;
  cursor: pointer;
  margin-right: auto;
  margin-top: -10px;
  z-index: 1001;
}

.logo-img {
  height: 100px;
  width: auto;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 3rem;
  list-style: none;
  margin-right: 3rem;
  margin-top: 25px;
}

.nav-links a {
  text-decoration: none;
  color: var(--white);
  font-weight: 500;
  transition: all 0.3s;
  font-size: 1.1rem;
  opacity: 0.9;
  position: relative;
}

.nav-links a:hover {
  opacity: 1;
  text-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

.nav-links a.active::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 3px;
  bottom: -5px;
  left: 0;
  background: var(--accent-yellow);
}

.cart-icon-link {
  text-decoration: none;
  display: block;
  margin-top: 23px;
  z-index: 1001;
}

.cart-icon {
  position: relative;
  color: var(--white);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.3s;
}

.cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  background: var(--accent-yellow);
  color: var(--primary-dark);
  font-size: 0.75rem;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-weight: 800;
}

/* HEADER DEL CATÁLOGO */
.hero {
  min-height: 60vh;
  background: linear-gradient(
    135deg,
    var(--primary-blue) 0%,
    var(--primary-dark) 100%
  );
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 150px 5% 0; /* Espacio para navbar fijo */
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.5;
  z-index: 1;
  pointer-events: none;
  animation: float 8s ease-in-out infinite;
}

.blob-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(0, 86, 179, 0.8) 0%,
    transparent 70%
  );
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(
    circle,
    rgba(243, 209, 54, 0.2) 0%,
    transparent 70%
  );
  bottom: 10%;
  right: -5%;
  animation: float 10s ease-in-out infinite reverse;
  animation-delay: 1s;
}

@keyframes float {
  0%,
  100% {
    transform: translate(0, 0) rotate(0deg);
  }

  33% {
    transform: translate(30px, -30px) rotate(5deg);
  }

  66% {
    transform: translate(-20px, 20px) rotate(-5deg);
  }
}

.hero-content {
  z-index: 10;
  max-width: 900px;
  position: relative;
  width: 100%;
}

.hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  line-height: 1.1;
  font-weight: 800;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards 0.2s;
  background: linear-gradient(
    120deg,
    #ffffff 0%,
    #ffffff 50%,
    var(--accent-yellow) 75%,
    #ffffff 100%
  );
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: fadeInUp 0.8s forwards 0.2s, shimmer 3s linear infinite;
  letter-spacing: -1px;
}

@keyframes shimmer {
  to {
    background-position: 200% center;
  }
}

.hero p {
  font-size: clamp(1rem, 2vw, 1.3rem);
  color: rgba(255, 255, 255, 0.95);
  margin-bottom: 3rem;
  font-weight: 300;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.8s forwards 0.4s;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}
/* FILTROS */
.filters-wrapper {
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
  padding: 0 5%;
  margin-bottom: 70px;
  margin-top: 20px;
}

.filter-btn {
  padding: 12px 30px;
  border: 2px solid #e2e8f0;
  border-radius: 50px;
  background: white;
  gap: 12px;
  margin: 10px; /* Separación extra entre botones */
  color: var(--text-light);
  font-weight: 600;
  cursor: pointer;
  transition: 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.filter-btn:hover {
  border-color: var(--primary-blue);
  color: var(--primary-blue);
}

.filter-btn.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
  box-shadow: 0 10px 20px rgba(4, 75, 171, 0.2);
}

.filter-btn i {
  font-size: 0.9rem;
}

/* GRID DE PRODUCTOS */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2.5rem;
  padding: 0 5% 6rem;
  max-width: 1300px;
  margin: 0 auto;
  flex-grow: 1;
  /* Empuja el footer */
}

/* TARJETA DE PRODUCTO (Estilo Index) */
.product-card {
  background: var(--white);
  border-radius: 24px;
  padding: 2.5rem 2rem;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  animation: fadeUp 0.6s ease backwards;
}

.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px rgba(4, 75, 171, 0.15);
  border-color: transparent;
}

/* Barra superior de color */
.product-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, var(--primary-blue), var(--accent-yellow));
  transform: scaleX(0);
  transform-origin: left;
  transition: 0.4s;
}

.product-card:hover::before {
  transform: scaleX(1);
}

.card-icon {
  width: 70px;
  height: 70px;
  background: rgba(4, 75, 171, 0.08);
  border-radius: 18px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 20px;
  transition: 0.4s;
}

.card-icon i {
  font-size: 2rem;
  color: var(--primary-blue);
}

.product-card:hover .card-icon {
  background: var(--primary-blue);
  transform: rotate(10deg);
}

.product-card:hover .card-icon i {
  color: white;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.card-desc {
  color: var(--text-light);
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 20px;
  margin-top: auto;
}

.price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-dark);
}

.price small {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-light);
}

.btn-add {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: var(--bg-light);
  color: var(--primary-blue);
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: 0.3s;
  font-size: 1.1rem;
}

.btn-add:hover {
  background: var(--primary-blue);
  color: white;
  transform: scale(1.1);
  box-shadow: 0 5px 15px rgba(4, 75, 171, 0.3);
}

/* Badge */
.badge {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--accent-yellow);
  color: var(--primary-dark);
  padding: 5px 12px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
}

.badge.new {
  background: var(--success);
  color: white;
}

/* Loader */
.loader-container {
  grid-column: 1 / -1;
  text-align: center;
  padding: 50px;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #e2e8f0;
  border-top: 4px solid var(--primary-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 15px;
}

/* FOOTER */
footer {
  background: linear-gradient(
    to bottom,
    var(--primary-blue),
    var(--primary-dark)
  );
  color: var(--white);
  padding: 4rem 5% 2rem;
  text-align: center;
  margin-top: auto;
  /* Footer al fondo */
}

.copyright {
  opacity: 0.6;
  font-size: 0.9rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- Animación Logo Footer --- */
.footer-logo {
  height: 80px;
  object-fit: contain;
  filter: brightness(0) invert(1) opacity(0.8);
  transition: all 0.4s ease;
  animation: float-logo 6s ease-in-out infinite;
}

.footer-logo:hover {
  transform: scale(1.05);
  filter: brightness(0) invert(1) opacity(1)
    drop-shadow(0 0 10px rgba(255, 255, 255, 0.5));
}

@keyframes float-logo {
  0% {
    transform: translateY(0px);
  }

  50% {
    transform: translateY(-8px);
  }

  100% {
    transform: translateY(0px);
  }
}

/* NOTIFICACIONES */
.notification-container {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 2000;
}

.toast {
  background: rgba(4, 75, 171, 0.95);
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 15px;
  transform: translateX(150%);
  transition: 0.4s;
  border-left: 5px solid var(--accent-yellow);
}

.toast.show {
  transform: translateX(0);
}

@keyframes fadeDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* Responsive */
.menu-toggle {
  display: none;
  font-size: 1.8rem;
  color: var(--white);
  cursor: pointer;
}

@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  nav {
    background: var(--primary-blue);
    align-items: center;
    padding: 0.8rem 5%;
  }

  .logo-img {
    height: 60px;
  }

  .cart-icon-link {
    margin-top: 0;
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 80%;
    background: rgba(4, 75, 171, 0.98);
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    transition: 0.4s;
    z-index: 1000;
  }

  .nav-links.active {
    right: 0;
  }

  .catalog-header {
    padding-top: 120px;
    padding-bottom: 40px;
  }

  .catalog-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .catalog-title {
    font-size: 1.8rem;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.5rem;
  }

  .filter-btn {
    padding: 8px 15px;
    font-size: 0.9rem;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}
