/*
 Theme Name:   DA Seguros Rio Maior
 Theme URI:    https://dasegurosriomaior.pt
 Description:  Child theme for DA Seguros Rio Maior - Insurance broker
 Author:       Claude AI
 Author URI:   https://anthropic.com
 Template:     twentytwentyfive
 Version:      1.0.0
 License:      GNU General Public License v2 or later
 License URI:  http://www.gnu.org/licenses/gpl-2.0.html
 Text Domain:  daseguros-child
 Domain Path:  /languages
*/

/* Importar estilos do tema pai */
@import url('../twentytwentyfive/style.css');

/* ============================================
   RESPONSIVE MOBILE
   ============================================ */
@media (max-width: 768px) {
  body {
    font-size: 14px;
  }
  
  h1 { font-size: 28px !important; }
  h2 { font-size: 22px !important; }
  
  /* Buttons responsive */
  button, .btn {
    width: 100%;
    padding: 12px 20px !important;
    font-size: 14px !important;
    margin-bottom: 10px;
  }
  
  /* WhatsApp button - corrigir posição */
  #whatsappButton {
    bottom: 20px !important;
    right: 20px !important;
    width: 55px !important;
    height: 55px !important;
    z-index: 1001 !important;
  }
  
  /* Formulário popup */
  #formulario {
    padding: 10px !important;
  }
  
  #formulario > div {
    width: 95% !important;
    max-width: calc(100% - 20px) !important;
    margin: auto !important;
  }
  
  /* Menu */
  nav {
    flex-direction: column;
    gap: 10px;
  }
  
  nav a {
    padding: 10px 0 !important;
    display: block;
  }
  
  /* Serviços grid */
  .grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Contacto */
  .contact-info {
    padding: 20px 15px !important;
  }
}

/* ============================================
   CORES E VARIÁVEIS DA MARCA
   ============================================ */
:root {
  --color-primary: #e63946;
  --color-primary-dark: #a4161a;
  --color-primary-light: #f1465d;
  --color-secondary: #d62828;
  --color-dark: #1a1a1a;
  --color-light: #f5f5f5;
  --color-white: #ffffff;
  --color-text: #333333;
  --color-border: #e0e0e0;
  --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
  --shadow-medium: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   RESET E ESTILOS GLOBAIS
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  width: 100%;
}

body {
  background-color: var(--color-white);
  max-width: 100%;
  overflow-x: hidden;
}

/* Remover título da página/site */
.wp-site-blocks > .wp-block-post-title,
.wp-block-post-title,
.page-title,
.entry-title,
h1.site-title,
.site-title {
  display: none !important;
}

/* Garantir que todo conteúdo é full-width */
#page,
.site,
.site-content,
.wp-site-blocks {
  width: 100%;
  max-width: 100%;
}

/* Bloco de conteúdo full-width */
.wp-block-group {
  width: 100%;
  max-width: 100%;
}

/* ============================================
   HEADER PERSONALIZADO
   ============================================ */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  padding: 20px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-light);
}

.site-branding {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 28px;
  font-weight: bold;
  color: var(--color-primary);
  margin: 0;
}

.site-title a {
  text-decoration: none;
  color: var(--color-primary);
}

/* ============================================
   INFORMAÇÕES DE CONTACTO NO HEADER
   ============================================ */
.header-contact-info {
  display: flex;
  gap: 30px;
  align-items: center;
  font-size: 14px;
  color: var(--color-dark);
}

.header-contact-info a {
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.3s ease;
}

.header-contact-info a:hover {
  color: var(--color-primary);
}

.header-contact-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============================================
   NAVEGAÇÃO
   ============================================ */
.site-navigation {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.wp-block-navigation {
  margin: 0;
  padding: 0;
}

.wp-block-navigation__responsive-container {
  display: flex;
  justify-content: center;
  padding: 20px 0;
  border-top: 1px solid var(--color-border);
  margin-top: 15px;
}

.wp-block-navigation__responsive-container .wp-block-navigation__submenu-icon {
  display: none;
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><path d="M0,50 Q25,25 50,50 T100,50" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="2"/></svg>');
  opacity: 0.5;
}

.hero-content {
  max-width: 800px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.hero-section h1 {
  font-size: 48px;
  margin-bottom: 20px;
  font-weight: bold;
  line-height: 1.2;
}

.hero-section p {
  font-size: 20px;
  margin-bottom: 40px;
  opacity: 0.95;
}

.hero-cta {
  display: inline-block;
  background-color: white;
  color: var(--color-primary);
  padding: 15px 40px;
  text-decoration: none;
  border-radius: 50px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-medium);
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

/* ============================================
   SEÇÃO DE SERVIÇOS
   ============================================ */
.services-section {
  max-width: 1200px;
  margin: 80px auto;
  padding: 0 20px;
}

.services-section h2 {
  text-align: center;
  font-size: 36px;
  margin-bottom: 50px;
  color: var(--color-dark);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 30px;
  margin-bottom: 60px;
}

.service-card {
  background: white;
  border-radius: 8px;
  padding: 30px;
  text-align: center;
  transition: all 0.3s ease;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-light);
}

.service-card:hover {
  box-shadow: var(--shadow-medium);
  transform: translateY(-5px);
}

.service-card h3 {
  color: var(--color-primary);
  font-size: 22px;
  margin-bottom: 15px;
}

.service-card p {
  color: var(--color-text);
  margin-bottom: 20px;
  line-height: 1.6;
}

.service-icon {
  font-size: 48px;
  margin-bottom: 15px;
}

/* ============================================
   SEÇÃO SOBRE NÓS
   ============================================ */
.about-section {
  background-color: var(--color-light);
  padding: 80px 20px;
}

.about-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.about-content h2 {
  font-size: 36px;
  color: var(--color-dark);
  margin-bottom: 30px;
}

.about-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: var(--color-text);
}

.about-badges {
  display: flex;
  gap: 20px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.badge {
  background: white;
  padding: 15px 25px;
  border-radius: 6px;
  box-shadow: var(--shadow-light);
  text-align: center;
}

.badge-title {
  font-weight: bold;
  color: var(--color-primary);
  font-size: 14px;
}

.badge-text {
  font-size: 12px;
  color: var(--color-text);
}

/* ============================================
   FORMULÁRIO DE COTAÇÃO
   ============================================ */
.quote-section {
  background: linear-gradient(135deg, var(--color-primary-light) 0%, var(--color-secondary) 100%);
  padding: 60px 20px;
  margin: 80px 0;
}

.quote-container {
  max-width: 600px;
  margin: 0 auto;
  background: white;
  padding: 40px;
  border-radius: 8px;
  box-shadow: var(--shadow-medium);
}

.quote-container h3 {
  text-align: center;
  color: var(--color-dark);
  font-size: 28px;
  margin-bottom: 30px;
}

.quote-container form {
  display: grid;
  gap: 20px;
}

.form-group {
  display: grid;
  gap: 8px;
}

.form-group label {
  font-weight: 600;
  color: var(--color-dark);
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(212, 87, 59, 0.1);
}

.form-button {
  background: var(--color-primary);
  color: white;
  padding: 14px 30px;
  border: none;
  border-radius: 4px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
}

.form-button:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-medium);
}

/* ============================================
   ASSISTENTE IA (CHATBOT)
   ============================================ */
.ai-assistant-button {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 60px;
  height: 60px;
  background: var(--color-primary);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  transition: all 0.3s ease;
  z-index: 999;
  color: white;
}

.ai-assistant-button:hover {
  transform: scale(1.1);
  box-shadow: 0 8px 24px rgba(212, 87, 59, 0.4);
}

.chat-widget {
  position: fixed;
  bottom: 100px;
  right: 30px;
  width: 350px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-medium);
  display: none;
  flex-direction: column;
  max-height: 500px;
  z-index: 998;
  animation: slideUp 0.3s ease;
}

.chat-widget.active {
  display: flex;
}

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

.chat-header {
  background: var(--color-primary);
  color: white;
  padding: 20px;
  border-radius: 12px 12px 0 0;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.chat-close {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 24px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.message {
  display: flex;
  gap: 10px;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.message.user {
  justify-content: flex-end;
}

.message-bubble {
  max-width: 80%;
  padding: 12px 16px;
  border-radius: 8px;
  word-wrap: break-word;
}

.message.bot .message-bubble {
  background: var(--color-light);
  color: var(--color-text);
}

.message.user .message-bubble {
  background: var(--color-primary);
  color: white;
}

.chat-input-area {
  padding: 15px;
  border-top: 1px solid var(--color-border);
  display: flex;
  gap: 10px;
}

.chat-input {
  flex: 1;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
}

.chat-send {
  background: var(--color-primary);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  padding: 10px 15px;
  transition: all 0.3s ease;
}

.chat-send:hover {
  background: var(--color-primary-dark);
}

/* ============================================
   RODAPÉ
   ============================================ */
.site-footer {
  background: var(--color-dark);
  color: white;
  padding: 60px 20px 20px;
  margin-top: 80px;
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  color: var(--color-secondary);
  margin-bottom: 20px;
  font-size: 16px;
}

.footer-section ul {
  list-style: none;
}

.footer-section ul li {
  margin-bottom: 12px;
}

.footer-section a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 30px;
  text-align: center;
  font-size: 14px;
  color: rgba(255,255,255,0.7);
}

/* ============================================
   RESPONSIVO
   ============================================ */
@media (max-width: 768px) {
  .hero-section h1 {
    font-size: 32px;
  }

  .hero-section p {
    font-size: 18px;
  }

  .about-container {
    grid-template-columns: 1fr;
  }

  .chat-widget {
    width: 90%;
    right: 5%;
    bottom: 90px;
  }

  .header-contact-info {
    gap: 15px;
    font-size: 12px;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .about-badges {
    flex-direction: column;
  }

  .badge {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .hero-section {
    padding: 50px 15px;
  }

  .hero-section h1 {
    font-size: 24px;
  }

  .services-section h2 {
    font-size: 28px;
  }

  .ai-assistant-button {
    width: 50px;
    height: 50px;
    bottom: 20px;
    right: 20px;
    font-size: 24px;
  }

  .chat-widget {
    width: 95%;
    right: 2.5%;
  }
}

/* ============================================
   ESTILOS PARA PÁGINAS DE CONTEÚDO
   ============================================ */

/* Garantir que divs de conteúdo ocupam full-width */
div[style*="max-width: 1200px"] {
  width: 100% !important;
  max-width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Página contacte-nos */
.page-content-full {
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Servicos, blog, contacto - garantir padding correto */
main {
  width: 100%;
  max-width: 100%;
}

/* Responsive para mobile */
@media (max-width: 768px) {
  div[style*="max-width: 1200px"] {
    padding: 0 15px !important;
  }
}

/* ============================================
   MENU NAVEGAÇÃO FULL-WIDTH
   ============================================ */

nav {
  width: 100% !important;
  max-width: 100% !important;
}

nav > div {
  width: 100% !important;
  max-width: 100% !important;
  padding: 0 20px !important;
}

nav a {
  white-space: nowrap;
}

/* Garantir que menu não tem restrições de largura */
.wp-block-navigation {
  width: 100% !important;
  max-width: 100% !important;
}

/* ============================================
   POPUP DO FORMULÁRIO
   ============================================ */

.form-popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}

.form-popup-overlay.active {
  display: flex;
}

.form-popup-container {
  background: white;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.form-popup-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: #e63946;
  color: white;
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
}

.form-popup-close:hover {
  background: #d62828;
}

.form-popup-container iframe {
  width: 100%;
  height: 600px;
  border: none;
}

@media (max-width: 768px) {
  .form-popup-container {
    width: 95%;
    max-height: 95vh;
  }
  
  .form-popup-container iframe {
    height: 500px;
  }
}
