/* Pizza Caseira V42 — catálogo alinhado em mobile, tablet e desktop + pré-visualização de produto. */
:root {
  --pc-brand: #a43b28;
  --pc-brand-dark: #812d20;
  --pc-surface: #fff;
  --pc-border: #e9e5e1;
  --pc-text: #202124;
  --pc-muted: #696d75;
  --pc-soft: #faf7f4;
  --pc-shadow-card: 0 5px 18px rgba(36, 28, 24, .07);
}

html { -webkit-text-size-adjust: 100%; }
body { overflow-x: clip; background: #faf9f7; color: var(--pc-text); }
.site-head { gap: 14px; }
.head-copy { flex: 1 1 300px; }
.menu-main { width: 100%; max-width: 1200px; margin-inline: auto; }
.menu-hero { min-width: 0; }
.menu-tools { width: 100%; }
.cat-tabs { scroll-padding-inline: 16px; }
.cat-tabs button { flex: 0 0 auto; }

/* Cards usam uma estrutura fixa: a fotografia nunca determina a altura da linha. */
.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
  padding-bottom: 34px;
}
.product {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--pc-border);
  border-radius: 19px;
  background: var(--pc-surface);
  box-shadow: var(--pc-shadow-card);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}
.product:hover { border-color: #ddc9c1; box-shadow: 0 12px 28px rgba(36, 28, 24, .10); }
.product-image {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  aspect-ratio: 4 / 3;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: radial-gradient(circle at 50% 35%, #fff 0%, #faf4ef 72%, #f3e9e2 100%);
  box-shadow: none;
  color: inherit;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.product-image img, .product-image .product-photo {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  padding: 12px;
  background: transparent;
}
.product-image .product-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  font-size: clamp(42px, 5vw, 58px);
  background: transparent;
}
.product-info {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 14px 15px 8px;
  border: 0;
  border-radius: 0;
  background: var(--pc-surface);
  color: inherit;
  text-align: left;
  box-shadow: none;
  white-space: normal;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.product-info:hover, .product-info:active { background: var(--pc-surface); color: inherit; box-shadow: none; }
.product-category {
  display: block;
  margin: 0 0 5px;
  color: var(--pc-brand);
  font-size: 10px;
  line-height: 1.25;
  font-weight: 900;
  letter-spacing: .8px;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.product-title {
  display: -webkit-box;
  overflow: hidden;
  color: #222;
  font-size: 17px;
  font-weight: 850;
  line-height: 1.28;
  letter-spacing: -.25px;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.product-description {
  display: -webkit-box;
  min-height: 3.9em;
  margin-top: 6px;
  overflow: hidden;
  color: var(--pc-muted);
  font-size: 12px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.product-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  margin-top: auto;
  padding: 11px 15px 15px;
  border-top: 1px solid #f1eeeb;
  background: #fff;
}
.product-foot .price { min-width: 0; color: #191919; font-size: 17px; line-height: 1.2; white-space: nowrap; }
.product-foot .add {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #ead5ce;
  border-radius: 11px;
  background: #fff7f3;
  color: var(--pc-brand-dark);
  box-shadow: none;
  font-size: 12px;
  line-height: 1.15;
  font-weight: 850;
  white-space: nowrap;
}
.product-foot .add span { font-size: 17px; line-height: .8; }
.product-foot .add:hover { border-color: var(--pc-brand); background: #fff0e9; transform: translateY(-1px); }
.product-preview-trigger:focus-visible, .product-foot .add:focus-visible { position: relative; z-index: 1; outline: 3px solid rgba(164,59,40,.35); outline-offset: -3px; }

/* Pré-visualização do produto, com CTA sempre fácil de alcançar. */
.product-preview-modal {
  z-index: 85;
  padding: 18px;
  place-items: center;
  background: rgba(25, 22, 20, .62);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}
.product-preview-card {
  position: relative;
  display: grid;
  grid-template-rows: auto 1fr auto;
  width: min(540px, 100%);
  max-height: min(92dvh, 880px);
  padding: 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 25px 90px rgba(0,0,0,.28);
}
.product-preview-close {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 50%;
  background: rgba(255,255,255,.95);
  color: #292523;
  font-size: 27px;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(0,0,0,.10);
}
.product-preview-media {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: clamp(230px, 36vh, 340px);
  min-height: 200px;
  overflow: hidden;
  background: radial-gradient(circle at 50% 38%, #fff 0%, #faf2ec 70%, #f0e5dd 100%);
}
.product-preview-media img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
  padding: 18px;
}
.product-preview-placeholder { display: grid; place-items: center; width: 100%; height: 100%; font-size: 84px; }
.product-preview-category {
  position: absolute;
  left: 16px;
  bottom: 14px;
  max-width: calc(100% - 32px);
  padding: 7px 11px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 999px;
  background: rgba(255,255,255,.92);
  color: var(--pc-brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: 0 3px 12px rgba(0,0,0,.06);
}
.product-preview-details { min-width: 0; padding: 20px 23px 15px; }
.product-preview-kicker { display: block; margin-bottom: 6px; color: var(--pc-brand); font-size: 10px; letter-spacing: 1.05px; font-weight: 900; }
.product-preview-details h2 { margin: 0; color: #222; font-size: clamp(22px, 4vw, 28px); font-weight: 900; line-height: 1.2; letter-spacing: -.5px; overflow-wrap: anywhere; }
.product-preview-details p { margin: 10px 0 0; color: #666b72; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.product-preview-hint { display: flex; align-items: flex-start; gap: 8px; margin-top: 15px; color: #777; }
.product-preview-hint span { display: grid; place-items: center; flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: #f9e9e4; color: var(--pc-brand); font-size: 11px; font-weight: 900; }
.product-preview-hint small { font-size: 11px; line-height: 1.4; }
.product-preview-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 15px 22px max(15px, env(safe-area-inset-bottom));
  border-top: 1px solid #eee8e4;
  background: rgba(255,255,255,.97);
}
.product-preview-price { display: grid; flex: 0 0 auto; gap: 3px; }
.product-preview-price small { color: #8b8581; font-size: 11px; font-weight: 700; }
.product-preview-price strong { color: #1f1d1b; font-size: 21px; font-weight: 950; white-space: nowrap; }
.product-preview-actions .primary { display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; min-height: 48px; padding: 13px 16px; border-radius: 13px; background: var(--pc-brand); box-shadow: 0 6px 14px rgba(164,59,40,.18); font-size: 14px; }
.product-preview-actions .primary:hover { background: var(--pc-brand-dark); }
.product-preview-actions .primary span { font-size: 20px; line-height: .8; }

.menu-trust-strip, .menu-footer { min-width: 0; }
img { max-inline-size: 100%; }

@media (max-width: 960px) {
  .products { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
  .product-image { aspect-ratio: 1.22 / 1; }
  .product-title { font-size: 16px; }
  .product-info { padding-inline: 13px; }
  .product-foot { padding-inline: 13px; }
}
@media (max-width: 760px) {
  .site-head { align-items: center; gap: 10px; }
  .head-copy { flex-basis: calc(100% - 70px); }
  .site-head p { max-width: 58ch; line-height: 1.45; }
  .menu-hero h2 { max-width: 18ch; line-height: 1.12; }
  .menu-trust-strip { margin-inline: 12px; }
}
@media (max-width: 560px) {
  .site-head { padding: 12px 12px; }
  .brand-mini { gap: 9px; }
  .brand-mini img { flex: 0 0 38px; width: 38px; height: 38px; }
  .site-head h1 { font-size: 23px; line-height: 1.12; letter-spacing: -.7px; }
  .site-head .eyebrow { font-size: 9px; letter-spacing: 1px; }
  .site-head p { margin-top: 6px; font-size: 12px; }
  .cart-btn { display: grid; place-items: center; flex: 0 0 46px; width: 46px; min-width: 46px; height: 46px; border-radius: 13px; }
  .menu-hero { margin: 0; padding: 20px 13px 12px; }
  .menu-hero h2 { font-size: 25px; }
  .menu-hero p { font-size: 13px; line-height: 1.4; }
  .menu-tools { padding: 10px 12px 0; }
  .search-box input { min-width: 0; height: 46px; }
  .cat-tabs { gap: 7px; padding: 11px 12px 13px; }
  .cat-tabs button { padding: 9px 12px; font-size: 12px; }
  .products {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    padding: 0 12px 108px;
  }
  .product {
    display: grid;
    grid-template-columns: clamp(94px, 29vw, 122px) minmax(0, 1fr);
    grid-template-rows: minmax(82px, 1fr) auto;
    min-height: 142px;
    border-radius: 15px;
    box-shadow: 0 3px 12px rgba(36,28,24,.055);
  }
  .product-image {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: stretch;
    width: 100%;
    height: 100%;
    min-height: 142px;
    aspect-ratio: auto;
    background: radial-gradient(circle at 50% 35%, #fff 0%, #faf3ee 76%, #f4e9e2 100%);
  }
  .product-image img, .product-image .product-photo { padding: 6px; }
  .product-image .product-placeholder { font-size: 36px; }
  .product-info {
    grid-column: 2;
    grid-row: 1;
    align-self: stretch;
    min-height: 0;
    padding: 11px 11px 3px;
  }
  .product-category { margin-bottom: 4px; font-size: 9px; letter-spacing: .55px; }
  .product-title { font-size: 14px; line-height: 1.23; -webkit-line-clamp: 2; }
  .product-description { min-height: 0; max-height: 2.6em; margin-top: 4px; font-size: 11px; line-height: 1.3; -webkit-line-clamp: 2; }
  .product-foot {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
    padding: 7px 10px 10px;
    gap: 6px;
    border-top: 0;
    background: transparent;
  }
  .product-foot .price { font-size: 15px; }
  .product-foot .add { min-height: 34px; padding: 7px 9px; border-radius: 9px; font-size: 11px; }
  .product-foot .add span { font-size: 15px; }
  .menu-trust-strip { margin: 8px 12px 0; }
  .menu-footer { padding: 20px 14px max(20px, env(safe-area-inset-bottom)); }
  .product-preview-modal { align-items: end; justify-items: center; padding: 0; }
  .product-preview-card {
    width: 100%;
    max-width: 620px;
    max-height: 93dvh;
    border: 0;
    border-radius: 23px 23px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    animation: pcPreviewSheetIn 180ms ease-out;
  }
  .product-preview-card::before { content: ""; position: absolute; z-index: 4; top: 7px; left: 50%; width: 38px; height: 4px; border-radius: 999px; background: rgba(40,30,25,.2); transform: translateX(-50%); }
  .product-preview-media { height: clamp(190px, 31dvh, 275px); min-height: 180px; }
  .product-preview-media img { padding: 15px; }
  .product-preview-close { top: 15px; right: 13px; width: 38px; height: 38px; }
  .product-preview-category { left: 13px; bottom: 11px; }
  .product-preview-details { padding: 17px 18px 13px; }
  .product-preview-kicker { font-size: 9px; }
  .product-preview-details h2 { font-size: 23px; }
  .product-preview-details p { margin-top: 8px; font-size: 13px; }
  .product-preview-hint { margin-top: 10px; }
  .product-preview-actions { gap: 10px; padding: 12px 14px max(13px, env(safe-area-inset-bottom)); }
  .product-preview-price strong { font-size: 19px; }
  .product-preview-actions .primary { min-height: 48px; padding: 11px 12px; font-size: 13px; }
}
@media (max-width: 360px) {
  .product { grid-template-columns: 88px minmax(0, 1fr); }
  .product-foot { align-items: flex-start; flex-direction: column; }
  .product-foot .price { font-size: 14px; }
  .product-foot .add { width: 100%; }
  .product { min-height: 164px; }
  .product-image { min-height: 164px; }
  .product-preview-actions { align-items: stretch; flex-direction: column; }
  .product-preview-price { display: flex; align-items: baseline; justify-content: space-between; }
}
@keyframes pcPreviewSheetIn { from { opacity: .7; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .product, .product-preview-card { transition: none !important; animation: none !important; }
}

/* Correção final de compatibilidade com regras legadas de botões no mobile. */
.product-foot .add { width: auto; margin-top: 0; }
.product-foot .price { flex: 0 0 auto; }
.cart-count-badge { display: none; }
@media (max-width: 560px) {
  .cart-btn { position: relative; }
  .cart-btn-copy { display: none !important; }
  .cart-count-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 999px;
    background: var(--pc-brand);
    color: #fff;
    font-size: 9px;
    line-height: 1;
    font-weight: 900;
    box-shadow: 0 2px 5px rgba(0,0,0,.12);
  }
  .product-foot .add { width: auto; margin-top: 0; }
  .product-preview-card { padding-bottom: 0; }
}
@media (max-width: 360px) {
  .product-foot { align-items: flex-start; flex-direction: column; }
  .product-foot .add { width: 100%; }
}
@media (max-width: 560px) {
  /* O trilho limitado impede que o conteúdo intrínseco da folha passe da viewport. */
  .product-preview-modal { grid-template-rows: minmax(0, 1fr); }
  .product-preview-card { min-height: 0; max-height: 100%; align-self: end; }
}
