/* ===== CATALOG PAGE ===== */

.nav-active {
  color: var(--teal-light) !important;
  font-weight: 700 !important;
}

/* HERO */
.cat-hero {
  background: linear-gradient(135deg, var(--blue-900) 0%, #1c1c1c 100%);
  padding: calc(120px + var(--banner-h)) 0 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cat-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 80%, rgba(255,255,255,.03) 0%, transparent 70%);
}
.cat-hero h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--white);
  letter-spacing: -.02em;
  margin-bottom: 10px;
  position: relative;
}
.cat-hero p {
  color: rgba(255,255,255,.6);
  font-size: 1.05rem;
  margin-bottom: 36px;
  position: relative;
}

/* SEARCH */
.search-wrap {
  max-width: 600px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--white);
  border-radius: 50px;
  padding: 14px 20px;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.search-box svg { color: var(--gray-400); flex-shrink: 0; }
.search-box input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  font-family: inherit;
  color: var(--gray-900);
  background: transparent;
}
.search-box input::placeholder { color: var(--gray-400); }
.search-clear {
  color: var(--gray-400);
  font-size: .85rem;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 50%;
  transition: all var(--transition);
  opacity: 0;
  pointer-events: none;
}
.search-clear.visible {
  opacity: 1;
  pointer-events: all;
}
.search-clear:hover { background: var(--gray-100); color: var(--gray-700); }

/* BREADCRUMB */
.breadcrumb-bar {
  background: var(--gray-100);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 0;
  font-size: .85rem;
}
.breadcrumb-inner { display: flex; align-items: center; }
#breadcrumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
#breadcrumb a { color: var(--blue-500); font-weight: 500; }
#breadcrumb a:hover { text-decoration: underline; }
#breadcrumb .bc-sep {
  color: var(--gray-400);
  font-size: .75rem;
}
#breadcrumb .bc-current {
  color: var(--gray-600);
  font-weight: 600;
}

/* MAIN LAYOUT */
.cat-main {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  padding-top: 36px;
  padding-bottom: 80px;
  align-items: start;
}

/* SIDEBAR */
.cat-sidebar {
  position: sticky;
  top: 80px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.sidebar-title {
  padding: 16px 20px;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gray-400);
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
}
.cat-menu { padding: 8px 0; }
.cat-menu li { position: relative; }
.cat-menu-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 11px 20px;
  font-size: .92rem;
  font-weight: 500;
  color: var(--gray-700);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  border-left: 3px solid transparent;
}
.cat-menu-btn svg { flex-shrink: 0; color: var(--gray-400); }
.cat-menu-btn:hover {
  background: var(--gray-50);
  color: var(--blue-600);
}
.cat-menu-btn:hover svg { color: var(--blue-500); }
.cat-menu-btn.active {
  background: rgba(242,101,34,.07);
  color: var(--blue-600);
  font-weight: 700;
  border-left-color: var(--blue-500);
}
.cat-menu-btn.active svg { color: var(--blue-500); }

/* sub-items */
.cat-submenu {
  display: none;
  padding: 4px 0 8px 0;
  background: var(--gray-50);
  border-top: 1px solid var(--gray-200);
  border-bottom: 1px solid var(--gray-200);
}
.cat-submenu.open { display: block; }
.cat-sub-btn {
  display: block;
  width: 100%;
  padding: 8px 20px 8px 44px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gray-600);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  position: relative;
}
.cat-sub-btn::before {
  content: '·';
  position: absolute;
  left: 32px;
  color: var(--gray-400);
  font-size: 1.1rem;
  line-height: 1;
  top: 50%;
  transform: translateY(-50%);
}
.cat-sub-btn:hover { color: var(--blue-600); background: rgba(242,101,34,.05); }
.cat-sub-btn.active {
  color: var(--blue-600);
  font-weight: 700;
  border-left-color: var(--teal);
  background: rgba(232,82,10,.06);
}

/* ===== CONTENT AREA ===== */
.cat-content {}

/* Category overview grid */
.overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}
.overview-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 28px 20px 24px;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}
.overview-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--blue-300);
}
.overview-card:hover .ov-icon { background: linear-gradient(135deg, var(--blue-500), var(--teal)); color: var(--white); }
.ov-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, rgba(242,101,34,.1), rgba(232,82,10,.1));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-500);
  margin: 0 auto 16px;
  transition: all var(--transition);
}
.overview-card h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); margin-bottom: 8px; }
.overview-card p { font-size: .8rem; color: var(--gray-400); }

/* Subcategory list inside a category */
.sub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}
.sub-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all var(--transition);
  display: flex;
  align-items: center;
  gap: 14px;
}
.sub-card:hover {
  border-color: var(--blue-400);
  box-shadow: var(--shadow);
  transform: translateX(4px);
}
.sub-card-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--blue-500), var(--teal));
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  flex-shrink: 0;
  font-size: 1rem;
  font-weight: 700;
}
.sub-card-text h4 { font-size: .95rem; font-weight: 700; color: var(--gray-900); }
.sub-card-text p { font-size: .78rem; color: var(--gray-400); margin-top: 2px; }

/* Section header inside content */
.content-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.content-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--gray-900);
  letter-spacing: -.02em;
}
.content-header .count {
  font-size: .82rem;
  color: var(--gray-400);
  background: var(--gray-100);
  padding: 4px 12px;
  border-radius: 50px;
}

/* Product cards */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.product-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 0;
  overflow: hidden;
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: transparent;
}
.product-thumb {
  height: 180px;
  background: linear-gradient(135deg, #f0f7ff, #e0f0ff);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--blue-300);
  position: relative;
  overflow: hidden;
}
.product-thumb svg { opacity: .6; }

/* Imagen real */
.product-thumb.thumb-img { background: #e8f0fb; }
.product-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.product-card:hover .product-thumb img { transform: scale(1.05); }

/* Fallback si la imagen falla */
.product-thumb.thumb-fallback {
  background: linear-gradient(135deg, #f0f7ff, #e0f0ff);
}

.product-thumb::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--blue-500), var(--teal));
  opacity: 0;
  transition: opacity var(--transition);
  z-index: 1;
}
.product-card:hover .product-thumb::after { opacity: 1; }
.product-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }
.product-body h4 {
  font-size: .97rem;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
  line-height: 1.3;
}
.product-body p {
  font-size: .84rem;
  color: var(--gray-600);
  line-height: 1.6;
  flex: 1;
}
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.product-tag {
  font-size: .72rem;
  background: rgba(242,101,34,.08);
  color: var(--blue-600);
  padding: 3px 9px;
  border-radius: 50px;
  font-weight: 500;
  text-transform: capitalize;
}
.product-action {
  padding: 14px 18px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  gap: 8px;
}
.product-action a {
  flex: 1;
  text-align: center;
  padding: 9px 10px;
  border-radius: 8px;
  font-size: .80rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all var(--transition);
}
.btn-cotizar {
  background: linear-gradient(135deg, var(--blue-500), var(--teal));
  color: var(--white) !important;
}
.btn-cotizar:hover { opacity: .9; transform: translateY(-1px); }
.btn-wa {
  background: #dcfce7;
  color: #15803d !important;
}
.btn-wa:hover { background: #bbf7d0; }

/* SEARCH RESULTS */
.search-results-header {
  margin-bottom: 20px;
  font-size: .95rem;
  color: var(--gray-600);
}
.search-results-header strong { color: var(--gray-900); }
.search-group-title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gray-400);
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
  display: flex;
  align-items: center;
  gap: 8px;
}
.no-results {
  text-align: center;
  padding: 80px 20px;
  color: var(--gray-400);
}
.no-results svg { opacity: .3; margin-bottom: 16px; }
.no-results p { font-size: 1.1rem; }

/* WA FLOAT */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 999;
  width: 56px; height: 56px;
  background: var(--green);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  box-shadow: 0 4px 20px rgba(37,211,102,.4);
  transition: all var(--transition);
}
.wa-float:hover { transform: scale(1.1); box-shadow: 0 8px 28px rgba(37,211,102,.5); }

/* RESPONSIVE */
@media (max-width: 900px) {
  .cat-main { grid-template-columns: 1fr; }
  .cat-sidebar { position: static; }
}
@media (max-width: 600px) {
  .overview-grid { grid-template-columns: 1fr 1fr; }
  .products-grid { grid-template-columns: 1fr; }
}
