/* ============================================================
   shell.css — casco compartilhado por todas as telas
   ------------------------------------------------------------
   Faixa de aviso, cabeçalho (marca, navegação, busca, ícones),
   menu e busca de celular, rodapé, avisos flutuantes e a gaveta
   da sacola. Destilado de front/template/gabili-ceramica-mvp.html.
   ============================================================ */

/* ---------- Faixa de aviso ---------- */
.announce {
  background: var(--ink);
  color: #F3F1EA;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .4px;
  padding: 8px 16px;
  font-weight: 450;
}

/* ---------- Cabeçalho ---------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 246, 242, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 22px; height: 66px; }

.brand { display: flex; align-items: center; gap: 10px; }
.logo-word {
  display: inline-block;
  width: 74px;
  height: 36px;
  background: url('/assets/img/logo-gabili.png') left center/contain no-repeat;
}
.logo-badge {
  display: inline-block;
  background: url('/assets/img/logo-selo.png') center/contain no-repeat;
}
/* Tamanhos fixos do menu de celular e do rodapé. Dois seletores de classe:
   valem em qualquer largura, por cima do ajuste de .logo-word no celular. */
.logo-word.logo-word-menu { width: 120px; height: 58px; }
.logo-badge.logo-badge-foot { display: block; width: 118px; height: 114px; }

.nav .links { display: flex; gap: 22px; margin-left: 8px; }
.nav .links a {
  font-size: 13.5px;
  color: var(--muted);
  font-weight: 450;
  position: relative;
  padding: 4px 0;
  transition: color .2s;
}
.nav .links a:hover,
.nav .links a.active { color: var(--ink); }
.nav .links a.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--sage);
}
.nav .spacer { flex: 1; }

.nav .search { position: relative; flex: 1; max-width: 320px; }
.nav .search input,
.msearch input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 9px 14px 9px 38px;
  font-size: 13.5px;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.nav .search input:focus,
.msearch input:focus { border-color: var(--sage); box-shadow: 0 0 0 3px var(--sage-tint); }
.nav .search svg,
.msearch svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  width: 16px;
  height: 16px;
}

.iconbtn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: var(--r-pill);
  display: grid;
  place-items: center;
  color: var(--ink);
  flex: none;
  transition: background .18s;
}
.iconbtn:hover { background: var(--line-2); }
.iconbtn svg { width: 19px; height: 19px; }
.menu-toggle { display: none; }
#mSearchBtn { display: none; }

/* Contador da sacola (badge posicionado sobre o ícone). */
.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: var(--r-pill);
  background: var(--sage);
  color: #fff;
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
}
.badge[hidden] { display: none; }

/* ---------- Busca de celular ---------- */
.msearch { display: none; padding: 10px 18px 4px; }
.msearch .search { position: relative; }

/* ---------- Menu de celular ---------- */
.mnav {
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--paper);
  transform: translateX(-100%);
  transition: transform .3s;
  padding: 22px;
  overflow-y: auto;
}
.mnav.open { transform: none; }
.mnav .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mnav a {
  display: block;
  font-family: var(--font-serif);
  font-size: 26px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-2);
}

/* ---------- Rodapé ---------- */
footer.site {
  border-top: 1px solid var(--line);
  margin-top: 40px;
  padding: 46px 0 40px;
  color: var(--muted);
}
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.foot-grid p { font-size: 13px; margin-top: 10px; max-width: 30ch; }
.foot-grid h4 {
  font-size: 12px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 12px;
  font-weight: 600;
}
.foot-grid a { display: block; font-size: 13.5px; margin-bottom: 8px; transition: color .15s; }
.foot-grid a:hover { color: var(--ink); }
.foot-bottom {
  border-top: 1px solid var(--line);
  margin-top: 34px;
  padding-top: 20px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Avisos flutuantes ---------- */
.toast-host {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--ink);
  color: #F3F1EA;
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 9px;
  animation: toastin .3s ease both;
}
.toast svg { width: 16px; height: 16px; color: var(--sage); flex: none; }
.toast.is-error svg { color: var(--rose); }
.toast.is-leaving { opacity: 0; transform: translateY(8px); transition: .3s; }
@keyframes toastin { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- Gaveta da sacola ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 33, 28, .32);
  backdrop-filter: blur(2px);
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: 420px;
  max-width: 92vw;
  background: var(--paper);
  z-index: 60;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .34s cubic-bezier(.4, 0, .15, 1);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: none; }
.drawer .dhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer .dhead h3 { font-size: 24px; }
.drawer .ditems { flex: 1; overflow-y: auto; padding: 12px 24px; }
.drawer .dfoot { border-top: 1px solid var(--line); padding: 20px 24px 24px; background: var(--card); }
.drawer .dfoot .line {
  display: flex;
  justify-content: space-between;
  font-size: 13.5px;
  color: var(--muted);
  margin-bottom: 8px;
}
.drawer .dfoot .total {
  display: flex;
  justify-content: space-between;
  font-size: 17px;
  font-weight: 600;
  color: var(--ink);
  margin: 12px 0 16px;
}
.drawer .dfoot .total .serif { font-size: 22px; }
.drawer .dfoot .btn + .btn { margin-top: 8px; }

/* Item da gaveta */
.citem { display: flex; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.citem.busy { opacity: .55; }
.citem .cthumb {
  width: 70px;
  height: 84px;
  border-radius: var(--r-sm);
  flex: none;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.citem .cthumb img { width: 100%; height: 100%; object-fit: cover; }
.citem .cmid { flex: 1; min-width: 0; }
.citem .cmid .nm { font-family: var(--font-serif); font-size: 18px; font-weight: 600; line-height: 1.2; }
.citem .cmid .cprice { font-size: 13px; color: var(--muted); margin-top: 2px; }
.citem .cwarn { font-size: 12px; font-weight: 600; color: var(--warn); margin-top: 3px; }
.citem .qmini {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  margin-top: 10px;
  background: var(--card);
}
.citem .qmini button { width: 28px; height: 28px; color: var(--muted); transition: color .15s; }
.citem .qmini button:hover:not(:disabled) { color: var(--ink); }
.citem .qmini button:disabled { opacity: .35; cursor: not-allowed; }
.citem .qmini .qval { width: 26px; text-align: center; font-size: 13px; font-weight: 500; }
.citem .cright { text-align: right; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.citem .lineprice { font-size: 14px; font-weight: 500; white-space: nowrap; }
.citem .rm { font-size: 11.5px; color: var(--faint); margin-top: 8px; transition: color .15s; }
.citem .rm:hover:not(:disabled) { color: var(--rose); }

.cart-empty { text-align: center; color: var(--muted); padding: 60px 20px; }
.cart-empty .glyph { width: 60px; height: 60px; color: var(--faint); margin: 0 auto 14px; opacity: .6; }
.cart-empty .serif { font-size: 22px; color: var(--ink); display: block; }
.cart-empty p { margin-top: 6px; font-size: 13.5px; }
.drawer-error { color: #9B5442; font-size: 13px; padding: 10px 0 0; }

/* ---------- Responsivo ---------- */
@media (max-width: 820px) {
  .nav .links { display: none; }
  .nav .search { display: none; }
  .menu-toggle { display: grid; }
  #mSearchBtn { display: grid; }
  .msearch.on { display: block; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 620px) {
  .drawer { width: 100%; }
  /* Com a marca e três ícones, 22px de gap estouram a linha em 360px. */
  .nav { gap: 8px; height: 60px; }
  .logo-word { width: 62px; height: 30px; }
  .iconbtn { width: 38px; height: 38px; }
  .announce { font-size: 11.5px; padding: 7px 12px; }
}
