/* ============================================
   RL MARKET 2.0 - SIDEBAR DE FILTROS
   Lateral fixa em desktop, drawer em mobile
   ============================================ */

.rl-layout-with-sidebar {
  max-width: 1500px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  align-items: start;
}

/* ===== TRIGGER MOBILE ===== */
.rl-filter-trigger {
  display: none;
  position: relative;
  align-items: center;
  gap: 8px;
  padding: 0.75rem 1.25rem;
  background: var(--primary-blue, #1E40AF);
  color: #fff;
  border: none;
  border-radius: 50px;
  font-weight: 700;
  font-size: 0.9375rem;
  box-shadow: 0 6px 18px rgba(30, 64, 175, .25);
  cursor: pointer;
}

.rl-filter-badge {
  background: #FBBF24;
  color: #1E3A8A;
  font-size: 0.6875rem;
  font-weight: 900;
  padding: 2px 7px;
  border-radius: 20px;
  margin-left: 4px;
}

/* ===== SIDEBAR ===== */
.rl-sidebar {
  position: sticky;
  top: 190px;
  background: #fff;
  border-radius: 16px;
  border: 1px solid #E2E8F0;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  padding: 1.5rem 1.25rem;
  max-height: calc(100vh - 210px);
  overflow-y: auto;
}

.rl-sidebar::-webkit-scrollbar { width: 6px; }
.rl-sidebar::-webkit-scrollbar-thumb { background: #CBD5E1; border-radius: 4px; }

.rl-sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #F1F5F9;
}

.rl-sidebar-header h3 {
  font-size: 1.125rem;
  font-weight: 800;
  color: #0F172A;
  display: flex;
  align-items: center;
  gap: 8px;
}

.rl-sidebar-header h3 i { color: #1E40AF; }

.rl-sidebar-close {
  display: none;
  background: transparent;
  border: none;
  font-size: 1.25rem;
  color: #64748B;
  cursor: pointer;
}

/* ===== BLOCO ===== */
.rl-filter-block {
  margin-bottom: 1.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px dashed #E2E8F0;
}

.rl-filter-block:last-of-type { border-bottom: none; }

.rl-filter-block h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  color: #475569;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.rl-filter-block h4 i { color: #1E40AF; font-size: 0.875rem; }

/* ===== CATEGORIAS ===== */
.rl-cat-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 280px;
  overflow-y: auto;
}

.rl-cat-list li { margin: 0; }

.rl-cat-list a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  color: #475569;
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 6px;
  transition: background .2s, color .2s;
}

.rl-cat-list a:hover { background: #EFF6FF; color: #1E40AF; }

.rl-cat-list a.active {
  background: #1E40AF;
  color: #fff;
  font-weight: 700;
}

.rl-cat-list a.active .rl-cat-count { background: #FBBF24; color: #1E3A8A; }

.rl-cat-list a i { margin-right: 6px; }

.rl-cat-count {
  background: #F1F5F9;
  color: #64748B;
  font-size: 0.6875rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
}

/* ===== PREÇO ===== */
.rl-price-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 8px;
  align-items: center;
}

.rl-price-range input {
  width: 100%;
  padding: 0.6rem 0.7rem;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 0.875rem;
  outline: none;
  transition: border .2s;
}

.rl-price-range input:focus { border-color: #1E40AF; }

.rl-price-range span { font-size: 0.75rem; color: #94A3B8; }

.rl-price-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 0.75rem;
}

.rl-chip {
  padding: 6px 10px;
  background: #F1F5F9;
  border: 1px solid #E2E8F0;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
  transition: all .2s;
}

.rl-chip:hover { background: #1E40AF; color: #fff; border-color: #1E40AF; }

/* ===== RADIO/CHECK ===== */
.rl-radio-group { display: flex; flex-direction: column; gap: 6px; }

.rl-radio, .rl-check {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  font-size: 0.875rem;
  color: #475569;
  cursor: pointer;
  border-radius: 6px;
  transition: background .2s;
}

.rl-radio:hover, .rl-check:hover { background: #F8FAFC; }

.rl-radio input, .rl-check input { accent-color: #1E40AF; cursor: pointer; }

.rl-radio-ml input:checked ~ span { color: #003087; font-weight: 700; }
.rl-radio-shopee input:checked ~ span { color: #EE4D2D; font-weight: 700; }

/* ===== SELECT ===== */
.rl-select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 2px solid #E2E8F0;
  border-radius: 8px;
  font-size: 0.875rem;
  color: #334155;
  background: #fff;
  cursor: pointer;
  outline: none;
}

.rl-select:focus { border-color: #1E40AF; }

/* ===== AÇÕES ===== */
.rl-filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 1rem;
}

.rl-btn-apply, .rl-btn-clear {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 8px;
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all .2s;
}

.rl-btn-apply {
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  box-shadow: 0 4px 14px rgba(16, 185, 129, .3);
}

.rl-btn-apply:hover { transform: translateY(-2px); box-shadow: 0 6px 18px rgba(16, 185, 129, .4); }

.rl-btn-clear {
  background: #F1F5F9;
  color: #475569;
  border: 2px solid #E2E8F0;
}

.rl-btn-clear:hover { background: #E2E8F0; }

/* ===== CONTEÚDO ===== */
.rl-content { min-width: 0; }

.rl-content-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid #E2E8F0;
}

.rl-page-title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 4px;
}

.rl-page-sub { color: #64748B; font-size: 0.9375rem; }
.rl-page-sub strong { color: #1E40AF; }

/* ===== PLATFORM BADGE NO CARD ===== */
.rl-platform-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 4px 10px;
  font-size: 0.6875rem;
  font-weight: 800;
  border-radius: 4px;
  z-index: 12;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.rl-platform-badge i { font-size: 0.625rem; }

/* ===== FAV BTN ===== */
.rl-fav-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  background: rgba(255,255,255,0.95);
  border: none;
  border-radius: 50%;
  color: #94A3B8;
  cursor: pointer;
  z-index: 12;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
  transition: all .2s;
}

.rl-fav-btn:hover { transform: scale(1.1); color: #EF4444; }

.rl-fav-btn.active { color: #EF4444; }

.rl-fav-btn.active i::before { content: "\f004"; font-weight: 900; }

/* ===== FAVORITOS PAGE ===== */
.rl-favorites-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.rl-fav-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  margin-bottom: 2rem;
}

.rl-fav-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: #0F172A;
}

.rl-fav-header h1 i { color: #EF4444; }

.rl-btn-clear-favs {
  background: transparent;
  border: 2px solid #E2E8F0;
  color: #94A3B8;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  margin-top: 0.5rem;
}

.rl-btn-clear-favs:hover { background: #FEE2E2; color: #EF4444; border-color: #FEE2E2; }

.rl-fav-loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  font-size: 1.125rem;
  color: #94A3B8;
}

/* ===== RESPONSIVO ===== */
@media (max-width: 900px) {
  .rl-layout-with-sidebar { grid-template-columns: 1fr; }
  .rl-filter-trigger { display: inline-flex; }

  .rl-sidebar {
    position: fixed;
    top: 0; right: 0;
    width: 320px;
    max-width: 90%;
    height: 100vh;
    max-height: 100vh;
    z-index: 2500;
    border-radius: 0;
    transform: translateX(100%);
    transition: transform .3s ease;
  }

  .rl-sidebar.open { transform: translateX(0); }
  .rl-sidebar-close { display: block; }

  body.sidebar-open { overflow: hidden; }
  body.sidebar-open::after {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 2400;
  }
}
