/* catalogo.css - Layout premium do Catálogo de Produtos Cardepel */

/* ================================================================
   LAYOUT PRINCIPAL (sidebar + grid)
   ================================================================ */
.catalogo-wrapper {
  background: #f7f9fd;
  padding: 40px 0 60px 0;
}

.catalogo-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 28px;
  align-items: start;
  min-width: 0;
}

.catalogo-main {
  min-width: 0;
}

/* ================================================================
   TOP BAR (título, contagem, ordenar)
   ================================================================ */
.catalogo-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
}

.catalogo-heading {
  margin: 0;
  color: #0B1533;
  font-weight: 800;
  font-size: 1.85rem;
  letter-spacing: -0.5px;
}

.catalogo-count {
  color: #5f6b7a;
  font-size: 0.95rem;
  font-weight: 500;
}

.catalogo-search-input {
  border: 1.5px solid #e0e5f0;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #0B1533;
  background: #fff;
  outline: none;
  width: 220px;
  transition: border-color .18s;
}

.catalogo-search-input:focus {
  border-color: #0235BB;
  box-shadow: 0 0 0 3px rgba(2,53,187,.08);
}

.catalogo-sort {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.catalogo-sort label {
  color: #5f6b7a;
  font-size: 0.95rem;
  font-weight: 600;
  white-space: nowrap;
}

.catalogo-sort select {
  border: 1.5px solid #e0e5f0;
  border-radius: 12px;
  padding: 10px 36px 10px 14px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0B1533;
  background: #fff;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230235BB' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color .18s;
  outline: none;
}

.catalogo-sort select:focus {
  border-color: #0235BB;
  box-shadow: 0 0 0 3px rgba(2,53,187,.08);
}

/* ================================================================
   FILTER SIDEBAR
   ================================================================ */
.catalogo-sidebar {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #ecf0fb;
  box-shadow: 0 4px 24px rgba(9,24,61,.04);
  padding: 24px;
  position: sticky;
  top: 90px;
}

.catalogo-sidebar-title {
  color: #0B1533;
  font-weight: 800;
  font-size: 1.15rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.catalogo-sidebar-title svg {
  width: 20px;
  height: 20px;
  color: #0235BB;
}

.catalogo-filter-group {
  margin-bottom: 22px;
}

.catalogo-filter-label {
  color: #5f6b7a;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}

.catalogo-filter-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
  font-size: 0.98rem;
  font-weight: 500;
  color: #0B1533;
}

.catalogo-filter-item:hover {
  background: #f6f8fc;
}

.catalogo-filter-item.active {
  background: rgba(2,53,187,.06);
  color: #0235BB;
  font-weight: 700;
}

.catalogo-filter-check {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  border: 2px solid #d0d7e8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .18s;
}

.catalogo-filter-item.active .catalogo-filter-check {
  background: #0235BB;
  border-color: #0235BB;
}

.catalogo-filter-check svg {
  width: 12px;
  height: 12px;
  color: #fff;
  opacity: 0;
  transition: opacity .18s;
}

.catalogo-filter-item.active .catalogo-filter-check svg {
  opacity: 1;
}

.catalogo-filter-count {
  margin-left: auto;
  font-size: 0.82rem;
  color: #98a2b8;
  font-weight: 600;
}

.catalogo-sidebar-reset {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: none;
  color: #5f6b7a;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  transition: color .18s;
}

.catalogo-sidebar-reset:hover {
  color: #0235BB;
}

.catalogo-sidebar-reset svg {
  width: 16px;
  height: 16px;
}

/* ================================================================
   SIDEBAR OVERLAY (only on mobile offcanvas)
   ================================================================ */
.catalogo-sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 1099;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s ease;
}

.catalogo-sidebar-overlay.show {
  display: block;
  opacity: 1;
  pointer-events: auto;
}

/* ================================================================
   FILTER TOGGLE (mobile / tablet)
   ================================================================ */
.catalogo-filter-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1.5px solid #e0e5f0;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 0.95rem;
  font-weight: 700;
  color: #0235BB;
  cursor: pointer;
  transition: all .18s;
}

.catalogo-filter-toggle:hover {
  border-color: #0235BB;
  background: rgba(2,53,187,.03);
}

.catalogo-filter-toggle svg {
  width: 18px;
  height: 18px;
}

.catalogo-filter-toggle .filter-count {
  background: #0235BB;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 800;
}

/* ================================================================
   ACTIVE FILTER CHIPS
   ================================================================ */
.catalogo-active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.catalogo-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(2,53,187,.08);
  color: #0235BB;
  border-radius: 999px;
  padding: 6px 12px 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .18s;
}

.catalogo-chip:hover {
  background: rgba(2,53,187,.16);
}

.catalogo-chip svg {
  width: 14px;
  height: 14px;
  stroke-width: 2.5;
}

/* ================================================================
   PRODUCT GRID
   ================================================================ */
.catalogo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

/* ================================================================
   PRODUCT CARD (catálogo)
   ================================================================ */
.catalogo-card {
  background: #fff;
  border: 1px solid #ecf0fb;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(9,24,61,.04);
  transition: transform .22s ease, box-shadow .22s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.catalogo-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(9,24,61,.10);
}

.catalogo-card-img {
  position: relative;
  background: linear-gradient(135deg, #f6f8fc 0%, #eef2fd 100%);
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  cursor: pointer;
}

.catalogo-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
  transition: transform .25s ease;
}

.catalogo-card:hover .catalogo-card-img img {
  transform: scale(1.04);
}

.catalogo-card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #0235BB;
  color: #fff;
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  box-shadow: 0 4px 12px rgba(2,53,187,.22);
}

.catalogo-card-body {
  padding: 16px 16px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalogo-card-category {
  font-size: 11px;
  font-weight: 800;
  color: #2d62de;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.catalogo-card-name {
  color: #0B1533;
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.25;
  margin-bottom: 6px;
}

.catalogo-card-desc {
  color: #5f6b7a;
  font-size: 0.9rem;
  line-height: 1.45;
  margin-bottom: 14px;
  flex: 1;
}

.catalogo-card-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: transparent;
  border: 2px solid #2d62de;
  color: #2d62de;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.93rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s;
  margin-top: auto;
}

.catalogo-card-btn:hover {
  background: #2d62de;
  color: #fff;
}

.catalogo-card-btn svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.2;
}

.catalogo-card-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: auto;
}

.catalogo-card-btn-outline {
  background: transparent;
  border: 2px solid #e0e5f0;
  color: #5f6b7a;
}

.catalogo-card-btn-outline:hover {
  background: #f6f8fc;
  border-color: #0235BB;
  color: #0235BB;
}

/* ================================================================
   PAGINATION
   ================================================================ */
.catalogo-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 36px;
}

.catalogo-pagination .page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1.5px solid #e0e5f0;
  background: #fff;
  color: #0B1533;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: all .18s;
  padding: 0 12px;
}

.catalogo-pagination .page-btn:hover {
  border-color: #0235BB;
  color: #0235BB;
  background: rgba(2,53,187,.03);
}

.catalogo-pagination .page-btn.active {
  background: #0235BB;
  color: #fff;
  border-color: #0235BB;
  box-shadow: 0 4px 14px rgba(2,53,187,.25);
}

.catalogo-pagination .page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
  cursor: default;
}

/* ================================================================
   EMPTY STATE
   ================================================================ */
.catalogo-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
}

.catalogo-empty svg {
  width: 64px;
  height: 64px;
  color: #c8d4e8;
  margin-bottom: 16px;
}

.catalogo-empty h3 {
  color: #5f6b7a;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.catalogo-empty p {
  color: #98a2b8;
  font-size: 0.95rem;
}

/* ================================================================
   LOADING OVERLAY
   ================================================================ */
.catalogo-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(247,249,253,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  border-radius: 12px;
}

.catalogo-loading-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.catalogo-loading-overlay span {
  color: #0235BB;
  font-weight: 700;
  font-size: 0.95rem;
}

.catalogo-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #e0e5f0;
  border-top-color: #0235BB;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ================================================================
   RESPONSIVE
   ================================================================ */

/* Tablet (<=1199px) - grid 3 colunas */
@media (max-width: 1199px) {
  .catalogo-layout {
    grid-template-columns: 240px 1fr;
    gap: 22px;
  }

  .catalogo-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Tablet pequeno (<=991px) - grid 2 colunas */
@media (max-width: 991px) {
  .catalogo-layout {
    grid-template-columns: 220px 1fr;
    gap: 18px;
  }

  .catalogo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalogo-sidebar {
    position: sticky;
    top: 80px;
  }
}

/* Mobile (<=767px) - sidebar vira offcanvas */
@media (max-width: 767px) {
  .catalogo-layout {
    grid-template-columns: 1fr;
  }

  .catalogo-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 300px;
    height: 100vh;
    z-index: 1100;
    border-radius: 0;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
  }

  .catalogo-sidebar.open {
    transform: translateX(0);
    box-shadow: 4px 0 32px rgba(0,0,0,.15);
  }

  .catalogo-filter-toggle {
    display: inline-flex;
  }

  .catalogo-search-input {
    width: 100%;
  }

  .catalogo-topbar {
    flex-wrap: wrap;
  }

  .catalogo-heading {
    font-size: 1.5rem;
    width: 100%;
  }

  .catalogo-sort {
    margin-left: 0;
  }

  .catalogo-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .catalogo-card-img {
    height: 160px;
  }

  .catalogo-card-body {
    padding: 12px 12px 14px;
  }

  .catalogo-card-name {
    font-size: 0.95rem;
  }

  .catalogo-card-desc {
    font-size: 0.84rem;
  }

  .catalogo-card-btn {
    font-size: 0.88rem;
    padding: 8px 10px;
  }
}

/* Mobile pequeno (<=480px) - grid 1 coluna */
@media (max-width: 480px) {
  .catalogo-wrapper {
    padding: 24px 0 40px 0;
  }

  .catalogo-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .catalogo-card-img {
    height: 220px;
  }

  .catalogo-sidebar {
    width: 85vw;
    max-width: 300px;
  }

  .catalogo-pagination .page-btn {
    min-width: 36px;
    height: 36px;
    font-size: 0.88rem;
  }
}
