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

/* ---------- CATALOG HEADER ---------- */
.catalog-header {
  background: #0F172A;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.catalog-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.catalog-logo {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
  letter-spacing: -0.3px;
}

.catalog-nav {
  display: none;
  gap: 28px;
}

.catalog-nav a {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.2s ease;
}

.catalog-nav a:hover,
.catalog-nav a.active {
  color: #FFFFFF;
}

/* ---------- MOBILE FILTER TOGGLE ---------- */
.filter-toggle-btn {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

.filter-toggle-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #FFFFFF;
  border-radius: 2px;
  transition: transform 0.2s ease;
}

/* ---------- CATALOG LAYOUT ---------- */
.catalog {
  padding: 32px 0 80px;
  background: #F8FAFC;
  min-height: 100vh;
}

.catalog-layout {
  display: flex;
  gap: 32px;
  align-items: flex-start;
}

/* ---------- SIDEBAR ---------- */
.catalog-sidebar {
  display: none;
  flex-direction: column;
  gap: 24px;
  width: 100%;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

.catalog-sidebar.is-open {
  display: flex;
}

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #0F172A;
}

.filter-reset {
  font-family: 'Inter', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  color: #6366F1;
  background: none;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.filter-reset:hover {
  opacity: 0.7;
}

/* ---------- FILTER GROUPS ---------- */
.filter-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 20px;
  border-bottom: 1px solid #F1F5F9;
}

.filter-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-group-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 2px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: #475569;
  cursor: pointer;
  transition: color 0.2s ease;
}

.filter-checkbox:hover {
  color: #0F172A;
}

.filter-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 1.5px solid #CBD5E1;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  position: relative;
}

.filter-checkbox input[type="checkbox"]:checked {
  background: #6366F1;
  border-color: #6366F1;
}

.filter-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------- CATALOG CONTENT ---------- */
.catalog-content {
  flex: 1;
  min-width: 0;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.catalog-results {
  font-size: 0.9rem;
  color: #64748B;
}

.catalog-results strong {
  color: #0F172A;
}

.catalog-sort {
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
  padding: 10px 16px;
  border: 1px solid #E2E8F0;
  border-radius: 10px;
  background: #FFFFFF;
  color: #0F172A;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s ease;
}

.catalog-sort:focus {
  border-color: #6366F1;
}

/* ---------- CATALOG GRID ---------- */
.catalog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

/* ---------- PRODUCT BADGE ---------- */
.product-card {
  position: relative;
}

.product-badge {
  position: absolute;
  top: 16px;
  right: 16px;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-out {
  background: #FEE2E2;
  color: #991B1B;
}

/* ---------- EMPTY STATE ---------- */
.catalog-empty {
  text-align: center;
  padding: 60px 20px;
}

.catalog-empty p {
  font-size: 1rem;
  color: #64748B;
  margin-bottom: 20px;
}

/* ---------- PRODUCT CARD HIDDEN STATE ---------- */
.product-card.is-hidden {
  display: none;
}

/* ---------- CTA (index page) ---------- */
.products-cta {
  text-align: center;
  margin-top: 40px;
}

/* ==========================================
   RESPONSIVE — TABLET (≥ 600px)
   ========================================== */
@media (min-width: 600px) {
  .catalog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================
   RESPONSIVE — DESKTOP (≥ 960px)
   ========================================== */
@media (min-width: 960px) {
  .catalog-nav {
    display: flex;
  }

  .filter-toggle-btn {
    display: none;
  }

  .catalog-sidebar {
    display: flex;
    position: sticky;
    top: 80px;
    width: 260px;
    min-width: 260px;
    height: fit-content;
    z-index: auto;
  }

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