/* ============================================================
   CARTA DE VINHOS (página por QR) — rústico, papel envelhecido
   ============================================================ */
:root {
  --cv-paper: #efe3cc;
  --cv-paper-2: #e7d8bb;
  --cv-ink: #3a2c20;
  --cv-ink-soft: #6b5743;
  --cv-wine: #6e2438;
  --cv-gold: #97793c;
  --cv-line: rgba(58, 44, 32, 0.18);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Jost', sans-serif;
  color: var(--cv-ink);
  min-height: 100vh;
  background-color: var(--cv-paper);
  background-image:
    radial-gradient(ellipse at 18% 12%, rgba(151, 121, 60, 0.10), transparent 45%),
    radial-gradient(ellipse at 85% 25%, rgba(110, 36, 56, 0.07), transparent 40%),
    radial-gradient(ellipse at 50% 100%, rgba(58, 44, 32, 0.10), transparent 55%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* Manchas de copo de vinho */
.wine-ring {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(0.6px);
  z-index: 0;
  background: radial-gradient(circle, transparent 38%, rgba(110, 36, 56, 0.16) 41%, rgba(110, 36, 56, 0.20) 47%, rgba(110, 36, 56, 0.05) 50%, transparent 52%);
}
.wine-ring.r1 { width: 230px; height: 230px; top: -40px; right: -30px; transform: rotate(12deg); }
.wine-ring.r2 { width: 170px; height: 170px; bottom: 8%; left: -50px; opacity: 0.8; }
.wine-ring.r3 { width: 120px; height: 120px; top: 42%; right: 4%; opacity: 0.55; }

.cv-wrap {
  position: relative;
  z-index: 1;
  max-width: 880px;
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4rem) clamp(1.2rem, 4vw, 2.5rem) 4rem;
}

/* Cabeçalho */
.cv-head { text-align: center; margin-bottom: clamp(2rem, 4vw, 3rem); }
.cv-eyebrow { font-size: 0.66rem; letter-spacing: 0.32em; text-transform: uppercase; color: var(--cv-gold); margin-bottom: 1rem; }
.cv-title { font-family: 'Cormorant Garamond', serif; font-weight: 400; font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1; color: var(--cv-ink); }
.cv-title em { font-style: italic; color: var(--cv-wine); }
.cv-sub { font-family: 'Cormorant Garamond', serif; font-size: clamp(1rem, 2.4vw, 1.25rem); color: var(--cv-ink-soft); margin-top: 0.8rem; font-style: italic; }
.cv-head::after { content: ''; display: block; width: 60px; height: 1px; background: var(--cv-gold); margin: 1.6rem auto 0; }

/* Logomarca */
.cv-logo { height: 60px; width: auto; display: block; margin: 0 auto 1.2rem; }

/* Foto decorativa (Carlos Gardel) */
.cv-photo { margin: 1.8rem auto 0; max-width: 330px; }
.cv-photo img {
  width: 100%; display: block;
  border: 6px solid #fbf6ea;
  box-shadow: 0 8px 26px rgba(58, 44, 32, 0.28);
  filter: sepia(0.14) contrast(1.02);
}
.cv-photo figcaption {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 1rem; color: var(--cv-ink-soft); text-align: center; margin-top: 0.6rem;
}

/* Controles (filtros + ordenação) */
.cv-controls {
  display: flex; flex-wrap: wrap; gap: 0.9rem 1.1rem; align-items: flex-end;
  justify-content: center;
  padding: 1.4rem; margin-bottom: 1.4rem;
  background: rgba(255, 252, 244, 0.45);
  border: 1px solid var(--cv-line);
}
.cv-field { display: flex; flex-direction: column; gap: 0.3rem; }
.cv-field label { font-size: 0.6rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--cv-ink-soft); }
.cv-field input, .cv-field select {
  font-family: 'Jost', sans-serif; font-size: 0.9rem; color: var(--cv-ink);
  background: rgba(255, 253, 247, 0.7);
  border: 1px solid var(--cv-line); border-radius: 0;
  padding: 0.5rem 0.7rem; min-width: 150px; cursor: pointer;
}
.cv-field input { cursor: text; }
.cv-field input:focus, .cv-field select:focus { outline: none; border-color: var(--cv-wine); }
.cv-clear { font-family: 'Jost', sans-serif; font-size: 0.7rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--cv-wine); background: none; border: 1px solid var(--cv-wine); padding: 0.55rem 1rem; cursor: pointer; transition: all 0.2s; }
.cv-clear:hover { background: var(--cv-wine); color: var(--cv-paper); }

.cv-count { text-align: center; font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cv-ink-soft); margin-bottom: 1.4rem; }
.cv-loading { text-align: center; color: var(--cv-ink-soft); padding: 2rem; }

/* Lista de vinhos */
.cv-region-title { font-family: 'Cormorant Garamond', serif; font-style: italic; font-weight: 400; font-size: clamp(1.5rem, 3.5vw, 2rem); color: var(--cv-wine); text-align: center; margin: 2.2rem 0 0.4rem; }
.cv-bodega-title { font-size: 0.68rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--cv-ink-soft); border-bottom: 1px solid var(--cv-line); padding-bottom: 0.4rem; margin: 1.4rem 0 0.8rem; }

.cv-row { padding: 0.7rem 0; border-bottom: 1px dotted var(--cv-line); }
.cv-row-top { display: flex; align-items: baseline; gap: 0.5rem; }
.cv-name { font-family: 'Cormorant Garamond', serif; font-weight: 500; font-size: 1.2rem; color: var(--cv-ink); flex: 0 1 auto; }
.cv-dots { flex: 1 1 auto; border-bottom: 1px dotted rgba(58,44,32,0.35); transform: translateY(-0.32rem); min-width: 1rem; }
.cv-price { flex: 0 0 auto; font-family: 'Cormorant Garamond', serif; font-weight: 600; font-size: 1.15rem; color: var(--cv-wine); white-space: nowrap; }
.cv-meta { font-size: 0.7rem; color: var(--cv-ink-soft); margin-top: 0.15rem; letter-spacing: 0.02em; }
.cv-meta .tag { color: var(--cv-gold); }
.cv-empty { text-align: center; color: var(--cv-ink-soft); padding: 2.5rem; font-style: italic; }

.cv-foot { text-align: center; margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--cv-line); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cv-ink-soft); }

/* ── Otimizado para smartphone (acesso via QR) ───────────── */
@media (max-width: 640px) {
  body { overflow-x: hidden; }
  .cv-wrap { padding: 1.6rem 1rem 3rem; }

  .wine-ring.r1 { width: 150px; height: 150px; top: -30px; right: -30px; }
  .wine-ring.r2 { width: 120px; height: 120px; }
  .wine-ring.r3 { display: none; }

  .cv-controls { padding: 0.9rem; gap: 0.6rem; }
  .cv-field { flex: 1 1 calc(50% - 0.35rem); }
  .cv-field:first-child { flex: 1 1 100%; }            /* busca ocupa a linha toda */
  .cv-field input, .cv-field select {
    min-width: 0; width: 100%;
    font-size: 16px;                                   /* evita zoom automático no iOS */
    padding: 0.65rem 0.7rem;
  }
  .cv-clear { flex: 1 1 100%; width: 100%; padding: 0.75rem; margin-top: 0.2rem; }

  .cv-count { margin-bottom: 1rem; }
  .cv-region-title { margin-top: 1.6rem; }
  .cv-row { padding: 0.65rem 0; }

  /* Nome à esquerda (quebra se preciso) + preço fixo à direita, sem pontilhado */
  .cv-row-top { gap: 0.6rem; align-items: flex-start; }
  .cv-name { flex: 1 1 auto; font-size: 1.08rem; line-height: 1.25; }
  .cv-dots { display: none; }
  .cv-price { flex: none; font-size: 1.05rem; padding-top: 0.05rem; }
  .cv-meta { font-size: 0.72rem; }
}

/* ── Nome clicável e popup de descrição do vinho ── */
.cv-name-link {
  background: none; border: none; padding: 0; margin: 0; cursor: pointer;
  font: inherit; color: inherit; text-align: left;
  text-decoration: underline; text-decoration-style: dotted;
  text-underline-offset: 3px; text-decoration-color: rgba(122, 90, 46, .55);
  transition: text-decoration-color .15s;
}
.cv-name-link:hover { text-decoration-color: #7a5a2e; }
.cv-icons-title { color: #7a5a2e; }

.cv-desc-modal {
  position: fixed; inset: 0; display: none; align-items: center; justify-content: center;
  background: rgba(40, 28, 14, 0.55); z-index: 999; padding: 22px;
}
.cv-desc-modal.open { display: flex; }
.cv-desc-card {
  background: #f3e7cf; color: #3a2c18; max-width: 440px; width: 100%;
  border-radius: 10px; padding: 26px 24px; position: relative;
  box-shadow: 0 18px 50px rgba(0,0,0,.4); border: 1px solid #cbb68a;
}
.cv-desc-close {
  position: absolute; top: 10px; right: 12px; background: none; border: none;
  font-size: 1.2rem; cursor: pointer; color: #6b5436;
}
.cv-desc-name { margin: 0 0 6px; font-size: 1.3rem; }
.cv-desc-meta { margin: 0 0 12px; font-size: .85rem; color: #7a6346; font-style: italic; }
.cv-desc-text { margin: 0; line-height: 1.55; font-size: .98rem; }
