/* ===========================
   LEGAL PAGES (legal.css)
   Política de Privacidade,
   Termos de Uso,
   Política de Cookies
=========================== */

/* --- Base --- */
.legal-page {
  background: var(--light-bg);
  color: var(--dark);
  font-family: var(--font-sans);
}

/* --- Header --- */
.legal-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 247, 244, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}

.legal-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .85rem;
  font-weight: 600;
  color: var(--wine);
  text-decoration: none;
  transition: gap 0.2s;
}
.legal-back-link:hover { gap: 12px; }

.legal-header-brand {
  font-family: var(--font-serif);
  font-size: .9rem;
  font-weight: 700;
  color: var(--dark);
  opacity: .5;
}

/* --- Main layout --- */
.legal-main {
  min-height: calc(100vh - 70px);
  padding: 64px 0 80px;
}

.legal-container {
  max-width: 800px;
  margin: 0 auto;
}

/* --- Hero --- */
.legal-hero {
  text-align: center;
  margin-bottom: 56px;
}

.legal-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--dark);
  margin: 12px 0 16px;
}
.legal-title span { color: var(--wine); }

.legal-meta {
  font-size: .82rem;
  color: var(--muted);
  letter-spacing: .03em;
}

/* --- Body --- */
.legal-body { display: flex; flex-direction: column; gap: 0; }

.legal-intro {
  background: rgba(140,26,58,.04);
  border-left: 3px solid var(--wine);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 20px 24px;
  margin-bottom: 40px;
  font-size: .97rem;
  line-height: 1.75;
  color: var(--dark);
}

/* --- Sections --- */
.legal-section {
  padding: 36px 0;
  border-bottom: 1px solid var(--border);
}
.legal-section:last-of-type { border-bottom: none; }

.legal-section h2 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 16px;
}

.legal-section h3 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--dark);
  margin: 20px 0 10px;
}

.legal-section p {
  font-size: .93rem;
  line-height: 1.78;
  color: #3a3545;
  margin-bottom: 12px;
}
.legal-section p:last-child { margin-bottom: 0; }

.legal-section a {
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal-section a:hover { color: var(--wine-light); }

/* --- List --- */
.legal-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.legal-list li {
  font-size: .93rem;
  line-height: 1.65;
  color: #3a3545;
  padding-left: 20px;
  position: relative;
}

.legal-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--wine);
  opacity: .6;
}

/* --- Info box --- */
.legal-info-box {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  margin: 16px 0;
  box-shadow: var(--shadow-sm);
}
.legal-info-box p {
  font-size: .9rem;
  line-height: 1.7;
  margin: 0;
}

/* --- Highlight box --- */
.legal-highlight {
  background: rgba(201,150,74,.08);
  border: 1px solid rgba(201,150,74,.25);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: .88rem;
  line-height: 1.65;
  color: #3a3545;
}

/* --- Table --- */
.legal-table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .85rem;
}

.legal-table th {
  background: rgba(140,26,58,.06);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.legal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(140,26,58,.07);
  color: #3a3545;
  line-height: 1.55;
  vertical-align: top;
}

.legal-table tr:last-child td { border-bottom: none; }
.legal-table tr:hover td { background: rgba(140,26,58,.03); }

.legal-table code {
  font-size: .8rem;
  background: rgba(140,26,58,.07);
  padding: 2px 7px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  color: var(--wine-dark);
  white-space: nowrap;
}

/* --- Cookie category block (cookies page) --- */
.cookie-category {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.cookie-category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.cookie-category-header h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}

.cookie-badge {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 100px;
}

.cookie-badge--essential {
  background: rgba(140,26,58,.1);
  color: var(--wine);
  border: 1px solid rgba(140,26,58,.2);
}

.cookie-badge--analytics {
  background: rgba(201,150,74,.1);
  color: #8a6420;
  border: 1px solid rgba(201,150,74,.25);
}

.cookie-status {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 100px;
}

.cookie-status--always {
  background: rgba(34,197,94,.1);
  color: #166534;
  border: 1px solid rgba(34,197,94,.2);
}

.cookie-status--optional {
  background: rgba(201,150,74,.1);
  color: #8a6420;
  border: 1px solid rgba(201,150,74,.25);
}

.cookie-category p {
  font-size: .88rem;
  margin-bottom: 16px;
}

/* --- Nav links at bottom of legal pages --- */
.legal-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

.legal-nav-links a {
  display: inline-flex;
  align-items: center;
  font-size: .85rem;
  font-weight: 600;
  color: var(--wine);
  text-decoration: none;
  padding: 10px 20px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: var(--white);
  transition: all .2s;
}

.legal-nav-links a:hover {
  background: var(--wine);
  color: var(--white);
  border-color: var(--wine);
}

/* --- Footer --- */
.legal-footer {
  background: var(--dark);
  padding: 24px 0;
}

.legal-footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: .78rem;
  color: rgba(255,255,255,.45);
}

/* --- Button for legal pages --- */
.btn-outline-wine {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 100px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--wine);
  background: transparent;
  border: 1.5px solid var(--wine);
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
}
.btn-outline-wine:hover {
  background: var(--wine);
  color: var(--white);
}

/* ===========================
   COOKIE BANNER
=========================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: var(--dark);
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 20px 0;
  animation: slideUp .35s ease;
}

@keyframes slideUp {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.cookie-banner[hidden] { display: none; }

.cookie-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}

.cookie-banner-text {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
  min-width: 240px;
}

.cookie-banner-icon {
  flex-shrink: 0;
  color: var(--gold);
  margin-top: 2px;
}

.cookie-banner-text p {
  font-size: .88rem;
  line-height: 1.6;
  color: rgba(255,255,255,.75);
  margin: 0;
}

.cookie-banner-text a {
  color: var(--gold-light);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

/* --- Cookie Buttons --- */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 100px;
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .2s;
  white-space: nowrap;
  font-family: var(--font-sans);
}

.cookie-btn--accept {
  background: var(--wine);
  color: var(--white);
}
.cookie-btn--accept:hover { background: var(--wine-light); }

.cookie-btn--reject {
  background: transparent;
  color: rgba(255,255,255,.7);
  border: 1px solid rgba(255,255,255,.2);
}
.cookie-btn--reject:hover {
  border-color: rgba(255,255,255,.5);
  color: var(--white);
}

.cookie-btn--settings {
  background: transparent;
  color: var(--gold-light);
  border: 1px solid rgba(201,150,74,.35);
  font-size: .8rem;
}
.cookie-btn--settings:hover {
  border-color: var(--gold);
  color: var(--gold);
}

/* ===========================
   COOKIE MODAL
=========================== */
.cookie-modal[hidden] { display: none; }

.cookie-modal {
  position: fixed;
  inset: 0;
  z-index: 9100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
}

@media (min-width: 560px) {
  .cookie-modal { align-items: center; }
}

.cookie-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.cookie-modal-box {
  position: relative;
  z-index: 1;
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalIn .3s ease;
}

@keyframes modalIn {
  from { transform: translateY(20px) scale(.97); opacity: 0; }
  to   { transform: translateY(0)    scale(1);   opacity: 1; }
}

.cookie-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 24px 0;
}

.cookie-modal-title {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
}

.cookie-modal-close {
  width: 36px; height: 36px;
  border: none;
  background: rgba(140,26,58,.06);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  transition: all .2s;
}
.cookie-modal-close:hover {
  background: rgba(140,26,58,.12);
  color: var(--dark);
}

.cookie-modal-body {
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cookie-modal-desc {
  font-size: .85rem;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 20px;
}

.cookie-pref-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  border-top: 1px solid var(--border);
}

.cookie-pref-info { flex: 1; }
.cookie-pref-info strong {
  display: block;
  font-size: .92rem;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 4px;
}
.cookie-pref-info p {
  font-size: .8rem;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

/* Toggle switch */
.cookie-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cookie-toggle--disabled .cookie-toggle-label {
  font-size: .75rem;
  font-weight: 600;
  color: #22c55e;
  white-space: nowrap;
}

.cookie-toggle-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-track {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  background: rgba(0,0,0,.15);
  border-radius: 100px;
  cursor: pointer;
  transition: background .2s;
}

.cookie-toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: var(--white);
  border-radius: 50%;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}

.cookie-toggle-input:checked + .cookie-toggle-track {
  background: var(--wine);
}

.cookie-toggle-input:checked + .cookie-toggle-track::after {
  left: 23px;
}

.cookie-modal-footer {
  padding: 16px 24px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.cookie-modal-link {
  font-size: .8rem;
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-modal-actions { display: flex; gap: 10px; }

/* ===========================
   FOOTER LEGAL LINKS
=========================== */
.footer-legal-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  font-size: .78rem;
  color: rgba(255,255,255,.45);
}

.footer-legal-links a {
  color: rgba(255,255,255,.55);
  text-decoration: none;
  transition: color .2s;
}
.footer-legal-links a:hover { color: var(--white); }

.footer-cookie-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: .78rem;
  color: rgba(255,255,255,.55);
  font-family: var(--font-sans);
  padding: 0;
  transition: color .2s;
}
.footer-cookie-btn:hover { color: var(--white); }
