/* Módulos novos do site: agendamento de visita, catálogo online e orçamento.
   Depende dos tokens e componentes de style.css. */

/* ---------- Formulários ---------- */
.field { display: grid; gap: 6px; }
.field > span { font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: var(--muted); }
.field > span i { font-style: normal; color: var(--terracotta-ink); }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
  transition: border-color .3s, box-shadow .3s;
}
.field textarea { resize: vertical; min-height: 84px; }
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--wood); box-shadow: 0 0 0 3px rgba(111, 140, 184, .35); }
.field input[aria-invalid="true"] { border-color: var(--terracotta-ink); }
.form-grid { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.form-grid .full { grid-column: 1 / -1; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.form-msg { min-height: 22px; font-size: 14px; color: var(--terracotta-ink); margin: 0; }
.form-note { font-size: 12px; color: var(--soft); margin: 0; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.btn-whats { background: #1F7A4D; color: #fff; }
.btn-whats:hover { background: #17633E; }
.btn svg { width: 18px; height: 18px; flex: none; }

/* ---------- Modal genérico ---------- */
dialog.sheet {
  border: 0; padding: 0; border-radius: 24px; background: var(--ivory); color: var(--ink);
  width: min(560px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto;
  box-shadow: 0 40px 120px rgba(10, 20, 38, .4);
}
dialog.sheet::backdrop { background: rgba(10, 20, 38, .62); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
dialog.sheet[open] { animation: qv-in .6s var(--ease); }
.sheet-head { padding: 30px 30px 0; display: grid; gap: 10px; }
.sheet-head h2 { font-size: clamp(32px, 5vw, 42px); }
.sheet-head p { margin: 0; color: var(--muted); font-size: 15px; }
.sheet-body { padding: 22px 30px 30px; display: grid; gap: 16px; }
.sheet-close {
  position: absolute; right: 14px; top: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: var(--linen); font-size: 22px; line-height: 1; cursor: pointer;
}
.sheet-close:hover { background: var(--sand); }
.sheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sheet-actions .btn { flex: 1 1 auto; }

.done { text-align: center; display: grid; gap: 14px; justify-items: center; padding: 10px 0 4px; }
.done-icon {
  width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(31, 122, 77, .12); color: #1F7A4D;
}
.done-icon svg { width: 30px; height: 30px; }
.done h3 { font-size: 32px; }
.done p { margin: 0; color: var(--muted); max-width: 40ch; }
.done .addr-mini { font-size: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; width: 100%; }

/* Botão destacado "Agende sua visita" */
.btn-visit { background: var(--ivory); color: var(--charcoal); }
.btn-visit:hover { background: #fff; }
.nav a.nav-cta { color: var(--brass-light); }
.header.is-scrolled .nav a.nav-cta, .header.menu-open .nav a.nav-cta { color: #3C5A8C; }
.visit-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  box-shadow: 0 18px 40px rgba(15, 27, 51, .28);
  transform: translateY(140%); transition: transform .6s var(--ease);
}
.visit-fab.is-on { transform: none; }

/* ---------- Página interna (catálogo / orçamento) ---------- */
.page-top { padding-top: clamp(120px, 14vw, 170px); padding-bottom: 30px; }
.page-top h1 { font-size: clamp(42px, 6vw, 76px); }
.page-top .lede { margin-top: 14px; }

/* ---------- Catálogo ---------- */
.cat-bar {
  position: sticky; top: 86px; z-index: 20; background: rgba(245, 243, 239, .92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-block: 1px solid var(--line); padding-block: 14px;
}
.cat-bar .wrap { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.cat-search { flex: 1 1 240px; position: relative; }
.cat-search input {
  width: 100%; font: inherit; font-size: 15px; border: 1px solid var(--line); background: #fff;
  border-radius: 999px; padding: 11px 16px 11px 42px; color: var(--ink);
}
.cat-search input:focus { outline: none; border-color: var(--wood); box-shadow: 0 0 0 3px rgba(111, 140, 184, .35); }
.cat-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--soft); }
.cat-count { font-size: 13px; color: var(--soft); white-space: nowrap; }

.cat-grid {
  display: grid; gap: clamp(14px, 2vw, 24px); padding-block: 34px 90px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
}
.p-card {
  background: #fff; border: 1px solid var(--line); border-radius: 20px; overflow: hidden;
  display: flex; flex-direction: column; transition: box-shadow .5s var(--ease), transform .5s var(--ease);
  content-visibility: auto; contain-intrinsic-size: 300px 460px;
}
.p-card:hover { box-shadow: 0 24px 60px rgba(34, 51, 86, .14); transform: translateY(-3px); }
.p-media { position: relative; aspect-ratio: 4 / 3.6; background: var(--sand); overflow: hidden; cursor: zoom-in; border: 0; padding: 0; width: 100%; }
.p-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .9s var(--ease); }
.p-card:hover .p-media img { transform: scale(1.05); }
.p-media .p-more { position: absolute; right: 10px; bottom: 10px; font-size: 11px; background: rgba(10, 20, 38, .7); color: #fff; padding: 3px 9px; border-radius: 999px; }
.p-body { padding: 18px 18px 20px; display: grid; gap: 8px; flex: 1; align-content: start; }
.p-body small { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #3C5A8C; font-weight: 600; }
.p-body h3 { font-size: 26px; }
.p-body p { margin: 0; font-size: 14px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.p-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 18px 18px; flex-wrap: wrap; }
.p-price { font-size: 14px; color: var(--muted); }
.p-price b { font-size: 17px; color: var(--ink); }
.p-add { padding: 11px 18px; font-size: 13px; }
.p-add[aria-pressed="true"] { background: var(--charcoal); color: var(--on-dark); border-color: var(--charcoal); }
.skeleton { background: linear-gradient(90deg, var(--linen) 0%, var(--sand) 50%, var(--linen) 100%); background-size: 200% 100%; animation: sk 1.4s infinite; border-radius: 20px; min-height: 420px; }
@keyframes sk { to { background-position: -200% 0; } }

/* Detalhe do produto */
.pd-grid { display: grid; grid-template-columns: 1.1fr 1fr; }
.pd-media { background: var(--sand); position: relative; min-height: 380px; }
.pd-media > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pd-info { padding: clamp(24px, 4vw, 40px); display: grid; gap: 14px; align-content: start; }
.pd-info h3 { font-size: clamp(30px, 3.4vw, 40px); }
.pd-info p { margin: 0; color: var(--muted); white-space: pre-line; }
dialog.pd { width: min(980px, calc(100vw - 32px)); }

/* Carrinho de orçamento */
.cart-fab {
  position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 45;
  display: inline-flex; gap: 10px; align-items: center; box-shadow: 0 18px 40px rgba(15, 27, 51, .3);
}
.cart-fab .badge { position: static; min-width: 22px; height: 22px; font-size: 12px; }
dialog.cart { margin-right: 0; margin-block: 0; height: 100dvh; max-height: 100dvh; border-radius: 24px 0 0 24px; width: min(480px, 100vw); }
dialog.cart[open] { animation: cart-in .5s var(--ease); }
@keyframes cart-in { from { transform: translateX(40px); opacity: 0; } }
.cart-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.cart-list li { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 8px 10px; }
.cart-list img { width: 56px; height: 56px; object-fit: cover; border-radius: 10px; background: var(--sand); }
.cart-list b { display: block; font-weight: 600; font-size: 14px; line-height: 1.3; }
.cart-list small { color: var(--soft); font-size: 12px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 30px; height: 30px; border: 0; background: transparent; cursor: pointer; font-size: 16px; }
.qty span { min-width: 22px; text-align: center; font-variant-numeric: tabular-nums; font-size: 14px; }
.cart-empty { color: var(--soft); text-align: center; padding: 20px 0; margin: 0; }

/* ---------- Orçamento público ---------- */
.qd { background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: clamp(22px, 4vw, 44px); margin-bottom: 80px; }
.qd-head { display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; border-bottom: 1px solid var(--line); padding-bottom: 22px; margin-bottom: 10px; }
.qd-head h2 { font-size: clamp(30px, 4vw, 44px); }
.qd-meta { font-size: 14px; color: var(--muted); text-align: right; }
.qd table { width: 100%; border-collapse: collapse; font-size: 15px; }
.qd th { text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--soft); font-weight: 600; padding: 14px 8px; border-bottom: 1px solid var(--line); }
.qd td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
.qd td.num, .qd th.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.qd td img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; }
.qd .tot td { border: 0; padding-block: 6px; }
.qd .tot.grand td { font-size: 20px; font-weight: 600; padding-top: 12px; }
.qd-notes { background: var(--ivory); border-radius: 14px; padding: 16px 18px; white-space: pre-line; margin-top: 20px; font-size: 15px; }
.qd-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }

@media (max-width: 860px) {
  .pd-grid { grid-template-columns: 1fr; }
  .pd-media { min-height: 0; aspect-ratio: 1 / 1; }
  .cat-bar { top: 78px; }
}
@media (max-width: 560px) {
  .form-grid { grid-template-columns: 1fr; }
  .sheet-head { padding: 26px 20px 0; }
  .sheet-body { padding: 18px 20px 24px; }
  .qd td.img, .qd th.img { display: none; }
  .qd-meta { text-align: left; }
  .cat-bar .wrap { gap: 10px; }
  .cat-bar .filters { flex-wrap: nowrap; overflow-x: auto; width: calc(100% + var(--gutter) * 2); scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .cat-bar .filters::-webkit-scrollbar { display: none; }
  .cat-bar .chip { white-space: nowrap; flex: none; }
}

@media print {
  .header, .footer, .qd-actions, .no-print, .visit-fab, .cart-fab, .cursor, .cursor-ring { display: none !important; }
  body { background: #fff; }
  .page-top { padding-top: 0; }
  .qd { border: 0; padding: 0; margin: 0; }
}
