/* =============================================
   LOJA — CSS Principal
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
  --azul:       #1a2b4a;
  --azul-hover: #223561;
  --accent:     #2563eb;
  --accent-lt:  #dbeafe;
  --verde:      #16a34a;
  --verde-lt:   #dcfce7;
  --laranja:    #ea580c;
  --laranja-lt: #fff7ed;
  --vermelho:   #dc2626;
  --cinza-bg:   #f8f9fb;
  --cinza-borda:#e2e8f0;
  --cinza-txt:  #64748b;
  --preto:      #0f172a;
  --branco:     #ffffff;
  --radius:     12px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.13);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--cinza-bg);
  color: var(--preto);
  font-size: 15px;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }

img { max-width: 100%; display: block; }

/* ── HEADER ── */
.header {
  background: var(--azul);
  color: var(--branco);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-logo {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.header-logo span { color: #60a5fa; }

.header-actions { display: flex; gap: 12px; align-items: center; }

.btn-carrinho {
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.2);
  color: var(--branco);
  padding: 8px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background .2s;
}

.btn-carrinho:hover { background: rgba(255,255,255,.2); }

.carrinho-badge {
  background: var(--laranja);
  color: #fff;
  border-radius: 50%;
  width: 20px; height: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
}

/* ── BANNER ── */
.banner {
  background: linear-gradient(135deg, var(--azul) 0%, #2563eb 100%);
  color: var(--branco);
  padding: 28px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.banner-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  background: rgba(255,255,255,.15);
  padding: 4px 10px;
  border-radius: 20px;
  display: inline-block;
  margin-bottom: 8px;
}

.banner h1 { font-size: 26px; font-weight: 800; margin-bottom: 4px; }
.banner p  { font-size: 14px; opacity: .8; }
.banner-arrow { font-size: 28px; opacity: .6; cursor: pointer; }

/* ── LAYOUT PRINCIPAL ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

.layout-catalogo {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  padding: 28px 20px;
  max-width: 1280px;
  margin: 0 auto;
}

/* ── SIDEBAR FILTROS ── */
.sidebar {
  background: var(--branco);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--cinza-txt);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.busca-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--cinza-borda);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 20px;
  transition: border-color .2s;
}

.busca-input:focus {
  outline: none;
  border-color: var(--accent);
}

.filtro-lista { list-style: none; }

.filtro-lista li {
  margin-bottom: 6px;
}

.filtro-lista label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s;
}

.filtro-lista label:hover { background: var(--cinza-bg); }

.filtro-lista input[type=checkbox] {
  accent-color: var(--accent);
  width: 15px; height: 15px;
}

.filtro-marca select {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--cinza-borda);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--branco);
  cursor: pointer;
}

/* ── GRID PRODUTOS ── */
.secao-titulo {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--preto);
}

.grid-produtos {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

/* ── CARD PRODUTO ── */
.card {
  background: var(--branco);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s;
  position: relative;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.card-badges {
  position: absolute;
  top: 10px; left: 10px;
  display: flex; gap: 4px;
  flex-wrap: wrap;
}

.badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

.badge-oferta    { background: #ef4444; color: #fff; }
.badge-lancamento{ background: #3b82f6; color: #fff; }
.badge-desconto  { background: #f59e0b; color: #fff; }

.card-img {
  width: 100%;
  height: 180px;
  object-fit: contain;
  padding: 16px;
  background: #f8f9fb;
}

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

.card-categoria {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 4px;
}

.card-desconto-tag {
  display: inline-block;
  background: var(--verde-lt);
  color: var(--verde);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  margin-bottom: 6px;
}

.card-nome {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: 8px;
  flex: 1;
}

.card-preco {
  font-size: 20px;
  font-weight: 800;
  color: var(--preto);
  margin-bottom: 12px;
}

.card-acoes { display: flex; flex-direction: column; gap: 8px; }

.btn { 
  padding: 10px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.btn-primary {
  background: var(--azul);
  color: var(--branco);
}

.btn-primary:hover { background: var(--azul-hover); }

.btn-outline {
  background: transparent;
  color: var(--azul);
  border: 1.5px solid var(--cinza-borda);
}

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

.btn-green {
  background: var(--verde);
  color: var(--branco);
}

.btn-green:hover { background: #15803d; }

.btn-laranja {
  background: var(--laranja);
  color: var(--branco);
}

.btn-laranja:hover { background: #c2410c; }

.btn-full { width: 100%; }

/* ── DRAWER CARRINHO ── */
.drawer-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
}

.drawer-overlay.ativo { opacity: 1; pointer-events: all; }

.drawer {
  position: fixed;
  top: 0; right: 0;
  width: 380px; max-width: 100vw;
  height: 100vh;
  background: var(--branco);
  z-index: 201;
  transform: translateX(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,.15);
}

.drawer.ativo { transform: translateX(0); }

.drawer-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--cinza-borda);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-header h2 { font-size: 18px; font-weight: 700; }

.drawer-fechar {
  background: var(--cinza-bg);
  border: none;
  cursor: pointer;
  width: 32px; height: 32px;
  border-radius: 50%;
  font-size: 18px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}

.drawer-fechar:hover { background: var(--cinza-borda); }

.drawer-itens { flex: 1; overflow-y: auto; padding: 16px 20px; }

.drawer-vazio {
  text-align: center;
  padding: 48px 20px;
  color: var(--cinza-txt);
}

.drawer-vazio .icon { font-size: 48px; margin-bottom: 12px; }

.item-carrinho {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 12px 0;
  border-bottom: 1px solid var(--cinza-bg);
}

.item-carrinho img {
  width: 64px; height: 64px;
  object-fit: contain;
  background: var(--cinza-bg);
  border-radius: 8px;
  padding: 6px;
}

.item-info { flex: 1; }

.item-nome { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.item-preco { font-size: 14px; font-weight: 700; color: var(--accent); }

.item-controle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.item-controle button {
  background: var(--cinza-bg);
  border: 1px solid var(--cinza-borda);
  width: 28px; height: 28px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: background .2s;
}

.item-controle button:hover { background: var(--cinza-borda); }
.item-qtd { font-weight: 600; font-size: 14px; min-width: 20px; text-align: center; }

.item-remover {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--cinza-txt);
  font-size: 18px;
  padding: 4px;
  transition: color .2s;
}

.item-remover:hover { color: var(--vermelho); }

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--cinza-borda);
}

.subtotal-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

/* ── TOAST ── */
.toast {
  position: fixed;
  top: 80px; left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--verde);
  color: #fff;
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 14px;
  font-weight: 600;
  z-index: 300;
  opacity: 0;
  transition: all .3s;
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── RESPONSIVO ── */
@media (max-width: 768px) {
  .layout-catalogo {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .sidebar {
    position: static;
  }

  .banner h1 { font-size: 20px; }

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

  .drawer { width: 100vw; }
}

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