/**
 * modules/listado/css/listado.css
 * Estilos específicos para el listado público (sin carrito)
 * Sobrescribe estilos de catalogo.css cuando es necesario
 */

/* ════════════════════════════════════════════════════════════
   LAYOUT
   ════════════════════════════════════════════════════════════ */
body.listado-page {
  background: #f5f7fa;
}

.listado-page .app-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.listado-page .navbar {
  background: #fff;
  border-bottom: 1px solid #e0e4e8;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.listado-page .navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 600;
  color: #0d1117;
  font-size: 1rem;
}

.listado-page .navbar-brand .brand-accent {
  color: #ea6321;
}

.listado-page .navbar-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.listado-page .main-content {
  flex: 1;
  overflow: auto;
  padding: 1.5rem;
}

.listado-page .page-content {
  max-width: 1400px;
  margin: 0 auto;
}

/* ════════════════════════════════════════════════════════════
   HEADER DE PÁGINA
   ════════════════════════════════════════════════════════════ */
.listado-page .page-header {
  margin-bottom: 1.5rem;
}

.listado-page .page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #0d1117;
  margin: 0 0 0.5rem 0;
}

.listado-page .cat-subtitle {
  color: #666;
  font-size: 0.95rem;
}

/* ════════════════════════════════════════════════════════════
   TARJETAS Y GRID
   ════════════════════════════════════════════════════════════ */
.listado-page .card {
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.listado-page .card-body {
  padding: 1rem;
}

.listado-page .cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

@media (max-width: 768px) {
  .listado-page .cat-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 0.75rem;
  }
}

.listado-page .cat-card {
  background: #fff;
  border: 1px solid #e0e4e8;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.listado-page .cat-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-2px);
}

.listado-page .cat-card-img {
  width: 100%;
  height: 160px;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-bottom: 1px solid #e0e4e8;
}

.listado-page .cat-card-product-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.listado-page .cat-card-name {
  padding: 0.75rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: #0d1117;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.3;
}

.listado-page .cat-card-price {
  padding: 0.5rem 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  color: #ea6321;
  border-top: 1px solid #f0f0f0;
  border-bottom: 1px solid #f0f0f0;
}

.listado-page .cat-card-buttons {
  padding: 0.75rem;
  display: flex;
  gap: 0.5rem;
}

.listado-page .cat-card-buy-btn {
  flex: 1;
  font-size: 0.85rem;
  padding: 0.5rem 0.75rem;
}

/* ════════════════════════════════════════════════════════════
   BUSCADOR Y FILTROS
   ════════════════════════════════════════════════════════════ */
.listado-page .search-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.listado-page .search-input-wrap i {
  position: absolute;
  left: 0.75rem;
  color: #999;
  pointer-events: none;
}

.listado-page .search-input-wrap .form-control {
  padding-left: 2.5rem;
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  font-size: 0.95rem;
}

.listado-page .search-input-wrap .form-control:focus {
  border-color: #ea6321;
  box-shadow: 0 0 0 3px rgba(234, 99, 33, 0.1);
}

.listado-page .search-clear-btn {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  color: #999;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem;
}

.listado-page .search-clear-btn:hover {
  color: #0d1117;
}

/* ════════════════════════════════════════════════════════════
   RESULTADOS Y ORDENAR
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.listado-page .cat-results-count {
  font-size: 0.95rem;
  color: #666;
}

.listado-page .cat-sort-wrap {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.listado-page .form-select {
  border: 1px solid #e0e4e8;
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  background: #fff;
  color: #0d1117;
}

.listado-page .form-select:focus {
  border-color: #ea6321;
  outline: none;
}

/* ════════════════════════════════════════════════════════════
   MODAL
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-modal-overlay {
  z-index: 1050;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(3px);
}

.listado-page .cat-modal-overlay.open {
  display: flex;
}

.listado-page .cat-modal {
  max-width: 960px;
  width: 96vw;
  max-height: 90vh;
  border-radius: 18px;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
}

.listado-page .cat-modal .modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 10;
  background: rgba(13, 17, 23, 0.65);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}

.listado-page .cat-modal .modal-close:hover {
  background: rgba(207, 34, 46, 0.9);
  transform: rotate(90deg);
}

/* Layout interno: galería + detalle */
.listado-page .cat-modal-inner {
  display: flex;
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

/* ════════════════════════════════════════════════════════════
   GALERÍA
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-gallery {
  flex: 0 0 40%;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border-right: 1px solid var(--border);
  gap: 0;
}

.listado-page .cat-gallery-main {
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 260px;
  background: #ffffff !important;
}

.listado-page .cat-gallery-img-wrap {
  background: #ffffff !important;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.listado-page .cat-main-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.listado-page .cat-no-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  color: var(--text-light);
  font-size: 0.83rem;
  width: 100%;
  height: 100%;
}

.listado-page .cat-no-image i {
  font-size: 3rem;
}

/* Navegación de galería */
.listado-page .cat-gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-primary);
  border: 1px solid var(--border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
  z-index: 2;
  font-size: 0.85rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.listado-page .cat-gallery-nav:hover {
  background: #fff;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
  transform: translateY(-50%) scale(1.08);
}

.listado-page .cat-gallery-prev {
  left: 10px;
}

.listado-page .cat-gallery-next {
  right: 10px;
}

/* Contador imagen */
.listado-page .cat-gallery-counter {
  position: absolute;
  bottom: 8px;
  right: 12px;
  background: rgba(255, 255, 255, 0.85);
  color: var(--text-secondary);
  font-size: 0.65rem;
  border-radius: 20px;
  padding: 2px 8px;
  border: 1px solid var(--border);
  backdrop-filter: blur(4px);
}

/* Miniaturas */
.listado-page .cat-gallery-thumbs {
  display: flex;
  gap: 6px;
  padding: 8px 10px;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  justify-content: center;
  overflow-x: auto;
  flex-shrink: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.listado-page .cat-thumb {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, transform 0.2s, opacity 0.2s;
  opacity: 0.65;
}

.listado-page .cat-thumb:hover {
  opacity: 1;
  transform: scale(1.06);
}

.listado-page .cat-thumb.active {
  border-color: var(--accent);
  opacity: 1;
  transform: scale(1.06);
}

.listado-page .cat-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ════════════════════════════════════════════════════════════
   PANEL DE DETALLE
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-detail {
  flex: 1;
  overflow-y: auto;
  padding: 1.75rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
}

.listado-page .cat-detail-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.listado-page .cat-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.listado-page .cat-tag-familia {
  background: rgba(234, 99, 33, 0.1);
  color: var(--cat-price-color);
}

.listado-page .cat-tag-marca {
  background: rgba(101, 109, 118, 0.1);
  color: var(--text-secondary);
}

.listado-page .cat-detail-name {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
}

.listado-page .cat-detail-code {
  font-size: 0.78rem;
  color: var(--text-light);
  font-family: 'Courier New', monospace;
  margin: -0.4rem 0 0;
}

/* Bloque de precios */
.listado-page .cat-prices {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.listado-page .cat-price-card {
  flex: 1;
  min-width: 130px;
  background: var(--bg-elevated);
  border-radius: 10px;
  padding: 0.7rem 1rem;
  border: 1px solid var(--border);
}

.listado-page .cat-price-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  margin-bottom: 0.2rem;
}

.listado-page .cat-price-amount {
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0.2rem 0;
}

.listado-page .cat-price-sub {
  font-size: 0.72rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-top: 0.15rem;
}

.listado-page .cat-price-retail .cat-price-amount {
  color: var(--cat-price-color);
}

.listado-page .cat-price-wholesale .cat-price-amount {
  color: var(--text-secondary);
}

/* Secciones acordeón */
.listado-page .cat-sections {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.listado-page .cat-section {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.listado-page .cat-section-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  text-align: left;
  transition: background 0.15s;
  gap: 0.4rem;
}

.listado-page .cat-section-header:hover {
  background: var(--bg-elevated);
}

.listado-page .cat-section-header span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.listado-page .cat-section-header span i {
  color: var(--accent);
  font-size: 0.8rem;
}

.listado-page .cat-section-icon {
  font-size: 0.7rem;
  color: var(--text-light);
  transition: transform 0.25s;
  flex-shrink: 0;
}

.listado-page .cat-section.closed .cat-section-icon {
  transform: rotate(-90deg);
}

.listado-page .cat-section.closed .cat-section-body {
  display: none;
}

.listado-page .cat-section-body {
  padding: 0.6rem 1rem 0.85rem;
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* Lista de características / incluye */
.listado-page .cat-bullet-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.listado-page .cat-bullet-list li {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  line-height: 1.5;
}

.listado-page .cat-bullet-list li::before {
  content: '•';
  color: var(--accent);
  font-weight: 700;
  flex-shrink: 0;
}

/* Acciones del modal */
.listado-page .cat-modal-actions {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Botones específicos */
.listado-page .btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.listado-page .btn-secondary:hover {
  background: #f0f4f8;
  border-color: #ccc;
}

.listado-page .cat-btn-whatsapp {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.65rem 1rem;
  font-size: 0.83rem;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 3px 12px rgba(37, 211, 102, 0.35);
  white-space: nowrap;
}

.listado-page .cat-btn-whatsapp:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 16px rgba(37, 211, 102, 0.5);
  color: #fff;
}

/* Responsive del modal */
@media (max-width: 700px) {
  .listado-page .cat-modal {
    max-width: 100vw;
    width: 100%;
    max-height: 100dvh;
    border-radius: 0;
  }
  
  .listado-page .cat-modal-inner {
    flex-direction: column;
  }
  
  .listado-page .cat-gallery {
    flex: 0 0 260px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  
  .listado-page .cat-gallery-main {
    min-height: 200px;
  }
  
  .listado-page .cat-detail {
    padding: 1.1rem 1rem 1rem;
  }
}

/* ════════════════════════════════════════════════════════════
   BOTONES
   ════════════════════════════════════════════════════════════ */
.listado-page .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: 6px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
  font-size: 0.95rem;
  padding: 0.625rem 1rem;
}

.listado-page .btn-primary {
  background: #ea6321;
  color: #fff;
}

.listado-page .btn-primary:hover {
  background: #d2521c;
}

.listado-page .btn-secondary {
  background: #e8eef2;
  color: #0d1117;
}

.listado-page .btn-secondary:hover {
  background: #d8e0e8;
}

.listado-page .btn-sm {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
}

/* ════════════════════════════════════════════════════════════
   LOADER
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem 1rem;
  color: #666;
}

.listado-page .spinner {
  display: inline-block;
  border: 3px solid #e0e4e8;
  border-top-color: #ea6321;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ════════════════════════════════════════════════════════════
   PAGINACIÓN
   ════════════════════════════════════════════════════════════ */
.listado-page .cat-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.listado-page .cat-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 0.6rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s;
  text-decoration: none;
}

.listado-page .cat-page-btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(234, 99, 33, 0.06);
}

.listado-page .cat-page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 700;
}

.listado-page .cat-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
