/* ===== catalogo.css - Serasomovil Catalog Page (v2) ===== */

/* ===== NAVBAR OVERRIDE ===== */
.cat-navbar { position: sticky; top: 0; z-index: 100; }
.cat-navbar .nav-inner { padding: 10px 20px; }
.btn-back-home {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 8px;
  background: rgba(255,255,255,0.06); color: var(--text-muted);
  font-size: 13px; font-weight: 600; border: 1px solid var(--border);
  transition: all 0.2s; white-space: nowrap;
}
.btn-back-home:hover { background: var(--blue-lt); color: var(--cyan); }

/* ===== CATALOG HERO HEADER ===== */
.cat-hero {
  background: linear-gradient(135deg, rgba(0,212,200,0.07) 0%, rgba(99,102,241,0.05) 100%);
  border-bottom: 1px solid rgba(0,212,200,0.1);
  padding: 28px 20px 0;
}
.cat-hero-inner { max-width: 1360px; margin: 0 auto; }
.cat-hero-title {
  font-size: clamp(20px, 4vw, 28px); font-weight: 900; color: var(--text);
  margin-bottom: 4px; letter-spacing: -0.02em;
}
.cat-hero-title span { color: var(--cyan); }
.cat-hero-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }

/* Search bar full-width inside hero */
.cat-search-hero { position: relative; max-width: 560px; margin-bottom: -1px; }
.cat-search-hero input {
  width: 100%; padding: 14px 48px 14px 46px;
  border-radius: 14px 14px 0 0;
  border: 1.5px solid rgba(0,212,200,0.3); border-bottom: none;
  background: var(--bg-card); color: var(--text);
  font-size: 15px; font-family: 'Outfit', sans-serif; outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.cat-search-hero input:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(0,212,200,0.1); }
.cat-search-hero input::placeholder { color: var(--text-muted); }
.cat-search-hero .search-icon-left {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}

/* ===== CATEGORY STRIP (sticky tabs) ===== */
.cat-strip {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 70px; z-index: 90;
}
.cat-strip-inner {
  max-width: 1360px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-strip-inner::-webkit-scrollbar { display: none; }

.cat-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 14px 20px;
  border: none; border-bottom: 3px solid transparent;
  background: none; color: var(--text-muted);
  font-family: 'Outfit', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; white-space: nowrap; flex-shrink: 0;
}
.cat-tab:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.cat-tab.active { color: var(--cyan); border-bottom-color: var(--cyan); font-weight: 800; }
.cat-tab .tab-count {
  font-size: 11px; background: rgba(0,212,200,0.12); color: var(--cyan);
  padding: 2px 7px; border-radius: 20px; font-weight: 700;
}

/* ===== MAIN LAYOUT ===== */
.catalogo-wrap {
  display: grid; grid-template-columns: 240px 1fr; gap: 0;
  max-width: 1360px; margin: 0 auto;
  padding: 0 20px 80px; min-height: 60vh;
}

/* ===== SIDEBAR ===== */
.catalogo-sidebar {
  position: sticky; top: 120px;
  height: calc(100vh - 130px); overflow-y: auto;
  padding: 24px 16px 24px 0; scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  border-right: 1px solid rgba(255,255,255,0.04);
}
.catalogo-sidebar::-webkit-scrollbar { width: 3px; }
.catalogo-sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-filter-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.sidebar-filter-header h2 { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.clear-filters-btn {
  font-size: 11px; color: var(--cyan); background: rgba(0,212,200,0.08);
  border: 1px solid rgba(0,212,200,0.22); cursor: pointer; font-weight: 700;
  padding: 4px 10px; border-radius: 20px; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.clear-filters-btn:hover { background: rgba(0,212,200,0.18); }

.filter-group { margin-bottom: 24px; }
.filter-group-title {
  font-size: 10px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 10px;
}
.filter-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.filter-list-btn {
  width: 100%; text-align: left; padding: 9px 12px;
  background: transparent; border: none; cursor: pointer;
  color: var(--text-muted); font-size: 13.5px;
  font-family: 'Outfit', sans-serif; font-weight: 500;
  border-radius: 8px; transition: all 0.15s;
  display: flex; align-items: center; gap: 8px;
}
.filter-list-btn:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.filter-list-btn.active { background: rgba(0,212,200,0.1); color: var(--cyan); font-weight: 700; }
.filter-count {
  margin-left: auto; font-size: 11px; font-weight: 700;
  color: var(--text-muted); min-width: 18px; text-align: right;
}
.filter-list-btn.active .filter-count { color: var(--cyan); }

/* ===== MAIN CONTENT ===== */
.catalogo-main { padding: 24px 0 24px 28px; }
.catalogo-topbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px; gap: 12px; flex-wrap: wrap;
}
.breadcrumb { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.breadcrumb a { color: var(--cyan); }
.breadcrumb a:hover { text-decoration: underline; }

.filter-toggle-btn {
  display: none; align-items: center; gap: 8px;
  padding: 9px 18px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1.5px solid var(--border);
  color: var(--text-muted); font-size: 13.5px; font-weight: 700;
  cursor: pointer; transition: all 0.2s; font-family: 'Outfit', sans-serif;
}
.filter-toggle-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,200,0.06); }
.filter-active-count {
  background: var(--cyan); color: #0a0f1a; font-size: 11px; font-weight: 800;
  min-width: 18px; height: 18px; border-radius: 9px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== RESULTS BAR ===== */
.results-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 10px;
}
.results-count { font-size: 13px; color: var(--text-muted); }
.results-count strong { color: var(--text); font-size: 15px; }
.sort-wrap { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-muted); }
.sort-wrap select {
  background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
  padding: 6px 12px; border-radius: 8px; font-family: 'Outfit', sans-serif; font-size: 13px; cursor: pointer;
}

/* ===== ACTIVE FILTER CHIPS ===== */
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.filter-chip {
  display: flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 20px;
  background: rgba(0,212,200,0.08); border: 1px solid rgba(0,212,200,0.25);
  color: var(--cyan); font-size: 12px; font-weight: 600;
}
.filter-chip button { background: none; border: none; color: var(--cyan); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }

/* ===== NO RESULTS ===== */
.no-results { padding: 12px 0 50px; color: var(--text-muted); }
.search-correction-note {
  margin: 0 0 16px; padding: 11px 14px; border-radius: 10px;
  border: 1px solid rgba(0,212,200,0.24); background: rgba(0,212,200,0.07);
  color: var(--text-muted); font-size: 14px; line-height: 1.5;
}
.search-correction-note[hidden] { display: none; }
.search-correction-note strong { color: var(--cyan); }
.search-empty-card {
  max-width: 760px; margin: 18px auto 34px; padding: 34px 28px;
  text-align: center; border: 1px solid rgba(0,212,200,0.2); border-radius: 20px;
  background: linear-gradient(145deg, rgba(0,212,200,0.08), rgba(99,102,241,0.06));
  box-shadow: 0 18px 45px rgba(0,0,0,0.16);
}
.search-empty-card-generic { border-color: var(--border); background: var(--bg-card); }
.search-empty-badge {
  display: table; margin: 0 auto 16px; padding: 6px 12px; border-radius: 999px;
  background: rgba(245,158,11,0.12); border: 1px solid rgba(245,158,11,0.28);
  color: #fbbf24; font-size: 12px; font-weight: 800; letter-spacing: .03em;
  text-transform: uppercase;
}
.search-empty-icon { display: block; margin-bottom: 10px; font-size: 46px; line-height: 1; }
.search-empty-card h2, .search-empty-card h3 {
  margin: 0 0 10px; color: var(--text); font-size: clamp(21px, 4vw, 28px); line-height: 1.2;
}
.search-empty-card p { max-width: 610px; margin: 8px auto; font-size: 15px; line-height: 1.6; }
.search-empty-card p strong { color: var(--text); }
.search-correction-inline { color: var(--cyan); }
.search-empty-actions {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 10px; margin-top: 22px;
}
.search-advisor-btn { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.search-clear-btn {
  min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 10px;
  background: rgba(255,255,255,0.03); color: var(--text); cursor: pointer;
  font: 700 14px 'Outfit', sans-serif; transition: border-color .2s, color .2s, background .2s;
}
.search-clear-btn:hover { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,200,0.06); }
.search-suggestions { margin-top: 8px; }
.search-suggestions-heading { margin-bottom: 20px; text-align: left; }
.search-suggestions-heading > span {
  color: var(--cyan); font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
}
.search-suggestions-heading h3 { margin: 5px 0 5px; color: var(--text); font-size: clamp(20px, 3vw, 26px); }
.search-suggestions-heading p { margin: 0; font-size: 14px; }
.search-suggestions-grid { text-align: left; }

/* ===== COLLAPSIBLE GROUPS ===== */
.cat-group { margin-bottom: 24px; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: rgba(13,21,38,0.4); }
.cat-group-header {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 15px 20px;
  background: rgba(255,255,255,0.02); border: none; border-bottom: 1px solid transparent;
  cursor: pointer; font-family: 'Outfit', sans-serif; transition: background 0.2s;
}
.cat-group-header:hover { background: rgba(0,212,200,0.05); }
.cat-group-header[aria-expanded="true"] { border-bottom-color: var(--border); }
.cat-group-icon  { font-size: 17px; flex-shrink: 0; }
.cat-group-title { font-size: 15px; font-weight: 800; color: var(--text); flex: 1; text-align: left; letter-spacing: -0.01em; }
.cat-group-count { font-size: 11px; font-weight: 700; color: var(--cyan); background: rgba(0,212,200,0.1); border: 1px solid rgba(0,212,200,0.2); padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.cat-group-chevron { font-size: 13px; color: var(--text-muted); transition: transform 0.25s; flex-shrink: 0; }
.cat-group-body { transition: max-height 0.35s cubic-bezier(0.4,0,0.2,1); }
.cat-group-grid { padding: 18px; }

/* ===== PAGINATION ===== */
.pagination-wrap { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; padding: 28px 0 16px; }
.page-btn {
  padding: 8px 14px; border-radius: 9px; border: 1.5px solid var(--border);
  background: rgba(255,255,255,0.02); color: var(--text-muted);
  font-family: 'Outfit', sans-serif; font-size: 13.5px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; min-width: 38px; text-align: center;
}
.page-btn:hover:not(:disabled) { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,200,0.08); transform: translateY(-1px); }
.page-btn.active { background: linear-gradient(135deg,rgba(0,212,200,0.22),rgba(0,212,200,0.08)); border-color: var(--cyan); color: var(--cyan); font-weight: 800; box-shadow: 0 0 12px rgba(0,212,200,0.18); }
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.page-ellipsis { color: var(--text-muted); font-size: 14px; padding: 0 4px; }
.page-info { width: 100%; text-align: center; font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.65); z-index: 299; backdrop-filter: blur(2px); }
.sidebar-overlay.visible { display: block; }

/* ===== MOBILE BOTTOM SEARCH BAR ===== */
.mobile-filter-bar {
  display: none; position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--bg-card); border-top: 1px solid var(--border);
  padding: 10px 14px 14px; z-index: 95; gap: 10px; align-items: center;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.3);
}
.mobile-filter-bar .mfb-search { flex: 1; position: relative; }
.mobile-filter-bar .mfb-search input {
  width: 100%; padding: 11px 14px 11px 38px; border-radius: 10px;
  border: 1.5px solid var(--border); background: var(--bg); color: var(--text);
  font-size: 14px; font-family: 'Outfit', sans-serif; outline: none; box-sizing: border-box;
}
.mobile-filter-bar .mfb-search input:focus { border-color: var(--cyan); }
.mobile-filter-bar .mfb-search input::placeholder { color: var(--text-muted); }
.mobile-filter-bar .mfb-icon { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.mfb-filter-btn {
  display: flex; align-items: center; justify-content: center; flex-direction: column;
  gap: 3px; padding: 9px 14px; border-radius: 10px;
  background: rgba(255,255,255,0.04); border: 1.5px solid var(--border);
  color: var(--text-muted); cursor: pointer; font-family: 'Outfit', sans-serif;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  transition: all 0.2s; flex-shrink: 0; position: relative;
}
.mfb-filter-btn.has-filter { border-color: var(--cyan); color: var(--cyan); background: rgba(0,212,200,0.08); }
.mfb-badge {
  position: absolute; top: -6px; right: -6px;
  background: var(--cyan); color: #0a0f1a; font-size: 10px; font-weight: 800;
  min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  display: none; align-items: center; justify-content: center;
}
.mfb-badge.visible { display: flex; }

/* ===== RESPONSIVE: TABLET (max 900px) ===== */
@media (max-width: 900px) {
  .cat-hero { padding: 20px 16px 16px; }
  .cat-search-hero { display: none; }
  .cat-hero-sub { display: none; }
  .cat-hero-title { font-size: 20px; margin-bottom: 0; }

  .cat-strip { top: 62px; }
  .cat-strip-inner { padding: 0 12px; }
  .cat-tab { padding: 12px 14px; font-size: 13px; }

  .catalogo-wrap { grid-template-columns: 1fr; padding: 0 12px 90px; }

  /* Sidebar becomes bottom sheet */
  .catalogo-sidebar {
    position: fixed; top: auto; bottom: -100%; left: 0; right: 0;
    width: 100%; height: auto; max-height: 80vh;
    background: var(--bg-card); border-top: 1px solid var(--border);
    border-radius: 20px 20px 0 0; z-index: 300;
    padding: 0 20px 32px; overflow-y: auto;
    transition: bottom 0.38s cubic-bezier(0.4,0,0.2,1);
    box-shadow: 0 -16px 60px rgba(0,0,0,0.5);
  }
  .catalogo-sidebar.open { bottom: 0; }
  .catalogo-sidebar::before {
    content: ''; display: block;
    width: 40px; height: 4px; background: var(--border);
    border-radius: 4px; margin: 14px auto 18px;
  }

  .catalogo-main { padding: 16px 0 16px 0; }
  .filter-toggle-btn { display: flex; }
  .mobile-filter-bar { display: flex; }
}

/* ===== RESPONSIVE: MOBILE (max 600px) ===== */
@media (max-width: 600px) {
  .cat-hero { padding: 14px 12px 12px; }
  .cat-hero-title { font-size: 17px; }

  .cat-tab { padding: 11px 13px; font-size: 12.5px; gap: 5px; }
  .cat-tab .tab-count { display: none; }

  .catalogo-wrap { padding: 0 10px 90px; }
  .catalogo-main { padding: 14px 0; }

  .results-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .sort-wrap select { font-size: 12px; padding: 5px 10px; }

  .cat-group-header { padding: 12px 14px; }
  .cat-group-title  { font-size: 13.5px; }
  .cat-group-grid   { padding: 12px 10px; }

  .page-btn { padding: 7px 11px; font-size: 12px; }
  .catalogo-topbar { margin-bottom: 10px; }
  .breadcrumb { font-size: 12px; }
  .search-empty-card { margin: 8px auto 26px; padding: 26px 16px; border-radius: 16px; }
  .search-empty-card p { font-size: 14px; }
  .search-empty-actions { align-items: stretch; flex-direction: column; }
  .search-advisor-btn, .search-clear-btn { width: 100%; }
  .search-suggestions-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 420px) {
  .search-suggestions-grid { grid-template-columns: 1fr; }
}
