.page{ padding:18px 0 80px; }

.categories{
  display:grid;
  grid-template-columns: repeat(10, minmax(72px, 1fr));
  gap:14px;
  padding:18px 0 10px;
  overflow:auto;
}

.category-card{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:10px 8px;
}

.category-card img{
  width:44px;
  height:44px;
  object-fit:contain;
}

.category-card span{
  font-size:12px;
  font-weight:700;
  text-align:center;
}

.section{ margin-top:18px; }

.section-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom:12px;
}

.section-head h2{
  margin:0;
  font-size:26px;
}

.section-head a{
  color:#f97316;
  font-weight:800;
  font-size:13px;
}

.scroll{
  display:flex;
  gap:14px;
  overflow:auto;
  padding-bottom:10px;
}

.product{
  width:220px;
  min-width:220px;
  background:var(--card);
  border:1px solid #eef2f7;
  border-radius:18px;
  box-shadow:0 10px 22px rgba(0,0,0,.04);
  overflow:hidden;
  position:relative;
}

.product .media{
  height:110px;
  background:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:14px;
}

.product .media img{
  width:100%;
  height:100%;
  object-fit:contain;
}

.product .body{ padding:12px; }

.product .name{
  font-size:12px;
  font-weight:800;
  line-height:1.2;
  height:34px;
  overflow:hidden;
}

.product .prices{
  margin-top:8px;
  display:flex;
  align-items:baseline;
  gap:8px;
}

.product .prices .old{
  color:#9ca3af;
  text-decoration:line-through;
  font-size:11px;
}

.product .prices .new{
  color:var(--green);
  font-weight:900;
  font-size:16px;
}

.product .add{
  margin-top:10px;
  width:100%;
  height:38px;
  border:0;
  border-radius:12px;
  background:var(--green);
  color:#fff;
  font-size:22px;
  cursor:pointer;
}

.product .add:hover{ background:var(--green2); }

.ribbon{
  position:absolute;
  top:10px;
  left:10px;
  background:#ef4444;
  color:#fff;
  font-size:11px;
  font-weight:900;
  padding:4px 8px;
  border-radius:8px;
}

.ribbon.yellow{ background:#f59e0b; }

/* FAB carrinho */
.fab-cart{
  position:fixed;
  right:16px;
  bottom:16px;
  z-index:45;
  width:56px;
  height:56px;
  border-radius:999px;
  border:0;
  background:#f97316;
  color:#fff;
  cursor:pointer;
  box-shadow:var(--shadow);
  display:none;
}

.fab-cart .badge{
  position:absolute;
  right:-2px;
  top:-2px;
  width:22px;
  height:22px;
  border-radius:999px;
  background:#fff;
  color:#111;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:900;
  font-size:12px;
}

/* toast */
.toast{
  position:fixed;
  top:90px;
  right:16px;
  z-index:60;
  background:#111827;
  color:#fff;
  padding:10px 12px;
  border-radius:12px;
  box-shadow:var(--shadow);
  opacity:0;
  transform:translateY(-8px);
  pointer-events:none;
  transition:.18s ease;
  font-weight:700;
  font-size:13px;
}

.toast.show{
  opacity:1;
  transform:translateY(0);
}

/* overlay + painel carrinho */
.cart-overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.35);
  z-index:70;
  display:none;
}

.cart-overlay.open{ display:block; }

.cart-panel{
  position:fixed;
  top:0;
  right:0;
  width:380px;
  max-width:92vw;
  height:100vh;
  background:#fff;
  z-index:80;
  box-shadow:var(--shadow);
  transform:translateX(110%);
  transition:.22s ease;
  display:flex;
  flex-direction:column;
}

.cart-panel.open{ transform:translateX(0); }

.cart-header{
  padding:16px;
  border-bottom:1px solid var(--border);
  display:flex;
  align-items:center;
  justify-content:space-between;
  font-weight:900;
  font-size:18px;
}

.cart-close{
  border:0;
  background:transparent;
  font-size:26px;
  cursor:pointer;
  color:#6b7280;
}

.cart-body{
  padding:12px 16px;
  overflow:auto;
  flex:1;
}

.cart-item{
  display:grid;
  grid-template-columns:52px 1fr auto;
  gap:10px;
  padding:10px 0;
  border-bottom:1px solid #f3f4f6;
}

.cart-item img{
  width:52px;
  height:52px;
  object-fit:contain;
}

.cart-item .title{
  font-weight:900;
  font-size:12px;
  line-height:1.2;
}

.cart-item .cat{
  font-size:11px;
  color:var(--muted);
}

.qty{
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:8px;
}

.qty button{
  width:28px;
  height:28px;
  border-radius:6px;
  border:1px solid var(--border);
  background:#f3f4f6;
  cursor:pointer;
  font-weight:900;
}

.qty span{
  min-width:18px;
  text-align:center;
  font-weight:900;
}

.cart-item .price{
  font-weight:900;
  color:var(--green);
}

.cart-item .remove{
  color:#ef4444;
  font-size:12px;
  cursor:pointer;
  margin-top:6px;
  display:inline-block;
}

.cart-footer{
  border-top:1px solid var(--border);
  padding:12px 16px 16px;
}

.cart-msg{
  background:#ecfdf5;
  border:1px solid #bbf7d0;
  padding:10px;
  border-radius:8px;
  font-size:13px;
  color:#166534;
  font-weight:800;
  margin-bottom:10px;
}

.sum-row{
  display:flex;
  justify-content:space-between;
  font-size:13px;
  margin:8px 0;
}

.sum-row strong{ font-weight:900; }

.hr{ height:1px; background:var(--border); margin:10px 0; }

.checkout-btn{
  width:100%;
  height:48px;
  border-radius:10px;
  border:0;
  background:#f97316;
  color:#fff;
  font-weight:900;
  cursor:pointer;
}

.clear-btn{
  width:100%;
  height:42px;
  margin-top:10px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#fff;
  color:#6b7280;
  cursor:pointer;
  font-weight:800;
}

/* grid categoria */
.grid{
  display:grid;
  grid-template-columns: repeat(6, 1fr);
  gap:14px;
}

.grid .product{ width:auto; min-width:0; }

@media (max-width: 1100px){
  .categories{ grid-template-columns: repeat(8, minmax(72px, 1fr)); }
  .grid{ grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 820px){
  .categories{ grid-template-columns: repeat(6, minmax(72px, 1fr)); }
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .fab-cart{ display:block; }

  /* painel carrinho vira modal */
  .cart-panel{
    top:50%;
    left:50%;
    right:auto;
    transform:translate(-50%, 120%);
    width:min(420px, 94vw);
    height:min(680px, 86vh);
    border-radius:22px;
  }

  .cart-panel.open{
    transform:translate(-50%, -50%);
  }
}

/* MOBILE – cards 2.25 por view */
@media (max-width: 768px){
  .scroll{
    gap:12px;
    padding:0 12px 12px;
    overflow-x:auto;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }

  .scroll::-webkit-scrollbar{ display:none; }

  .scroll .product{
    flex-shrink:0;
    width:calc((100% - 12px) / 2.25);
    min-width:calc((100% - 12px) / 2.25);
    max-width:calc((100% - 12px) / 2.25);
    scroll-snap-align:start;
    border-radius:16px;
  }

  .product .media{ height:140px; padding:10px; }
  .product .name{ font-size:13px; line-height:1.25; min-height:32px; }
  .product .prices .old{ font-size:11px; }
  .product .prices .new{ font-size:15px; }
  .product .add{ height:36px; font-size:18px; border-radius:10px; }

  .section-head h2{
    font-size:18px;
    font-weight:800;
    margin-bottom:6px;
  }

  .grid{
    grid-template-columns: repeat(2, 1fr);
    gap:10px;
  }

  .product{ border-radius:14px; }
  .product .media{ aspect-ratio:1/1; }
  .product .add{ height:40px; }
}
/* =========================
   GRID DE PRODUTOS – CATEGORIA
   ========================= */

#catGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}

.product {
  background: #fff;
  border-radius: 16px;
  padding: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}

.product .media {
  display: block;
  margin-bottom: 8px;
}

.product .media img {
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.product .name {
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 6px;
}

.product .prices {
  display: flex;
  gap: 6px;
  align-items: center;
}

.product .prices .old {
  font-size: 11px;
  color: #9ca3af;
  text-decoration: line-through;
}

.product .prices .new {
  font-size: 14px;
  font-weight: 900;
  color: #16a34a;
}

.product .add {
  margin-top: 8px;
  width: 100%;
  height: 36px;
  border-radius: 10px;
  border: none;
  background: #16a34a;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
}
/* =============================
   Card de Produto - Estilo Premium
   ============================= */

/* FORÇA TAMANHO FIXO DO CARD */
.product {
  width: 200px;                /* tamanho fixo */
  min-width: 200px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #eef2f7;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 12px;
  text-align: center;
  gap: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06);
  position: relative;
}

/* badge de porcentagem no canto */
.product .ribbon {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 4px 7px;
  border-radius: 8px;
  z-index: 2;
}

/* área da imagem com proporção */
.product .media {
  width: 100%;
  height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product .media img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  display: block;
  margin: 0 auto;
}

/* corpo do card */
.product .body {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 10px;
}

/* nome do produto */
.product .name {
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  min-height: 36px;  /* faz altura uniforme */
  color: #111;
}

/* preços - centro e com destaque */
.product .prices {
  display: flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  margin-top: 2px;
}

.product .prices .old {
  font-size: 11px;
  color: #9ca3af;
  text-decoration: line-through;
}

.product .prices .new {
  font-size: 16px;
  font-weight: 900;
  color: #16a34a;
}

/* botão "+" no estilo premium */
.product .add {
  margin-top: 6px !important;
  width: 130px;
  height: 38px;
  border-radius: 10px;
  border: none;
  background: #16a34a;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
  transition: background .2s ease;
}

.product .add:hover {
  background: #15803d;
}
/* ===============================
   FIX DEFINITIVO – BOTÃO ADD (CATEGORIA)
   =============================== */

/* garante altura consistente do card */
.product {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* corpo do card ocupa o espaço */
.product .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* nome com altura fixa */
.product .name {
  min-height: 36px;
  line-height: 1.2;
}

/* preços logo abaixo do nome */
.product .prices {
  margin-top: 6px;
}

/* botão SEMPRE no fundo */
.product .add {
  margin-top: auto;        /* 🔥 ISSO É A CHAVE */
  align-self: center;
  width: 120px;
}
/* ===============================
   BADGE OFF – ESTILO PREMIUM
   =============================== */

.ribbon {
  position: absolute;
  top: 10px;
  left: 10px;

  background: linear-gradient(135deg, #ff3b3b, #e11d48);
  color: #fff;

  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.4px;
  text-transform: uppercase;

  padding: 5px 10px;
  border-radius: 999px;

  box-shadow:
    0 6px 14px rgba(225, 29, 72, 0.45),
    inset 0 1px 0 rgba(255,255,255,0.25);

  z-index: 5;
  line-height: 1;
}

/* Badge um pouco menor no mobile */
@media (max-width: 768px) {
  .ribbon {
    font-size: 10px;
    padding: 4px 9px;
  }
}

