/* Trama — loja de moda fictícia (projeto demonstrativo da Vivanto Digital)
   Identidade própria: papel #F5F1EA · tinta #1D1B18 · terracota #A8492B */
:root {
  --paper: #F5F1EA; --paper-2: #ECE5DA; --white: #FFFFFF; --ink: #1D1B18; --ink-2: #635D55; --line: #DDD5C8;
  --terra: #A8492B; --terra-dk: #8A3A21; --ok: #2F6B45;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .8, .24, 1);
  --vd-badge-bottom: 12px;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
img { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; margin: 0; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 48px); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 300; background: var(--ink); color: var(--paper); padding: 10px 14px; border-radius: 6px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 26px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font-weight: 700; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.btn:hover { background: var(--terra); transform: translateY(-1px); }
.btn-line { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 700; font-size: 14px; cursor: pointer; }
.link { border: 0; background: none; padding: 0; color: var(--terra); font-weight: 700; cursor: pointer; text-decoration: underline; }
.eyebrow { font-size: 12.5px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; color: var(--terra); margin-bottom: 14px; }

/* Topo */
.topbar { background: var(--ink); color: var(--paper); text-align: center; font-size: 13px; padding: 8px 16px; }
.hdr { position: sticky; top: 0; z-index: 50; background: rgba(245, 241, 234, .94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.hdr-in { display: flex; align-items: center; gap: 22px; min-height: 72px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--serif); font-size: 28px; font-weight: 600; letter-spacing: -0.03em; }
.hdr-nav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
.hdr-nav a { text-decoration: none; color: var(--ink-2); padding: 6px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.hdr-nav a:hover { color: var(--ink); border-color: var(--terra); }
.hdr-search { margin-left: auto; position: relative; display: flex; align-items: center; flex: 0 1 320px; }
.hdr-search svg { position: absolute; left: 14px; color: var(--ink-2); }
.hdr-search input { width: 100%; min-height: 44px; padding: 8px 14px 8px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); }
.bag-btn { position: relative; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: transform .2s; }
.bag-btn.bump { animation: bump .5s var(--ease); }
@keyframes bump { 40% { transform: scale(1.15); } }
.bag-n { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--terra); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.hdr-menu { display: none; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 980px) {
  .hdr-menu { display: inline-flex; }
  .hdr-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--paper); border-bottom: 1px solid var(--line); padding: 6px clamp(16px, 4vw, 48px) 14px; display: none; }
  .hdr-nav.open { display: flex; }
  .hdr-nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .hdr-in { gap: 12px; }
}
@media (max-width: 640px) {
  .hdr-in { flex-wrap: wrap; padding-bottom: 12px; min-height: 0; padding-top: 12px; }
  .hdr-search { order: 5; flex: 1 1 100%; }
  .bag-btn { margin-left: auto; }
  .logo { font-size: 25px; }
}

/* Hero */
.hero { position: relative; min-height: min(78vh, 680px); display: flex; align-items: flex-end; color: #fff; overflow: hidden; }
.hero-img { position: absolute; inset: 0; background: #3A342D; }
.hero-img img { width: 100%; height: 100%; object-fit: cover; animation: hero-zoom 14s ease-out both; }
@keyframes hero-zoom { from { transform: scale(1.08); } }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20, 16, 12, .05) 30%, rgba(20, 16, 12, .72)); }
.hero-txt { position: relative; z-index: 2; padding-top: 80px; padding-bottom: clamp(40px, 7vw, 80px); max-width: 1320px; width: 100%; }
.hero-txt .eyebrow { color: #F0C9B5; }
.hero h1 { font-size: clamp(44px, 7.5vw, 104px); max-width: 820px; animation: rise .9s .1s var(--ease) both; }
.hero-txt > p:not(.eyebrow) { max-width: 520px; margin: 18px 0 28px; font-size: 18px; color: #EDE6DC; animation: rise .9s .25s var(--ease) both; }
.hero .btn { background: var(--paper); color: var(--ink); animation: rise .9s .4s var(--ease) both; }
.hero .btn:hover { background: #fff; }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } }

/* Categorias */
.cats { padding-top: 36px; padding-bottom: 8px; }
.cats-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }
.cat-chip { flex: none; display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 6px 18px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 700; font-size: 14.5px; cursor: pointer; transition: border-color .2s, background .2s, color .2s; }
.cat-chip img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; background: var(--paper-2); }
.cat-chip[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.cat-chip:hover { border-color: var(--ink); }

/* Catálogo */
.shop { padding-top: 32px; padding-bottom: 72px; }
.shop-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.shop-head h2 { font-size: clamp(34px, 4vw, 52px); }
.shop-head p { color: var(--ink-2); margin-top: 6px; }
.shop-tools { display: flex; gap: 10px; align-items: center; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; color: var(--ink-2); }
.sort select { min-height: 44px; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--white); font-weight: 700; color: var(--ink); }
.filters-toggle { display: none; }
.shop-body { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; align-items: start; }
.filters { position: sticky; top: 96px; display: grid; gap: 22px; }
.f-head { display: flex; justify-content: space-between; align-items: center; }
.filters fieldset { border: 0; margin: 0; padding: 0; }
.filters legend { font-weight: 700; font-size: 14px; margin-bottom: 10px; padding: 0; }
.f-opts { display: grid; gap: 8px; }
.f-opts label, .f-check { display: flex; align-items: center; gap: 10px; font-size: 14.5px; cursor: pointer; }
.f-opts input, .f-check input { width: 18px; height: 18px; accent-color: var(--ink); }
.f-sizes, .f-colors { display: flex; flex-wrap: wrap; gap: 6px; }
.size-btn { min-width: 42px; height: 38px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--line); background: var(--white); font-weight: 700; font-size: 13px; cursor: pointer; }
.size-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.color-btn { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--white); box-shadow: 0 0 0 1px var(--line); cursor: pointer; padding: 0; }
.color-btn[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--ink); }
.filters input[type="range"] { width: 100%; accent-color: var(--terra); }
.f-apply { display: none; }
@media (max-width: 900px) {
  .shop-body { grid-template-columns: 1fr; }
  .filters-toggle { display: inline-flex; }
  .filters { position: fixed; inset: auto 0 0 0; top: auto; z-index: 120; max-height: 82vh; overflow-y: auto; background: var(--paper); border-radius: 20px 20px 0 0; padding: 22px clamp(16px, 4vw, 32px) 28px; box-shadow: 0 -20px 50px rgba(0, 0, 0, .25); transform: translateY(105%); transition: transform .35s var(--ease); }
  .filters.open { transform: none; }
  .f-apply { display: inline-flex; width: 100%; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 28px 20px; }
.card { position: relative; display: flex; flex-direction: column; gap: 10px; animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 40ms); }
.card-img { position: relative; aspect-ratio: 3 / 4; border-radius: 14px; overflow: hidden; background: var(--paper-2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.card:hover .card-img img { transform: scale(1.05); }
.card-open { position: absolute; inset: 0; z-index: 1; border: 0; background: transparent; cursor: pointer; border-radius: 14px; }
.card-tags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; z-index: 2; pointer-events: none; }
.tag { font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; background: var(--white); color: var(--ink); }
.tag.sale { background: var(--terra); color: #fff; }
.card-quick { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; min-height: 42px; border-radius: 999px; border: 0; background: rgba(255, 255, 255, .95); font-weight: 700; font-size: 14px; cursor: pointer; opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s; }
.card:hover .card-quick, .card-quick:focus-visible { opacity: 1; transform: none; }
@media (hover: none) { .card-quick { opacity: 1; transform: none; } }
.card h3 { font-family: var(--sans); font-weight: 600; font-size: 15.5px; letter-spacing: 0; line-height: 1.3; }
.card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.price { font-weight: 700; }
.price s { color: var(--ink-2); font-weight: 500; font-size: 13px; margin-left: 6px; }
.dots { display: flex; gap: 4px; }
.dots i { width: 12px; height: 12px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15); }
.empty { grid-column: 1 / -1; padding: 60px 20px; text-align: center; color: var(--ink-2); border: 1px dashed var(--line); border-radius: 16px; }
.empty b { display: block; font-family: var(--serif); font-size: 26px; color: var(--ink); margin-bottom: 6px; font-weight: 500; }

/* Banner */
.banner { display: grid; grid-template-columns: 1.2fr 1fr; gap: 0; margin-bottom: 72px; border-radius: 20px; overflow: hidden; background: var(--ink); color: var(--paper); padding: 0; }
.banner-img { min-height: 340px; background: #3A342D; }
.banner-img img { width: 100%; height: 100%; object-fit: cover; }
.banner-txt { padding: clamp(28px, 4vw, 56px); display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.banner-txt h2 { font-size: clamp(30px, 3.4vw, 46px); }
.banner-txt p:not(.eyebrow) { color: #D9D1C4; }
.banner .eyebrow { color: #E9A386; margin: 0; }
@media (max-width: 800px) { .banner { grid-template-columns: 1fr; } .banner-img { min-height: 220px; } }

/* Rodapé */
.ftr { border-top: 1px solid var(--line); padding: 40px 0 80px; font-size: 14px; color: var(--ink-2); }
.ftr-in { display: grid; grid-template-columns: 1fr 2fr 1fr; gap: 24px; align-items: start; }
.ftr-logo { font-family: var(--serif); font-size: 26px; color: var(--ink); font-weight: 600; }
.ftr a { color: var(--terra); font-weight: 700; }
@media (max-width: 760px) { .ftr-in { grid-template-columns: 1fr; } }

/* Produto (modal) */
.sheet, .drawer { position: fixed; inset: 0; z-index: 200; background: rgba(29, 27, 24, .55); animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.sheet { display: flex; align-items: center; justify-content: center; padding: 16px; }
.sheet-box { position: relative; width: 100%; max-width: 980px; max-height: calc(100dvh - 32px); overflow-y: auto; background: var(--paper); border-radius: 20px; animation: pop .35s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.pd-box { display: grid; grid-template-columns: 1fr 1fr; }
.pd-img { background: var(--paper-2); min-height: 100%; }
.pd-img img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 3 / 4; }
.pd-info { padding: clamp(22px, 3vw, 40px); display: flex; flex-direction: column; gap: 14px; }
.pd-cat { font-size: 12.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--terra); }
.pd-info h2 { font-size: clamp(30px, 3vw, 40px); padding-right: 40px; }
.pd-price { font-size: 22px; font-weight: 700; }
.pd-price s { font-size: 15px; color: var(--ink-2); font-weight: 500; margin-left: 8px; }
.pd-desc { color: var(--ink-2); }
.pd-field { border: 0; padding: 0; margin: 0; }
.pd-field legend { font-weight: 700; font-size: 14px; margin-bottom: 8px; padding: 0; }
.pd-field legend span { font-weight: 500; color: var(--ink-2); }
.pd-colors, .pd-sizes { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-sizes .size-btn { min-width: 48px; height: 44px; }
.pd-err { color: #B3261E; font-weight: 700; font-size: 14px; margin-top: 8px; }
.pd-buy { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.pd-buy .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--white); }
.qty button { width: 42px; height: 46px; border: 0; background: transparent; font-size: 20px; cursor: pointer; }
.qty span { min-width: 26px; text-align: center; font-weight: 700; }
.pd-stock { font-size: 13.5px; color: var(--ok); font-weight: 600; }
.pd-stock.low { color: var(--terra); }
.pd-guide { font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.pd-guide summary { cursor: pointer; font-weight: 700; }
.pd-guide table { width: 100%; border-collapse: collapse; margin: 10px 0 6px; }
.pd-guide th, .pd-guide td { text-align: left; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.pd-guide p { color: var(--ink-2); font-size: 12.5px; }
.x { position: absolute; top: 12px; right: 12px; z-index: 3; width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); background: var(--white); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
@media (max-width: 760px) {
  .sheet { align-items: flex-end; padding: 0; }
  .sheet-box { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .pd-box { grid-template-columns: 1fr; }
  .pd-img img { aspect-ratio: 4 / 3.4; }
}

/* Sacola (gaveta) */
.drawer { display: flex; justify-content: flex-end; }
.drawer-box { width: min(440px, 100%); height: 100%; background: var(--paper); display: flex; flex-direction: column; animation: slide .35s var(--ease); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { position: relative; display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 28px; }
.drawer-head .x { position: static; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px 22px; display: grid; gap: 10px; background: var(--white); }
.line { display: grid; grid-template-columns: 74px 1fr; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line img { width: 74px; height: 94px; object-fit: cover; border-radius: 10px; background: var(--paper-2); }
.line b { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; }
.line small { display: block; color: var(--ink-2); font-size: 13px; margin: 2px 0 8px; }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.line .qty button { width: 34px; height: 36px; font-size: 17px; }
.line .rm { border: 0; background: none; color: var(--ink-2); font-size: 13px; text-decoration: underline; cursor: pointer; padding: 4px 0; }
.sum { display: flex; justify-content: space-between; font-size: 15px; }
.sum.total { font-size: 19px; font-weight: 700; }
.sum small { color: var(--ok); font-weight: 700; }
.bag-empty { padding: 60px 10px; text-align: center; color: var(--ink-2); }
.bag-empty b { display: block; font-family: var(--serif); font-size: 26px; font-weight: 500; color: var(--ink); margin-bottom: 8px; }
.ck { display: grid; gap: 12px; padding: 16px 0; }
.ck label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
.ck input, .ck select, .ck textarea { min-height: 46px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--white); font-weight: 500; font-size: 15px; }
.ck .err { color: #B3261E; font-size: 13px; font-weight: 700; display: none; }
.ck .invalid .err { display: block; }
.ck .invalid input, .ck .invalid select { border-color: #B3261E; }
.ck .radios { display: flex; flex-wrap: wrap; gap: 8px; }
.ck .radios label { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); font-weight: 600; cursor: pointer; }
.ck .radios input { min-height: 0; width: 16px; height: 16px; accent-color: var(--ink); }
.ck-note { font-size: 12.5px; color: var(--ink-2); }
.done { padding: 30px 4px; display: grid; gap: 14px; }
.done b { font-family: var(--serif); font-size: 30px; font-weight: 500; line-height: 1.1; }
.done p { color: var(--ink-2); }
.done pre { white-space: pre-wrap; font: 13px/1.5 var(--sans); background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: 14px; margin: 0; max-height: 240px; overflow: auto; }

.toast { position: fixed; left: 50%; bottom: 24px; z-index: 400; transform: translateX(-50%); background: var(--ink); color: var(--paper); padding: 12px 18px; border-radius: 999px; font-weight: 600; font-size: 14.5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); animation: rise .3s var(--ease); white-space: nowrap; max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis; }

.vd-fallback::after { border-radius: inherit; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media (max-width: 600px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; }
  .card h3 { font-size: 14px; }
  .card .meta { flex-direction: column; align-items: flex-start; gap: 4px; }
  .card-quick { font-size: 12.5px; min-height: 36px; left: 6px; right: 6px; bottom: 6px; }
}
