/* ============================================
   LACA Ecuador — Product Catalog Stylesheet
   Extends main styles.css design system
   ============================================ */

/* ---- CATALOG LAYOUT ---- */
.catalog-header {
  background: linear-gradient(135deg, var(--laca-gray-blue) 0%, #2d3e4d 100%);
  padding: 100px 0 50px;
  color: #fff;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.catalog-header::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(120,193,154,0.15) 0%, transparent 70%);
  border-radius: 50%;
}
.catalog-header h1 {
  font-family: 'MuseoSans-900', sans-serif;
  font-size: 2.4rem;
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
}
.catalog-header p {
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 1.05rem;
  opacity: 0.85;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}
.catalog-header .breadcrumb {
  font-size: 0.82rem;
  margin-bottom: 16px;
  opacity: 0.7;
  position: relative;
}
.catalog-header .breadcrumb a {
  color: var(--laca-green);
  text-decoration: none;
}

/* ---- TOOLBAR (Search + Filters) ---- */
.catalog-toolbar {
  background: #fff;
  border-bottom: 1px solid var(--laca-light-gray);
  padding: 16px 0;
  position: sticky;
  top: 70px;
  z-index: 90;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.toolbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.search-box {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 16px 10px 42px;
  border: 1.5px solid var(--laca-light-gray);
  border-radius: var(--radius-pill);
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.9rem;
  color: var(--laca-text-dark);
  background: var(--laca-tiza-gray);
  transition: all 0.3s;
  outline: none;
}
.search-box input:focus {
  border-color: var(--laca-green);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(120,193,154,0.15);
}
.search-box .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--laca-text);
  opacity: 0.5;
}
.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.filter-pill {
  padding: 8px 18px;
  border: 1.5px solid var(--laca-light-gray);
  border-radius: var(--radius-pill);
  background: #fff;
  font-family: 'MuseoSans-500', sans-serif;
  font-size: 0.82rem;
  color: var(--laca-text);
  cursor: pointer;
  transition: all 0.25s;
  white-space: nowrap;
}
.filter-pill:hover {
  border-color: var(--laca-green);
  color: var(--laca-green-hover);
}
.filter-pill.active {
  background: var(--laca-green);
  color: #fff;
  border-color: var(--laca-green);
}
.view-toggle {
  display: flex;
  gap: 4px;
  background: var(--laca-tiza-gray);
  border-radius: var(--radius-sm);
  padding: 3px;
}
.view-toggle button {
  background: none;
  border: none;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--laca-text);
  transition: all 0.2s;
}
.view-toggle button.active {
  background: #fff;
  color: var(--laca-gray-blue);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.product-count {
  font-size: 0.82rem;
  color: var(--laca-text);
  white-space: nowrap;
  font-family: 'MuseoSans-300', sans-serif;
}

/* ---- PRODUCT GRID ---- */
.catalog-body {
  max-width: 1280px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  min-height: 60vh;
}
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}
.product-grid.list-view {
  grid-template-columns: 1fr;
}

/* ---- PRODUCT CARD ---- */
.product-card {
  background: #fff;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0,0,0,0.06);
  overflow: hidden;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  cursor: pointer;
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(71,92,109,0.12);
  border-color: var(--laca-green);
}
.product-card .card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--laca-green);
  color: #fff;
  font-family: 'MuseoSans-700', sans-serif;
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}
.product-card .card-badge.new { background: #e74c3c; }
.product-card .card-badge.promo { background: #f39c12; }

.product-card .card-actions-top {
  position: absolute;
  top: 12px;
  right: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  opacity: 0;
  transform: translateX(8px);
  transition: all 0.3s;
  z-index: 2;
}
.product-card:hover .card-actions-top {
  opacity: 1;
  transform: translateX(0);
}
.card-actions-top button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.92);
  color: var(--laca-gray-blue);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: all 0.2s;
}
.card-actions-top button:hover {
  background: var(--laca-green);
  color: #fff;
}
.product-img-wrapper {
  aspect-ratio: 1;
  background: var(--laca-tiza-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-img-wrapper img {
  width: 75%;
  height: 75%;
  object-fit: contain;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
}
.product-card:hover .product-img-wrapper img {
  transform: scale(1.08);
}
.product-info {
  padding: 16px 18px 20px;
}
.product-category-tag {
  font-family: 'RobotoCondensed-Bold', sans-serif;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--laca-green);
  margin-bottom: 6px;
}
.product-name {
  font-family: 'MuseoSans-700', sans-serif;
  font-size: 0.95rem;
  color: var(--laca-text-dark);
  line-height: 1.3;
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-desc-short {
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.78rem;
  color: var(--laca-text);
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.product-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.product-price {
  font-family: 'MuseoSans-900', sans-serif;
  font-size: 1.15rem;
  color: var(--laca-gray-blue);
}
.product-price.hidden-price {
  display: none;
}
.product-price-label {
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.75rem;
  color: var(--laca-text);
  background: var(--laca-tiza-gray);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}
.product-actions {
  display: flex;
  gap: 8px;
}
.product-actions .btn-sm {
  flex: 1;
  padding: 8px 12px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  font-family: 'MuseoSans-700', sans-serif;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}
.btn-catalog-primary {
  background: var(--laca-green);
  color: #fff;
}
.btn-catalog-primary:hover {
  background: var(--laca-green-hover);
}
.btn-catalog-outline {
  background: transparent;
  color: var(--laca-gray-blue);
  border: 1.5px solid var(--laca-light-gray) !important;
}
.btn-catalog-outline:hover {
  border-color: var(--laca-green) !important;
  color: var(--laca-green);
}

/* ---- LIST VIEW CARD ---- */
.product-grid.list-view .product-card {
  display: grid;
  grid-template-columns: 200px 1fr;
}
.product-grid.list-view .product-img-wrapper {
  aspect-ratio: auto;
  height: 100%;
}
.product-grid.list-view .product-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- PRODUCT DETAIL MODAL ---- */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.35s;
  backdrop-filter: blur(4px);
}
.product-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.product-modal {
  background: #fff;
  border-radius: var(--radius-md);
  max-width: 920px;
  width: 95%;
  max-height: 90vh;
  overflow-y: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  transform: scale(0.92) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
.product-modal-overlay.open .product-modal {
  transform: scale(1) translateY(0);
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.06);
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--laca-text);
  z-index: 10;
  transition: all 0.2s;
}
.modal-close:hover {
  background: var(--laca-green);
  color: #fff;
}
.modal-img-section {
  background: var(--laca-tiza-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  min-height: 400px;
}
.modal-img-section img {
  max-width: 100%;
  max-height: 380px;
  object-fit: contain;
}
.modal-info-section {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-category {
  font-family: 'RobotoCondensed-Bold', sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--laca-green);
}
.modal-name {
  font-family: 'MuseoSans-900', sans-serif;
  font-size: 1.5rem;
  color: var(--laca-text-dark);
  line-height: 1.25;
}
.modal-description {
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.88rem;
  color: var(--laca-text);
  line-height: 1.6;
}
.modal-details-list {
  list-style: none;
  padding: 0;
}
.modal-details-list li {
  padding: 8px 0;
  border-bottom: 1px solid var(--laca-tiza-gray);
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.82rem;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.modal-details-list li strong {
  font-family: 'MuseoSans-700', sans-serif;
  color: var(--laca-gray-blue);
  min-width: 100px;
}
.modal-price-box {
  background: linear-gradient(135deg, rgba(120,193,154,0.08), rgba(120,193,154,0.02));
  border: 1px solid rgba(120,193,154,0.2);
  border-radius: var(--radius-sm);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.modal-price-box .modal-price-value {
  font-family: 'MuseoSans-900', sans-serif;
  font-size: 1.6rem;
  color: var(--laca-gray-blue);
}
.modal-price-box .modal-price-note {
  font-size: 0.72rem;
  color: var(--laca-text);
}
.modal-price-box.hidden-price { display: none; }
.modal-consult-price {
  font-family: 'MuseoSans-500', sans-serif;
  font-size: 0.88rem;
  color: var(--laca-green-hover);
  padding: 12px 16px;
  background: rgba(120,193,154,0.06);
  border-radius: var(--radius-sm);
  text-align: center;
}
.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  flex-wrap: wrap;
}
.modal-actions .btn {
  flex: 1;
  min-width: 140px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-family: 'MuseoSans-700', sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all 0.25s;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}
.modal-actions .btn-primary-cat {
  background: var(--laca-green);
  color: #fff;
}
.modal-actions .btn-primary-cat:hover {
  background: var(--laca-green-hover);
}
.modal-actions .btn-outline-cat {
  background: transparent;
  color: var(--laca-gray-blue);
  border: 1.5px solid var(--laca-light-gray) !important;
}
.modal-actions .btn-outline-cat:hover {
  border-color: var(--laca-green) !important;
  color: var(--laca-green);
}

/* ---- SMART CHAT (Asesor de Ventas) ---- */
.sales-chat-panel {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 370px;
  max-height: 520px;
  background: #fff;
  border-radius: var(--radius-md);
  box-shadow: 0 12px 48px rgba(0,0,0,0.14);
  z-index: 500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(110%);
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.4,0,0.2,1);
}
.sales-chat-panel.open {
  transform: translateY(0);
  opacity: 1;
}
.sales-chat-header {
  background: linear-gradient(135deg, var(--laca-gray-blue), #2d3e4d);
  color: #fff;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.sales-chat-header .chat-avatar-sm {
  width: 36px;
  height: 36px;
  background: var(--laca-green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.sales-chat-header .chat-header-text h4 {
  font-family: 'MuseoSans-700', sans-serif;
  font-size: 0.9rem;
  margin: 0;
}
.sales-chat-header .chat-header-text span {
  font-size: 0.7rem;
  opacity: 0.8;
}
.sales-chat-close {
  margin-left: auto;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.2rem;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.sales-chat-close:hover { opacity: 1; }

.sales-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 200px;
  max-height: 340px;
}
.sc-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.82rem;
  line-height: 1.45;
  font-family: 'MuseoSans-300', sans-serif;
}
.sc-msg.agent {
  background: var(--laca-tiza-gray);
  color: var(--laca-text-dark);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.sc-msg.user {
  background: var(--laca-green);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.sc-msg strong { font-family: 'MuseoSans-700', sans-serif; }
.sc-suggestion {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 0 16px 8px;
}
.sc-suggestion button {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--laca-light-gray);
  background: #fff;
  font-family: 'MuseoSans-500', sans-serif;
  font-size: 0.72rem;
  color: var(--laca-text-dark);
  cursor: pointer;
  transition: all 0.2s;
}
.sc-suggestion button:hover {
  border-color: var(--laca-green);
  color: var(--laca-green);
  background: rgba(120,193,154,0.05);
}
.sales-chat-input {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  border-top: 1px solid var(--laca-tiza-gray);
}
.sales-chat-input input {
  flex: 1;
  border: 1.5px solid var(--laca-light-gray);
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.82rem;
  outline: none;
  transition: border-color 0.2s;
}
.sales-chat-input input:focus {
  border-color: var(--laca-green);
}
.sales-chat-input button {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--laca-green);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.sales-chat-input button:hover {
  background: var(--laca-green-hover);
}
.sales-chat-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--laca-green);
  color: #fff;
  border: none;
  cursor: pointer;
  z-index: 499;
  box-shadow: 0 4px 20px rgba(120,193,154,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  animation: chat-pulse 2.5s infinite;
}
.sales-chat-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 28px rgba(120,193,154,0.5);
}
.sales-chat-fab .badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  background: #e74c3c;
  border-radius: 50%;
  font-size: 0.65rem;
  font-family: 'MuseoSans-700', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
}
@keyframes chat-pulse {
  0%,100% { box-shadow: 0 4px 20px rgba(120,193,154,0.4); }
  50% { box-shadow: 0 4px 28px rgba(120,193,154,0.6); }
}

/* ---- NO RESULTS ---- */
.no-results {
  text-align: center;
  padding: 80px 24px;
  color: var(--laca-text);
}
.no-results svg { opacity: 0.3; margin-bottom: 16px; }
.no-results h3 {
  font-family: 'MuseoSans-700', sans-serif;
  color: var(--laca-text-dark);
  margin-bottom: 8px;
}
.no-results p {
  font-family: 'MuseoSans-300', sans-serif;
  font-size: 0.9rem;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 768px) {
  .catalog-header h1 { font-size: 1.6rem; }
  .toolbar-inner { flex-direction: column; align-items: stretch; }
  .filter-pills { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .view-toggle { display: none; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-grid.list-view { grid-template-columns: 1fr; }
  .product-grid.list-view .product-card { grid-template-columns: 120px 1fr; }
  .product-modal { grid-template-columns: 1fr; max-height: 95vh; }
  .modal-img-section { min-height: 260px; padding: 24px; border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .sales-chat-panel { width: calc(100% - 24px); right: 12px; bottom: 12px; }
  .product-card .card-actions-top { opacity: 1; transform: none; }
}
@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
}
