/**
 * ETERNA BELEZA | Módulo de Documentação Legal e Gestão de Cookies
 * Estilos Dedicados (legal.css)
 *
 * CSS puro, modular, responsivo e sem dependências externas.
 */

:root {
  --cookie-bg: #FFFFFF;
  --cookie-text: #2D2A26;
  --cookie-border: rgba(198, 161, 91, 0.35);
  --cookie-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
  --cookie-btn-accept-bg: #C6A15B;
  --cookie-btn-accept-text: #FFFFFF;
  --cookie-btn-reject-bg: #F5F3EF;
  --cookie-btn-reject-text: #2D2A26;
  --cookie-btn-settings-bg: transparent;
  --cookie-btn-settings-text: #5A5650;
}

/* Aviso discreto de tarifário telefónico (Decreto-Lei n.º 59/2021) */
.phone-rate-note {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  color: inherit;
  opacity: 0.72;
  margin-top: 3px;
  letter-spacing: normal;
  text-transform: none;
}

.phone-rate-note-inline {
  display: inline;
  font-size: 0.82em;
  font-weight: 400;
  color: inherit;
  opacity: 0.75;
  letter-spacing: normal;
  text-transform: none;
}

/* Aviso discreto de consentimento RGPD para contactos via WhatsApp */
.whatsapp-consent-note {
  display: block;
  font-size: 0.74rem;
  font-weight: 400;
  line-height: 1.4;
  color: var(--color-gray, #6B655D);
  opacity: 0.88;
  margin-top: 0.55rem;
  letter-spacing: normal;
  text-transform: none;
}

.whatsapp-consent-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer .whatsapp-consent-note {
  color: rgba(255, 255, 255, 0.65);
  max-width: 320px;
}

.site-footer .whatsapp-consent-note a {
  color: #C6A15B;
}

/* Botões com ícones de Redes Sociais */
.social-icon-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-icon-btn:hover {
  background-color: #C6A15B;
  border-color: #C6A15B;
  color: #1A1816;
  transform: translateY(-2px);
}

.social-icon-btn svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

.footer-dev-credit {
  font-size: 0.74rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.35rem;
  letter-spacing: 0.02em;
}

.footer-dev-credit a {
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-dev-credit a:hover {
  color: #C6A15B;
  text-decoration: underline;
}

/* ==========================================================================
   1. BARRA DE CONSENTIMENTO DE COOKIES (footer-cookies.php)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background-color: var(--cookie-bg);
  color: var(--cookie-text);
  border-top: 1px solid var(--cookie-border);
  box-shadow: var(--cookie-shadow);
  padding: 1.25rem 1.5rem;
  transform: translateY(110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease, visibility 0.3s;
}

.cookie-banner.is-active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.cookie-banner-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  align-items: stretch;
}

@media (min-width: 992px) {
  .cookie-banner-container {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
  }
}

.cookie-banner-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #4A4640;
  margin: 0;
  flex: 1;
}

.cookie-banner-text a {
  color: #A37E36;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-banner-text a:hover {
  color: #1A1816;
}

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

.cookie-btn {
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 0.7rem 1.25rem;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.25s ease;
  text-align: center;
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cookie-btn-accept {
  background-color: var(--cookie-btn-accept-bg);
  color: var(--cookie-btn-accept-text);
  border-color: var(--cookie-btn-accept-bg);
}

.cookie-btn-accept:hover,
.cookie-btn-accept:focus-visible {
  background-color: #B28E46;
  border-color: #B28E46;
  box-shadow: 0 4px 14px rgba(198, 161, 91, 0.4);
}

.cookie-btn-reject {
  background-color: var(--cookie-btn-reject-bg);
  color: var(--cookie-btn-reject-text);
  border-color: #E6E1D8;
}

.cookie-btn-reject:hover,
.cookie-btn-reject:focus-visible {
  background-color: #ECE7DE;
  border-color: #D8D2C6;
}

.cookie-btn-settings {
  background-color: var(--cookie-btn-settings-bg);
  color: var(--cookie-btn-settings-text);
  border-color: #D8D2C6;
}

.cookie-btn-settings:hover,
.cookie-btn-settings:focus-visible {
  background-color: #F5F3EF;
  color: #1A1816;
}

/* ==========================================================================
   2. MODAL DE PREFERÊNCIAS DE COOKIES
   ========================================================================== */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background-color: rgba(20, 18, 16, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  backdrop-filter: blur(4px);
}

.cookie-modal-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.cookie-modal {
  background-color: #FFFFFF;
  border-radius: 20px;
  max-width: 680px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.25);
  display: flex;
  flex-direction: column;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.cookie-modal-overlay.is-active .cookie-modal {
  transform: translateY(0);
}

.cookie-modal-header {
  padding: 1.5rem 2rem 1.25rem;
  border-bottom: 1px solid #ECE7DE;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cookie-modal-header h3 {
  font-family: var(--font-serif, "Playfair Display", serif);
  font-size: 1.45rem;
  color: #1A1816;
  margin: 0;
}

.cookie-modal-close {
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #8C867D;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: color 0.2s, background-color 0.2s;
}

.cookie-modal-close:hover {
  color: #1A1816;
  background-color: #F5F3EF;
}

.cookie-modal-body {
  padding: 1.75rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cookie-modal-intro {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #5A5650;
  margin: 0;
}

.cookie-category-item {
  border: 1px solid #ECE7DE;
  border-radius: 14px;
  padding: 1.15rem 1.25rem;
  background-color: #FAF8F5;
  transition: border-color 0.2s;
}

.cookie-category-item:hover {
  border-color: #D8D2C6;
}

.cookie-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
}

.cookie-category-title {
  font-weight: 600;
  font-size: 1rem;
  color: #1A1816;
}

.cookie-category-status {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 9999px;
  background-color: #E8F5E9;
  color: #2E7D32;
}

.cookie-category-desc {
  font-size: 0.86rem;
  line-height: 1.6;
  color: #6A655F;
  margin: 0;
}

/* Custom Switch Toggle */
.cookie-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 26px;
  flex-shrink: 0;
}

.cookie-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: #D3CEC4;
  border-radius: 9999px;
  transition: 0.3s;
}

.cookie-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  border-radius: 50%;
  transition: 0.3s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cookie-switch input:checked + .cookie-slider {
  background-color: #C6A15B;
}

.cookie-switch input:focus-visible + .cookie-slider {
  outline: 2px solid #C6A15B;
  outline-offset: 2px;
}

.cookie-switch input:checked + .cookie-slider:before {
  transform: translateX(22px);
}

.cookie-modal-footer {
  padding: 1.25rem 2rem;
  border-top: 1px solid #ECE7DE;
  background-color: #FAF8F5;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  border-radius: 0 0 20px 20px;
}

/* Botão permanente no rodapé */
.btn-cookie-preferences {
  background: none;
  border: none;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
  font-family: inherit;
  font-size: 0.82rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s;
}

.btn-cookie-preferences:hover {
  color: #C6A15B;
}

/* ==========================================================================
   3. NAVEGAÇÃO E ARTIGOS DAS PÁGINAS LEGAIS
   ========================================================================== */
.legal-nav-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 2.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid #EAE5DC;
}

.legal-tab-link {
  font-size: 0.84rem;
  font-weight: 500;
  color: #5A5650;
  padding: 6px 14px;
  border-radius: 9999px;
  background-color: #F7F5F0;
  text-decoration: none;
  transition: all 0.2s;
}

.legal-tab-link:hover {
  background-color: #ECE7DE;
  color: #1A1816;
}

.legal-tab-link.is-active {
  background-color: #1A1816;
  color: #FFFFFF;
}

/* Tabelas Legais e de Cookies */
.legal-table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 1.75rem 0 2rem;
  border: 1px solid #ECE7DE;
  border-radius: 12px;
}

.legal-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.88rem;
  background-color: #FFFFFF;
}

.legal-table th,
.legal-table td {
  padding: 12px 16px;
  border-bottom: 1px solid #ECE7DE;
  vertical-align: top;
}

.legal-table th {
  background-color: #FAF8F5;
  color: #1A1816;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.legal-table tr:last-child td {
  border-bottom: none;
}

.legal-table tr:hover td {
  background-color: #FFFDF9;
}

/* Destaque para Livro de Reclamações */
.livro-reclamacoes-box {
  background-color: #FAF8F5;
  border: 1px solid rgba(198, 161, 91, 0.4);
  border-radius: 16px;
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
}

.livro-reclamacoes-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #1A1816;
  color: #FFFFFF;
  padding: 1rem 2rem;
  border-radius: 9999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 0.95rem;
  transition: all 0.25s;
  margin-top: 1.25rem;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.livro-reclamacoes-btn:hover {
  background-color: #C6A15B;
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(198, 161, 91, 0.35);
}

/* Cartões de Entidade RAL */
.ral-card {
  border: 1px solid #ECE7DE;
  border-radius: 14px;
  padding: 1.5rem;
  background-color: #FAF8F5;
  margin: 1.5rem 0;
}

.ral-card h4 {
  font-size: 1.1rem;
  color: #1A1816;
  margin-bottom: 0.75rem;
}

.ral-card p {
  margin-bottom: 0.5rem;
  font-size: 0.92rem;
}

.ral-card a {
  color: #A37E36;
  font-weight: 600;
  text-decoration: underline;
}

/* ==========================================================================
   4. RESPONSIVIDADE E USABILIDADE MOBILE
   ========================================================================== */
@media (max-width: 575px) {
  .cookie-banner {
    padding: 1rem 1rem max(1rem, env(safe-area-inset-bottom, 1rem));
  }

  .cookie-banner-actions {
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .cookie-banner-actions .cookie-btn {
    width: 100%;
    min-height: 44px;
  }

  .cookie-modal-overlay {
    padding: 0.75rem;
  }

  .cookie-modal {
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 16px;
  }

  .cookie-modal-header {
    padding: 1.15rem 1.25rem 1rem;
  }

  .cookie-modal-header h3 {
    font-size: 1.25rem;
  }

  .cookie-modal-body {
    padding: 1.15rem 1.25rem;
    gap: 1.15rem;
  }

  .cookie-category-item {
    padding: 1rem;
  }

  .cookie-modal-footer {
    padding: 1rem 1.25rem max(1rem, env(safe-area-inset-bottom, 1rem));
    flex-direction: column;
    border-radius: 0 0 16px 16px;
  }

  .cookie-modal-footer .cookie-btn {
    width: 100%;
    min-height: 44px;
  }

  .livro-reclamacoes-box {
    padding: 1.25rem 1rem;
  }

  .livro-reclamacoes-btn {
    width: 100%;
    justify-content: center;
    padding: 0.85rem 1.25rem;
    font-size: 0.88rem;
  }

  .legal-table-responsive {
    -webkit-overflow-scrolling: touch;
  }
}
