/* ============================================
   Dra. Natalia Fernández - Estudio Jurídico
   Professional Legal Website Styles
   ============================================ */

/* --- CSS Variables --- */
:root {
  --color-navy: #1a2332;
  --color-navy-light: #243044;
  --color-navy-dark: #111926;
  --color-gold: #c9a84c;
  --color-gold-light: #dbc06e;
  --color-gold-dark: #a88a3a;
  --color-cream: #f5f0e8;
  --color-cream-dark: #e8e0d0;
  --color-white: #ffffff;
  --color-text: #2c3e50;
  --color-text-light: #5a6b7d;
  --color-text-muted: #8899aa;
  --color-border: #d4cfc5;

  --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  --container-max: 1140px;
  --header-height: 72px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.12);
  --shadow-card: 0 2px 12px rgba(26, 35, 50, 0.06);

  --transition: 0.3s ease;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

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

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

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

/* --- Container --- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
}

/* --- Header --- */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-height);
  background: var(--color-white);
  border-bottom: 1px solid var(--color-border);
  z-index: 1000;
  transition: box-shadow var(--transition), background var(--transition);
}

.header.scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  color: var(--color-gold);
  font-size: 22px;
}

.logo-text {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-navy);
  letter-spacing: -0.02em;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav-link {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-light);
  letter-spacing: 0.03em;
  text-transform: uppercase;
  position: relative;
  padding: 4px 0;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-gold);
  transition: width var(--transition);
}

.nav-link:hover {
  color: var(--color-navy);
}

.nav-link:hover::after {
  width: 100%;
}

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

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-navy);
  transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-navy);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/hero01.webp') center center / cover no-repeat;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg,
      rgba(17, 25, 38, 0.75) 0%,
      rgba(17, 25, 38, 0.55) 40%,
      rgba(17, 25, 38, 0.7) 70%,
      rgba(17, 25, 38, 0.85) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 120px 24px 80px;
  max-width: 720px;
}

.hero-pre {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 20px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.2s;
}

.hero-title {
  font-family: var(--font-serif);
  font-size: clamp(42px, 8vw, 72px);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-white);
  letter-spacing: -0.02em;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.4s;
}

.hero-divider {
  width: 60px;
  height: 2px;
  background: var(--color-gold);
  margin: 28px auto;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.6s;
}

.hero-subtitle {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 400;
  font-style: italic;
  color: var(--color-gold-light);
  margin-bottom: 16px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.7s;
}

.hero-description {
  font-size: 16px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.65);
  max-width: 520px;
  margin: 0 auto 36px;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.8s;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards 0.9s;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: 4px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
}

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

.btn-primary:hover {
  background: var(--color-gold-light);
  border-color: var(--color-gold-light);
  box-shadow: 0 4px 20px rgba(201, 168, 76, 0.3);
}

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

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

/* --- Section Shared --- */
.section-pre {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(30px, 5vw, 42px);
  font-weight: 700;
  color: var(--color-navy);
  line-height: 1.2;
  margin-bottom: 48px;
  letter-spacing: -0.02em;
}

/* --- Services --- */
.services {
  padding: 100px 0;
  background: var(--color-white);
}

.services .container {
  text-align: center;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  text-align: left;
}

.service-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 36px 28px;
  transition: all var(--transition);
}

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

.service-icon {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  color: var(--color-gold-dark);
  border-radius: 8px;
  font-size: 22px;
  margin-bottom: 20px;
  transition: all var(--transition);
}

.service-card:hover .service-icon {
  background: var(--color-gold);
  color: var(--color-white);
}

.service-card h3 {
  font-family: var(--font-serif);
  font-size: 22px;
  font-weight: 700;
  color: var(--color-navy);
  margin-bottom: 10px;
}

.service-card p {
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-light);
}

/* --- About --- */
.about {
  padding: 100px 0;
  background: var(--color-cream);
}

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

.about-text p {
  font-size: 16px;
  line-height: 1.8;
  color: var(--color-text-light);
  margin-bottom: 16px;
}

.about-features {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.about-feature {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 500;
  color: var(--color-navy);
}

.about-feature i {
  color: var(--color-gold);
  font-size: 16px;
}

/* About aside card */
.about-card {
  background: var(--color-navy);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  color: var(--color-white);
  box-shadow: var(--shadow-lg);
}

.about-card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(201, 168, 76, 0.15);
  border-radius: 50%;
  font-size: 26px;
  color: var(--color-gold);
}

.about-card h3 {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.about-card > p {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.7);
}

.about-card-divider {
  width: 40px;
  height: 1px;
  background: var(--color-gold);
  margin: 20px auto;
}

.about-card-address {
  font-size: 14px;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.6);
}

.about-card-address i {
  color: var(--color-gold);
  margin-right: 6px;
}

/* --- Contact --- */
.contact {
  padding: 100px 0;
  background: var(--color-white);
}

.contact .container {
  text-align: center;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  text-align: left;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.contact-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.contact-item-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-cream);
  color: var(--color-gold-dark);
  border-radius: 8px;
  font-size: 18px;
}

.contact-item h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-navy);
  margin-bottom: 4px;
}

.contact-item p {
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.6;
}

.contact-item a {
  display: block;
  font-size: 15px;
  color: var(--color-text-light);
  line-height: 1.6;
}

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

/* Map */
.contact-map {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.contact-map iframe {
  width: 100%;
  height: 100%;
  min-height: 380px;
  display: block;
}

/* --- Footer --- */
.footer {
  background: var(--color-navy);
  color: rgba(255, 255, 255, 0.6);
  padding: 48px 0 32px;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  margin-bottom: 24px;
}

.footer-logo {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-white);
}

.footer-logo i {
  color: var(--color-gold);
  margin-right: 6px;
}

.footer-brand p {
  font-size: 14px;
  margin-top: 4px;
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.5);
  transition: color var(--transition);
}

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
}

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

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

/* --- Floating WhatsApp --- */
.wa-float {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 900;
  text-decoration: none;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

/* Breathing glow ring (replaces the cliché pulse) */
.wa-float-ring {
  position: absolute;
  inset: -6px;
  border-radius: 32px;
  border: 2px solid var(--color-gold);
  opacity: 0;
  animation: waRingBreathe 3.5s ease-in-out infinite;
  pointer-events: none;
}

/* The pill container */
.wa-float-pill {
  display: flex;
  align-items: center;
  gap: 0;
  height: 56px;
  padding: 0 18px;
  border-radius: 28px;
  background: var(--color-navy);
  color: var(--color-gold);
  box-shadow:
    0 4px 24px rgba(26, 35, 50, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 168, 76, 0.2);
  transition:
    padding 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    gap 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    background 0.3s ease,
    box-shadow 0.3s ease;
  overflow: hidden;
  cursor: pointer;
}

.wa-float:hover .wa-float-pill {
  gap: 10px;
  padding: 0 22px 0 18px;
  background: var(--color-navy-light);
  box-shadow:
    0 8px 32px rgba(201, 168, 76, 0.2),
    0 4px 16px rgba(26, 35, 50, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
  border-color: rgba(201, 168, 76, 0.4);
}

/* WhatsApp icon (custom SVG, not the standard Font Awesome one) */
.wa-float-icon {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  transition: transform 0.3s ease;
}

.wa-float:hover .wa-float-icon {
  transform: rotate(-8deg) scale(1.1);
}

/* Expandable label */
.wa-float-label {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--color-cream);
  white-space: nowrap;
  max-width: 0;
  opacity: 0;
  transition:
    max-width 0.4s cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity 0.3s ease 0.1s;
  overflow: hidden;
}

.wa-float:hover .wa-float-label {
  max-width: 120px;
  opacity: 1;
}

/* Breathing ring keyframe */
@keyframes waRingBreathe {
  0%, 100% {
    opacity: 0;
    transform: scale(0.95);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.05);
  }
}

/* Mobile: always show compact, bigger tap target */
@media (max-width: 767px) {
  .wa-float {
    bottom: 20px;
    right: 20px;
  }

  .wa-float-pill {
    height: 52px;
    padding: 0 15px;
  }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .wa-float-ring {
    animation: none;
    opacity: 0.3;
  }

  .wa-float-pill,
  .wa-float-label,
  .wa-float-icon {
    transition: none;
  }
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Scroll-triggered fade-in */
.fade-in {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* --- Responsive --- */
@media (max-width: 991px) {
  .services-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .about-content {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .about-card {
    max-width: 360px;
  }
}

@media (max-width: 767px) {
  :root {
    --header-height: 64px;
  }

  .nav {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--color-white);
    flex-direction: column;
    padding: 24px;
    gap: 0;
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-md);
  }

  .nav.open {
    display: flex;
  }

  .nav-link {
    padding: 14px 0;
    font-size: 15px;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-link:last-child {
    border-bottom: none;
  }

  .nav-toggle {
    display: flex;
  }

  .hero-content {
    padding: 100px 20px 60px;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
  }

  .btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .services {
    padding: 64px 0;
  }

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

  .about {
    padding: 64px 0;
  }

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

  .contact {
    padding: 64px 0;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .contact-map iframe {
    min-height: 280px;
  }

  .section-title {
    margin-bottom: 32px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero-pre,
  .hero-title,
  .hero-divider,
  .hero-subtitle,
  .hero-description,
  .hero-actions {
    animation: none;
    opacity: 1;
  }

  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .service-card:hover {
    transform: none;
  }
}
