/* estilos.css - Versión optimizada */
:root {
  --color-primario: #cc0000;
  --color-secundario: #00cc66;
  --color-fondo: #f4f4f4;
  --color-texto: #333;
  --color-blanco: #fff;
  --color-negro: #000;
}

/* Estilos base */
body {
  font-family: 'Arial', sans-serif;
  margin: 0;
  padding: 0;
  background-color: var(--color-fondo);
  color: var(--color-texto);
  line-height: 1.6;
}

/* Estructura común */
header {
  background-color: var(--color-negro);
  color: var(--color-blanco);
  padding: 1.5em;
  text-align: center;
}

nav {
  background-color: var(--color-primario);
  text-align: center;
  padding: 1em 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

nav a {
  color: var(--color-blanco);
  margin: 0 1.5em;
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s;
}

nav a:hover {
  color: var(--color-secundario);
}

/* Hero section */
.hero {
  height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-blanco);
  text-align: center;
  position: relative;
  background-size: cover;
  background-position: center;
}

.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.hero h1 {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 0 1rem;
}

/* Productos */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2em;
  padding: 2em;
  max-width: 1200px;
  margin: 0 auto;
}

.product {
  background-color: var(--color-blanco);
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 1em;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-align: center;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  border-color: var(--color-primario);
}

.product img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 1em;
}

.precio {
  font-weight: bold;
  color: var(--color-secundario);
  font-size: 1.2em;
  margin: 0.5em 0;
}

.button {
  display: inline-block;
  background-color: var(--color-secundario);
  color: var(--color-blanco);
  padding: 0.6em 1.2em;
  border-radius: 5px;
  text-decoration: none;
  transition: background-color 0.3s;
  border: none;
  cursor: pointer;
  font-size: 0.9em;
}

.button:hover {
  background-color: #00994d;
}

/* Footer */
footer {
  background-color: var(--color-negro);
  color: var(--color-blanco);
  text-align: center;
  padding: 1.5em;
  margin-top: 2em;
}

.social-links {
  margin: 1em 0;
}

.social-links a {
  margin: 0 1em;
  color: var(--color-blanco);
  text-decoration: none;
  font-size: 1.2em;
}

.social-links a:hover {
  color: var(--color-secundario);
}

/* WhatsApp flotante */
.whatsapp-float {
  position: fixed;
  width: 60px;
  height: 60px;
  bottom: 40px;
  left: 40px;
  background-color: #25d366;
  color: var(--color-blanco);
  border-radius: 50%;
  text-align: center;
  font-size: 30px;
  box-shadow: 2px 2px 8px rgba(0, 0, 0, 0.3);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.whatsapp-float:hover {
  background-color: #128C7E;
  transform: scale(1.1);
}

/* Estado de usuario */
.user-status {
  position: fixed;
  top: 80px;
  right: 20px;
  background: var(--color-blanco);
  padding: 10px 15px;
  border-radius: 5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-status img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.user-status .user-name {
  font-weight: bold;
  font-size: 0.9em;
}

.user-status .btn-logout {
  background: var(--color-primario);
  color: white;
  border: none;
  padding: 5px 10px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8em;
  transition: background-color 0.3s;
}

.user-status .btn-logout:hover {
  background: #a80000;
}

/* Sección destacada */
.destacado {
  max-width: 800px;
  margin: 2em auto;
  padding: 2em;
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  color: var(--color-blanco);
}

/* Responsive Design */
@media (max-width: 768px) {
  nav a {
    margin: 0 0.8em;
    font-size: 0.9em;
  }
  
  .products {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    padding: 1em;
    gap: 1em;
  }
  
  .hero {
    height: 250px;
  }
  
  .whatsapp-float {
    width: 50px;
    height: 50px;
    font-size: 24px;
    bottom: 20px;
    left: 20px;
  }
  
  .user-status {
    top: 70px;
    right: 10px;
    padding: 8px 12px;
  }
}

@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }
  
  nav {
    padding: 0.8em 0;
  }
  
  nav a {
    margin: 0 0.5em;
    font-size: 0.8em;
  }
  /* Estilos del carrusel */
.carrusel-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carrusel-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.carrusel-slide.active {
  opacity: 1;
  z-index: 1;
}

/* Asegura que las secciones con carrusel tengan posición relativa */
.section-bicicletas,
.section-componentes {
  position: relative;
}
.cart-link .fa-shopping-cart.animado {
  animation: sacudir 0.5s ease;
}

@keyframes sacudir {
  0% { transform: rotate(0deg); }
  25% { transform: rotate(-10deg); }
  50% { transform: rotate(10deg); }
  75% { transform: rotate(-10deg); }
  100% { transform: rotate(0deg); }
}

/* Estilos para el carrito */
.producto-carrito {
  display: flex;
  align-items: center;
  padding: 15px;
  border-bottom: 1px solid #eee;
  gap: 20px;
}

.producto-info {
  flex: 1;
}

.producto-info h4 {
  margin: 0;
  color: #333;
}

.producto-info .descripcion {
  font-size: 0.9em;
  color: #666;
  margin: 5px 0 0;
}

.producto-cantidad {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn-cantidad {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ddd;
  background: #f9f9f9;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-cantidad:hover {
  background: #eee;
}

.producto-precio {
  font-weight: bold;
  min-width: 100px;
  text-align: right;
}

.producto-acciones button {
  background: none;
  border: none;
  color: #cc0000;
  cursor: pointer;
  font-size: 1.1em;
}

.resumen-carrito {
  padding: 20px;
  border-top: 2px solid #eee;
  margin-top: 20px;
}

.resumen-carrito div {
  margin-bottom: 10px;
  display: flex;
  justify-content: space-between;
}

.total {
  font-size: 1.2em;
  font-weight: bold;
  margin: 15px 0;
}

.descuento {
  color: #00a650;
}

.acciones-carrito {
  display: flex;
  gap: 15px;
  margin-top: 20px;
}

.btn-vaciar {
  background: #f5f5f5;
  color: #333;
}

.btn-pagar {
  background: #00a650;
  color: white;
}

.carrito-vacio {
  text-align: center;
  padding: 40px 0;
}

.carrito-vacio i {
  font-size: 3em;
  color: #ccc;
  margin-bottom: 20px;
}

.carrito-vacio p {
  font-size: 1.2em;
  color: #666;
  margin-bottom: 20px;
}

/* Notificaciones */
.notificacion {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  padding: 15px 25px;
  border-radius: 5px;
  background: #333;
  color: white;
  display: flex;
  align-items: center;
  gap: 10px;
  z-index: 1000;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  animation: slideDown 0.3s ease-out;
}1

.notificacion.error {
  background: #cc0000;
}

.notificacion.info {
  background: #0066cc;
}

.notificacion.fade-out {
  animation: fadeOut 0.3s ease-out forwards;
}

@keyframes slideDown {
  from {
    top: -50px;
    opacity: 0;
  }
  to {
    top: 20px;
    opacity: 1;
  }
}

@keyframes fadeOut {
  to {
    opacity: 0;
    top: -50px;
  }
}

/* Contador del carrito */
#cart-count.animate {
  animation: bounce 0.5s;
}

@keyframes bounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.3); }
}
}

/* Fondo oscuro sobre cada slide del carrusel */
.carrusel-slide::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1;
  pointer-events: none;
}