/* ===== Base ===== */
:root {
  --green-dark: #1f3327;
  --green: #33513f;
  --green-mid: #5c7a68;
  --green-light: #a9bfae;
  --cream: #f7f4ec;
  --cream-2: #efe9dc;
  --gold: #b08d4f;
  --gold-light: #d8c39a;
  --white: #ffffff;
  --text: #22271f;
  --text-2: #5a5f54;
  --border: #e3ddcd;
  --danger: #8c2f2f;

  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 10px;
  --shadow: 0 10px 30px -12px rgba(31, 51, 39, 0.18);
  --container: 1160px;
}

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

button { font-family: inherit; }

html { scroll-behavior: smooth; }

html, body {
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--green-dark);
  line-height: 1.2;
}

a { color: inherit; text-decoration: none; }

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

img, svg { display: block; }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 10px;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

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

.btn--ghost-light {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.55);
}
.btn--ghost-light:hover { background: rgba(255, 255, 255, 0.12); }

.btn--urgencia {
  background: var(--danger);
  color: var(--white);
}
.btn--urgencia:hover { background: #742525; }

.btn--sm { padding: 9px 18px; font-size: 0.85rem; }
.btn--full { width: 100%; }

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease, padding 0.3s ease;
  padding: 22px 0;
}
.header.scrolled {
  background: rgba(247, 244, 236, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 18px rgba(31, 51, 39, 0.08);
  padding: 12px 0;
}

.header__inner {
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  transition: color 0.3s ease;
  margin-right: auto;
}
.header.scrolled .brand { color: var(--green-dark); }

.brand__mark { display: flex; color: var(--gold); }

.brand__text {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-weight: 600;
}

.nav {
  display: flex;
  gap: 30px;
  margin-right: 12px;
}

.nav__link {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--white);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s ease;
}
.header.scrolled .nav__link { color: var(--text); }

.nav__link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width 0.25s ease;
}
.nav__link:hover::after,
.nav__link.active::after { width: 100%; }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--white);
  transition: background 0.3s ease;
}
.header.scrolled .nav-toggle span { background: var(--green-dark); }

.nav__close { display: none; }

.nav-overlay {
  display: none;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.hero__bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(255,255,255,0.06), transparent 45%),
    linear-gradient(160deg, #2a4636 0%, #1f3327 55%, #16241b 100%);
}
.hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 26px 26px;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 24, 18, 0.55), transparent 60%);
}

.hero__content {
  position: relative;
  z-index: 2;
  color: var(--white);
  max-width: 720px;
}

.hero h1 {
  color: var(--white);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  margin-bottom: 20px;
}

.hero__lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.85);
  max-width: 560px;
  margin-bottom: 34px;
}

.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero__scroll {
  position: absolute;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.75);
  animation: bounce 2.2s infinite;
  z-index: 2;
}
@keyframes bounce {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ===== Emergency FAB ===== */
.emergency-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--danger);
  color: var(--white);
  padding: 14px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 24px -8px rgba(140, 47, 47, 0.55);
  font-weight: 600;
  font-size: 0.9rem;
}
.emergency-fab__pulse {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--danger);
  animation: pulse 2s infinite;
  z-index: -1;
}
@keyframes pulse {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* ===== Modal (urgencias) ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease, visibility 0s linear 0.25s;
}
.modal.is-open {
  opacity: 1;
  visibility: visible;
  transition: opacity 0.25s ease;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(15, 24, 18, 0.55);
}
.modal__panel {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  padding: 36px 32px;
  width: min(90vw, 400px);
  box-shadow: var(--shadow);
}
.modal__panel h3 { font-size: 1.3rem; margin-bottom: 8px; }
.modal__sub { color: var(--text-2); font-size: 0.9rem; margin-bottom: 22px; }
.modal__close {
  position: absolute;
  top: 18px; right: 18px;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: none;
  background: var(--cream-2);
  color: var(--green-dark);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.modal__options {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.modal__option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cream);
  transition: border-color 0.2s ease, background 0.2s ease;
}
.modal__option:hover { border-color: var(--gold); background: var(--cream-2); }
.modal__option-name { font-weight: 600; color: var(--green-dark); }
.modal__option-phone { color: var(--danger); font-weight: 600; }

/* ===== Sections ===== */
.section {
  padding: 110px 0;
}
.section--alt {
  background: var(--cream-2);
}

.section-head {
  max-width: 640px;
  margin-bottom: 56px;
}
.section-sub {
  color: var(--text-2);
  margin-top: 10px;
}

/* ===== Values ===== */
.values {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}
.value-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 26px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.value-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}
.value-card__icon {
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--cream-2);
  color: var(--green);
  margin-bottom: 18px;
}
.value-card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.value-card p { color: var(--text-2); font-size: 0.92rem; }

/* ===== Locations ===== */
.locations {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.location-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.location-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.location-card--highlight {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}
.location-card--highlight h3 { color: var(--white); }
.location-card--highlight .location-card__list { color: rgba(255,255,255,0.85); }
.location-card--highlight .link-arrow { color: var(--gold-light); }

.location-card__tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--green);
  background: var(--cream-2);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}
.location-card__tag--gold {
  background: rgba(216, 195, 154, 0.2);
  color: var(--gold-light);
}

.location-card h3 { margin-bottom: 14px; font-size: 1.15rem; }

.location-card__list {
  list-style: none;
  color: var(--text-2);
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.location-card__list a { text-decoration: underline; text-underline-offset: 2px; }

.link-arrow {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--green);
  transition: opacity 0.2s ease;
}
.link-arrow:hover { opacity: 0.7; }

/* ===== Gallery ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.gallery__item {
  aspect-ratio: 4 / 3;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.85);
  position: relative;
  overflow: hidden;
  transition: transform 0.3s ease;
}
.gallery__item svg { width: 34%; height: 34%; }
.gallery__item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery__item:hover { transform: scale(1.02); }
.gallery__item[style*="--tile-tone:1"] { background: linear-gradient(145deg, #33513f, #1f3327); }
.gallery__item[style*="--tile-tone:2"] { background: linear-gradient(145deg, #5c7a68, #33513f); }
.gallery__item[style*="--tile-tone:3"] { background: linear-gradient(145deg, #b08d4f, #7a5f34); }
.gallery__item[style*="--tile-tone:4"] { background: linear-gradient(145deg, #4a6b57, #223a2c); }
.gallery__item::after {
  content: attr(data-caption);
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 10px 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--white);
  background: linear-gradient(to top, rgba(0,0,0,0.45), transparent);
  text-align: left;
}

/* ===== Lightbox ===== */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 20, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
.lightbox__stage {
  width: min(70vw, 560px);
  aspect-ratio: 4/3;
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
}
.lightbox__stage svg { width: 30%; height: 30%; }
.lightbox__caption {
  position: absolute;
  bottom: 40px;
  color: var(--white);
  font-size: 0.95rem;
}
.lightbox__close, .lightbox__nav {
  position: absolute;
  background: rgba(255,255,255,0.1);
  border: none;
  color: var(--white);
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.2rem;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.lightbox__close:hover, .lightbox__nav:hover { background: rgba(255,255,255,0.22); }
.lightbox__close { top: 24px; right: 24px; }
.lightbox__nav--prev { left: 24px; top: 50%; transform: translateY(-50%); }
.lightbox__nav--next { right: 24px; top: 50%; transform: translateY(-50%); }

/* ===== Accordion ===== */
.accordion {
  max-width: 760px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.accordion__item {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.accordion__trigger {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background: none;
  border: none;
  text-align: left;
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--green-dark);
  cursor: pointer;
}
.accordion__icon {
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 0.25s ease;
  flex-shrink: 0;
  margin-left: 16px;
}
.accordion__item.is-open .accordion__icon { transform: rotate(45deg); }

.accordion__panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease, padding 0.3s ease;
  padding: 0 24px;
}
.accordion__panel p { color: var(--text-2); font-size: 0.92rem; }
.accordion__item.is-open .accordion__panel { padding: 0 24px 20px; }

/* ===== Contact ===== */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 40px;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.contact-info__card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 28px;
}
.contact-info__card--urgent {
  background: var(--green-dark);
  border-color: var(--green-dark);
  color: var(--white);
}
.contact-info__card--urgent h3 { color: var(--white); margin-bottom: 16px; }
.urgent-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}
.urgent-line:first-of-type { border-top: none; padding-top: 0; }
.urgent-line__label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}
.contact-info__phone {
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--white);
}
.contact-info__card h3 { font-size: 1rem; margin-bottom: 10px; }
.contact-info__card p { color: var(--text-2); font-size: 0.92rem; }
.contact-info__card a:hover { text-decoration: underline; }

.contact-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 34px;
}
.form-row { margin-bottom: 18px; }
.form-row label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--green-dark);
}
.form-row input, .form-row textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--sans);
  font-size: 0.94rem;
  background: var(--cream);
  resize: vertical;
  transition: border-color 0.2s ease;
}
.form-row input:focus, .form-row textarea:focus {
  outline: none;
  border-color: var(--gold);
}
.form-note {
  margin-top: 12px;
  font-size: 0.78rem;
  color: var(--text-2);
  text-align: center;
}

/* ===== Footer ===== */
.footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.75);
  padding: 40px 0;
}
.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.brand--footer .brand__text { color: var(--white); }
.footer__copy { font-size: 0.85rem; }

/* ===== Back to top ===== */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 89;
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--green-dark);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s ease;
}
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: translateY(0); }

/* ===== Reveal animation ===== */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ===== Responsive ===== */
@media (max-width: 960px) {
  .values { grid-template-columns: repeat(2, 1fr); }
  .locations { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .nav {
    position: fixed;
    top: 0; right: 0;
    height: 100vh;
    width: min(78vw, 320px);
    background: var(--cream);
    flex-direction: column;
    padding: 100px 32px 32px;
    gap: 26px;
    transform: translateX(100%);
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.3s ease, visibility 0s linear 0.3s;
    box-shadow: -10px 0 30px rgba(0,0,0,0.12);
    z-index: 99;
  }
  .nav.is-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition: transform 0.3s ease;
  }
  .nav__link { color: var(--text) !important; font-size: 1.05rem; }
  .nav-toggle { display: flex; }
  .header__inner .btn--urgencia { display: none; }

  .nav__close {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: flex-end;
    position: absolute;
    top: 28px;
    right: 28px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--cream-2);
    color: var(--green-dark);
    font-size: 1.1rem;
    cursor: pointer;
  }

  .nav-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(15, 24, 18, 0.45);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  }
  .nav-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity 0.3s ease;
  }
  .values { grid-template-columns: 1fr; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .section { padding: 80px 0; }
  .emergency-fab__text { display: none; }
  .emergency-fab { padding: 14px; }
}

@media (max-width: 480px) {
  .gallery { grid-template-columns: 1fr; }
  .hero__actions { flex-direction: column; align-items: flex-start; }
}
