/* Search */
.search{position:relative}
.search__input{
  width:100%;
  padding:12px 42px 12px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline:none;
}
.search__input:focus{
  border-color: rgba(255,179,0,0.45);
  box-shadow: 0 0 0 4px rgba(255,179,0,0.12);
}
.search__clear{
  position:absolute;
  right:8px;
  top:50%;
  transform:translateY(-50%);
  border:none;
  background:transparent;
  color: var(--muted);
  cursor:pointer;
  padding:8px;
  border-radius:999px;
}
.search__clear:hover{color:var(--text); background: rgba(255,255,255,0.06)}

/* Buttons */
.btn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .06s ease, background .15s ease, border-color .15s ease;
}
.btn:hover{background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.16)}
.btn:active{transform: translateY(1px)}
.btn--primary{
  border:none;
  background: linear-gradient(135deg, var(--brand), var(--brand2));
  color:#1a1406;
  font-weight:800;
}
.btn--ghost{background: rgba(255,255,255,0.03)}
.btn--block{width:100%; justify-content:center}

.iconbtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.05);
  color: var(--text);
  width:40px;
  height:40px;
  border-radius: 12px;
  cursor:pointer;
}
.iconbtn:hover{background: rgba(255,255,255,0.08)}

.actions{display:flex; gap:10px; align-items:center}
.pill{
  margin-left:8px;
  background: rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.14);
  padding: 3px 8px;
  border-radius: 999px;
  font-size:12px;
  font-weight:800;
}

/* Chips */
.chip{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding:10px 12px;
  border-radius: 999px;
  cursor:pointer;
  white-space:nowrap;
}
.chip:hover{background: rgba(255,255,255,0.08)}
.chip--active{
  border-color: rgba(255,179,0,0.45);
  background: rgba(255,179,0,0.12);
}

/* Hero */
.hero__card{
  background: linear-gradient(180deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.hero__badge{
  display:inline-flex;
  padding:6px 10px;
  border-radius:999px;
  background: rgba(255,179,0,0.12);
  border: 1px solid rgba(255,179,0,0.25);
  color: var(--text);
  font-weight:700;
  font-size:13px;
}
.hero__title{
  margin:12px 0 8px;
  font-size: 30px;
  letter-spacing:-0.03em;
}
.hero__subtitle{margin:0; color: var(--muted); line-height:1.5}
.hero__cta{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap}
.hero__info{
  display:grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap:10px;
  margin-top:14px;
}
.mini{
  border:1px solid var(--line);
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding:12px;
}
.mini__title{font-weight:800}
.mini__text{color: var(--muted); margin-top:4px; font-size:13px}

/* Side */
.sidecard{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius);
  padding: 14px;
}
.sidecard__title{font-weight:800; margin-bottom:10px}
.sidecard__grid{display:grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap:10px}
.tile{
  border:1px solid var(--line);
  background: rgba(0,0,0,0.18);
  border-radius: 14px;
  padding:12px;
  cursor:pointer;
  text-align:left;
}
.tile:hover{background: rgba(255,255,255,0.06)}
.tile__icon{font-size:20px}
.tile__label{display:block; margin-top:8px; font-weight:800}
.sidecard__body{display:grid; gap:10px}

/* Controls */
.section-title{margin:0; font-size:18px; font-weight:900}
.select{display:grid; gap:6px}
.select__label{font-size:12px; color: var(--muted)}
.select__control{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding:10px 12px;
  border-radius: 14px;
}
.toggle{
  display:flex; gap:10px; align-items:center;
  color: var(--muted);
  user-select:none;
}
.toggle input{width:18px; height:18px}

/* Product card */
.card{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: 18px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  min-height: 320px;
}
.card__media{
  height: 160px;
  background: rgba(0,0,0,0.22);
  display:flex;
  align-items:center;
  justify-content:center;
}
.card__media img{
  width:100%;
  height:100%;
  object-fit: cover;
}
.card__body{padding:12px; display:grid; gap:8px}
.card__name{font-weight:900; letter-spacing:-0.01em}
.card__meta{font-size:12px; color: var(--muted)}
.card__bottom{
  margin-top:auto;
  padding:12px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;            /* ✅ deixa quebrar linha no mobile */
}

/* evita o "Adicionar" cortar no mobile */
.card__bottom .btn{
  white-space: nowrap;
  min-width: 0;
}

.card__qty{
  display:flex;
  align-items:center;
  gap:6px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding:4px 6px;
}
.card__qty button{
  width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
}
.card__qty button:hover{background: rgba(255,255,255,0.08)}
.card__qty span{
  min-width:14px;
  text-align:center;
  font-weight:900;
  font-size: 13px;
}
.price{font-weight:900; font-size:16px}
.badge{
  padding:6px 10px;
  border-radius: 999px;
  background: rgba(34,197,94,0.12);
  border: 1px solid rgba(34,197,94,0.25);
  font-weight:900;
  font-size:12px;
}
.badge--deal{
  background: rgba(255,179,0,0.12);
  border-color: rgba(255,179,0,0.25);
}

/* Empty */
.empty{
  border:1px dashed rgba(255,255,255,0.20);
  background: rgba(0,0,0,0.18);
  border-radius: var(--radius);
  padding: 24px;
  text-align:center;
  margin: 12px 0;
}
.empty__icon{font-size:28px}
.empty__title{font-weight:900; margin-top:6px}
.empty__text{color: var(--muted); margin:6px 0 14px}

/* Drawer + Modal */
.backdrop{
  position:fixed;
  inset:0;
  background: rgba(0,0,0,0.55);
  z-index:40;
}

.drawer{
  position:fixed;
  top:0;
  right:0;
  height:100%;
  width: min(420px, 92vw);
  background: rgba(12,16,22,0.92);
  border-left: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(14px);
  z-index:50;
  transform: translateX(110%);
  transition: transform .22s ease;
  display:flex;
  flex-direction:column;
}
.drawer--open{transform: translateX(0)}
.drawer__header{
  padding:14px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-bottom:1px solid var(--line);
}
.drawer__title{font-weight:900}
.drawer__sub{color: var(--muted); font-size:12px; margin-top:2px}
.drawer__items{
  padding:10px 14px;
  overflow:auto;
  display:grid;
  gap:10px;
}
.drawer__footer{
  margin-top:auto;
  border-top:1px solid var(--line);
  padding:14px;
  display:grid;
  gap:12px;
}
.totals__row{display:flex; align-items:center; justify-content:space-between}
.totals__hint{font-size:12px; color: var(--muted); margin-top:6px}
.drawer__actions{display:grid; gap:10px}

.cartitem{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.05);
  border-radius: 12px;
  padding:8px 10px;
}
.cartitem__name{
  font-weight:800;
  font-size:13px;
  line-height:1.25;
}
.cartitem__meta{color:var(--muted); font-size:11.5px; margin-top:1px}
.cartitem__row{
  display:flex; align-items:center; justify-content:space-between;
  gap:8px;
  margin-top:6px;
}
.cartitem__total{ font-size:14px; white-space:nowrap; }
.cartitem__weight{
  flex:1; min-width:90px;
  padding:6px 9px; border-radius:10px;
  border:1px solid var(--line);
  background:rgba(255,255,255,0.06); color:var(--text);
  font-size:13px;
}
.cartitem__del{
  border:1px solid var(--line);
  background:transparent; color:var(--muted);
  font-size:12px; padding:6px 10px; border-radius:10px; cursor:pointer;
}
.cartitem__del:hover{ color:#e53935; border-color:rgba(229,57,53,.5); }
.qty{
  display:flex; align-items:center; gap:8px;
}
.qty button{
  width:32px; height:32px;
  border-radius: 12px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color:var(--text);
  cursor:pointer;
}
.qty button:hover{background: rgba(255,255,255,0.08)}
.qty span{min-width:20px; text-align:center; font-weight:900}

.modal{
  position:fixed;
  z-index:60;
  inset: 50% auto auto 50%;
  transform: translate(-50%,-50%);
  width: min(860px, 94vw);
  background: rgba(12,16,22,0.96);
  border:1px solid rgba(255,255,255,0.12);
  border-radius: 18px;
  box-shadow: var(--shadow);
}
.modal__header{
  padding:14px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  border-bottom:1px solid var(--line);
}
.modal__title{font-weight:900}
.modal__body{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  padding:14px;
}
.modal__media{
  border:1px solid var(--line);
  background: rgba(0,0,0,0.22);
  border-radius: 16px;
  overflow:hidden;
  height: 320px;
}
/* Imagem do modal "Detalhes do produto": mostra a embalagem INTEIRA, sem cortar.
   object-fit:contain preserva a proporção e centraliza; o fundo neutro do
   .modal__media preenche as bordas. (Antes era object-fit:cover → cortava.) */
.modal__media img{
  width:100%; height:100%;
  max-width:100%; max-height:100%;
  object-fit:contain; object-position:center;
}
.modal__name{font-weight:900; font-size:20px}
.modal__meta{color: var(--muted); margin-top:4px}
.modal__price{
  margin-top:12px;
  display:flex; align-items:center; justify-content:space-between;
  padding:12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.05);
  border:1px solid var(--line);
}
.modal__desc{color: var(--muted); line-height:1.5; margin:12px 0 0}
.modal__actions{display:flex; gap:10px; margin-top:14px; flex-wrap:wrap}

/* Toast */
.toast{
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 80;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(0,0,0,0.75);
  border:1px solid rgba(255,255,255,0.16);
  color: var(--text);
  display:none;
}
.toast--show{display:block}

/* Carrossel de encartes */
.promo{
  display:grid;
  gap:10px;
}

.promo__track{
  display:flex;
  overflow:auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  border-radius: 18px;
  scrollbar-width: none;
  min-height: 1px;           /* ✅ garante área */
}
.promo__track::-webkit-scrollbar{display:none}

/* ✅ garante que as bolinhas sempre fiquem visíveis */
.promo__dots{
  display:flex;
  justify-content:center;
  gap:8px;
  padding-bottom: 2px;
  min-height: 14px;          /* ✅ reserva espaço */
}

.promo__slide{
  flex: 0 0 100%;
  scroll-snap-align: start;
  border-radius: 18px;
  overflow:hidden;
  border:1px solid var(--line);
  background: rgba(0,0,0,0.22);
}
.promo__slide img{
  width:100%;
  height: 320px;
  object-fit: cover;
  display:block;
}

.promo__dots{
  display:flex;
  justify-content:center;
  gap:8px;
}
.promo__dot{
  width:10px;
  height:10px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.08);
}
.promo__dot--active{
  background: rgba(255,179,0,0.35);
  border-color: rgba(255,179,0,0.45);
}

@media (max-width: 520px){
  .promo__slide img{height: 240px;}
}

/* evita "Adicionar" cortar no mobile */
.card__bottom .btn{
  white-space: nowrap;
  min-width: 0;
}

/* contador no card: - 1 + */
.card__qty{
  display:flex;
  align-items:center;
  gap:8px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  border-radius: 999px;
  padding:6px 8px;
}
.card__qty button{
  width:30px;
  height:30px;
  border-radius:999px;
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor:pointer;
}
.card__qty button:hover{background: rgba(255,255,255,0.08)}
.card__qty span{
  min-width:18px;
  text-align:center;
  font-weight:900;
}

/* ===== Load more / paginação simples ===== */
.loadmore{
  display:grid;
  gap:8px;
  justify-items:center;
  padding: 14px 0 6px;
}
.loadmore__meta{
  font-size: 13px;
}

/* ===== Paginação (1,2,3...) ===== */
.pager{
  display:flex;
  align-items:center;
  justify-content:center;
  gap:12px;
  flex-wrap:wrap; /* quebra bonito se faltar espaço */
  padding:14px 0 6px;
}

.pager__nums{
  display:flex;
  gap:8px;
  align-items:center;
}
.pagebtn{
  border:1px solid var(--line);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  padding:8px 12px;
  border-radius: 999px;
  cursor:pointer;
  font-weight:800;
}
.pagebtn:hover{background: rgba(255,255,255,0.08)}
.pagebtn--active{
  border-color: rgba(255,179,0,0.45);
  background: rgba(255,179,0,0.12);
}
.pager__meta{font-size:13px}

/* ===== Ajuste tamanho Anterior / Próxima ===== */
#prevPageBtn,
#nextPageBtn{
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 999px;
  min-width: unset;
}

#prevPageBtn{
  opacity: 0.85;
}

#nextPageBtn{
  opacity: 0.85;
}

#prevPageBtn:disabled,
#nextPageBtn:disabled{
  opacity: 0.35;
  cursor: not-allowed;
}

/* ===== Checkout / lead modal ===== */
.lead-modal{
  width: min(560px, 94vw);
}

.lead-form{
  display: grid;
  gap: 12px;
}

.lead-field{
  display: grid;
  gap: 6px;
}

.lead-field__label{
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.lead-input{
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  padding: 12px 14px;
  border-radius: 14px;
  outline: none;
}

.lead-input:focus{
  border-color: rgba(255,179,0,0.45);
  box-shadow: 0 0 0 4px rgba(255,179,0,0.12);
}

.lead-actions{
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 4px;
}

#leadMsg{
  display: block;
  min-height: 20px;
}

@media (max-width: 520px){
  .lead-modal{
    width: min(94vw, 420px);
  }

  .lead-actions{
    display: grid;
    grid-template-columns: 1fr;
  }

  .lead-actions .btn{
    width: 100%;
    justify-content: center;
  }
}

#leadModal{
  width: min(980px, 94vw);
}

#leadModal .modal__body{
  display: block;
  padding: 20px;
}

#leadModal .lead-form{
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 14px;
  align-items: end;
}

#leadModal .lead-field{
  display: flex;
  flex-direction: column;
  min-width: 0;
}

#leadModal .lead-input{
  width: 100%;
  min-width: 0;
}

#leadModal .lead-actions{
  grid-column: 1 / -1;
  display: flex;
  gap: 12px;
  margin-top: 8px;
}

#leadModal #leadMsg{
  grid-column: 1 / -1;
}

/* bloco do produto por peso */
.card__weight-row{
  display: flex;
  gap: 8px;
  width: 100%;
}

.card__weight-row input{
  flex: 1 1 auto;
  min-width: 0;
}

.card__weight-row .btn{
  flex: 0 0 auto;
}

@media (max-width: 520px){
  .card__weight-row{
    flex-direction: column;
  }

  .card__weight-row .btn{
    width: 100%;
    justify-content: center;
  }
}

/* bloco do açougue */
[data-weight-box]{
  width: 100%;
  min-width: 0;
}

.card__weight-row{
  width: 100%;
  min-width: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.card__weight-row input,
.card__weight-row .btn{
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.card__weight-row .btn{
  justify-content: center;
}

/* desktop/tablet */
@media (min-width: 521px){
  .card__weight-row{
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .card__weight-row .btn{
    width: auto;
    min-width: 96px;
  }
}


.catalog-section {
  margin-bottom: 28px;
}

.catalog-section__title {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 800;
}

.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.card__title {
  min-height: 44px;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card__bottom {
  margin-top: auto;
}

.card img,
.card__img,
.card__media img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

#productsGrid {
  display: block;
}

.catalog-section {
  width: 100%;
  margin-bottom: 28px;
}

.catalog-section .grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

/* 📱 mobile */
@media (max-width: 980px) {
  .catalog-section .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 📱 celular pequeno */
@media (max-width: 520px) {
  .catalog-section .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 📱 muito pequeno */
@media (max-width: 360px) {
  .catalog-section .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .catalog-section__title {
    font-size: 18px;
    padding-left: 6px;
  }
}

.catalog-section{
  margin-bottom: 22px;
}

.catalog-section__title{
  margin-bottom: 12px;
}

.catalog-section__actions{
  display: flex;
  justify-content: center;
  margin-top: 12px;
}
/* ================================================================
   FASE 2 — ALINHAMENTO EXCLUSIVO DOS CARDS DA GRADE (#productsGrid)
   Seletores dedicados: valem SOMENTE para os cards dentro da grade
   de produtos (vitrine do index, resultados de busca e categoria).
   NADA aqui atinge modal (#modalImg/.modal__media), carrinho
   (.cartitem__thumb) ou página de detalhes.
================================================================ */
#productsGrid .grid,
#productsGrid.grid { align-items: stretch; }        /* linha estica os cards */
#productsGrid .card {
  height: 100%;                                     /* mesma altura na linha */
  display: flex;
  flex-direction: column;
}
#productsGrid .card .card__media { height: 160px; flex: none; } /* área de imagem uniforme */
#productsGrid .card .card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;                              /* produto inteiro, sem corte — SÓ no card */
  /* sem background: a área de mídia mantém o fundo escuro original do card
     (.card__media rgba(0,0,0,0.22)); imagens com transparência ficam sem
     caixa branca atrás */
}
#productsGrid .card .card__body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 8px; }
#productsGrid .card .card__name {
  min-height: 2.5em;                                /* espaço reservado p/ 2 linhas de título */
  line-height: 1.25em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
#productsGrid .card .card__stockmsg { min-height: 1.2em; }
#productsGrid .card .card__stockmsg--empty { visibility: hidden; }
#productsGrid .card .card__bottom { margin-top: auto; }         /* botões alinhados na base */
