:root {
  --green-darkest: #041208;
  --green-dark: #0A1F0D;
  --green-mid: #1B4332;
  --green-accent: #2D6A4F;
  --gold: #C9A84C;
  --gold-light: #D4BA6A;
  --gold-glow: rgba(201, 168, 76, 0.15);
  --cream: #F5F0E8;
  --white: #FFFFFF;

  --font-display: "Playfair Display", "Georgia", serif;
  --font-body: "Inter", "Helvetica Neue", sans-serif;

  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
}

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--cream);
  background-color: var(--green-dark);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(1100px, 100% - 1.5rem);
  margin: 0 auto;
  padding-left: var(--safe-left);
  padding-right: var(--safe-right);
}

/* ========================
   KEYFRAME ANIMATIONS
   ======================== */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes scrollLine {
  0% { transform: scaleY(0); transform-origin: top; }
  50% { transform: scaleY(1); transform-origin: top; }
  51% { transform-origin: bottom; }
  100% { transform: scaleY(0); transform-origin: bottom; }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.15); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  33% { transform: translateY(-8px) rotate(1deg); }
  66% { transform: translateY(4px) rotate(-1deg); }
}

@keyframes borderGlow {
  0%, 100% { border-color: rgba(201, 168, 76, 0.1); }
  50% { border-color: rgba(201, 168, 76, 0.4); }
}

@keyframes goldShine {
  0% { left: -100%; }
  100% { left: 200%; }
}

@keyframes pulseRing {
  0% { transform: scale(1); opacity: 0.4; }
  100% { transform: scale(1.8); opacity: 0; }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

/* Entry animations */
.anim-fade-up {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) forwards;
  animation-delay: var(--delay, 0s);
}

.anim-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.anim-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ========================
   NAVBAR
   ======================== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: calc(0.6rem + var(--safe-top)) 0 0.6rem;
  transition: background-color 0.4s var(--ease), padding 0.3s var(--ease), box-shadow 0.4s var(--ease);
}

.navbar.scrolled {
  background: rgba(10, 31, 13, 0.92);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  padding: calc(0.4rem + var(--safe-top)) 0 0.4rem;
  box-shadow: 0 1px 0 rgba(201, 168, 76, 0.1), 0 4px 20px rgba(0, 0, 0, 0.4);
}

.navbar__inner {
  width: min(1100px, 100% - 1.5rem);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo { display: flex; align-items: center; }

.navbar__logo-img {
  height: 32px;
  width: auto;
  transition: transform 0.3s var(--ease);
}

.navbar__logo:hover .navbar__logo-img {
  transform: scale(1.05);
}

.navbar__links {
  display: flex;
  gap: 2rem;
}

.navbar__links a {
  font-size: 0.8rem;
  font-weight: 500;
  color: rgba(245, 240, 232, 0.7);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.3s var(--ease);
}

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

.navbar__links a::after {
  content: "";
  position: absolute;
  bottom: 0; left: 50%;
  width: 0; height: 1px;
  background: var(--gold);
  transition: width 0.3s var(--ease), left 0.3s var(--ease);
}

.navbar__links a:hover::after {
  width: 100%; left: 0;
}

/* Hamburger */
.navbar__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px; height: 44px;
  padding: 10px;
  background: none; border: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.navbar__burger span {
  display: block;
  width: 22px; height: 1.5px;
  background: var(--cream);
  border-radius: 1px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}

.navbar__burger.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.navbar__burger.active span:nth-child(2) { opacity: 0; }
.navbar__burger.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ========================
   HERO
   ======================== */
.hero {
  position: relative;
  min-height: 55vh;
  min-height: 55svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(3rem + var(--safe-top)) 1rem calc(2rem + var(--safe-bottom));
  background: url("https://cracks.agency/wp-content/uploads/2026/03/LCDV-3-scaled.jpg") center center / cover no-repeat;
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(4, 18, 8, 0.7) 0%,
    rgba(10, 31, 13, 0.55) 40%,
    rgba(10, 31, 13, 0.7) 70%,
    var(--green-dark) 100%
  );
  pointer-events: none;
}

.hero__glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  animation: glowPulse 6s ease-in-out infinite;
}

.hero__glow--1 {
  width: 400px; height: 400px;
  top: -10%; left: -5%;
  background: radial-gradient(circle, rgba(27, 67, 50, 0.7), transparent 70%);
}

.hero__glow--2 {
  width: 300px; height: 300px;
  bottom: -5%; right: -5%;
  background: radial-gradient(circle, rgba(201, 168, 76, 0.12), transparent 70%);
  animation-delay: 3s;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 600px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.hero__logo {
  max-width: 260px;
  width: 55vw;
  height: auto;
  filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4));
  animation: fadeUp 0.7s var(--ease-out) forwards, float 6s ease-in-out 1.5s infinite;
  animation-delay: var(--delay, 0s);
}

.hero__subtitle {
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  font-weight: 300;
  line-height: 1.5;
  color: rgba(245, 240, 232, 0.7);
  max-width: 440px;
}

/* Scroll indicator */
.hero__scroll {
  position: relative;
  z-index: 1;
  margin-top: 1.5rem;
  width: 1px;
  height: 32px;
  overflow: hidden;
}

.hero__scroll-line {
  width: 100%;
  height: 100%;
  background: var(--gold);
  animation: scrollLine 2s var(--ease) infinite;
}

/* ========================
   BUTTONS
   ======================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 42px;
  padding: 0.55rem 1.5rem;
  border: none;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}

.btn--gold {
  background: var(--gold);
  color: var(--green-darkest);
  position: relative;
  overflow: hidden;
}

.btn--gold::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 50%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: none;
  pointer-events: none;
}

.btn--gold:hover::after {
  animation: goldShine 0.6s ease forwards;
}

.btn--gold:hover {
  background: var(--gold-light);
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 30px rgba(201, 168, 76, 0.4), 0 0 15px rgba(201, 168, 76, 0.15);
}

.btn--gold:active { transform: translateY(0) scale(0.98); }

.btn--whatsapp {
  background: #25D366;
  color: var(--white);
  width: 100%;
  gap: 0.5rem;
}

.btn--whatsapp:hover {
  background: #1EBE5D;
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 25px rgba(37, 211, 102, 0.35), 0 0 15px rgba(37, 211, 102, 0.1);
}

.btn--whatsapp:active {
  transform: translateY(0) scale(0.98);
  box-shadow: none;
}

/* ========================
   SECTION HEADER
   ======================== */
.section-header {
  text-align: center;
  margin-bottom: 1rem;
}

.section-header__eyebrow {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.25rem;
}

.section-header__title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 5vw, 2.2rem);
  font-weight: 600;
  color: var(--white);
}

.section-header__line {
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  margin: 0.5rem auto 0;
  transition: width 0.8s var(--ease-out) 0.3s;
}

.anim-on-scroll.visible .section-header__line {
  width: 60px;
}

/* ========================
   SUCURSALES
   ======================== */
.sucursales {
  padding: 1.5rem 0 2rem;
}

.sucursales__grid {
  display: grid;
  gap: 0.6rem;
}

/* ========================
   BRANCH CARD
   ======================== */
.branch-card {
  background: linear-gradient(145deg, rgba(27, 67, 50, 0.5) 0%, rgba(10, 31, 13, 0.6) 100%);
  border: 1px solid rgba(201, 168, 76, 0.1);
  border-radius: 10px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
  transform-style: preserve-3d;
  will-change: transform;
}

/* Shimmer effect on hover */
.branch-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 40%,
    rgba(201, 168, 76, 0.06) 45%,
    rgba(201, 168, 76, 0.06) 55%,
    transparent 60%
  );
  background-size: 200% 100%;
  opacity: 0;
  transition: opacity 0.4s var(--ease);
}

.branch-card:hover::before {
  opacity: 1;
  animation: shimmer 1.5s ease-in-out;
}

.branch-card:hover {
  border-color: rgba(201, 168, 76, 0.35);
  box-shadow:
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 30px rgba(201, 168, 76, 0.08),
    0 0 0 1px rgba(201, 168, 76, 0.12),
    inset 0 1px 0 rgba(201, 168, 76, 0.1);
}

/* Gold shine sweep on hover */
.branch-card::after {
  content: "";
  position: absolute;
  top: 0; left: -100%;
  width: 60%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.07), transparent);
  transition: none;
  pointer-events: none;
}

.branch-card:hover::after {
  animation: goldShine 0.8s ease forwards;
}

/* Card entry animation */
.branch-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out), border-color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.branch-card.visible {
  opacity: 1;
  transform: translateY(0);
}

.branch-card__name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--white);
  position: relative;
}

.branch-card__address {
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(245, 240, 232, 0.55);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.branch-card__actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.branch-card__map-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--gold);
  letter-spacing: 0.04em;
  min-height: 30px;
  transition: color 0.3s var(--ease), gap 0.3s var(--ease);
  -webkit-tap-highlight-color: transparent;
}

.branch-card__map-link:hover {
  color: var(--gold-light);
  gap: 0.5rem;
}

.branch-card__map-link svg {
  flex-shrink: 0;
}

/* ========================
   FOOTER
   ======================== */
.footer {
  padding: 1.5rem 0 calc(0.75rem + var(--safe-bottom));
  text-align: center;
  background: var(--green-dark);
}

.footer__logo {
  height: 40px;
  width: auto;
  margin: 0 auto 0.5rem;
  opacity: 0.8;
}

.footer__text {
  font-size: 0.78rem;
  font-weight: 300;
  color: rgba(245, 240, 232, 0.5);
  max-width: 340px;
  margin: 0 auto;
}

.footer__line {
  width: 30px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(201, 168, 76, 0.3), transparent);
  margin: 0.6rem auto;
}

.footer__copy {
  font-size: 0.65rem;
  color: rgba(245, 240, 232, 0.25);
  letter-spacing: 0.03em;
}

/* ========================
   REDUCED MOTION
   ======================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .anim-fade-up, .anim-on-scroll, .branch-card { opacity: 1; transform: none; }
  .hero__glow { animation: none; }
}

/* ========================
   MOBILE
   ======================== */
@media (max-width: 640px) {
  .navbar__burger { display: flex; }

  .navbar__links {
    position: fixed;
    inset: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    background: rgba(4, 18, 8, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s var(--ease);
  }

  .navbar__links.open { opacity: 1; visibility: visible; }

  /* Staggered menu link animations */
  .navbar__links li {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
  }

  .navbar__links.open li {
    opacity: 1;
    transform: translateY(0);
  }

  .navbar__links.open li:nth-child(1) { transition-delay: 0.1s; }
  .navbar__links.open li:nth-child(2) { transition-delay: 0.2s; }
  .navbar__links.open li:nth-child(3) { transition-delay: 0.3s; }

  .navbar__links a {
    font-size: 1.3rem;
    color: var(--cream);
    letter-spacing: 0.2em;
    display: block;
    padding: 1rem 2rem;
    position: relative;
  }

  .navbar__links a::after {
    content: "";
    position: absolute;
    bottom: 0; left: 50%;
    width: 0; height: 1px;
    background: var(--gold);
    transition: width 0.3s var(--ease), left 0.3s var(--ease);
  }

  .navbar__links a:hover::after,
  .navbar__links a:active::after {
    width: 40%; left: 30%;
  }

  /* Hero mobile */
  .hero {
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(3rem + var(--safe-top)) 1.25rem calc(2rem + var(--safe-bottom));
  }

  .hero__content { gap: 1rem; }
  .hero__logo { max-width: 220px; width: 55vw; animation-name: fadeUp !important; }
  .hero__subtitle { font-size: 0.88rem; line-height: 1.6; max-width: 320px; }

  .hero__glow--1 { width: 250px; height: 250px; }
  .hero__glow--2 { width: 180px; height: 180px; }
  .hero__scroll { margin-top: 1rem; height: 24px; }

  /* Sucursales mobile */
  .sucursales { padding: 1.5rem 0 2rem; }
  .sucursales__grid { grid-template-columns: 1fr; gap: 0.65rem; }
  .section-header { margin-bottom: 1rem; }
  .section-header__title { font-size: 1.5rem; }

  /* Cards mobile - tap-friendly */
  .branch-card {
    padding: 1rem 1rem 0.85rem;
    border-radius: 12px;
    -webkit-tap-highlight-color: transparent;
  }

  .branch-card:hover { transform: none; box-shadow: none; }
  .branch-card::before, .branch-card::after { display: none; }

  /* Active state for touch feedback */
  .branch-card:active {
    background: linear-gradient(145deg, rgba(27, 67, 50, 0.7) 0%, rgba(10, 31, 13, 0.75) 100%);
    border-color: rgba(201, 168, 76, 0.25);
    transition: background 0.1s, border-color 0.1s;
  }

  .branch-card__name { font-size: 1.05rem; }
  .branch-card__address { font-size: 0.82rem; line-height: 1.4; }

  /* Bigger touch targets */
  .btn--whatsapp {
    min-height: 48px;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  .branch-card__map-link {
    min-height: 44px;
    font-size: 0.78rem;
  }

  .btn--gold {
    min-height: 48px;
    padding: 0.65rem 2rem;
    font-size: 0.82rem;
    border-radius: 8px;
  }

  /* Footer mobile */
  .footer { padding: 1.5rem 0 calc(0.75rem + var(--safe-bottom)); }
  .footer__logo { height: 36px; margin-bottom: 0.75rem; }
  .footer__text { font-size: 0.82rem; max-width: 280px; }
}

/* ========================
   TABLET
   ======================== */
@media (min-width: 641px) and (max-width: 1023px) {
  .sucursales__grid { grid-template-columns: repeat(2, 1fr); gap: 0.75rem; }
  .sucursales { padding: 2rem 0; }
  .container { width: min(1100px, 100% - 2.5rem); }

  .hero {
    min-height: 70vh;
    min-height: 70svh;
  }

  .hero__logo { max-width: 260px; }
  .hero__subtitle { font-size: 0.95rem; max-width: 420px; }

  .btn--whatsapp { min-height: 46px; }
  .branch-card__map-link { min-height: 40px; }
}

/* ========================
   DESKTOP
   ======================== */
@media (min-width: 1024px) {
  .container { width: min(1100px, 100% - 3rem); }
  .navbar { padding: 1rem 0; }
  .navbar.scrolled { padding: 0.5rem 0; }
  .navbar__logo-img { height: 40px; }

  .hero { min-height: 60vh; min-height: 60svh; }
  .hero__logo { max-width: 300px; }

  .sucursales__grid { grid-template-columns: repeat(3, 1fr); gap: 0.85rem; }
  .sucursales { padding: 2.5rem 0; }
  .section-header { margin-bottom: 1.25rem; }

  .branch-card { padding: 1.15rem; gap: 0.45rem; }
  .branch-card__name { font-size: 1.1rem; }

  .footer { padding: 2rem 0 1rem; }
  .footer__logo { height: 48px; }
}
