/**
 * CatalogoPro.css - Estilos dedicados para el Catálogo Pro de Alta Velocidad
 * Complementa a productos.css y product-list.css con soporte de rendimiento instantáneo (0ms)
 */

/* Botón Catálogo Digital en Tarjeta de Categorías */
.categories-card__catalog-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 48px !important;
  height: 48px !important;
  min-width: 48px !important;
  max-width: 48px !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  margin-left: 0.5rem !important;
  cursor: pointer !important;
  flex-shrink: 0 !important;
  transition: transform 0.15s ease, filter 0.15s ease, box-shadow 0.15s ease !important;
}

.categories-card__catalog-btn:hover {
  transform: scale(1.05) !important;
  filter: brightness(1.06) !important;
  box-shadow: 0 4px 12px rgba(255, 153, 64, 0.4) !important;
}

.categories-card__catalog-btn img {
  width: 48px !important;
  height: 48px !important;
  max-width: 48px !important;
  max-height: 48px !important;
  object-fit: contain !important;
  display: block !important;
}

/* Menú de Categorías (se despliega al hacer clic en Categorías) */
.category-menu {
  display: none;
}

/* Buscador Rápido del Catálogo Pro */
.catalogo-pro-search-bar {
  margin-bottom: 20px;
  position: relative;
  width: 100%;
}

.catalogo-pro-search-inner {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 1.5px solid #d0d7e5;
  border-radius: 10px;
  padding: 4px 14px;
  box-shadow: 0 3px 10px rgba(12, 28, 71, 0.05);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.catalogo-pro-search-inner:focus-within {
  border-color: #0c1c47;
  box-shadow: 0 4px 16px rgba(12, 28, 71, 0.12);
}

.catalogo-pro-search-icon {
  width: 20px;
  height: 20px;
  color: #0c1c47;
  margin-right: 10px;
  flex-shrink: 0;
}

.catalogo-pro-search-input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  font-weight: 500;
  color: #0c1c47;
  padding: 8px 0;
  background: transparent;
}

.catalogo-pro-search-input::placeholder {
  color: #8c98af;
  font-weight: 400;
}

.catalogo-pro-search-clear {
  display: none;
  cursor: pointer;
  background: #eef2f8;
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  color: #43516c;
  font-size: 14px;
  line-height: 1;
  transition: background 0.15s ease;
}

.catalogo-pro-search-clear:hover {
  background: #dfe5f0;
  color: #0c1c47;
}

/* Filtros en Barra Lateral */
.filter-title {
  font-size: 36px;
  font-weight: 700;
  color: #0c1c47;
  margin-bottom: 20px;
}

input[type="checkbox"].check-cats {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  border-radius: 5px !important;
  border: solid 1px #0d1f58;
}

label.name-cat {
  margin-bottom: 0px;
  display: flex;
  line-height: normal;
  padding-right: 15px;
}

.filter-box {
  width: 100%;
  background: #ffffff;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 16px;
}

.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.filter-header h3 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #1f2d5a;
}

.arrow {
  transition: 0.3s ease;
  font-size: 20px;
  color: #1f2d5a;
}

.filter-box.closed .arrow {
  transform: rotate(180deg);
}

.selected-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  margin-bottom: 10px;
}

.selected-tags.vacia {
  display: none;
}

.catalogo-tag {
  color: var(--color-primary-500, #0c1c47);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: solid 1px var(--color-primary-500, #0c1c47);
  background: #eef4ff;
}

.catalogo-tag .close_tag {
  cursor: pointer;
  font-weight: 700;
  color: #1d4ed8;
  font-size: 14px;
  line-height: 1;
}

.catalogo-tag .close_tag:hover {
  color: #dc2626;
}

.clear-selection {
  margin-top: 10px;
  margin-bottom: 10px;
  text-align: right;
  font-size: 13px;
  color: #1f2d5a;
  font-weight: 600;
  cursor: pointer;
  display: block;
}

.clear-selection:hover {
  text-decoration: underline;
  color: #dc2626;
}

.clear-selection.hide {
  display: none;
}

.filter-box .search-box {
  position: relative;
  margin-top: 12px;
  margin-bottom: 10px;
}

.filter-box .search-box input {
  width: 100%;
  height: 28px;
  border: 1.5px solid #2d3f73;
  border-radius: 8px;
  padding: 0 35px 0 10px;
  font-size: 13px;
  outline: none;
}

.filter-box .search-box input:focus {
  border-color: #0c1c47;
}

.filter-box .search-box svg {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  fill: #1f2d5a;
  pointer-events: none;
}

.filter-options-scroll {
  max-height: 220px;
  overflow-y: auto;
  padding-right: 4px;
  display: flex;
  flex-direction: column;
}

.filter-options-scroll::-webkit-scrollbar {
  width: 5px;
}

.filter-options-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.option-cats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
  font-size: 14px;
  color: var(--color-primary-500, #0c1c47);
  cursor: pointer;
}

.option-cats:hover {
  color: #0c1c47;
}

.option-left {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-cats input {
  width: 18px;
  height: 18px;
  accent-color: #0d1f58;
  border: solid 1px #0d1f58;
  cursor: pointer;
  flex-shrink: 0;
}

.option-cats .name-cat {
  margin: 0;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.option-cats .count {
  font-size: 12px;
  color: #64748b;
  background: #f1f5f9;
  padding: 1px 6px;
  border-radius: 10px;
  font-weight: 600;
  flex-shrink: 0;
}

.filter-content {
  overflow: hidden;
  transition: 0.3s ease;
}

.filter-box.closed .filter-content {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  display: none;
}

/* Skeleton Loading Cards */
.catalogo-pro-skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  width: 100%;
  padding: 10px 0;
}

.catalogo-pro-skeleton-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: catalogoPulse 1.4s infinite ease-in-out;
}

@keyframes catalogoPulse {
  0% { opacity: 0.6; }
  50% { opacity: 1; }
  100% { opacity: 0.6; }
}

.catalogo-pro-skeleton-img {
  width: 100%;
  height: 160px;
  background: #edf2f7;
  border-radius: 8px;
}

.catalogo-pro-skeleton-line {
  height: 14px;
  background: #edf2f7;
  border-radius: 4px;
}

.catalogo-pro-skeleton-line.short {
  width: 60%;
}

.catalogo-pro-skeleton-line.medium {
  width: 80%;
}

/* Paginación Clásica Instantánea */
.catalogo-pagination-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 32px 0 20px 0;
  flex-wrap: wrap;
}

.catalogo-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #0c1c47;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.catalogo-page-btn:hover:not(.disabled):not(.active) {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.catalogo-page-btn.active {
  background: #0c1c47;
  border-color: #0c1c47;
  color: #ffffff;
  cursor: default;
}

.catalogo-page-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f8fafc;
}

.catalogo-page-dots {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 38px;
  color: #64748b;
  font-weight: 700;
}

/* Estado Sin Resultados */
.catalogo-pro-no-results {
  text-align: center;
  padding: 48px 20px;
  background: #ffffff;
  border-radius: 12px;
  border: 1px dashed #cbd5e1;
  width: 100%;
  margin: 20px 0;
}

.catalogo-pro-no-results i {
  font-size: 42px;
  color: #94a3b8;
  margin-bottom: 14px;
  display: block;
}

.catalogo-pro-no-results h3 {
  font-size: 20px;
  color: #0c1c47;
  font-weight: 700;
  margin-bottom: 8px;
}

.catalogo-pro-no-results p {
  font-size: 14px;
  color: #64748b;
  margin-bottom: 18px;
}

.catalogo-pro-no-results .reset-btn {
  background: #0c1c47;
  color: #ffffff;
  border: none;
  padding: 9px 20px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 14px;
  transition: background 0.2s ease;
}

.catalogo-pro-no-results .reset-btn:hover {
  background: #1e3a8a;
}

/* Efecto hover suave para doble imagen */
.product__image-container.prd {
  position: relative;
  overflow: hidden;
}

.product__image.img1 {
  transition: opacity 0.25s ease;
}

.product__image.img2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.product:hover .product__image.img1 {
  opacity: 0;
}

.product:hover .product__image.img2 {
  opacity: 1;
}

/* Active Highlight en el menú de categorías */
.category-name-container.is-active .category-name {
  color: #f59223 !important;
  font-weight: 700;
}

.card--highlight.is-active {
  background: #0c1c47 !important;
  color: #ffffff !important;
}

/* ==========================================================================
   Botón Compartir y Modal de Compartir Productos (share-product-modal-portal)
   ========================================================================== */
button.products__header__view-button-container__button.share {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.35rem;
  height: 2rem;
  padding: 0;
  border-radius: 0.3rem;
  border: 1.5px solid #f59223 !important;
  background-color: #ffffff !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

button.products__header__view-button-container__button.share:hover {
  background-color: #fff8f0 !important;
  box-shadow: 0 2px 6px rgba(245, 146, 35, 0.25);
  transform: translateY(-1px);
}

button.products__header__view-button-container__button.share .share-btn-icon {
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
  filter: brightness(0) saturate(100%) invert(10%) sepia(47%) saturate(2865%) hue-rotate(211deg) brightness(91%) contrast(101%);
}

.share-modal-portal {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100000 !important;
  background-color: rgba(8, 22, 56, 0.55) !important;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.share-modal-card {
  width: 100%;
  max-width: 410px;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 14px 36px rgba(8, 30, 75, 0.32);
  border: 1px solid #d9e0ec;
  animation: shareModalFadeIn 0.18s ease-out;
}

@keyframes shareModalFadeIn {
  from {
    opacity: 0;
    transform: scale(0.96) translateY(8px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.share-modal__header {
  background-color: #081e4b;
  color: #ffffff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.share-modal__header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.share-modal__header-icon {
  width: 22px !important;
  height: 22px !important;
  max-width: 22px !important;
  max-height: 22px !important;
  object-fit: contain;
  filter: brightness(0) invert(1);
  display: block;
}

.share-modal__header-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #ffffff;
}

.share-modal__close {
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.9;
  transition: opacity 0.15s ease;
}

.share-modal__close:hover {
  opacity: 1;
}

.share-modal__body {
  background: #ffffff;
}

.share-modal__product-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 20px 16px 20px;
  border-bottom: 1px solid #ebedf2;
}

.share-modal__product-img-wrap {
  width: 96px;
  height: 96px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 8px;
  padding: 4px;
}

.share-modal__product-img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.share-modal__product-info {
  flex: 1;
  min-width: 0;
}

.share-modal__product-title {
  margin: 0 0 5px 0;
  font-size: 17px;
  font-weight: 800;
  color: #081e4b;
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.share-modal__product-ref {
  margin: 0 0 8px 0;
  font-size: 13.5px;
  font-weight: 500;
  color: #1f3366;
}

.share-modal__brand-wrap {
  display: flex;
  align-items: center;
}

.share-modal__brand-img {
  max-height: 28px;
  max-width: 110px;
  object-fit: contain;
}

.share-modal__brand-badge {
  display: inline-block;
  background-color: #ffd400;
  color: #111111;
  font-weight: 900;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.share-modal__options-section {
  padding: 14px 20px 20px 20px;
}

.share-modal__subtitle {
  margin: 0 0 12px 0;
  font-size: 15px;
  font-weight: 700;
  color: #081e4b;
}

.share-modal__option {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 15px;
  margin-bottom: 10px;
  background: #ffffff;
  border: 1.5px solid #e4e8f0;
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
  text-align: left;
}

.share-modal__option:last-child {
  margin-bottom: 0;
}

.share-modal__option:hover,
.share-modal__option:focus {
  border-color: #f59223;
  background-color: #fffaf4;
  box-shadow: 0 2px 10px rgba(245, 146, 35, 0.16);
  outline: none;
}

.share-modal__option--pdf {
  border: 2px solid #f59223;
}

.share-modal__option-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.share-modal__option-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.share-modal__option-icon--whatsapp img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.share-modal__option-text {
  font-size: 15.5px;
  font-weight: 700;
  color: #081e4b;
}

.share-modal__option-chevron {
  font-size: 22px;
  line-height: 1;
  color: #7c8aa6;
  font-weight: 400;
}

/* Botón flotante Volver arriba (#back-top) */
#back-top {
  text-align: center;
  position: fixed;
  cursor: pointer;
  overflow: hidden;
  right: 10px;
  bottom: 40px;
  z-index: 1002;
  border-radius: 50%;
  display: none;
  width: 45px;
  height: 45px;
  background: #28316d;
  box-shadow: 0 4px 12px rgba(40, 49, 109, 0.3);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

#back-top:hover {
  background: #1c2452;
  transform: translateY(-2px);
}

#back-top a {
  color: #ffffff;
  font-size: 30px;
  line-height: 45px;
  text-decoration: none;
  display: block;
}
