/* ============================================================
   Funeraria "A la Diestra de Dios" — estilos
   Paleta: oro / crema / cielo sobre fondo claro, acento profundo
   en marrón dorado. Tipografía: Space Grotesk (títulos) +
   Inter (texto).
   ============================================================ */

:root {
  --gold: #c8a24a;
  --gold-soft: rgba(200, 162, 74, .16);
  --cream: #e8dcc0;
  --sky: #b8d4e8;
  --deep: #7a6329;
  --white: #ffffff;
  --ink: #2a2520;
  --ink-soft: #5c574f;
  --bg-soft: #faf8f3;
  --border: #eae3d5;
  --shadow: 0 4px 24px rgba(0, 0, 0, .06);
  --shadow-lg: 0 12px 40px rgba(122, 99, 41, .14);
}

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

html { color-scheme: light; scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--ink);
  background: var(--white);
  line-height: 1.7;
  overflow-x: hidden;
}

button, a, input, textarea, select {
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4 {
  font-family: 'Space Grotesk', sans-serif;
  line-height: 1.2;
  font-weight: 600;
}
h1, h2 { text-wrap: balance; }

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }

section[id] { scroll-margin-top: 86px; }

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

a:focus-visible, button:focus-visible,
input:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.skip-link {
  position: absolute; top: -100%; left: 0; z-index: 9999;
  background: var(--deep); color: #fff;
  padding: 12px 20px; border-radius: 0 0 12px 0;
}
.skip-link:focus { top: 0; }

/* ---------- piezas comunes ---------- */

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: .78rem; letter-spacing: .2em; text-transform: uppercase;
  font-weight: 600; color: var(--deep); margin-bottom: 18px;
}
.eyebrow::before {
  content: ""; width: 11px; height: 11px; flex: none;
  background: var(--gold);
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
}

.section-head { max-width: 640px; margin-bottom: 52px; }
.section-head h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.3rem);
  margin-bottom: 14px;
}
.section-head p { color: var(--ink-soft); font-size: 1.08rem; }

.sep {
  height: 1px; border: 0;
  background: linear-gradient(to right, transparent, rgba(200, 162, 74, .28), transparent);
}

.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 34px; border-radius: 14px;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 1rem; cursor: pointer;
  border: none;
  transition: transform .3s ease, box-shadow .3s ease, background .3s ease, color .3s ease, opacity .3s ease;
}
.btn[disabled] { opacity: .65; cursor: wait; transform: none; box-shadow: none; }

.btn-primary { background: var(--deep); color: #fff; }
.btn-primary:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(122, 99, 41, .32); }

.btn-gold { background: var(--gold); color: #241b0e; }
.btn-gold:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(200, 162, 74, .4); }

.btn-outline { background: transparent; color: var(--deep); border: 1.5px solid var(--gold); }
.btn-outline:hover { background: var(--gold); color: #fff; transform: translateY(-3px); }

/* ---------- cabecera ---------- */

header.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  transition: background .35s ease, box-shadow .35s ease, padding .35s ease;
  padding: 16px 0;
}
header.nav.scrolled {
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 4px 24px rgba(0, 0, 0, .07);
  backdrop-filter: blur(8px);
  padding: 8px 0;
}

.nav-inner { display: flex; align-items: center; justify-content: space-between; }

.nav-logo { display: flex; align-items: center; gap: 12px; }
.nav-logo img {
  height: 56px; width: auto;
  background: rgba(255, 255, 255, .92);
  border-radius: 12px; padding: 4px;
}
.nav-logo .brand {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 600; font-size: 1.02rem; color: #fff; line-height: 1.15;
  transition: color .35s ease;
}
.nav-logo .brand small {
  display: block; font-size: .68rem; font-weight: 400;
  letter-spacing: .12em; text-transform: uppercase; opacity: .85;
}
header.nav.scrolled .brand { color: var(--deep); }

.nav-links { display: flex; align-items: center; gap: 34px; list-style: none; }
.nav-links a {
  font-size: .95rem; font-weight: 500; color: #fff;
  transition: color .3s ease; position: relative;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -5px;
  width: 0; height: 2px; background: var(--gold);
  transition: width .3s ease;
}
.nav-links a:hover::after { width: 100%; }
header.nav.scrolled .nav-links a { color: var(--ink); }

.nav-cta {
  padding: 11px 24px; border-radius: 12px;
  background: var(--gold); color: #241b0e !important; font-weight: 600;
}
.nav-cta::after { display: none !important; }
.nav-cta:hover { background: var(--deep); color: #fff !important; }

.hamburger {
  display: none; background: none; border: none; cursor: pointer;
  color: #fff; font-size: 2rem;
}
header.nav.scrolled .hamburger { color: var(--deep); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 640px;
  display: flex; align-items: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: -10% 0; z-index: 0;
  background: url('assets/hero.webp') center/cover no-repeat;
  will-change: transform;
}
.hero-overlay {
  position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(rgba(30, 25, 15, .55), rgba(30, 25, 15, .72));
}
.hero-blur {
  position: absolute; border-radius: 50%;
  filter: blur(90px); z-index: 2;
  animation: float 8s ease-in-out infinite;
}
.hero-blur.a { width: 280px; height: 280px; background: rgba(200, 162, 74, .28); top: 8%; right: 6%; }
.hero-blur.b { width: 220px; height: 220px; background: rgba(184, 212, 232, .22); bottom: 12%; left: 4%; animation-delay: 3s; }

.hero-content { position: relative; z-index: 5; max-width: 760px; }

.hero-svg {
  position: absolute; top: 50%; right: -40px; transform: translateY(-50%);
  z-index: 3; width: 340px; height: 340px; opacity: .5;
}
.hero-svg circle, .hero-svg line, .hero-svg path {
  stroke: var(--gold); fill: none; stroke-width: 1.4;
}
.draw { stroke-dasharray: 600; stroke-dashoffset: 600; animation: draw 3s ease forwards; }

.hero .eyebrow { color: var(--cream); }
.hero .eyebrow::before { background: var(--gold); }
.hero h1 {
  font-size: clamp(2.1rem, 4.6vw, 3.4rem);
  color: #fff; margin-bottom: 22px;
  animation: fadeInUp .9s ease both;
}
.hero p {
  font-size: clamp(1.02rem, 1.5vw, 1.2rem);
  color: rgba(255, 255, 255, .9); max-width: 560px; margin-bottom: 34px;
  animation: fadeInUp .9s ease .2s both;
}
.hero-actions {
  display: flex; gap: 16px; flex-wrap: wrap;
  animation: fadeInUp .9s ease .4s both;
}
.hero .btn-gold { animation: pulse 2.4s infinite; }

@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-20px) rotate(3deg); }
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 162, 74, .45); }
  50% { box-shadow: 0 0 22px 5px rgba(200, 162, 74, .18); }
}

/* ---------- secciones ---------- */

section { padding: clamp(70px, 8vw, 96px) 0; position: relative; }

.bg-soft { background: var(--bg-soft); }
.bg-deep { background: var(--deep); color: #fff; }
.bg-radial {
  background:
    radial-gradient(circle at 25% 70%, rgba(200, 162, 74, .05), transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(184, 212, 232, .06), transparent 55%);
}

/* valores */
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; }

.val-card {
  background: #fff; border: 1px solid var(--border); border-radius: 16px;
  padding: 36px 28px; box-shadow: var(--shadow);
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.val-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--gold); }

.val-icon {
  width: 56px; height: 56px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-soft), rgba(184, 212, 232, .16));
  clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%);
  margin-bottom: 22px;
}
.val-icon .material-icons-outlined { color: var(--deep); font-size: 28px; }
.val-card h3 { font-size: 1.22rem; margin-bottom: 10px; }
.val-card p { color: var(--ink-soft); font-size: .98rem; }

/* contadores */
.counters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 32px; margin-top: 64px; }
.counter { text-align: center; position: relative; z-index: 2; }
.counter .num {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.9rem; font-weight: 700; color: var(--cream);
  font-variant-numeric: tabular-nums;
}
.counter .lbl { font-size: .9rem; letter-spacing: .05em; color: rgba(255, 255, 255, .78); margin-top: 6px; }
.deep-pattern {
  position: absolute; inset: 0; opacity: .05; z-index: 0;
  background-image: radial-gradient(var(--cream) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* servicios */
.serv-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 36px; }

.serv-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.serv-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--gold); }

.serv-img { height: 230px; overflow: hidden; background: var(--bg-soft); }
.serv-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.serv-card:hover .serv-img img { transform: scale(1.06); }

.serv-body { padding: 30px 28px 32px; flex: 1; display: flex; flex-direction: column; }
.serv-body h3 { font-size: 1.4rem; margin-bottom: 12px; }
.serv-body p { color: var(--ink-soft); margin-bottom: 24px; flex: 1; }
.serv-body .btn { align-self: flex-start; }

/* galería */
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gal-item { border-radius: 16px; overflow: hidden; height: 280px; box-shadow: var(--shadow); background: var(--bg-soft); }
.gal-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gal-item:hover img { transform: scale(1.08); }
.gal-item.tall { grid-row: span 2; height: auto; }

/* testimonios */
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }

.test-card {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 34px 30px; box-shadow: var(--shadow); position: relative;
  transition: transform .3s ease, box-shadow .3s ease, border-color .3s ease;
}
.test-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--gold); }
.test-card .quote { font-family: 'Space Grotesk'; font-size: 3.4rem; color: var(--cream); line-height: .6; height: 26px; }
.test-stars { color: var(--gold); margin: 6px 0 14px; }
.test-stars .material-icons-outlined { font-size: 20px; }
.test-card p { color: var(--ink-soft); font-size: 1rem; margin-bottom: 22px; }

.test-person { display: flex; align-items: center; gap: 14px; }
.test-person img { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; }
.test-person strong { display: block; font-family: 'Space Grotesk'; font-size: 1rem; }
.test-person span { font-size: .85rem; color: var(--ink-soft); }

/* faq */
.faq-wrap { max-width: 820px; margin: 0 auto; }
.faq-item {
  background: #fff; border: 1px solid var(--border); border-radius: 14px;
  margin-bottom: 16px; overflow: hidden;
  transition: box-shadow .3s ease, border-color .3s ease;
}
.faq-item:hover { border-color: var(--gold); }

.faq-q {
  width: 100%; text-align: left; background: none; border: none;
  padding: 22px 26px; font-family: 'Space Grotesk';
  font-size: 1.06rem; font-weight: 500; color: var(--ink); cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.faq-q .material-icons-outlined { color: var(--gold); transition: transform .3s ease; flex: none; }
.faq-q[aria-expanded="true"] .material-icons-outlined { transform: rotate(180deg); }

.faq-a { max-height: 0; overflow: hidden; transition: max-height .35s ease; }
.faq-a p { padding: 0 26px 24px; color: var(--ink-soft); }

/* contacto */
.contact-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; }

.contact-form {
  background: #fff; border: 1px solid var(--border); border-radius: 18px;
  padding: 38px; box-shadow: var(--shadow);
}
.field { margin-bottom: 20px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 8px; font-family: 'Space Grotesk'; }
.field input, .field textarea {
  width: 100%; padding: 13px 16px; border: 1.5px solid var(--border); border-radius: 12px;
  font-family: 'Inter'; font-size: .98rem; background: var(--bg-soft);
  transition: border-color .3s ease, background .3s ease;
}
.field input:focus, .field textarea:focus { border-color: var(--gold); background: #fff; }
.field textarea { resize: vertical; min-height: 120px; }

.form-success {
  display: none;
  background: rgba(200, 162, 74, .12); border: 1px solid var(--gold); color: var(--deep);
  padding: 16px; border-radius: 12px; margin-top: 18px; font-size: .95rem;
}
.form-success.show { display: block; }

.form-error {
  display: flex; align-items: flex-start; gap: 10px;
  background: rgba(155, 44, 44, .07); border: 1px solid rgba(155, 44, 44, .35); color: #8c2727;
  padding: 14px 16px; border-radius: 12px; margin-top: 18px; font-size: .95rem;
}
.form-error .material-icons-outlined { font-size: 20px; flex: none; margin-top: 1px; }

.contact-info { display: flex; flex-direction: column; gap: 26px; }
.info-item { display: flex; gap: 18px; align-items: flex-start; }
.info-ico {
  width: 50px; height: 50px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--gold-soft), rgba(184, 212, 232, .16));
  border-radius: 14px; color: var(--deep);
}
.info-ico .fa-whatsapp { font-size: 22px; }
.info-item h4 { font-family: 'Space Grotesk'; font-size: 1.05rem; margin-bottom: 4px; }
.info-item p, .info-item a { color: var(--ink-soft); font-size: .98rem; }
.info-item a:hover { color: var(--gold); }
.map-wrap { margin-top: 8px; }

/* ---------- pie ---------- */

footer { background: #1f1a12; color: rgba(255, 255, 255, .8); padding: 70px 0 30px; }

.foot-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1fr; gap: 44px; margin-bottom: 50px; }
.foot-col img {
  height: 64px; width: auto;
  background: rgba(255, 255, 255, .9); border-radius: 12px;
  padding: 6px; margin-bottom: 18px;
}
.foot-col h4 { font-family: 'Space Grotesk'; color: #fff; font-size: 1.05rem; margin-bottom: 20px; }
.foot-col p { font-size: .94rem; line-height: 1.7; }
.foot-col ul { list-style: none; }
.foot-col ul li { margin-bottom: 12px; }
.foot-col ul a { font-size: .94rem; transition: color .3s ease; }
.foot-col ul a:hover { color: var(--gold); }

.foot-social { display: flex; gap: 14px; margin-top: 8px; }
.foot-social a {
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255, 255, 255, .08); border-radius: 12px;
  color: #fff; font-size: 1.15rem;
  transition: background .3s ease, transform .3s ease;
}
.foot-social a:hover { background: var(--gold); color: #241b0e; transform: translateY(-3px); }

.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 26px; text-align: center;
  font-size: .88rem; color: rgba(255, 255, 255, .6);
}
.foot-bottom a { color: var(--gold); }

/* ---------- flotante whatsapp ---------- */

.whatsapp-float {
  position: fixed; bottom: 24px; right: 24px;
  width: 60px; height: 60px;
  background: #25D366; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.9rem; z-index: 999;
  box-shadow: 0 6px 20px rgba(37, 211, 102, .4);
  animation: pulse-wa 2.2s infinite;
  transition: transform .3s ease;
}
.whatsapp-float:hover { transform: scale(1.08); }
@keyframes pulse-wa {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, .5); }
  50% { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
}

/* ---------- reveal on scroll ---------- */

.reveal { opacity: 0; transform: translateY(30px); transition: opacity .6s ease, transform .6s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* ---------- responsive ---------- */

@media (max-width: 960px) {
  .values-grid { grid-template-columns: repeat(2, 1fr); }
  .counters { grid-template-columns: repeat(2, 1fr); gap: 36px; }
  .serv-grid { grid-template-columns: 1fr; }
  .test-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
  .gal-item.tall { grid-row: auto; height: 280px; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links {
    position: fixed; top: 0; right: -100%;
    height: 100vh; height: 100dvh; width: 78%; max-width: 320px;
    background: #fff; flex-direction: column; align-items: flex-start;
    padding: 96px 32px; gap: 26px;
    transition: right .35s ease;
    box-shadow: -8px 0 30px rgba(0, 0, 0, .12);
    overscroll-behavior: contain;
  }
  .nav-links.open { right: 0; }
  .nav-links a { color: var(--ink) !important; }
  .hero { min-height: 600px; }
  .hero-svg { display: none; }
  .contact-form { padding: 28px 22px; }
}

@media (max-width: 520px) {
  .values-grid, .counters, .gal-grid { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hero-bg { transform: none !important; }
}
