:root {
  /* Variables base - se sobrescriben dinámicamente según la gama */
  --gama-primary: #2C3E50;
  --gama-primary-dark: #1A252F;
  --gama-secondary: #34495E;
  --gama-accent: #3498DB;
  
  /* Variables comunes */
  --text-dark: #2C3E50;
  --text-light: #7F8C8D;
  --bg-light: #F8F9FA;
  --white: #FFFFFF;
  --shadow-light: 0 4px 20px rgba(0,0,0,0.08);
  --shadow-medium: 0 8px 30px rgba(0,0,0,0.12);
  --gradient-primary: linear-gradient(135deg, var(--gama-primary), var(--gama-primary-dark));
  --border-radius: 8px;
  --transition: all 0.3s ease;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}


html {
  scroll-behavior: smooth;
  height: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  overflow-x: hidden;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Contenedor principal - empuja el footer al final */
#page-wrapper {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  min-height: 0; /* permite que flex calcule bien y no desborde */
}

/* Contenido principal: cierre explícito para que nada quede debajo del footer */
#page-wrapper .main-content {
  flex: 0 0 auto;
}

/* Footer siempre al final y por encima de cualquier desborde */
.footer-custom {
  flex-shrink: 0;
  position: relative;
  z-index: 10;
}

/* Asegurar que las secciones dentro del wrapper crezcan correctamente */
#page-wrapper > section:last-of-type {
  margin-bottom: 0;
}

/* Navigation */
.navbar-custom {
  background: var(--white);
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  padding: 1rem 0;
  height: 120px; /* Altura fija igual para todas las gamas */
  min-height: 120px;
  max-height: 120px;
}

.navbar-custom .container {
  height: 100%;
  display: flex;
  align-items: center;
}

.navbar-custom .d-flex {
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand-custom {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 600;
  font-size: 1.2rem;
  height: 96px; /* Altura fija del contenedor */
  flex-shrink: 0;
}

.navbar-brand-custom img {
  height: 80px !important;
  width: 200px !important; /* Fijo: 500x200 ratio = 80px altura x 200px ancho */
  max-width: none !important;
  min-width: 200px !important;
  object-fit: contain !important;
}

.navbar-nav-custom {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 1.5rem;
  align-items: center;
  margin-left: auto; /* Empuja el menú a la derecha */
}

.navbar-nav-custom li a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 0;
  position: relative;
}

.navbar-nav-custom li a:hover,
.navbar-nav-custom li a.active {
  color: var(--gama-primary);
}

.navbar-nav-custom li a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gama-primary);
  transition: width 0.3s ease;
}

.navbar-nav-custom li a:hover::after,
.navbar-nav-custom li a.active::after {
  width: 100%;
}

/* Los botones de gama no deben tener el efecto ::after */
.navbar-nav-custom li a.btn-gama::after {
  display: none;
}

.navbar-nav-custom li a.btn-gama {
  padding: 0.65rem 1.75rem;
  margin-left: 0.5rem;
  position: relative;
}

.navbar-toggler-custom {
  display: none;
  background: none;
  border: 2px solid var(--gama-primary);
  color: var(--gama-primary);
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1.2rem;
}

/* Botones de gama */
.btn-gama {
  padding: 0.65rem 1.75rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-decoration: none !important;
  transition: var(--transition);
  border: 2px solid;
  display: inline-block;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}

.btn-gama-networks {
  background: #007FEA !important;
  color: white !important;
  border-color: #007FEA !important;
}

.btn-gama-networks:hover {
  background: #0066BB !important;
  border-color: #0066BB !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 127, 234, 0.3);
}

.btn-gama-fibra {
  background: #FF1C42 !important;
  color: white !important;
  border-color: #FF1C42 !important;
}

.btn-gama-fibra:hover {
  background: #CC1635 !important;
  border-color: #CC1635 !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 28, 66, 0.3);
}

.btn-gama-kelvo {
  background: #001434 !important;
  color: white !important;
  border-color: #001434 !important;
}

.btn-gama-kelvo:hover {
  background: #001A4D !important;
  border-color: #001A4D !important;
  color: white !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 20, 52, 0.3);
}

/* Dropdown Menu */
.navbar-nav-custom li {
  position: relative;
}

.dropdown-toggle {
  cursor: pointer;
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  padding: 0.5rem 0;
  position: relative;
  display: inline-block;
}

.dropdown-toggle::after {
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  margin-left: 0.5rem;
  vertical-align: middle;
  transition: transform 0.3s ease;
}

.dropdown-toggle:hover,
.dropdown-toggle.active {
  color: var(--gama-primary);
}

.dropdown-toggle::before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gama-primary);
  transition: width 0.3s ease;
}

.dropdown-toggle:hover::before,
.dropdown-toggle.active::before {
  width: 100%;
}

.dropdown-toggle.active::after {
  transform: rotate(180deg);
  border-top: none;
  border-bottom: 5px solid currentColor;
}

.dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  background: var(--white);
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  border-radius: var(--border-radius);
  min-width: 280px;
  padding: 0.75rem 0;
  margin: 0;
  z-index: 1000;
  list-style: none;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-menu li {
  margin: 0;
  padding: 0;
}

.dropdown-menu a {
  display: block;
  padding: 0.85rem 2rem 0.85rem 2.5rem !important;
  color: var(--text-dark) !important;
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
  position: relative;
}

.dropdown-menu a:hover {
  background: var(--bg-light);
  color: var(--gama-primary) !important;
}

/* Buttons */
.btn-primary {
  background: var(--gama-primary);
  color: var(--white);
  border: none;
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-primary:hover {
  background: var(--gama-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
  color: var(--white);
}

.btn-outline-primary {
  background: transparent;
  color: var(--gama-primary);
  border: 2px solid var(--gama-primary);
  padding: 0.75rem 2rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  display: inline-block;
}

.btn-outline-primary:hover {
  background: var(--gama-primary);
  color: var(--white);
  transform: translateY(-2px);
}

/* Hero Section */
.hero-section {
  padding: 6rem 0;
  background: var(--gradient-primary);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  margin-bottom: 1.5rem;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  opacity: 0.95;
}

/* Cards */
.service-card,
.product-card {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-light);
  transition: var(--transition);
  position: relative;
}

.service-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 150px;
}

/* Panel clicable (ej. Regístrate como partner) */
a.service-card-link {
  cursor: pointer;
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}
a.service-card-link:hover {
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  transform: translateY(-2px);
}

/* Permitir que JavaScript controle la altura de las tarjetas de secciones */
.service-card.section-card {
  height: auto !important;
  min-height: auto !important;
}

/* Forzar altura uniforme en tarjetas de secciones */
section .row.g-4 .service-card.section-card {
  height: auto;
  min-height: auto;
}

/* Asegurar que el contenedor de familias tenga altura mínima */
.section-card > div:last-child {
  min-height: 1.4em;
  display: flex;
  align-items: flex-end;
}

.service-card h4 {
  margin: 0;
}

.service-card > div:first-child,
.section-card-header {
  flex-shrink: 0;
  margin-bottom: 0 !important;
  padding: 0 !important;
}

/* Espaciado fijo entre header y familias para alineación consistente */
.section-card-header {
  margin-bottom: 1rem !important;
}

/* Contenedor de familias - mismo espaciado en todas las tarjetas */
.section-card-families {
  flex-shrink: 0;
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  min-height: 0;
  height: auto;
}

.section-card-families > p {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4;
}

/* Badge redondo para cantidad de productos */
.product-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: var(--gama-primary) !important;
  color: #FFFFFF !important;
  border-radius: 50% !important;
  width: 32px !important;
  height: 32px !important;
  min-width: 32px !important;
  max-width: 32px !important;
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  flex-shrink: 0 !important;
  margin-left: 0.75rem !important;
  padding: 0 !important;
  border: none !important;
  text-align: center !important;
  line-height: 1 !important;
  box-sizing: border-box !important;
}

/* Asegurar que el badge siempre tenga el color correcto */
.section-card-header .product-count-badge {
  background-color: var(--gama-primary) !important;
  color: #FFFFFF !important;
}

/* Asegurar que las columnas igualen alturas en las filas - SOLO para tarjetas de secciones con enlaces */
.section-cards-container .row.g-4 {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
}

.section-cards-container .row.g-4 > [class*="col-"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.section-cards-container .row.g-4 > [class*="col-"] > a {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
}

.section-cards-container .row.g-4 > [class*="col-"] > a > .service-card {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 100% !important;
}

.product-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Sobrescribir para vista en lista */
.products-container.view-list .product-card {
  flex-direction: row !important;
  height: auto !important;
}

.service-card:hover,
.product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
}

/* Contenedor de imagen del producto con overflow hidden para el zoom */
.product-card .product-image-wrapper {
  width: 100%;
  height: 220px;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-card .product-image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  padding: 0;
  margin-bottom: 0;
  background: transparent;
  border-radius: 0;
  transition: transform 0.35s ease;
}

/* Efecto hover: zoom suave en la imagen */
.product-card:hover .product-image-wrapper img {
  transform: scale(1.08);
}

/* Fallback para tarjetas sin el wrapper (compatibilidad) */
.product-card > img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: center;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  margin-bottom: 1rem;
  padding: 0;
  transition: transform 0.35s ease;
}

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

.product-card h4 {
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 1.2rem;
}

.product-card .product-reference {
  color: var(--gama-primary);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.product-card .product-description {
  color: var(--text-light);
  font-size: 0.95rem;
  flex-grow: 1;
}

/* Placeholder para imágenes */
.image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--bg-light);
  border: 2px dashed #ddd;
  border-radius: var(--border-radius);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.9rem;
  text-align: center;
  padding: 1rem;
}

.image-placeholder strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

/* Footer */
.footer-custom {
  background: var(--gama-primary-dark);
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
  flex-shrink: 0;
  width: 100%;
  position: relative;
  z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
  .navbar-toggler-custom {
    display: block;
  }
  
  .navbar-nav-custom {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    padding: 1rem;
    gap: 0;
  }
  
  .navbar-nav-custom.show {
    display: flex;
  }
  
  .navbar-nav-custom li {
    width: 100%;
    padding: 0.5rem 0;
  }
  
  .dropdown-menu {
    position: static;
    box-shadow: none;
    padding-left: 1rem;
  }
  
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
}

/* Welcome Page Styles */
.welcome-logo {
  max-width: 400px;
  width: 100%;
  margin-bottom: 2rem;
  transition: transform 0.3s ease;
}

.welcome-logo:hover {
  transform: scale(1.05);
}

.gama-card {
  border-radius: var(--border-radius);
  box-shadow: var(--shadow-medium);
  transition: var(--transition);
  height: 100%;
  overflow: hidden;
  min-height: 400px;
}

.gama-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.gama-card.kelvonetworks {
  background: linear-gradient(135deg, #007FEA 0%, #0066BB 100%);
}

.gama-card.kelvofibra {
  background: linear-gradient(135deg, #FF1C42 0%, #CC1635 100%);
}

/* Product Detail Page */
.product-detail {
  padding: 3rem 0;
}

.product-detail-image {
  width: 100%;
  max-width: 500px;
  background: var(--bg-light);
  border-radius: var(--border-radius);
  padding: 2rem;
  margin-bottom: 2rem;
}

/* Galería de productos */
.product-gallery-main {
  margin-bottom: 1.5rem;
  width: 100%;
  position: relative;
}

.product-image-wrapper {
  position: relative;
  width: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--white);
  box-shadow: var(--shadow-medium);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-image-wrapper:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.product-image-wrapper:hover .image-zoom-overlay {
  opacity: 1;
}

.product-main-image {
  width: 100%;
  max-width: 100%;
  display: block;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-image-wrapper:hover .product-main-image {
  transform: scale(1.02);
}

.image-zoom-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 10;
  border-radius: var(--border-radius);
}

.zoom-icon {
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.zoom-icon svg {
  filter: drop-shadow(0 2px 10px rgba(0,0,0,0.5));
}

.zoom-text {
  color: white;
  font-size: 1rem;
  font-weight: 500;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
  text-align: center;
}

.product-gallery-thumbs {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
  justify-content: flex-start;
  width: 100%;
}

.gallery-thumb {
  width: 80px;
  height: 80px;
  min-width: 80px;
  min-height: 80px;
  border-radius: var(--border-radius);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid #ddd;
  transition: var(--transition);
  opacity: 0.7;
  background: var(--bg-light);
  flex-shrink: 0;
  display: block;
  position: relative;
  box-sizing: border-box;
}

.gallery-thumb:hover {
  opacity: 1;
  border-color: var(--gama-primary);
  transform: translateY(-2px);
}

.gallery-thumb.active {
  opacity: 1;
  border-color: var(--gama-primary) !important;
  border-width: 3px !important;
  box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.3), 0 4px 12px rgba(0, 102, 204, 0.4) !important;
  transform: scale(1.08);
  background: rgba(0, 102, 204, 0.1);
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gallery-thumb .thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-light);
  padding: 0.25rem;
}

.gallery-thumb .thumb-placeholder small {
  font-size: 0.7rem;
  color: var(--text-light);
  text-align: center;
  word-break: break-all;
}

/* Lightbox Modal */
.lightbox-modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--border-radius);
  animation: zoomIn 0.3s;
}

@keyframes zoomIn {
  from { transform: scale(0.8); }
  to { transform: scale(1); }
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  transition: color 0.3s;
}

.lightbox-close:hover {
  color: #fff;
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  padding: 16px;
  user-select: none;
  transition: color 0.3s, background-color 0.3s;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(0, 0, 0, 0.5);
}

.lightbox-prev {
  left: 20px;
}

.lightbox-next {
  right: 20px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
  color: #fff;
  background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #f1f1f1;
  font-size: 18px;
  background-color: rgba(0, 0, 0, 0.7);
  padding: 10px 20px;
  border-radius: var(--border-radius);
  z-index: 10000;
}

.product-specs {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-light);
}

.product-specs h3 {
  color: var(--gama-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--bg-light);
}

.btn-download-ficha {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--gama-primary);
  color: white;
  text-decoration: none;
  border-radius: var(--border-radius);
  font-size: 0.9rem;
  transition: var(--transition);
  border: none;
  font-weight: 500;
}

.btn-download-ficha:hover {
  background: var(--gama-primary-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.spec-row {
  display: flex;
  padding: 1rem 0;
  border-bottom: 1px solid var(--bg-light);
}

.spec-row:last-child {
  border-bottom: none;
}

.spec-label {
  font-weight: 600;
  color: var(--text-dark);
  width: 40%;
}

.spec-value {
  color: var(--text-light);
  width: 60%;
}

/* Product Actions - Botones de ficha de producto */
.product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.product-actions .btn-primary,
.product-actions .btn-outline-primary {
  flex: 0 0 auto;
}

/* Responsive: en móvil los botones ocupan todo el ancho */
@media (max-width: 576px) {
  .product-actions {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .product-actions .btn-primary,
  .product-actions .btn-outline-primary {
    width: 100%;
    text-align: center;
    padding: 1rem 1.5rem;
  }
}

/* Contact Page Specific Styles */

/* Resetear comportamiento de filas en páginas de contacto/distribuidor para que no fuercen alturas iguales */
.contact-page .row,
.distributor-page .row,
.legal-page .row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start !important;
}

/* Las columnas en páginas de contacto/distribuidor/legal deben comportarse normalmente */
.contact-page .row > [class*="col-"],
.distributor-page .row > [class*="col-"],
.legal-page .row > [class*="col-"] {
  display: block !important;
}

/* Service cards en páginas de contacto deben tener altura automática */
.contact-page .service-card,
.distributor-page .service-card,
.legal-page .service-card {
  height: auto !important;
  min-height: auto !important;
}

/* Asegurar que el formulario sticky funcione correctamente */
.contact-page .col-lg-4 .service-card,
.distributor-page .col-lg-4 .service-card {
  position: sticky;
  top: 140px; /* Debajo del navbar */
}

/* Estilos para cambio de vista en catálogo */
.view-toggle-buttons .view-btn {
  transition: all 0.3s ease;
}

.view-toggle-buttons .view-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.view-toggle-buttons .view-btn.active {
  background: var(--gama-primary) !important;
  color: white !important;
  border-color: var(--gama-primary) !important;
}

.view-toggle-buttons .view-btn:not(.active) {
  background: transparent !important;
  color: var(--text-light) !important;
  border-color: var(--text-light) !important;
}

.view-toggle-buttons .view-btn:not(.active):hover {
  background: var(--bg-light) !important;
  border-color: var(--gama-primary) !important;
  color: var(--gama-primary) !important;
}

/* Vista en filas (lista) - Estilos muy específicos */
#productsContainer.view-list .row,
section #productsContainer.view-list .row,
.products-container.view-list .row {
  display: block !important;
  margin: 0 !important;
  --bs-gutter-x: 0 !important;
  --bs-gutter-y: 0 !important;
}

#productsContainer.view-list .row.g-4,
section #productsContainer.view-list .row.g-4,
.products-container.view-list .row.g-4 {
  gap: 0 !important;
}

#productsContainer.view-list .product-item,
section #productsContainer.view-list .product-item,
.products-container.view-list .product-item {
  width: 100% !important;
  max-width: 100% !important;
  flex: 0 0 100% !important;
  margin-bottom: 1rem !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#productsContainer.view-list .product-item.col-md-6,
#productsContainer.view-list .product-item.col-lg-4,
section #productsContainer.view-list .product-item.col-md-6,
section #productsContainer.view-list .product-item.col-lg-4 {
  flex: 0 0 100% !important;
  max-width: 100% !important;
}

#productsContainer.view-list .product-card,
section #productsContainer.view-list .product-card,
.products-container.view-list .product-card {
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  padding: 1rem !important;
  height: auto !important;
  gap: 1.5rem !important;
  margin: 0 !important;
}

#productsContainer.view-list .product-card .product-image-wrapper,
section #productsContainer.view-list .product-card .product-image-wrapper,
.products-container.view-list .product-card .product-image-wrapper {
  width: 120px !important;
  height: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  flex-shrink: 0 !important;
  padding: 0 !important;
}

#productsContainer.view-list .product-card .product-image-wrapper img,
section #productsContainer.view-list .product-card .product-image-wrapper img,
.products-container.view-list .product-card .product-image-wrapper img {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  padding: 0.5rem !important;
}

#productsContainer.view-list .product-card > img,
section #productsContainer.view-list .product-card > img,
.products-container.view-list .product-card > img {
  width: 120px !important;
  height: 120px !important;
  min-width: 120px !important;
  max-width: 120px !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  object-fit: contain !important;
  flex-shrink: 0 !important;
  padding: 0.5rem !important;
}

#productsContainer.view-list .product-card-content,
section #productsContainer.view-list .product-card-content,
.products-container.view-list .product-card-content {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 !important;
  min-width: 0 !important;
}

#productsContainer.view-list .product-card h4,
section #productsContainer.view-list .product-card h4,
.products-container.view-list .product-card h4 {
  margin-bottom: 0.5rem !important;
  font-size: 1.1rem !important;
}

#productsContainer.view-list .product-reference,
section #productsContainer.view-list .product-reference,
.products-container.view-list .product-reference {
  margin-bottom: 0.25rem !important;
}

#productsContainer.view-list .product-description,
section #productsContainer.view-list .product-description,
.products-container.view-list .product-description {
  font-size: 0.9rem !important;
  line-height: 1.5 !important;
  margin-top: 0.25rem !important;
  flex-grow: 0 !important;
}

/* Estilos adicionales para igualar alturas de tarjetas de secciones - SOLO en páginas con section-cards-container */
.section-cards-container.py-5 .row.g-4 {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: stretch !important;
}

.section-cards-container.py-5 .row.g-4 > [class*="col-"] {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
}

.section-cards-container.py-5 .row.g-4 > [class*="col-"] > a {
  display: flex !important;
  flex-direction: column !important;
  flex: 1 1 auto !important;
  width: 100% !important;
  height: 100% !important;
}

.section-cards-container.py-5 .row.g-4 > [class*="col-"] > a > .service-card {
  flex: 1 1 auto !important;
  display: flex !important;
  flex-direction: column !important;
  height: 100% !important;
  min-height: 100% !important;
}
