/* Variables CSS */
:root {
  --primary-color: #1e88e5;
  --secondary-color: #ff6b35;
  --dark-color: #2c3e50;
  --light-color: #ecf0f1;
  --gray-color: #7f8c8d;
  --white: #ffffff;
  --text-dark: #2c3e50;
  --text-light: #7f8c8d;

  /* Alturas globales de HERO */
  --hero-min: 420px;
  --hero-pad-block: clamp(72px, 14vh, 160px);
}

/* Reset y estilos base */
* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Arial', sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
}

/* Header superior */
.header-top {
  background-color: var(--dark-color);
  color: var(--white);
  padding: 10px 0;
  font-size: 14px;
}
.contact-info i { color: var(--primary-color); margin-right: 5px; }
.social-links a { color: var(--white); margin: 0 10px; transition: color .3s ease; }
.social-links a:hover { color: var(--primary-color); }

/* Navegación */
.navbar { padding-top: 10px; padding-bottom: 10px; height: 100px; }
.navbar.scrolled { padding: 10px 0; box-shadow: 0 2px 20px rgba(0,0,0,.1); }

.logo { display: flex; flex-direction: column; align-items: flex-start; }
.logo-text { font-size: 2.0rem; font-weight: bold; color: var(--primary-color); text-decoration: none; margin: 0; line-height: 1; }
.logo-text-container { line-height: 1.1; }
.logo-subtitle { font-size: .9rem; font-weight: 400; color: #666; margin: 0; line-height: 1; }

/* Logo grande en el navbar */
.navbar-brand {
    position: relative;
    z-index: 1000;
}
.navbar-brand img {
    height: 180px;
    width: auto;
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

.navbar-nav .nav-link {
  font-weight: 600; color: var(--text-dark);
  margin: 0 15px; padding: 10px 0; transition: color .3s ease; position: relative;
}
.navbar-nav .nav-link:hover { color: var(--primary-color); }
.navbar-nav .nav-link::after {
  content: ''; position: absolute; width: 0; height: 2px; bottom: 0; left: 50%;
  background-color: var(--primary-color); transition: all .3s ease; transform: translateX(-50%);
}
.navbar-nav .nav-link:hover::after { width: 100%; }

/* Hero Section (UNIFICADO) */
.hero {
  /* color/fondo corporativo */
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
  color: var(--white);
  position: relative; overflow: hidden;

  /* altura y padding controlados por variables */
  min-height: var(--hero-min);
  padding-block: var(--hero-pad-block);

  /* centrado vertical del contenido */
  display: flex; align-items: center;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  /* Si quieres imagen de fondo, descomenta y coloca tu ruta */
  /* background: url('/static/images/warehouse.jpg') center/cover; */
  opacity: .2; z-index: 0;
}
.hero .container { position: relative; z-index: 1; }
.hero h1 { font-size: 3rem; font-weight: bold; margin-bottom: 20px; text-shadow: 2px 2px 4px rgba(0,0,0,.3); }
.hero p  { font-size: 1.25rem; margin-bottom: 30px; opacity: .9; }

/* Modificadores por página */
.hero--sm{ --hero-min: 260px; --hero-pad-block: 56px; }
.hero--md{ --hero-min: 320px; --hero-pad-block: clamp(56px, 10vh, 120px); }
.hero--lg{ --hero-min: 420px; --hero-pad-block: clamp(72px, 14vh, 160px); }
.hero--xl{ --hero-min: 560px; --hero-pad-block: clamp(96px, 18vh, 200px); }

/* Botones */
.btn-primary-custom {
  background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border: none; padding: 15px 30px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px;
  border-radius: 50px; transition: all .3s ease; box-shadow: 0 4px 15px rgba(30,136,229,.3);
}
.btn-primary-custom:hover { transform: translateY(-3px); box-shadow: 0 8px 25px rgba(30,136,229,.4); }

/* Secciones */
.section { padding: 80px 0; }
.section-title { text-align: center; margin-bottom: 60px; }
.section-title h2 {
  font-size: 2.5rem; color: var(--dark-color); margin-bottom: 20px; position: relative;
}
.section-title h2::after {
  content: ''; position: absolute; bottom: -10px; left: 50%; transform: translateX(-50%);
  width: 80px; height: 3px; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}
.section-title p { font-size: 1.1rem; color: var(--text-light); max-width: 600px; margin: 0 auto; }

/* Cards de características */
.feature-card {
  background: var(--white); padding: 40px 30px; border-radius: 15px; text-align: center;
  box-shadow: 0 10px 30px rgba(0,0,0,.1); transition: all .3s ease; height: 100%;
  border: 1px solid rgba(30,136,229,.1);
}
.feature-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,.15); }
.feature-card .icon {
  width: 80px; height: 80px; background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 25px;
  color: var(--white); font-size: 2rem;
}
.feature-card h4 { color: var(--dark-color); margin-bottom: 15px; font-weight: 600; }
.feature-card p { color: var(--text-light); line-height: 1.7; }

/* Productos Grid */
.productos-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px; margin-top: 50px;
}
.producto-card {
  background: var(--white); border-radius: 15px; overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,.1); transition: all .3s ease;
  display: flex; flex-direction: column;
}
.producto-card:hover { transform: translateY(-10px); box-shadow: 0 20px 40px rgba(0,0,0,.15); }
.producto-card img { width: 100%; height: 250px; object-fit: cover; }
.producto-card.img-contain img { object-fit: contain; background: #f8f9fa; padding: 15px; }
.producto-card .card-content { padding: 25px; flex: 1; display: flex; flex-direction: column; }
.producto-card h3 { color: var(--dark-color); margin-bottom: 15px; font-size: 1.3rem; }
.producto-card p { color: var(--text-light); margin-bottom: 20px; line-height: 1.6; flex: 1; }
.producto-card .btn { margin-top: auto; }

/* Pestañas de productos */
.product-tabs {
  background: var(--light-color); padding: 20px; border-radius: 10px; margin-bottom: 30px;
}
.product-tabs .nav-link {
  background: var(--white); color: var(--text-dark); border: none; margin: 0 10px 10px 0;
  padding: 15px 25px; border-radius: 25px; font-weight: 600; transition: all .3s ease;
}
.product-tabs .nav-link.active { background: var(--primary-color); color: var(--white); }

/* Tablas */
.table-custom { background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: 0 5px 20px rgba(0,0,0,.1); }
.table-custom th { background: var(--primary-color); color: var(--white); font-weight: 600; border: none; padding: 15px; }
.table-custom td { padding: 12px 15px; border-bottom: 1px solid rgba(0,0,0,.05); }

/* Formulario de contacto */
.contact-form {
  background: var(--white); padding: 40px; border-radius: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.1);
}
.form-group { margin-bottom: 25px; }
.form-control {
  border: 2px solid var(--light-color); border-radius: 10px; padding: 15px; font-size: 1rem; transition: all .3s ease;
}
.form-control:focus { border-color: var(--primary-color); box-shadow: 0 0 0 .2rem rgba(30,136,229,.25); }

/* Stats */
.stats {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--dark-color) 100%);
  color: var(--white); padding: 80px 0;
}
.stat-item { text-align: center; padding: 20px; }
.stat-number { font-size: 3rem; font-weight: bold; display: block; margin-bottom: 10px; }
.stat-label { font-size: 1.1rem; opacity: .9; }

/* Footer */
.footer { background: var(--dark-color); color: var(--white); }
.footer h5 { color: var(--primary-color); margin-bottom: 20px; }
.footer a { color: var(--white); text-decoration: none; transition: color .3s ease; }
.footer a:hover { color: var(--primary-color); }

/* Animaciones */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
.animate-fadeInUp { animation: fadeInUp .6s ease-out; }

/* Utilidades */
.text-primary-custom { color: var(--primary-color) !important; }
.bg-primary-custom { background: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) !important; }
.border-primary-custom { border-color: var(--primary-color) !important; }

/* ========================================
   GRID DE PRODUCTOS EN INICIO
   ======================================== */
.product-card-home {
    display: block;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    text-decoration: none;
    height: 100%;
}

.product-card-home:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    text-decoration: none;
}

.product-img-home {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f8f9fa;
}

.product-img-home img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 15px;
    transition: transform 0.3s ease;
}

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

.product-name-home {
    padding: 15px 20px;
    font-weight: 600;
    color: var(--dark-color);
    text-align: center;
    font-size: 0.95rem;
    background: white;
    border-top: 1px solid #f0f0f0;
}

.product-card-home:hover .product-name-home {
    color: var(--primary-color);
}

.product-card-home.eco-badge .product-name-home {
    color: #27ae60;
}

/* ========================================
   CARRUSEL DE PRODUCTOS (LEGACY)
   ======================================== */
.products-carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding: 20px 0;
}

.products-carousel {
  display: flex;
  gap: 25px;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 10px 5px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.products-carousel::-webkit-scrollbar {
  display: none;
}

.product-card-carousel {
  flex: 0 0 320px;
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.08);
  transition: all 0.3s ease;
  cursor: pointer;
}

.product-card-carousel:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0,0,0,0.15);
}

.product-image-wrapper {
  position: relative;
  height: 200px;
  overflow: hidden;
}

.product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.product-card-carousel:hover .product-image-wrapper img {
  transform: scale(1.1);
}

.product-badge {
  position: absolute;
  top: 15px;
  right: 15px;
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: white;
  padding: 6px 15px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.product-badge.badge-new {
  background: linear-gradient(135deg, #ff6b35 0%, #e55a2b 100%);
}

.product-badge.badge-featured {
  background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

.product-badge.badge-eco {
  background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
}

.product-content {
  padding: 25px;
}

.product-content h5 {
  color: #2c3e50;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 12px;
}

.product-content p {
  color: #666;
  font-size: 0.9rem;
  line-height: 1.6;
  margin-bottom: 20px;
  min-height: 60px;
}

/* Controles del Carrusel */
.carousel-controls {
  display: flex;
  justify-content: center;
  gap: 15px;
}

.carousel-btn {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #1e88e5 0%, #1565c0 100%);
  color: white;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(30, 136, 229, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
}

.carousel-btn:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(30, 136, 229, 0.4);
}

.carousel-btn:active {
  transform: scale(0.95);
}

/* Indicadores de posición */
.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 30px;
}

.carousel-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ddd;
  cursor: pointer;
  transition: all 0.3s ease;
}

.carousel-dot.active {
  background: #1e88e5;
  width: 30px;
  border-radius: 6px;
}

/* ========================================
   RESPONSIVE
   ======================================== */
@media (max-width: 768px) {
  .product-card-carousel {
    flex: 0 0 280px;
  }
  
  .product-image-wrapper {
    height: 180px;
  }
  
  .product-content {
    padding: 20px;
  }
  
  .product-content h5 {
    font-size: 1.1rem;
  }
  
  .product-content p {
    font-size: 0.85rem;
    min-height: auto;
  }
  
  .dropdown-menu {
    min-width: 100%;
  }
}

@media (max-width: 480px) {
  .product-card-carousel {
    flex: 0 0 260px;
  }
  
  .carousel-btn {
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 { font-size: 2.2rem; }
  .hero p { font-size: 1.05rem; }
  .section { padding: 60px 0; }
  .feature-card { margin-bottom: 30px; }
  .navbar-nav .nav-link { margin: 0; padding: 10px 15px; }
  .logo-text { font-size: 1.6rem; }
}
@media (max-width: 576px) {
  /* altura mínima razonable en móvil */
  .hero { min-height: 360px; padding-block: 72px; }
  .hero h1 { font-size: 1.8rem; }
  .section-title h2 { font-size: 2rem; }
  .productos-grid { grid-template-columns: 1fr; }
  .contact-form { padding: 25px; }
}
