/* ==========================================================================
   GRUPO HG - ESTILOS PREMIUM DEL CATÁLOGO (css/catalogo.css)
   ========================================================================== */

/* --- Toolbar: Buscador y Filtros --- */
.hg-catalog-toolbar {
  background: #ffffff;
  border-radius: 16px;
  padding: 24px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  margin-bottom: 45px;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.hg-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.hg-search-box .hg-search-icon {
  position: absolute;
  left: 18px;
  color: #7b8893;
  font-size: 16px;
  pointer-events: none;
}

.hg-search-input {
  width: 100%;
  height: 52px;
  padding: 12px 48px 12px 48px;
  border-radius: 30px;
  border: 1.5px solid #e2e8f0;
  background: #f8fafc;
  font-size: 15px;
  font-family: inherit;
  color: #1e293b;
  transition: all 0.3s ease;
  outline: none;
}

.hg-search-input:focus {
  border-color: #2a7bc1;
  background: #ffffff;
  box-shadow: 0 0 0 4px rgba(42, 123, 193, 0.12);
}

.hg-search-clear {
  position: absolute;
  right: 15px;
  background: #e2e8f0;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #475569;
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: all 0.2s ease;
}

.hg-search-clear:hover {
  background: #cbd5e1;
  color: #0f172a;
}

/* --- Categorías / Pestañas de Filtro --- */
.hg-filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  align-items: center;
}

.hg-filter-btn {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 10px 20px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all 0.25s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.hg-filter-btn:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: translateY(-1px);
}

.hg-filter-btn.active {
  background: #2a7bc1;
  color: #ffffff;
  border-color: #2a7bc1;
  box-shadow: 0 4px 12px rgba(42, 123, 193, 0.3);
}

.hg-filter-btn .hg-count-badge {
  background: rgba(0, 0, 0, 0.08);
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
}

.hg-filter-btn.active .hg-count-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* --- Contador de Resultados --- */
.hg-results-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 25px;
  padding: 0 5px;
  color: #64748b;
  font-size: 14px;
}

.hg-results-info b {
  color: #0f172a;
}

/* --- Grid de Productos --- */
.hg-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
}

/* --- Tarjeta de Producto --- */
.hg-product-card {
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid #e9edf2;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
  transition: all 0.35s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  animation: hgFadeUp 0.45s ease forwards;
}

.hg-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.1);
  border-color: #cbd5e1;
}

@keyframes hgFadeUp {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Marco de Imagen de la Tarjeta */
.hg-card-image-wrap {
  position: relative;
  width: 100%;
  height: 250px;
  background: #f8fafc;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.hg-card-image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.45s ease;
}

.hg-product-card:hover .hg-card-image-wrap img {
  transform: scale(1.06);
}

/* Ribbon / Badge */
.hg-card-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: #f39c12;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 12px;
  border-radius: 20px;
  z-index: 2;
  box-shadow: 0 4px 8px rgba(243, 156, 18, 0.3);
}

/* Botón de Zoom (Lupa Fancybox) */
.hg-zoom-btn {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #ffffff;
  color: #1e293b;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  transition: all 0.25s ease;
  z-index: 2;
  cursor: pointer;
  border: none;
  text-decoration: none;
}

.hg-zoom-btn:hover {
  background: #2a7bc1;
  color: #ffffff;
  transform: scale(1.12);
}

.hg-photo-counter-badge {
  position: absolute;
  bottom: 12px;
  right: 14px;
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

/* Cuerpo de la Tarjeta */
.hg-card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.hg-card-category {
  font-size: 12px;
  font-weight: 700;
  color: #2a7bc1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.hg-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #1e293b;
  margin: 0 0 10px 0;
  line-height: 1.35;
}

.hg-card-desc {
  font-size: 13.5px;
  color: #64748b;
  line-height: 1.55;
  margin-bottom: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex-grow: 1;
}

/* Botones de Acción de la Tarjeta */
.hg-card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.hg-btn-info {
  flex: 1;
  height: 42px;
  background: #f1f5f9;
  color: #1e293b;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.hg-btn-info:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.hg-btn-whatsapp {
  height: 42px;
  padding: 0 16px;
  background: #25d366;
  color: #ffffff;
  border-radius: 10px;
  border: none;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-decoration: none;
}

.hg-btn-whatsapp:hover {
  background: #1eb956;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 6px 14px rgba(37, 211, 102, 0.35);
}

/* --- Botón "Ver Más Productos" --- */
.hg-load-more-wrap {
  text-align: center;
  margin-top: 50px;
  margin-bottom: 20px;
}

.hg-load-more-btn {
  background: #2a7bc1;
  color: #ffffff;
  padding: 14px 34px;
  border-radius: 30px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 6px 20px rgba(42, 123, 193, 0.3);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.hg-load-more-btn:hover {
  background: #2367a3;
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(42, 123, 193, 0.4);
}

.hg-load-more-btn .hg-remaining-badge {
  background: rgba(255, 255, 255, 0.25);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
}

/* --- Estado Vacío (Sin Resultados) --- */
.hg-empty-state {
  text-align: center;
  padding: 60px 20px;
  background: #ffffff;
  border-radius: 16px;
  border: 1px dashed #cbd5e1;
  grid-column: 1 / -1;
}

.hg-empty-state i {
  font-size: 48px;
  color: #94a3b8;
  margin-bottom: 15px;
}

.hg-empty-state h3 {
  font-size: 20px;
  color: #1e293b;
  margin-bottom: 8px;
}

.hg-empty-state p {
  color: #64748b;
  margin-bottom: 20px;
}

/* ==========================================================================
   MODAL DE DETALLES DEL PRODUCTO (INFO POPUP)
   ========================================================================== */
.hg-modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(6px);
  z-index: 99999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.hg-modal-backdrop.active {
  display: flex;
  opacity: 1;
}

.hg-modal-container {
  background: #ffffff;
  border-radius: 20px;
  width: 100%;
  max-width: 920px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  position: relative;
  transform: scale(0.92);
  transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.hg-modal-backdrop.active .hg-modal-container {
  transform: scale(1);
}

.hg-modal-close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 38px;
  height: 38px;
  background: #f1f5f9;
  border: none;
  border-radius: 50%;
  color: #475569;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 16px;
  z-index: 10;
  transition: all 0.2s ease;
}

.hg-modal-close:hover {
  background: #e2e8f0;
  color: #0f172a;
  transform: rotate(90deg);
}

.hg-modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  padding: 35px;
}

/* Galería en Modal */
.hg-modal-gallery {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.hg-modal-main-image-wrap {
  width: 100%;
  height: 330px;
  background: #f8fafc;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  border: 1px solid #e2e8f0;
}

.hg-modal-main-image-wrap img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.hg-modal-zoom-hint {
  position: absolute;
  bottom: 12px;
  right: 12px;
  background: rgba(0, 0, 0, 0.65);
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  backdrop-filter: blur(4px);
  cursor: pointer;
}

.hg-modal-thumbs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 5px;
}

.hg-modal-thumb {
  width: 65px;
  height: 65px;
  border-radius: 8px;
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  padding: 4px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.hg-modal-thumb.active {
  border-color: #2a7bc1;
  box-shadow: 0 0 0 2px rgba(42, 123, 193, 0.2);
}

.hg-modal-thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Contenido / Ficha Técnica en Modal */
.hg-modal-details {
  display: flex;
  flex-direction: column;
}

.hg-modal-category {
  font-size: 13px;
  font-weight: 700;
  color: #2a7bc1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.hg-modal-title {
  font-size: 26px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 15px 0;
  line-height: 1.25;
}

.hg-modal-desc {
  font-size: 14.5px;
  color: #475569;
  line-height: 1.6;
  margin-bottom: 22px;
}

.hg-specs-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  color: #1e293b;
  margin-bottom: 12px;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 6px;
}

.hg-specs-list {
  list-style: none;
  padding: 0;
  margin: 0 0 25px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.hg-specs-list li {
  display: flex;
  font-size: 13.5px;
  color: #334155;
}

.hg-specs-list li b {
  min-width: 120px;
  color: #64748b;
  font-weight: 600;
}

.hg-modal-whatsapp-cta {
  background: #25d366;
  color: #ffffff;
  padding: 14px 26px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-decoration: none;
  transition: all 0.25s ease;
  box-shadow: 0 6px 18px rgba(37, 211, 102, 0.35);
  margin-top: auto;
}

.hg-modal-whatsapp-cta:hover {
  background: #1eb956;
  color: #ffffff;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.45);
}

/* Responsive */
@media (max-width: 768px) {
  .hg-catalog-toolbar {
    padding: 18px 16px;
  }
  .hg-filter-tabs {
    gap: 6px;
  }
  .hg-filter-btn {
    font-size: 13px;
    padding: 8px 14px;
  }
  .hg-modal-grid {
    grid-template-columns: 1fr;
    padding: 25px 20px;
  }
  .hg-modal-main-image-wrap {
    height: 250px;
  }
}
