/*
  CSS DEFINITIVO - ESTUDIO JURÍDICO MOLINS
*/

/* --- 1. Definición de Variables de Color --- */
:root {
  /* --- MODO CLARO (Default) --- */
  --primary-color: #D4AF37;       /* Oro */
  --secondary-color: #0a1931;     /* Azul Noche */
  --bg-main: #ffffff;             /* Fondo Principal Blanco */
  --bg-secondary: #f8f9fa;        /* Fondo Secundario Gris */
  --bg-contact: #0a1931;          /* Fondo Contacto (Azul) */
  --bg-card: #ffffff;             /* Fondo Tarjetas */
  --text-main: #333333;           /* Texto Principal */
  --text-light: #f1f1f1;          /* Texto Claro (sobre fondos oscuros) */
  --text-heading: #0a1931;        /* Títulos */
  --shadow: rgba(0, 0, 0, 0.1);   /* Sombra */
  --border-color: #3a4b6c;        /* Bordes inputs */
  --input-bg: #1a2c53;            /* Fondo inputs (en contacto) */
}

/* --- MODO OSCURO (Clase .dark-mode) --- */
.dark-mode {
  --primary-color: #D4AF37;       /* Oro */
  --secondary-color: #ffffff;     /* Elementos secundarios blancos */
  --bg-main: #0a1931;             /* Body Azul Noche */
  --bg-secondary: #050d1a;        /* Secciones alternas más oscuras */
  --bg-contact: #050d1a;          /* Contacto oscuro */
  --bg-card: #112240;             /* Tarjetas azul intermedio */
  --text-main: #e6e6e6;           /* Texto claro */
  --text-light: #e6e6e6;          
  --text-heading: #ffffff;        /* Títulos blancos */
  --shadow: rgba(0, 0, 0, 0.3);   
  --border-color: #555;           
  --input-bg: #0a1931;            
}

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

html {
  /* Fallback de scroll suave por si falla JS en algún navegador raro */
  scroll-behavior: smooth; 
  scroll-padding-top: 100px; 
}

body {
  background-color: var(--bg-main);
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

a {
  text-decoration: none;
  transition: color 0.3s ease;
}

h1, h2, h3 {
  font-family: 'Playfair Display', serif;
  font-weight: 700;
  color: var(--text-heading);
}

h2 {
  font-size: 2.8rem;
  text-align: center;
  margin-bottom: 50px;
}

h3 {
  font-size: 1.6rem;
  margin-bottom: 15px;
}

/* --- Header --- */
.main-header {
  background-color: var(--bg-main);
  padding: 0 5%;
  position: fixed;
  z-index: 1000;
  width: 100%;
  top: 0;
  left: 0;
  height: 100px;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px var(--shadow);
  transition: background-color 0.3s ease;
}

.top-header-container {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1300px;
  margin: 0 auto;
}

#top-header {
  flex-shrink: 0;
}

#logo {
  display: inline-block;
  vertical-align: middle;
}

#logo img {
  max-height: 80px;
  width: auto;
  display: block;
  transition: filter 0.3s ease;
}

/* FILTRO MAGICO: Convierte logo oscuro en Dorado en modo oscuro */
.dark-mode #logo img {
    filter: invert(76%) sepia(35%) saturate(836%) hue-rotate(359deg) brightness(89%) contrast(88%);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* Botón Toggle Dark Mode */
#theme-toggle {
    background: transparent;
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
}

#theme-toggle:hover {
    background-color: var(--primary-color);
    color: var(--bg-main); 
}

#site-navigation {
  display: none;
}

.main-navbar {
  list-style: none;
  display: flex;
  gap: 30px;
}

#site-navigation a {
  color: var(--text-heading);
  font-weight: 700;
  font-size: 1rem;
  padding-bottom: 5px;
  position: relative;
}

#site-navigation a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

#site-navigation a:hover::after {
  width: 100%;
}

.header-contact-block {
  display: none;
  align-items: center;
  gap: 25px;
}

.header-phone {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-heading); 
  font-weight: 700;
}
.header-phone:hover {
  color: var(--primary-color);
}
.header-phone i {
  color: var(--primary-color);
  font-size: 1.1rem;
}

.header-cta {
  font-size: 0.9rem;
  padding: 10px 20px;
}

#burger-menu {
  display: block;
  background: transparent;
  border: none;
  color: var(--text-heading);
  font-size: 1.8rem;
  cursor: pointer;
  padding: 5px;
}

#burger-menu i {
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out; 
    display: block;
}

/* --- Hero Section --- */
.hero-section {
  position: relative;
  text-align: center;
  color: white;
  height: 100vh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5%;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 0;
}

.hero-dark-layer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(rgba(10, 25, 49, 0.4), rgba(10, 25, 49, 0.6));
  z-index: 1;
}

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

.hero-text-overlay {
  background-color: rgba(5, 10, 20, 0.75);
  padding: 50px 70px;
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: inline-block;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  font-size: 1.2rem;
  font-weight: 400;
  color: #f0f0f0;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 15px;
}

.nombre-destacado {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-top: 10px;
    margin-bottom: 10px;
    text-transform: none;
    letter-spacing: 0;
    font-family: 'Playfair Display', serif;
    line-height: 1.2;
}

.hero-text-overlay h1 {
  color: #ffffff;
  font-size: 3.2rem;
  font-weight: 700;
  margin: 10px 0 40px 0;
  line-height: 1.1;
}

/* --- Botones --- */
.btn-primary {
  background-color: var(--primary-color);
  color: #0a1931; 
  padding: 12px 28px;
  font-weight: 700;
  border-radius: 5px;
  transition: all 0.3s ease;
  display: inline-block;
  border: 2px solid var(--primary-color);
  cursor: pointer;
  font-size: 0.9rem;
  font-family: 'Montserrat', sans-serif;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.btn-primary:hover {
  background-color: transparent;
  color: var(--primary-color);
}

.btn-large {
  font-size: 1.1rem;
  padding: 18px 45px;
  margin-top: 20px;
  border-radius: 8px;
}

.btn-primary.dark-outline {
  background-color: transparent;
  border-color: var(--text-heading);
  color: var(--text-heading);
}
.btn-primary.dark-outline:hover {
  background-color: var(--text-heading);
  color: var(--bg-main); 
}

/* --- Contenido --- */
main {
  width: 100%;
}

.main-section {
  padding: 100px 5%;
  max-width: 1300px;
  margin: 0 auto;
}

#servicios {
  background-color: var(--bg-secondary);
  transition: background-color 0.3s ease;
}

.practice-areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.area-card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 35px 30px;
  text-align: center;
  border-top: 4px solid var(--primary-color);
  box-shadow: 0 10px 30px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}

.area-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1); 
}

.area-icon {
  font-size: 3rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.area-card h3 {
    margin-bottom: 25px;
}

.area-card .service-list {
  list-style: none;
  text-align: left;
  padding-left: 10px;
}

.area-card .service-list li {
  color: var(--text-main);
  opacity: 0.8;
  font-size: 0.95rem;
  line-height: 1.8;
  position: relative;
  padding-left: 25px;
  margin-bottom: 8px;
}

.area-card .service-list li::before {
  content: '\f00c';
  font-family: 'Font Awesome 5 Free';
  font-weight: 900;
  color: var(--primary-color);
  position: absolute;
  left: 0;
  top: 3px;
}

.about-us-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 60px;
}

.about-text p {
  font-size: 1.1rem;
  margin-bottom: 25px;
}

.about-image img {
  border-radius: 8px;
  box-shadow: 0 10px 30px var(--shadow);
}

/* --- Contacto --- */
#contacto {
  background-color: var(--bg-contact);
  color: var(--text-light);
  transition: background-color 0.3s ease;
}

#contacto h2,
#contacto h3 {
  color: #ffffff; 
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
}

.location-info h3 {
  margin-bottom: 20px;
}
.location-info p {
  font-size: 1.1rem;
  font-weight: 300;
  margin-bottom: 20px;
}

.contact-details p {
  font-size: 1rem;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
}
.contact-details i {
  color: var(--primary-color);
  font-size: 1.1rem;
  margin-right: 15px;
  width: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-light);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
  font-family: 'Montserrat', sans-serif;
  background-color: var(--input-bg);
  color: #ffffff;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary-color);
}

#contacto .btn-primary {
  width: 100%;
}
#contacto .btn-primary:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  color: #0a1931;
}

/* --- Footer --- */
footer {
  background-color: #050d1a; 
  color: #ffffff;
  padding: 40px 5% 15px;
  font-size: 0.95rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-columns-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav {
  justify-self: start;
  text-align: left;
}

.footer-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-nav li {
  margin-bottom: 10px;
}

.footer-nav a {
  color: #ffffff; 
  text-decoration: none;
  transition: color 0.3s;
  display: inline-block;
}

.footer-nav a:hover {
  color: var(--primary-color); 
}

.footer-contact-info {
  justify-self: center;
  text-align: left;
}

.footer-contact-info p {
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
}

.footer-contact-info a {
    color: #ffffff; 
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 12px;
}

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

.footer-contact-info i {
  color: #ffffff;
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.footer-social-links {
    justify-self: end;
    display: flex;
    gap: 20px;
    padding-top: 5px;
}

.footer-social-links a {
    color: #ffffff;
    font-size: 1.8rem;
    transition: color 0.3s;
}

.footer-social-links a:hover {
    color: var(--primary-color);
}

.footer-bottom-bar {
    text-align: center;
    padding-top: 10px;
}

#copyright {
  font-size: 0.85rem;
  color: #888;
  margin: 0;
}

/* --- WhatsApp --- */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #25D366;
  color: #fff;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  z-index: 999;
  transition: transform 0.3s ease;
}
.whatsapp-float:hover {
  transform: scale(1.1);
}


/* --- Media Queries (RESPONSIVE) --- */

@media (min-width: 992px) {
  #burger-menu {
    display: none;
  }
  #site-navigation {
    display: flex;
  }
  .header-contact-block {
    display: flex;
  }
}

@media (max-width: 991px) {
  .top-header-container {
    justify-content: space-between; 
  }

  #top-header {
      position: static;
      transform: none;
  }
  
  .header-actions {
      gap: 15px;
  }

  #site-navigation {
    display: none;
    position: absolute;
    top: 100px;
    left: 0;
    width: 100%;
    background-color: var(--bg-main); 
    padding: 10px 0;
    box-shadow: 0 5px 10px var(--shadow);
  }

  #site-navigation.is-active {
    display: block;
  }

  .main-navbar {
    flex-direction: column;
    width: 100%;
  }

  #site-navigation a {
    color: var(--text-heading);
    display: block;
    padding: 15px 5%;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
  }
  #site-navigation a::after {
    display: none;
  }
  #site-navigation a:hover {
    background-color: var(--bg-secondary);
  }

  .footer-columns-grid {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    border-bottom: none;
  }

  .footer-nav,
  .footer-contact-info,
  .footer-social-links {
    justify-self: center;
    text-align: center;
    align-items: center;
  }

  .footer-contact-info {
    display: flex;
    flex-direction: column;
  }

  .footer-contact-info p,
  .footer-contact-info a {
    justify-content: center;
  }

  .footer-social-links {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .about-us-content, .contact-container {
    grid-template-columns: 1fr;
  }

  .hero-text-overlay {
      padding: 30px;
  }

  .hero-text-overlay h1 {
      font-size: 2.5rem;
  }
}

@media (max-width: 576px) {
  .main-header {
    height: 85px;
  }

  #site-navigation {
    top: 85px;
  }

  #logo img {
    max-height: 60px;
  }

  html {
    scroll-padding-top: 85px;
  }

  .hero-text-overlay {
      padding: 20px;
      width: 100%;
  }

  .hero-text-overlay h1 {
      font-size: 2rem;
  }

  .hero-subtitle { font-size: 1rem; }
  .nombre-destacado { font-size: 2rem; }

  .main-section {
    padding: 60px 5%;
  }

  footer {
    padding: 20px 5% 5px;
  }
  
  #theme-toggle {
      width: 35px;
      height: 35px;
      font-size: 1rem;
  }
}