/* ============================================================
   Martos y Asociados — Hoja de estilos
   Paleta heredada del sitio original:
   primario #DABA24 (amarillo dorado) · títulos #333 · texto #777 · header #000
   ============================================================ */

/* ---------- Fuentes self-hosted ---------- */
@font-face {
  font-family: 'Roboto';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/roboto-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'Roboto Slab';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('../fonts/robotoslab-latin.woff2') format('woff2');
}

/* ---------- Variables ---------- */
:root {
  --color-primary: #DABA24;
  --color-primary-dark: #b8991b;
  --color-on-primary: #1f1f1f;
  --color-heading: #333333;
  --color-text: #777777;
  --color-dark: #000000;
  --color-light: #f8f9f9;
  --color-border: #e9e9e9;
  --color-white: #ffffff;
  --color-wa: #25D366;
  --color-phone: #AA0000;

  --font-body: 'Roboto', Helvetica, Arial, sans-serif;
  --font-head: 'Roboto Slab', Georgia, 'Times New Roman', serif;

  --container: 1140px;
  --radius: 10px;
  --shadow: 0 6px 24px rgba(0, 0, 0, .08);
  --shadow-hover: 0 14px 34px rgba(0, 0, 0, .14);
  --header-h: 74px;
  --transition: .25s ease;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--header-h); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text);
  background: var(--color-white);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: var(--color-primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--color-heading); }
h1, h2, h3 { font-family: var(--font-head); color: var(--color-heading); line-height: 1.25; }

.container { width: 100%; max-width: var(--container); margin: 0 auto; padding: 0 20px; }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 1000;
  background: var(--color-primary); color: #fff; padding: 10px 16px; border-radius: 0 0 6px 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 2px; }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border: 2px solid transparent; border-radius: 50px;
  font-family: var(--font-head); font-weight: 600; font-size: 15px; letter-spacing: .3px;
  text-transform: uppercase; cursor: pointer; transition: all var(--transition);
  text-align: center; line-height: 1;
}
.btn-primary { background: var(--color-primary); color: var(--color-on-primary); border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); border-color: var(--color-primary-dark); color: var(--color-on-primary); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--color-heading); border-color: var(--color-border); }
.btn-outline:hover { border-color: var(--color-primary); color: var(--color-primary); }
.btn-wa { background: var(--color-wa); color: #fff; border-color: var(--color-wa); }
.btn-wa:hover { background: #1da851; border-color: #1da851; color: #fff; transform: translateY(-2px); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--color-dark);
  box-shadow: 0 2px 12px rgba(0, 0, 0, .25);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: var(--header-h); gap: 16px; }
.brand { display: flex; flex-direction: column; line-height: 1.1; }
.brand-title { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: #fff; }
.brand-tagline { font-size: 12.5px; color: #9fb4c7; letter-spacing: .4px; }
.brand:hover .brand-title { color: var(--color-primary); }

.site-nav ul { display: flex; align-items: center; gap: 6px; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: #cdd8e2; font-size: 14.5px; font-weight: 500; padding: 10px 14px; border-radius: 6px; text-transform: uppercase; letter-spacing: .3px; }
.site-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.site-nav a.nav-cta { background: var(--color-primary); color: var(--color-on-primary); }
.site-nav a.nav-cta:hover { background: var(--color-primary-dark); color: var(--color-on-primary); }

.nav-toggle {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 44px; height: 44px; background: transparent; border: 0; cursor: pointer; padding: 8px;
}
.nav-toggle-bar { display: block; height: 2px; width: 100%; background: #fff; border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative; display: flex; align-items: center;
  min-height: min(78vh, 640px);
  background: #1a2733 url('../img/hero.jpeg') center/cover no-repeat;
  text-align: center;
}
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.45), rgba(0,0,0,.6)); }
.hero-content { position: relative; z-index: 1; }
.hero h1 { color: #fff; font-size: clamp(30px, 5vw, 54px); margin: 0 0 28px; text-shadow: 0 2px 18px rgba(0, 0, 0, .5); }
.hero-cta { font-size: 16px; padding: 15px 34px; }

/* ---------- Secciones ---------- */
.section { padding: 72px 0; }
.section-alt { background: var(--color-light); }
.section-title { text-align: center; font-size: clamp(24px, 3.4vw, 34px); margin: 0 0 12px; position: relative; padding-bottom: 18px; }
.section-title::after { content: ""; position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 64px; height: 3px; background: var(--color-primary); border-radius: 3px; }
.section-lead { text-align: center; max-width: 640px; margin: 0 auto 42px; }

/* ---------- Tarjetas de áreas ---------- */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 46px; }
.card {
  background: #fff; border: 1px solid var(--color-border); border-radius: var(--radius);
  padding: 36px 28px; text-align: center; box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); border-color: var(--color-primary); }
.card-icon {
  width: 78px; height: 78px; margin: 0 auto 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(218, 186, 36, .15); color: var(--color-primary-dark);
  transition: background var(--transition), color var(--transition);
}
.card:hover .card-icon { background: var(--color-primary); color: var(--color-on-primary); }
.card-title { font-size: 20px; text-transform: uppercase; letter-spacing: .5px; margin: 0 0 14px; }
.card-text { font-size: 14.5px; margin: 0; }

/* ---------- Área extrajudicial ---------- */
.extra-list {
  list-style: none; margin: 44px auto 0; padding: 0; max-width: 900px;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 34px;
}
.extra-list li {
  position: relative; padding-left: 32px; color: var(--color-heading);
  font-family: var(--font-head); font-weight: 600; font-size: 14.5px; line-height: 1.5;
}
.extra-list li::before {
  content: ""; position: absolute; left: 0; top: 3px; width: 18px; height: 18px;
  background: var(--color-primary);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z'/%3E%3C/svg%3E") center/contain no-repeat;
}

/* ---------- Contacto ---------- */
.contact-grid { display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: start; }
.contact-list { list-style: none; margin: 0 0 28px; padding: 0; }
.contact-list li { display: flex; align-items: flex-start; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--color-border); }
.contact-ico {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(218, 186, 36, .15); color: var(--color-primary-dark);
}
.contact-label { display: block; font-family: var(--font-head); font-weight: 600; color: var(--color-heading); font-size: 15px; }
.contact-list a { font-size: 16px; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.contact-map iframe { border-radius: var(--radius); box-shadow: var(--shadow); }

/* ---------- Footer ---------- */
.site-footer { background: var(--color-dark); color: #b8c4cf; padding: 26px 0; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer-copy { margin: 0; font-size: 14px; }
.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.legal-link, .cookie-inline-link {
  background: none; border: 0; color: #b8c4cf; font-size: 13.5px; cursor: pointer;
  font-family: var(--font-body); padding: 4px 2px; text-decoration: underline; text-underline-offset: 3px;
}
.legal-link:hover, .cookie-inline-link:hover { color: var(--color-primary); }

/* ---------- Botones flotantes ---------- */
.floating-actions { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: flex; flex-direction: column; gap: 14px; }
.fab {
  width: 56px; height: 56px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; box-shadow: 0 4px 14px rgba(0, 0, 0, .3); transition: transform var(--transition), background var(--transition);
}
.fab:hover { transform: scale(1.08); color: #fff; }
.fab-phone { background: var(--color-phone); }
.fab-phone:hover { background: #c62828; }
.fab-wa { background: var(--color-wa); }
.fab-wa:hover { background: #1da851; }

/* ---------- Volver arriba ---------- */
.back-to-top {
  position: fixed; left: 20px; bottom: 20px; z-index: 90;
  width: 46px; height: 46px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--color-heading); color: #fff; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transform: translateY(10px); transition: all var(--transition);
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }
.back-to-top:hover { background: var(--color-primary); }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); animation: fade .2s ease; }
.modal-dialog {
  position: relative; background: #fff; border-radius: var(--radius); max-width: 720px; width: 100%;
  max-height: 86vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0, 0, 0, .4);
  animation: pop .22s ease;
}
.modal-content { overflow-y: auto; padding: 40px 40px 44px; }
.modal-content h2 { margin: 0 0 8px; font-size: 26px; }
.modal-content h3 { margin: 26px 0 8px; font-size: 17px; color: var(--color-heading); }
.modal-content p, .modal-content li { font-size: 14.5px; }
.modal-content ul { padding-left: 20px; }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 50%;
  background: var(--color-light); color: var(--color-heading); font-size: 26px; line-height: 1; cursor: pointer; z-index: 1;
}
.modal-close:hover { background: var(--color-primary); color: #fff; }
.legal-note { background: #fff8e1; border-left: 3px solid #f5c518; padding: 10px 14px; border-radius: 4px; font-size: 13px; }
.legal-note code, .modal-content code { background: #eef1f3; padding: 1px 5px; border-radius: 3px; font-size: .9em; }

/* ---------- Banner de cookies ---------- */
.cookie-banner {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 200;
  background: rgba(0, 0, 0, .96); color: #e6edf2; padding: 18px 20px;
  display: flex; align-items: center; justify-content: center; gap: 22px; flex-wrap: wrap;
}
.cookie-banner[hidden] { display: none; }
.cookie-text { margin: 0; font-size: 13.5px; max-width: 760px; }
.cookie-inline-link { color: var(--color-primary); }
.cookie-buttons { display: flex; gap: 12px; }
.cookie-buttons .btn { padding: 10px 22px; font-size: 13px; }
.cookie-buttons .btn-outline { color: #fff; border-color: rgba(255, 255, 255, .4); }
.cookie-buttons .btn-outline:hover { color: var(--color-primary); border-color: var(--color-primary); }

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

body.no-scroll { overflow: hidden; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 900px) {
  .cards { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .contact-grid { grid-template-columns: 1fr; }
  .extra-list { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; top: var(--header-h); left: 0; right: 0;
    background: var(--color-dark); border-top: 1px solid rgba(255, 255, 255, .1);
    max-height: 0; overflow: hidden; transition: max-height var(--transition);
  }
  .site-nav.is-open { max-height: 340px; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; padding: 8px 16px 16px; }
  .site-nav a { display: block; padding: 12px 10px; }
  .site-nav a.nav-cta { text-align: center; margin-top: 6px; }
  .section { padding: 54px 0; }
  .footer-inner { flex-direction: column; text-align: center; }
  .modal-content { padding: 34px 22px 36px; }
}

@media (max-width: 480px) {
  .cookie-banner { flex-direction: column; gap: 14px; }
  .cookie-buttons { width: 100%; }
  .cookie-buttons .btn { flex: 1; }
  .contact-actions .btn { flex: 1 1 100%; }
}
