/* Reset y estilos generales */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    color: #333;
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    cursor: pointer;
}

/* Header */
header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.top-bar {
    background-color: #f5f5f5;
    padding: 8px 0;
    font-size: 14px;
}

.top-bar-content {
    display: flex;
    justify-content: space-between;
}

.contact-info, .social-links {
    display: flex;
    align-items: center;
}

.contact-info span {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.contact-info i {
    margin-right: 5px;
    color: #e10000;
}

.social-links a {
    margin-left: 15px;
    color: #e10000;
    transition: color 0.3s;
}

.social-links a:hover {
    color: #555;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
}

.logo img {
    height: 50px;
}

.search-cart {
    display: flex;
    align-items: center;
}

.search-box {
    position: relative;
    margin-right: 20px;
}

.search-box input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 250px;
}

.search-box button {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #777;
}

.cart-icon {
    position: relative;
    font-size: 24px;
    color: #333;
}

.cart-count {
    position: absolute;
    top: -10px;
    right: -10px;
    background-color: #e10000;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

nav ul {
    display: flex;
    background-color: #e10000;
}

nav ul li {
    position: relative;
}

nav ul li a {
    color: white;
    padding: 15px 20px;
    display: block;
    transition: background-color 0.3s;
}

nav ul li:hover > a {
    background-color: #c10000;
}

.dropdown {
    position: absolute;
    background-color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 200px;
    display: none;
    z-index: 100;
}

.dropdown li a {
    color: #333;
    padding: 12px 15px;
    border-bottom: 1px solid #f5f5f5;
}

.dropdown li a:hover {
    background-color: #f9f9f9;
}

nav ul li:hover .dropdown {
    display: block;
}

/* Hero Slider */
.hero-slider {
    position: relative;
    height: 500px;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 1s ease;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
}

.slide.active {
    opacity: 1;
}

.slide-content {
    color: white;
    max-width: 600px;
    padding: 30px;
    background-color: rgba(0, 0, 0, 0.5);
    border-radius: 5px;
    margin-left: 100px;
}

.slide-content h2 {
    font-size: 2.5rem;
    margin-bottom: 20px;
}

.slide-content p {
    margin-bottom: 20px;
}

.btn {
    display: inline-block;
    padding: 12px 25px;
    background-color: #e10000;
    color: white;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.btn:hover {
    background-color: #c10000;
}

.slider-nav {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    margin: 0 5px;
    cursor: pointer;
}

.slider-dot.active {
    background-color: white;
}

/* Categorías */
.categories {
    padding: 50px 0;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
}

.section-title h2 {
    font-size: 2rem;
    color: #333;
    display: inline-block;
    padding-bottom: 10px;
    position: relative;
}

.section-title h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background-color: #e10000;
}

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.category-card {
    background-color: #f9f9f9;
    border-radius: 5px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    text-align: center;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.category-img {
    height: 200px;
    background-color: #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-img i {
    font-size: 64px;
    color: #999;
}

.category-content {
    padding: 20px;
}

.category-content h3 {
    margin-bottom: 10px;
}

/* Productos destacados */
.featured-products {
    padding: 50px 0;
    background-color: #f5f5f5;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.product-card {
    background-color: white;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.product-img {
    height: 200px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-img i {
    font-size: 64px;
    color: #ddd;
}

.product-tag {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: #e10000;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 2;
}

.product-content {
    padding: 20px;
}

.product-title {
    font-weight: 600;
    margin-bottom: 10px;
    display: block;
    height: 40px;
    overflow: hidden;
}

.product-price {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 15px;
}

.price {
    font-weight: bold;
    color: #e10000;
    font-size: 1.2rem;
}

.add-to-cart {
    background-color: #333;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.add-to-cart:hover {
    background-color: #e10000;
}

/* Marcas */
.brands {
    padding: 50px 0;
}

.brands-slider {
    display: flex;
    overflow-x: auto;
    padding: 20px 0;
    scrollbar-width: none; /* Firefox */
}

.brands-slider::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Edge */
}

.brand-item {
    flex: 0 0 auto;
    width: 150px;
    height: 100px;
    margin: 0 15px;
    background-color: #f9f9f9;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
}

.brand-item i {
    font-size: 48px;
    color: #ccc;
}

/* Footer */
footer {
    background-color: #222;
    color: #fff;
    padding: 50px 0 0;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.footer-column h3 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-column h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background-color: #e10000;
}

.footer-column p {
    margin-bottom: 15px;
    color: #bbb;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #bbb;
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #e10000;
}

.footer-contact li {
    display: flex;
    margin-bottom: 15px;
    color: #bbb;
}

.footer-contact i {
    margin-right: 10px;
    color: #e10000;
}

.newsletter input {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border: none;
    border-radius: 4px;
}

.newsletter button {
    width: 100%;
    padding: 10px;
    background-color: #e10000;
    color: white;
    border: none;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.newsletter button:hover {
    background-color: #c10000;
}

.footer-bottom {
    background-color: #111;
    padding: 20px 0;
    text-align: center;
    margin-top: 50px;
}

.footer-bottom p {
    color: #bbb;
    font-size: 14px;
}

/*------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ----------------------------CHAT FLOTANTE ARMONIZADO--------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------*/

/* === Contenedor flotante del chat en esquina inferior derecha === */
.chat-flotante {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
}

/* Estado cerrado: solo muestra el botón */
.chat-flotante.cerrado .contenedor-chatbot {
  display: none;
}

/* Estado abierto: muestra el chatbot y botón cerrar */
.chat-flotante.abierto .boton-chat {
  display: none;
}

/* Botón de chat con estilo acorde al sitio */
.chat-flotante .boton-chat {
  background-color: #e10000; /* Rojo principal del sitio */
  color: white;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(225, 0, 0, 0.3);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.chat-flotante .boton-chat:hover {
  background-color: #c10000;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(225, 0, 0, 0.4);
}

/* Contenedor chatbot visible cuando abierto */
.chat-flotante .contenedor-chatbot {
  width: 370px;
  height: 500px;
  background-color: white;
  border-radius: 10px;
  overflow: hidden; /* Oculta cualquier contenido que se desborde */
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.15);
  position: relative;
  border: 1px solid #eee;
  animation: entradaChat 0.3s ease;
  /* Ocultar barras de scroll en todos los navegadores */
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
}

/* Ocultar scrollbar en Chrome, Safari y Opera */
.chat-flotante .contenedor-chatbot::-webkit-scrollbar {
  display: none;
}

/* Asegurar que el iframe ocupe todo el contenedor SIN scroll */
.chatbot-iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 10px;
  display: block; /* Elimina espacios en blanco debajo del iframe */
  overflow: hidden; /* Desactiva scroll en el iframe */
}

/* Animación entrada */
@keyframes entradaChat {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* Botón para cerrar chat - Estilo consistente */
.cerrar-chat {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #e10000;
  color: white;
  border: none;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
  z-index: 10000; /* Mayor z-index para estar por encima del contenido del chatbot */
}

.cerrar-chat:hover {
  background-color: #c10000;
}

/* Responsive */
@media (max-width: 480px) {
  .chat-flotante .contenedor-chatbot {
    width: 320px;
    height: 450px;
    right: 10px;
    bottom: 10px;
  }
  
  .chat-flotante {
    right: 10px;
    bottom: 10px;
  }
}

/*------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ----------------------------BARRA - BUSCAR--------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------*/
/* === Estilos del buscador avanzado === */
.buscador-container {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 8px;
  margin: 30px auto;
  max-width: 1000px;
}

.buscador-container input,
.buscador-container select,
.buscador-container button {
  padding: 10px;
  margin: 5px;
  border: 1px solid #ddd;
  border-radius: 5px;
}

/* Caja de sugerencias con scroll */
.suggestions {
  border: 1px solid #ddd;
  background: white;
  max-height: 150px;
  overflow-y: auto;
  border-radius: 4px;
  position: absolute;
  width: 300px;
  z-index: 10;
}

/* Cada item de sugerencia */
.suggestion-item {
  padding: 8px;
  cursor: pointer;
}
.suggestion-item:hover {
  background: #eee;
}

/* -------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ------------------------ Botón "Ver más"  -------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------
  ----------------------------------------------------------------------------------------------------------
  ------------------------------------------------------------------------------------ */
.ver-mas-container {
  text-align: center;
  margin: 40px 0;
}

.btn-ver-mas {
  background-color: #e10000;
  color: #fff;
  font-weight: 600;
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  cursor: pointer;
  font-size: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(225, 0, 0, 0.3);
}

.btn-ver-mas:hover {
  background-color: #c10000;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(225, 0, 0, 0.4);
}

.btn-ver-mas i {
  font-size: 1.2rem;
}

/* ===== ESTILOS MEJORADOS PARA TARJETA DE PRODUCTO ===== */

/* Contenedor de precios */
.price-section {
  margin-bottom: 15px;
  text-align: left;
}

/* Precio al contado */
.price-contado {
  margin-bottom: 12px;
}

.price-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 3px;
  font-weight: normal;
}

.price-amount {
  display: block;
  font-size: 18px;
  font-weight: bold;
  color: #2c3e50;
}

/* Sección de cuotas */
.cuotas-section {
  margin-bottom: 15px;
}

.cuotas-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin-bottom: 5px;
  font-weight: normal;
}

.cuotas-select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: border-color 0.3s;
}

.cuotas-select:focus {
  outline: none;
  border-color: #e10000;
}

/* Estado de stock */
.stock-status {
  font-size: 11px;
  font-weight: bold;
  padding: 3px 8px;
  border-radius: 12px;
  display: inline-block;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.stock-status.en-stock {
  background: #25D366;
  color: white;
}

.stock-status.agotado {
  background: #e10000;
  color: white;
}

/* Código del producto */
.product-cod {
  font-size: 11px;
  color: #888;
  margin-bottom: 5px;
  text-align: left;
  font-weight: 500;
}

/* Botón de WhatsApp mejorado */
.whatsapp-button {
  background: linear-gradient(135deg, #25D366, #128C7E);
  color: white;
  border: none;
  padding: 12px 15px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.3);
  position: relative;
  overflow: hidden;
}

.whatsapp-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  background: linear-gradient(135deg, #128C7E, #25D366);
}

.whatsapp-button:active {
  transform: translateY(0);
}

.whatsapp-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

.whatsapp-button:hover::before {
  left: 100%;
}

/* Ajustes para el título del producto */
.product-title {
  font-weight: bold;
  font-size: 16px;
  display: block;
  margin-bottom: 15px;
  color: #333;
  text-align: left;
  height: auto;
  min-height: 40px;
  line-height: 1.3;
}

/* Mejoras visuales para la tarjeta */
.product-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border: 1px solid #e9ecef;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: #e10000;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #e10000, #c10000);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}

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

/* Contenedor de imagen mejorado */
.product-img {
  height: 200px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.product-img img {
  transition: transform 0.3s ease;
  max-height: 90%;
}

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

/* Mejora para el contenido */
.product-content {
  padding: 20px;
  position: relative;
}

/* ===== BUSCADOR EN UNA SOLA LÍNEA ===== */
.buscador-container {
  background: #f5f5f5;
  padding: 20px;
  border-radius: 10px;
  margin: 30px auto;
  max-width: 1200px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.buscador-container h2 {
  text-align: center;
  margin-bottom: 20px;
  color: #333;
  font-size: 1.8rem;
}

.buscador-fila-completa {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  flex-wrap: nowrap;
}

.buscador-principal {
  display: flex;
  flex: 2;
  min-width: 250px;
  position: relative;
}

.buscador-principal input {
  flex: 1;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 25px 0 0 25px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.buscador-principal input:focus {
  outline: none;
  border-color: #e10000;
}

.buscador-principal button {
  padding: 12px 20px;
  background: #e10000;
  color: white;
  border: 2px solid #e10000;
  border-radius: 0 25px 25px 0;
  cursor: pointer;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.buscador-principal button:hover {
  background: #c10000;
  border-color: #c10000;
}

.filtro-categoria {
  flex: 1;
  min-width: 180px;
}

.filtro-categoria select {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  background: white;
  transition: border-color 0.3s;
}

.filtro-categoria select:focus {
  outline: none;
  border-color: #e10000;
}

.filtro-precios {
  display: flex;
  flex: 2;
  gap: 10px;
  min-width: 300px;
}

.filtro-precio {
  flex: 1;
}

.filtro-precio input {
  width: 100%;
  padding: 12px 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s;
}

.filtro-precio input:focus {
  outline: none;
  border-color: #e10000;
}

.boton-filtrar {
  flex: 0.5;
  min-width: 120px;
}

.boton-filtrar button {
  width: 100%;
  padding: 12px 15px;
  background: #333;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  transition: background-color 0.3s;
  white-space: nowrap;
}

.boton-filtrar button:hover {
  background: #e10000;
}

/* Responsive para el buscador en una línea */
@media (max-width: 1024px) {
  .buscador-fila-completa {
    flex-wrap: wrap;
  }
  
  .buscador-principal {
    flex: 1 1 100%;
    order: 1;
  }
  
  .filtro-categoria {
    flex: 1;
    min-width: 200px;
    order: 2;
  }
  
  .filtro-precios {
    flex: 2;
    min-width: 250px;
    order: 3;
  }
  
  .boton-filtrar {
    flex: 1;
    min-width: 120px;
    order: 4;
  }
}

@media (max-width: 768px) {
  .buscador-container {
    margin: 20px 15px;
    padding: 20px 15px;
  }
  
  .buscador-fila-completa {
    flex-direction: column;
    gap: 10px;
  }
  
  .buscador-principal,
  .filtro-categoria,
  .filtro-precios,
  .boton-filtrar {
    width: 100%;
    min-width: 100%;
  }
  
  .filtro-precios {
    flex-direction: column;
    gap: 10px;
  }
}

/* ========== ESTILOS NUEVOS PARA AUTOCOMPLETADO ========== */
.suggestions {
    border: 1px solid #ddd;
    background: white;
    max-height: 250px;
    overflow-y: auto;
    border-radius: 8px;
    position: absolute;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
    top: 100%;
    left: 0;
    margin-top: 5px;
}

.suggestion-item {
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s;
}

.suggestion-item:hover {
    background: #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-content strong {
    display: block;
    color: #333;
    font-size: 14px;
    margin-bottom: 4px;
}

.suggestion-details {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 12px;
}

.suggestion-code {
    color: #666;
    background: #f5f5f5;
    padding: 2px 6px;
    border-radius: 3px;
}

.suggestion-tag {
    color: #e10000;
    background: #ffe6e6;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}

.suggestion-price {
    color: #2c3e50;
    font-weight: bold;
}

.buscador-principal {
    position: relative;
}