/* ── Loja ── */

.loja-main {
  padding-top: 70px;
  min-height: 100vh;
  background: var(--cinza-bg);
}

/* ── Layout desktop: sidebar + conteúdo ── */
.loja-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1.25rem;
  gap: 1.5rem;
}

/* ── Sidebar de filtros (desktop) ── */
.filtros-sidebar {
  display: none;
  width: 220px;
  flex-shrink: 0;
  padding-top: 1.25rem;
  position: sticky;
  top: 134px;
}

.filtros-titulo {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--texto-escuro);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filtro-grupo {
  border-bottom: 1px solid #E5E7EB;
}

.filtro-header {
  width: 100%;
  background: none;
  border: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 0;
  font-family: 'Poppins', sans-serif;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--texto-escuro);
  cursor: pointer;
  text-align: left;
}

.filtro-arrow {
  font-size: 1rem;
  transition: transform 0.25s;
  line-height: 1;
}

.filtro-header[aria-expanded="true"] .filtro-arrow {
  transform: rotate(180deg);
}

.filtro-opcoes {
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding-bottom: 0.75rem;
}

.filtro-opcoes.aberto {
  display: flex;
}

.filtro-opcoes label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--texto-suave);
  cursor: pointer;
}

.filtro-opcoes input[type="checkbox"] {
  accent-color: var(--verde);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.btn-filtrar-sidebar {
  width: 100%;
  margin-top: 1.25rem;
  background: var(--verde);
  color: var(--branco);
  border: none;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtrar-sidebar:hover { background: var(--verde-hover); }

.btn-redefinir-sidebar {
  width: 100%;
  margin-top: 0.5rem;
  background: none;
  border: none;
  color: var(--texto-suave);
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  padding: 0.25rem 0;
  transition: color 0.2s;
}

.btn-redefinir-sidebar:hover { color: var(--texto-escuro); }

/* ── Conteúdo principal ── */
.loja-content {
  flex: 1;
  min-width: 0;
}

/* ── Barra de categorias ── */
.categorias-wrap {
  background: var(--branco);
  border-bottom: 1px solid #E5E7EB;
  position: sticky;
  top: 70px;
  z-index: 50;
}

.categorias-scroll {
  display: flex;
  gap: 0.25rem;
  padding: 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.categorias-scroll::-webkit-scrollbar {
  display: none;
}

.categoria-btn {
  background: none;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--texto-suave);
  padding: 1rem 1rem;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.categoria-btn:hover { color: var(--verde); }
.categoria-btn.active {
  color: var(--verde);
  border-bottom-color: var(--verde);
}

/* ── Barra de pesquisa ── */
.pesquisa-wrap {
  padding: 1.25rem 0 0;
}

.pesquisa-box {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  background: var(--branco);
  border: 1.5px solid #E5E7EB;
  border-radius: 10px;
  padding: 0 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.pesquisa-box:focus-within {
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

.pesquisa-lupa {
  color: #9CA3AF;
  flex-shrink: 0;
}

.pesquisa-input {
  flex: 1;
  border: none;
  outline: none;
  background: none;
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  color: var(--texto-escuro);
  padding: 0.8rem 0;
}

.pesquisa-input::placeholder {
  color: #9CA3AF;
}

/* ── Grid de produtos ── */
.produtos-wrap {
  padding: 1.25rem 0 2rem;
}

.produtos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ── Card de produto ── */
.produto-card {
  background: var(--branco);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,0.07);
  transition: transform 0.2s, box-shadow 0.2s;
}

.produto-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.1);
}

.produto-img-wrap { position: relative; }

.produto-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  display: block;
}

.placeholder-img { aspect-ratio: 3/4; }

.produto-info {
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.produto-nome {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--texto-escuro);
  line-height: 1.35;
}

.produto-preco {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.preco-antigo {
  font-size: 0.75rem;
  color: #9CA3AF;
  text-decoration: line-through;
}

.preco-atual {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--verde);
}

.btn-ver-detalhes {
  display: block;
  text-align: center;
  background: var(--texto-escuro);
  color: var(--branco);
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.55rem;
  border-radius: 7px;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 0.25rem;
}

.btn-ver-detalhes:hover { background: var(--verde); }

/* ── Botão flutuante filtros (mobile) ── */
.filtros-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.25rem;
  z-index: 90;
  background: var(--texto-escuro);
  color: var(--branco);
  border: none;
  border-radius: 999px;
  padding: 0.9rem 1.5rem;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,0.3);
  transition: background 0.2s;
}

.filtros-fab:hover { background: var(--verde); }

/* ── Drawer de filtros (mobile) ── */
.filtros-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.filtros-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.filtros-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 90vw;
  height: 100%;
  background: var(--branco);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.4, 0, 0.2, 1);
}

.filtros-drawer.active { transform: translateX(0); }

.filtros-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #E5E7EB;
  font-weight: 700;
  font-size: 1rem;
  color: var(--texto-escuro);
}

.filtros-drawer-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  color: var(--texto-suave);
  cursor: pointer;
  line-height: 1;
}

.filtros-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 1.25rem;
}

.filtros-drawer-footer {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid #E5E7EB;
}

.filtros-drawer-acoes {
  display: flex;
  gap: 0.75rem;
}

.btn-redefinir-drawer {
  background: none;
  border: none;
  color: var(--texto-suave);
  font-family: 'Poppins', sans-serif;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: underline;
  cursor: pointer;
  text-align: center;
  padding: 0;
  transition: color 0.2s;
}

.btn-redefinir-drawer:hover { color: var(--texto-escuro); }

.btn-filtro-cancelar {
  flex: 1;
  background: none;
  border: 1px solid #D1D5DB;
  color: var(--texto-escuro);
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtro-cancelar:hover { background: var(--cinza-bg); }

.btn-filtro-aplicar {
  flex: 1;
  background: var(--verde);
  border: none;
  color: var(--branco);
  font-family: 'Poppins', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.7rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-filtro-aplicar:hover { background: var(--verde-hover); }

/* ── Estado vazio / carregando ── */
.produtos-vazio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--texto-suave);
  font-size: 0.9rem;
}

/* ── Desktop ── */
@media (min-width: 768px) {
  .filtros-sidebar { display: block; }
  .filtros-fab { display: none; }

  .loja-layout { padding: 0 1.5rem; }

  .produtos-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
  }
}

@media (min-width: 1024px) {
  .produtos-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
