/* ============================================================
   Consultoría Legal Herrera & Asociados — Design System
   ============================================================ */

/* --- CSS Custom Properties --- */
:root {
  --navy:       #0a2a43;
  --navy-light: #123a58;
  --navy-dark:  #061e32;
  --gold:       #d4a843;
  --gold-light: #e8c876;
  --gold-dark:  #b8912e;
  --cream:      #faf8f5;
  --white:      #ffffff;
  --gray-50:    #f9fafb;
  --gray-100:   #f3f4f6;
  --gray-200:   #e5e7eb;
  --gray-300:   #d1d5db;
  --gray-400:   #9ca3af;
  --gray-500:   #6b7280;
  --gray-600:   #4b5563;
  --gray-700:   #374151;
  --gray-800:   #1f2937;
  --gray-900:   #111827;
  --text:       #1f2937;
  --text-light: #6b7280;

  --font-sans:    'Inter', system-ui, -apple-system, sans-serif;
  --font-serif:   'Playfair Display', Georgia, serif;

  --shadow-sm:  0 1px 2px rgba(0,0,0,0.05);
  --shadow:     0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
  --shadow-md:  0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
  --shadow-lg:  0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);

  --rounded:    8px;
  --rounded-lg: 12px;
  --rounded-xl: 16px;

  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background-color: var(--white);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--navy);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--gold);
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
}

h1 { font-size: clamp(2rem, 5vw, 3.25rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.25rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1rem;
  color: var(--gray-600);
}

.text-gold   { color: var(--gold); }
.text-navy   { color: var(--navy); }
.text-white  { color: var(--white); }
.text-center { text-align: center; }

.section-label {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 0.75rem;
  display: block;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.1rem;
  color: var(--gray-500);
  max-width: 640px;
  margin: 0 auto 2.5rem;
}

/* --- Layout --- */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.section {
  padding: 5rem 0;
}

.section-sm {
  padding: 3rem 0;
}

.bg-cream  { background-color: var(--cream); }
.bg-navy   { background-color: var(--navy); }
.bg-white  { background-color: var(--white); }
.bg-gray   { background-color: var(--gray-50); }

.grid {
  display: grid;
  gap: 2rem;
}

.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* --- Navigation --- */
.navbar {
  background-color: var(--navy);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: all var(--transition);
}

.navbar.scrolled {
  padding: 0.6rem 0;
  box-shadow: var(--shadow-md);
}

.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.1rem;
}

.navbar-brand img {
  height: 40px;
  width: auto;
}

.nav-links {
  display: none;
  list-style: none;
  gap: 0;
}

.nav-links.active {
  display: flex;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--navy-dark);
  padding: 1rem 0;
}

.nav-links a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.75rem 1.5rem;
  transition: color var(--transition);
  display: block;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--gold);
}

.nav-toggle {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
  transition: var(--transition);
}

.lang-btn {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.4);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.3rem 0.75rem;
  border-radius: 4px;
  cursor: pointer;
  transition: all var(--transition);
  letter-spacing: 0.5px;
}

.lang-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
}

@media (min-width: 992px) {
  .nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
  }

  .nav-links a {
    padding: 0.5rem 0.75rem;
    border-radius: var(--rounded);
  }

  .nav-toggle {
    display: none;
  }
}

/* --- Hero Section --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  margin-top: 72px; /* offset for fixed navbar */
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(6,30,50,0.85) 0%, rgba(10,42,67,0.7) 50%, rgba(10,42,67,0.6) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 750px;
  padding: 2rem 1.5rem;
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1.25rem;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.hero p {
  color: rgba(255,255,255,0.85);
  font-size: 1.15rem;
  margin-bottom: 2rem;
  line-height: 1.8;
}

.hero .section-label {
  color: var(--gold);
}

/* Page hero (shorter, for inner pages) */
.page-hero {
  position: relative;
  padding: 6rem 0 4rem;
  text-align: center;
  background-size: cover;
  background-position: center;
  margin-top: 72px;
}

.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(6,30,50,0.88) 0%, rgba(10,42,67,0.75) 100%);
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  color: var(--white);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
}

.page-hero p {
  position: relative;
  z-index: 1;
  color: rgba(255,255,255,0.8);
  margin-top: 0.75rem;
  font-size: 1.05rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.75rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--rounded);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
  line-height: 1.4;
}

.btn-primary {
  background-color: var(--gold);
  color: var(--navy);
  border-color: var(--gold);
}

.btn-primary:hover {
  background-color: var(--gold-dark);
  border-color: var(--gold-dark);
  color: var(--white);
}

.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255,255,255,0.5);
}

.btn-outline:hover {
  background-color: var(--white);
  color: var(--navy);
  border-color: var(--white);
}

.btn-navy {
  background-color: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

.btn-navy:hover {
  background-color: var(--navy-light);
  border-color: var(--navy-light);
  color: var(--white);
}

.btn-whatsapp {
  background-color: #25d366;
  color: var(--white);
  border-color: #25d366;
}

.btn-whatsapp:hover {
  background-color: #1fb855;
  border-color: #1fb855;
  color: var(--white);
}

.btn-sm {
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
}

.btn-lg {
  padding: 1rem 2.25rem;
  font-size: 1rem;
}

/* --- Cards --- */
.card {
  background: var(--white);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
  transition: all var(--transition);
  height: 100%;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card-icon {
  width: 56px;
  height: 56px;
  border-radius: var(--rounded);
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  color: var(--gold);
}

.card-icon svg,
.card-icon i {
  width: 28px;
  height: 28px;
}

.card h4 {
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
}

.card p {
  font-size: 0.92rem;
  line-height: 1.7;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--gold-dark);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 1rem;
}

.card-link:hover {
  color: var(--navy);
  gap: 0.5rem;
}

/* --- Stats / Trust Bar --- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  text-align: center;
  padding: 3rem 0;
}

@media (min-width: 768px) {
  .stats-bar {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-item h3 {
  font-family: var(--font-sans);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.stat-item p {
  font-size: 0.88rem;
  color: var(--gray-500);
  margin: 0;
}

/* --- Testimonials --- */
.testimonial-card {
  background: var(--white);
  border-radius: var(--rounded-lg);
  padding: 2rem;
  box-shadow: var(--shadow);
  position: relative;
}

.testimonial-card::before {
  content: "\201C";
  font-family: var(--font-serif);
  font-size: 4rem;
  color: var(--gold-light);
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
  opacity: 0.5;
}

.testimonial-text {
  font-style: italic;
  font-size: 0.95rem;
  color: var(--gray-600);
  margin-bottom: 1.25rem;
  padding-top: 1rem;
}

.testimonial-author {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.9rem;
}

.testimonial-role {
  font-size: 0.8rem;
  color: var(--gray-400);
}

/* --- CTA Section --- */
.cta-section {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
  padding: 4rem 0;
  text-align: center;
}

.cta-section h2 {
  color: var(--white);
  margin-bottom: 1rem;
}

.cta-section p {
  color: rgba(255,255,255,0.8);
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* --- Footer --- */
.footer {
  background-color: var(--navy-dark);
  color: rgba(255,255,255,0.7);
  padding: 3.5rem 0 1.5rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  margin-bottom: 2.5rem;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
  }
}

.footer h4 {
  color: var(--white);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.footer p,
.footer a {
  color: rgba(255,255,255,0.6);
  font-size: 0.88rem;
  line-height: 1.8;
}

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

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 0.4rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  text-align: center;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.4);
}

/* --- Forms --- */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.4rem;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--gray-200);
  border-radius: var(--rounded);
  font-family: var(--font-sans);
  font-size: 0.92rem;
  color: var(--text);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212,168,67,0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 120px;
}

/* --- Contact Info Card --- */
.contact-card {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--rounded-lg);
  padding: 2rem;
}

.contact-card h4 {
  color: var(--gold);
  margin-bottom: 1.5rem;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.contact-item svg {
  color: var(--gold);
  flex-shrink: 0;
  margin-top: 2px;
}

.contact-item p,
.contact-item a {
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  margin: 0;
}

.contact-item a:hover {
  color: var(--gold);
}

/* --- News Cards --- */
.news-card {
  border-radius: var(--rounded-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  height: 100%;
  background: var(--white);
}

.news-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.news-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.news-card-body {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-badge {
  display: inline-block;
  background: var(--navy);
  color: var(--gold);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.5rem;
  width: fit-content;
}

.news-card-body h5 {
  font-family: var(--font-sans);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  margin-bottom: auto;
}

.news-card-body h5 a {
  color: var(--navy);
}

.news-card-body h5 a:hover {
  color: var(--gold);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: var(--gray-400);
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--gray-100);
}

/* --- Skeleton Loader --- */
.skeleton {
  background: var(--gray-200);
  border-radius: 4px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.skeleton-img { height: 180px; width: 100%; border-radius: 0; }
.skeleton-line { height: 14px; margin-bottom: 8px; border-radius: 4px; }
.skeleton-line.short { width: 60%; }
.skeleton-line.shorter { width: 40%; }

/* --- Filter Pills --- */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.filter-pill {
  padding: 0.4rem 1rem;
  border: 1px solid var(--gray-300);
  border-radius: 20px;
  background: var(--white);
  color: var(--gray-600);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-pill:hover,
.filter-pill.active {
  background: var(--navy);
  color: var(--gold);
  border-color: var(--navy);
}

/* --- Tools Section --- */
.tool-card {
  background: var(--white);
  border-radius: var(--rounded-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
}

.tool-result {
  background: var(--cream);
  border-radius: var(--rounded);
  padding: 1.25rem;
  margin-top: 1rem;
}

.tool-result h5 {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
  color: var(--navy);
}

/* --- FAQ / Accordion --- */
.faq-item {
  border-bottom: 1px solid var(--gray-200);
}

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1.25rem 0;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  cursor: pointer;
  text-align: left;
}

.faq-question svg {
  flex-shrink: 0;
  transition: transform var(--transition);
  color: var(--gold);
}

.faq-item.open .faq-question svg {
  transform: rotate(180deg);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s ease;
}

.faq-item.open .faq-answer {
  max-height: 500px;
}

.faq-answer p {
  padding-bottom: 1.25rem;
  font-size: 0.92rem;
}

/* --- Divider --- */
.divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1rem auto 2rem;
  border-radius: 2px;
}

/* --- Two-column layout --- */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}

@media (min-width: 768px) {
  .split {
    grid-template-columns: 1fr 1fr;
  }
}

.split-reverse {
  direction: ltr;
}

@media (min-width: 768px) {
  .split-reverse > :first-child {
    order: 2;
  }
  .split-reverse > :last-child {
    order: 1;
  }
}

/* --- About Team --- */
.team-photo {
  border-radius: var(--rounded-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
}

/* --- Map Container --- */
.map-container {
  border-radius: var(--rounded-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.map-container iframe {
  width: 100%;
  height: 350px;
  border: 0;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
  width: 8px;
}
::-webkit-scrollbar-track {
  background: var(--gray-100);
}
::-webkit-scrollbar-thumb {
  background: var(--gray-400);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-500);
}

/* --- Utility --- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* --- Animations (AOS-compatible classes) --- */
[data-aos] {
  opacity: 0;
  transition-property: opacity, transform;
  transition-duration: 0.6s;
  transition-timing-function: ease-out;
}

[data-aos="fade-up"] {
  transform: translateY(30px);
}

[data-aos="fade-in"] {
  transform: none;
}

[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}

/* --- Scroll-to-top Button --- */
.scroll-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: all var(--transition);
  z-index: 900;
}

.scroll-top:hover {
  background: var(--gold);
  color: var(--navy);
}

.scroll-top.visible {
  display: flex;
}

/* --- WhatsApp FAB --- */
.whatsapp-fab {
  position: fixed;
  bottom: 2rem;
  left: 2rem;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25d366;
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition);
  z-index: 900;
}

.whatsapp-fab:hover {
  transform: scale(1.1);
  color: var(--white);
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
}

/* --- Mobile Bottom Bar --- */
.mobile-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--navy);
  padding: 0.6rem 0;
  z-index: 1000;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
}

.mobile-bar-inner {
  display: flex;
  justify-content: space-around;
  align-items: center;
}

.mobile-bar a {
  color: var(--white);
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.mobile-bar a svg {
  width: 22px;
  height: 22px;
}

.mobile-bar a:hover {
  color: var(--gold);
}

@media (max-width: 991px) {
  .mobile-bar {
    display: block;
  }

  body {
    padding-bottom: 70px;
  }

  .whatsapp-fab {
    display: none;
  }

  .scroll-top {
    bottom: 5rem;
    right: 1rem;
  }
}
