:root {
  --ink:        #15171C;
  --ink-2:      #1C1F26;
  --ink-3:      #262A34;
  --hairline:   #34394480;
  --parchment:  #ECE6D9;
  --muted:      #948C7C;
  --muted-2:    #6C6759;
  --gold:       #C9A45A;
  --gold-soft:  #E7D19E;
  --gold-dim:   #8A6F3E;
  --wine:       #7C303C;
  --danger-text:#E2949B;
  --shadow:     0 24px 48px -24px rgba(10,7,2,0.7);
  --radius-s:   3px;
  --radius-m:   6px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { background: var(--ink); }

body {
  margin: 0;
  background: var(--ink);
  color: var(--parchment);
  font-family: 'Public Sans', 'Segoe UI', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

::selection { background: var(--gold-dim); color: var(--ink); }
a { color: var(--gold-soft); }

.weave {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(115deg, rgba(201,164,90,0.05) 0px, rgba(201,164,90,0.05) 1px, transparent 1px, transparent 7px),
    repeating-linear-gradient(25deg, rgba(0,0,0,0.35) 0px, rgba(0,0,0,0.35) 1px, transparent 1px, transparent 7px);
  opacity: .55;
}
.vignette {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse 90% 60% at 50% -10%, rgba(201,164,90,0.10), transparent 60%),
              radial-gradient(ellipse 120% 80% at 50% 110%, rgba(0,0,0,0.55), transparent 55%);
}

.wrap { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 56px); }

/* ---------- HERO ---------- */
header.hero { position: relative; z-index: 1; padding: clamp(40px, 7vw, 76px) 0 clamp(48px, 7vw, 72px); border-bottom: 1px solid var(--hairline); }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
.mark { width: 40px; height: auto; display: block; margin-bottom: 20px; filter: drop-shadow(0 6px 14px rgba(201,164,90,0.22)); }
.eyebrow { font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); margin: 0 0 16px; }
h1.title { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: clamp(2.3rem, 4.6vw, 3.6rem); line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 16px; text-wrap: balance; color: var(--parchment); }
h1.title em { font-style: italic; font-weight: 500; color: var(--gold-soft); padding-bottom: 0.08em; display: inline-block; }
p.tagline { font-size: clamp(0.98rem, 1.4vw, 1.08rem); color: var(--muted); margin: 0 0 30px; max-width: 42ch; }
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.cta { display: inline-flex; align-items: center; gap: 9px; padding: 12px 22px; border-radius: 999px; font-family: 'Public Sans', sans-serif; font-weight: 600; font-size: 14.5px; white-space: nowrap; text-decoration: none; border: 1px solid var(--hairline); color: var(--parchment); background: var(--ink-2); transition: border-color .2s ease, transform .2s ease, background .2s ease; cursor: pointer; }
.cta.primary { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); color: #1C1508; border-color: transparent; font-weight: 700; }
.cta:hover { transform: translateY(-1px); border-color: var(--gold-dim); }
.cta.primary:hover { filter: brightness(1.05); }
.cta svg { width: 16px; height: 16px; flex: none; }

.hero-collage { position: relative; height: clamp(280px, 34vw, 400px); }
.hero-collage figure { position: absolute; margin: 0; width: 58%; aspect-ratio: 4 / 5; border-radius: var(--radius-m); overflow: hidden; border: 1px solid var(--hairline); box-shadow: var(--shadow); background: var(--ink-2); }
.hero-collage img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; }
.hero-collage .p1 { top: 0; left: 4%; width: 52%; transform: rotate(-4deg); z-index: 2; }
.hero-collage .p2 { top: 8%; right: 2%; width: 46%; transform: rotate(3deg); z-index: 3; }
.hero-collage .p3 { bottom: 0; left: 26%; width: 44%; transform: rotate(-1.5deg); z-index: 1; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-collage { order: -1; height: clamp(220px, 62vw, 320px); margin-bottom: 8px; }
}

/* ---------- FILTER BAR ---------- */
.filterbar { position: sticky; top: 0; z-index: 5; background: rgba(21,23,28,0.86); backdrop-filter: blur(10px); border-bottom: 1px solid var(--hairline); }
.filterbar-inner { display: flex; gap: 9px; flex-wrap: wrap; padding: 16px clamp(20px, 4vw, 56px); max-width: 1180px; margin: 0 auto; }
.chip { font-family: 'IBM Plex Mono', monospace; font-size: 12px; letter-spacing: 0.03em; color: var(--muted); background: transparent; border: 1px solid var(--hairline); border-radius: 999px; padding: 7px 14px; cursor: pointer; display: inline-flex; align-items: center; gap: 7px; transition: border-color .15s ease, color .15s ease, background .15s ease; }
.chip:hover { color: var(--parchment); border-color: var(--gold-dim); }
.chip.is-active { color: var(--ink); background: var(--gold-soft); border-color: var(--gold-soft); }
.chip-n { opacity: .65; font-size: 10.5px; }
.chip.is-active .chip-n { opacity: .55; }

/* ---------- GRID ---------- */
main { position: relative; z-index: 1; padding: 44px 0 120px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 30px 24px; }

.card { position: relative; display: flex; flex-direction: column; opacity: 0; transform: translateY(18px); transition: opacity .6s cubic-bezier(.22,.61,.36,1), transform .6s cubic-bezier(.22,.61,.36,1); }
.card.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .card { transition: none; opacity: 1; transform: none; } }

.frame { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-m); overflow: hidden; background: var(--ink-2); border: 1px solid var(--hairline); box-shadow: var(--shadow); transition: border-color .25s ease, transform .25s ease; }
.card:hover .frame { border-color: var(--gold-dim); transform: translateY(-3px); }
.frame img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; display: block; filter: saturate(1.03) contrast(1.02); transition: transform .5s cubic-bezier(.22,.61,.36,1), filter .25s ease; }
.card:hover .frame img { transform: scale(1.045); }
.frame-sheen { position: absolute; inset: 0; background: linear-gradient(155deg, rgba(255,255,255,0.10) 0%, transparent 30%, transparent 100%); pointer-events: none; }

.stitch { height: 12px; margin: 10px 2px 0; background-image: repeating-linear-gradient(90deg, var(--gold-dim) 0 6px, transparent 6px 12px); background-position: center; background-size: 100% 1px; background-repeat: no-repeat; opacity: .55; }

.meta { padding: 2px 2px 0; }
.meta-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.code { font-family: 'IBM Plex Mono', monospace; font-size: 12px; color: var(--gold); letter-spacing: 0.04em; }
.tag-cut { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 500; font-size: 13.5px; color: var(--muted); }
h3.name { font-family: 'Cormorant Garamond', Georgia, serif; font-weight: 600; font-size: 19px; line-height: 1.28; margin: 0 0 8px; color: var(--parchment); text-wrap: balance; }
.cat-pill { display: inline-block; font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted-2); border: 1px solid var(--hairline); border-radius: 999px; padding: 3px 9px; }

.empty-state { display: none; text-align: center; padding: 60px 0; color: var(--muted); font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 1.2rem; }
.empty-state.is-visible { display: block; }
.is-hidden { display: none !important; }

/* ---------- SELECT + DISPONIBILIDADE ---------- */
.select-btn { position: absolute; top: 10px; left: 10px; z-index: 4; width: 30px; height: 30px; border-radius: 50%; background: rgba(21,23,28,0.72); border: 1px solid var(--hairline); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; backdrop-filter: blur(2px); padding: 0; }
.select-btn svg { width: 15px; height: 15px; stroke: var(--parchment); fill: none; stroke-width: 2.4; opacity: .85; }
.select-btn:hover { border-color: var(--gold-dim); transform: scale(1.06); }
.card.is-selected .select-btn { background: var(--gold-soft); border-color: var(--gold-soft); }
.card.is-selected .select-btn svg { stroke: #1C1508; opacity: 1; }
.card.is-selected .frame { border-color: var(--gold); box-shadow: var(--shadow), 0 0 0 1px var(--gold) inset; }

.card.is-unavailable .frame img { filter: grayscale(1) brightness(.5) saturate(.8); }
.ribbon-corner { position: absolute; top: 0; right: 0; width: 96px; height: 96px; overflow: hidden; z-index: 4; pointer-events: none; }
.sold-badge { position: absolute; top: 16px; right: -30px; transform: rotate(40deg); background: var(--wine); color: var(--parchment); font-family: 'IBM Plex Mono', monospace; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; padding: 4px 40px; box-shadow: 0 4px 10px rgba(0,0,0,.4); }

/* ---------- CARRINHO / PEDIDO ---------- */
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--ink-2); border-top: 1px solid var(--hairline); padding: 14px clamp(20px, 4vw, 56px); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; transform: translateY(110%); transition: transform .3s cubic-bezier(.22,.61,.36,1); box-shadow: 0 -16px 32px -16px rgba(0,0,0,.5); }
.cart-bar.is-visible { transform: translateY(0); }
.cart-count { font-family: 'IBM Plex Mono', monospace; font-size: 13px; color: var(--muted); }
.cart-count b { color: var(--gold-soft); font-weight: 500; }
.cart-actions { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.cart-clear { background: none; border: none; color: var(--muted); font-family: 'Public Sans', sans-serif; font-size: 13px; text-decoration: underline; cursor: pointer; padding: 0; }

/* ---------- FOOTER ---------- */
footer { position: relative; z-index: 1; margin-top: 60px; padding: 56px 0 60px; border-top: 1px solid var(--hairline); text-align: center; }
.footer-mark { width: 34px; height: auto; margin: 0 auto 16px; opacity: .9; }
footer h2 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: clamp(1.6rem, 3vw, 2.1rem); margin: 0 0 10px; color: var(--parchment); }
footer p.note { color: var(--muted-2); font-size: 13px; margin: 26px 0 0; }
.contact-row { display: flex; justify-content: center; gap: 34px; flex-wrap: wrap; margin: 22px 0 6px; font-family: 'IBM Plex Mono', monospace; font-size: 13.5px; color: var(--muted); }
.contact-row b { color: var(--gold-soft); font-weight: 500; }
.contact-row a { color: inherit; text-decoration: underline; }
.admin-link { color: var(--muted-2); font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .04em; text-decoration: underline; margin-top: 22px; display: inline-block; }

@media (max-width: 480px) {
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 22px 14px; }
}

/* ---------- AUTH ---------- */
.auth-shell { position: relative; z-index: 1; min-height: 100dvh; display: flex; align-items: center; justify-content: center; padding: 24px; }
.auth-card { width: 100%; max-width: 380px; background: var(--ink-2); border: 1px solid var(--hairline); border-radius: 10px; padding: 34px 30px; }
.auth-card .mark { margin: 0 auto 18px; }
.auth-card h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.6rem; text-align: center; margin: 0 0 4px; color: var(--parchment); }
.auth-card p.sub { text-align: center; color: var(--muted-2); font-size: 12.5px; margin: 0 0 24px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-family: 'IBM Plex Mono', monospace; font-size: 11px; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); margin-bottom: 7px; }
.field input { width: 100%; background: var(--ink-3); border: 1px solid var(--hairline); border-radius: var(--radius-s); color: var(--parchment); font-family: 'Public Sans', sans-serif; font-size: 14.5px; padding: 11px 14px; outline: none; }
.field input:focus { border-color: var(--gold-dim); }
.field-error { color: var(--danger-text); font-size: 12px; margin-top: 6px; font-family: 'IBM Plex Mono', monospace; }
.btn-block { width: 100%; }
.back-link { display: block; text-align: center; margin-top: 18px; font-size: 12.5px; color: var(--muted-2); }

/* ---------- AREA DA LOJA ---------- */
.admin-shell { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; padding: clamp(28px, 5vw, 56px) clamp(20px, 4vw, 40px) 80px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.admin-header h1 { font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.9rem; margin: 0; color: var(--parchment); }
.admin-status-banner { background: var(--ink-2); border: 1px solid var(--gold-dim); color: var(--gold-soft); font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; padding: 10px 16px; border-radius: var(--radius-s); margin-bottom: 22px; }
.admin-row { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
.admin-row img { width: 46px; height: 58px; object-fit: cover; border-radius: 4px; flex: none; border: 1px solid var(--hairline); }
.admin-row-name { flex: 1; font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; color: var(--parchment); }
.admin-row-name b { color: var(--gold); margin-right: 8px; }
.admin-row-name span.sub { display: block; color: var(--muted-2); font-size: 11px; margin-top: 2px; }
.switch { position: relative; width: 42px; height: 24px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch .track { position: absolute; inset: 0; background: var(--ink-3); border: 1px solid var(--hairline); border-radius: 999px; transition: background .15s ease, border-color .15s ease; cursor: pointer; }
.switch .thumb { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.switch input:checked + .track { background: var(--gold-dim); border-color: var(--gold); }
.switch input:checked + .track .thumb { transform: translateX(18px); background: var(--gold-soft); }
.admin-actions-row { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }
.btn-ghost { background: transparent; border: 1px solid var(--hairline); color: var(--parchment); border-radius: 999px; padding: 10px 18px; font-family: 'Public Sans', sans-serif; font-weight: 600; font-size: 13.5px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; }
.btn-gold { background: linear-gradient(180deg, var(--gold-soft), var(--gold)); border: none; color: #1C1508; border-radius: 999px; padding: 10px 18px; font-family: 'Public Sans', sans-serif; font-weight: 700; font-size: 13.5px; cursor: pointer; }
