/* ============================================================
   Três Fios v2 — App CSS (genérico, compartilhado)
   Reset, tipografia, seções, botões, inputs, etc.
   ============================================================ */

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; -moz-osx-font-smoothing: grayscale; }

body {
  margin: 0;
  font-family: var(--font-corpo);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--grafite);
  background: var(--branco);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-titulo);
  line-height: var(--lh-tight);
  font-weight: 700;
  color: var(--grafite-claro);
}

a { color: var(--vinho); text-decoration: none; transition: color var(--t-fast) ease; }
a:hover { color: var(--dourado); }

/* Dropdowns do header */
.tf-header__dropdown {
  position: relative;
}

.tf-header__dropdown summary {
  cursor: pointer;
  list-style: none;
}

.tf-header__dropdown summary::-webkit-details-marker {
  display: none;
}

.tf-header__dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--branco);
  border: 1px solid var(--cinza-claro);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: var(--sp-2) 0;
  margin: var(--sp-2) 0 0;
  list-style: none;
  z-index: 100;
}

.tf-header__dropdown-link {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4);
  color: var(--grafite);
  font-size: var(--fs-sm);
  text-decoration: none;
  transition: background var(--t-fast) ease;
}

.tf-header__dropdown-link:hover {
  background: var(--cinza-fundo);
  color: var(--vinho);
}

.tf-header__dropdown-link i {
  width: 16px;
  color: var(--cinza);
}

img { max-width: 100%; height: auto; display: block; }

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

input, select, textarea { font-family: inherit; font-size: inherit; color: var(--grafite); }

ul { list-style: none; }

::selection { background: var(--vinho); color: var(--branco); }
:focus-visible { outline: 2px solid var(--dourado); outline-offset: 2px; }

/* --- Container --- */
.tf-container { width: 100%; max-width: var(--container); margin: 0 auto; }

/* --- Seções --- */
.tf-section { padding: var(--sp-16) 0; position: relative; }
.tf-section--white { background: var(--branco); }
.tf-section--light { background: var(--osso); }
.tf-section--cream { background: var(--cinza-fundo); }
.tf-section--wine { background: var(--gradient-vinho); color: var(--branco); }
.tf-section--dark { background: var(--gradient-section); color: var(--branco); }
.tf-section--center { text-align: center; }
.tf-section__cta { text-align: center; margin-top: var(--sp-8); }

.tf-section-header {
  text-align: center;
  margin-bottom: var(--sp-8);
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.tf-section-number {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-family: var(--font-corpo);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--dourado);
  margin-bottom: var(--sp-4);
}

.tf-section-title {
  font-size: var(--fs-h1);
  margin-bottom: var(--sp-4);
  line-height: var(--lh-tight);
  color: var(--vinho);
}
.tf-section--wine .tf-section-title,
.tf-section--dark .tf-section-title { color: var(--branco); }

.tf-section-subtitle {
  font-size: var(--fs-lg);
  color: var(--cinza);
  line-height: var(--lh-relaxed);
}
.tf-section--wine .tf-section-subtitle,
.tf-section--dark .tf-section-subtitle { color: rgba(255,255,255,0.75); }

.gold-line {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--dourado), var(--dourado-claro));
  margin: var(--sp-5) auto 0;
  border-radius: 2px;
}

/* --- Inputs --- */
.tf-input {
  padding: 0.875rem 1.25rem;
  border: 1px solid var(--cinza-claro);
  border-radius: var(--radius-md);
  font-size: var(--fs-body);
  background: var(--branco);
  transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease;
}
.tf-input:focus { outline: none; border-color: var(--vinho); box-shadow: 0 0 0 3px rgba(107,29,42,0.08); }
.tf-input::placeholder { color: var(--cinza); }

/* --- Breadcrumb --- */
.tf-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; font-size: 0.8125rem; padding: var(--space-sm) 0}
.tf-breadcrumb__link { color: var(--cinza); transition: color var(--t-fast) ease; }
.tf-breadcrumb__link:hover { color: var(--vinho); }
.tf-breadcrumb__sep { color: var(--cinza); opacity: 0.5; }
.tf-breadcrumb__current { color: var(--grafite); font-weight: var(--fw-medium); }

/* --- Botões --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-xl);
  font-family: var(--font-corpo);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none;
  cursor: pointer;
  transition: all var(--t-base) var(--ease);
  white-space: nowrap;
  border: none;
  position: relative;
  overflow: hidden;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn--primary { background: var(--vinho); color: var(--branco); }
.btn--primary:hover:not(:disabled) { background: var(--dourado); color: var(--vinho-escuro); transform: translateY(-2px); box-shadow: var(--shadow-btn); }

.btn--secondary { background: transparent; color: var(--vinho); border: 1px solid var(--vinho); }
.btn--secondary:hover:not(:disabled) { background: var(--vinho); color: var(--branco); transform: translateY(-2px); }

.btn--ghost { background: transparent; color: var(--branco); border: 1px solid rgba(255,255,255,0.25); }
.btn--ghost:hover { background: rgba(255,255,255,0.08); border-color: var(--dourado); color: var(--dourado); transform: translateY(-2px); }

.btn--cta { background: linear-gradient(135deg, var(--dourado), var(--dourado-claro)); color: var(--vinho-escuro); font-weight: 700; box-shadow: var(--shadow-btn); }
.btn--cta:hover:not(:disabled) { transform: translateY(-3px); box-shadow: var(--shadow-btn-hover); }

.btn--sm { padding: 0.5rem 1rem; font-size: var(--fs-xs); }
.btn--lg { padding: 1rem 2.5rem; font-size: var(--fs-body); }
.btn--block { display: flex; width: 100%; }

.btn--danger { background: var(--erro); color: var(--branco); border: none; }
.btn--danger:hover:not(:disabled) { background: #991b1b; transform: translateY(-2px); }

/* Dialog de confirmação */
.tf-dialog-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-modal) + 20);
  background: rgba(31,8,13,0.7);
  backdrop-filter: blur(2px);
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.tf-dialog-overlay.is-open { display: flex; }

.tf-dialog {
  background: var(--branco);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  box-shadow: var(--shadow-xl);
  animation: dialog-in 0.2s ease;
}

@keyframes dialog-in {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.tf-dialog__header {
  padding: var(--sp-5) var(--sp-5) 0;
}

.tf-dialog__title {
  font-family: var(--font-titulo);
  font-size: var(--fs-h3);
  color: var(--vinho);
}

.tf-dialog__body {
  padding: var(--sp-4) var(--sp-5);
}

.tf-dialog__msg {
  font-size: var(--fs-body);
  color: var(--grafite);
  line-height: 1.5;
  margin: 0;
}

.tf-dialog__actions {
  display: flex;
  gap: var(--sp-3);
  justify-content: flex-end;
  padding: 0 var(--sp-5) var(--sp-5);
}

/* --- Loading --- */
.tf-loading { position: relative; opacity: 0.7; pointer-events: none; }
.tf-loading::after {
  content: '';
  position: absolute; top: 50%; left: 50%;
  width: 28px; height: 28px;
  margin: -14px 0 0 -14px;
  border: 2px solid var(--osso);
  border-top-color: var(--dourado);
  border-radius: 50%;
  animation: tf-spin 0.8s linear infinite;
}
@keyframes tf-spin { to { transform: rotate(360deg); } }

/* --- Empty state --- */
.tf-empty { text-align: center; padding: var(--sp-16) var(--sp-4); }
.tf-empty__text { color: var(--cinza); font-size: var(--fs-lg); margin-bottom: var(--sp-5); }

.tf-hide { display:none; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--cinza); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--vinho); }

/* --- Scroll reveal --- */
.tf-reveal { opacity: 0; transform: translateY(40px); transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out); }
.tf-reveal.tf-visible { opacity: 1; transform: translateY(0); }

/* --- Responsivo genérico --- */
@media (max-width: 768px) {
  .tf-section { padding: var(--sp-10) 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
