/* ============================================================
   LOS LUCEROS — Hoja de estilos principal
   Paleta:
     Fondo crema     #FAF7F2
     Texto oscuro    #1C1C1C
     Terracota       #C1440E
     Verde oscuro    #2D5016
   ============================================================ */

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

:root {
  --crema:      #FAF7F2;
  --oscuro:     #1C1C1C;
  --terracota:  #C1440E;
  --verde:      #2D5016;
  --gris-claro: #D9D3CA;
  --gris-medio: #8A8178;

  --font-titulo: 'Playfair Display', Georgia, serif;
  --font-cuerpo: 'DM Sans', system-ui, sans-serif;

  --radio:    12px;
  --radio-sm: 6px;
  --sombra:   0 4px 24px rgba(28, 28, 28, 0.10);
  --sombra-fuerte: 0 8px 40px rgba(28, 28, 28, 0.18);

  --transicion: 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--crema);
  color: var(--oscuro);
  font-family: var(--font-cuerpo);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

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

/* ---------- Placeholders de fotos ---------- */
.photo-placeholder {
  background-color: var(--gris-claro);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--gris-medio);
  font-family: var(--font-cuerpo);
  font-size: 0.85rem;
  line-height: 1.6;
  border-radius: var(--radio);
  position: relative;
  overflow: hidden;
}

.photo-placeholder--hero {
  position: absolute;
  inset: 0;
  border-radius: 0;
  background-color: #b0a89e;
  font-size: 1.1rem;
}

.photo-placeholder--about {
  width: 100%;
  aspect-ratio: 6 / 5;
}

.photo-placeholder--gallery {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radio);
}

/* ---------- Contenedor y utilidades ---------- */
.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px;
}

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terracota);
  margin-bottom: 12px;
}

.section-title {
  font-family: var(--font-titulo);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--oscuro);
  margin-bottom: 24px;
}

.section-title--center {
  text-align: center;
}

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-cuerpo);
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radio-sm);
  padding: 12px 24px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background-color var(--transicion), color var(--transicion), border-color var(--transicion), transform var(--transicion), box-shadow var(--transicion);
  white-space: nowrap;
  text-decoration: none;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--sombra);
}

.btn--terracota {
  background-color: var(--terracota);
  color: white;
  border-color: var(--terracota);
}

.btn--terracota:hover {
  background-color: #a63a0c;
  border-color: #a63a0c;
}

.btn--outline-white {
  background-color: transparent;
  color: white;
  border-color: white;
}

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

.btn--outline-terracota {
  background-color: transparent;
  color: var(--terracota);
  border-color: var(--terracota);
}

.btn--outline-terracota:hover {
  background-color: rgba(193, 68, 14, 0.06);
}

.btn--lg {
  font-size: 1rem;
  padding: 14px 32px;
}

.btn--xl {
  font-size: 1.1rem;
  padding: 18px 36px;
}

.btn--full {
  width: 100%;
  max-width: 460px;
}

/* ---------- Fade-in al scroll ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 16px 24px;
  transition: background-color var(--transicion), box-shadow var(--transicion), padding var(--transicion);
}

.navbar.scrolled {
  background-color: var(--crema);
  box-shadow: 0 2px 20px rgba(28, 28, 28, 0.10);
  padding: 12px 24px;
}

.navbar__inner {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar__logo {
  font-family: var(--font-titulo);
  font-size: 1.5rem;
  font-weight: 700;
  color: white;
  transition: color var(--transicion);
  text-decoration: none;
}

.navbar.scrolled .navbar__logo {
  color: var(--oscuro);
}

.navbar__cta {
  font-size: 0.9rem;
  padding: 10px 20px;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
}

.hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__panel {
  position: relative;
  z-index: 2;
  background: rgba(0, 0, 0, 0.52);
  width: 46%;
  max-width: 600px;
  min-height: 100;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 120px 56px 80px;
}

.hero__title {
  font-family: var(--font-titulo);
  font-size: clamp(2rem, 3.5vw, 3rem);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero__subtitle {
  font-family: var(--font-cuerpo);
  font-size: 1.05rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.75;
  margin-bottom: 40px;
}

.hero__buttons {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

@media (max-width: 768px) {
  .hero__panel {
    width: 100%;
    max-width: none;
    padding: 96px 24px 56px;
  }
}

@media (max-width: 480px) {
  .hero__buttons {
    width: 100%;
  }
  .hero__buttons .btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================================
   FRANJA DE IMPACTO
   ============================================================ */
.impact {
  background-color: var(--terracota);
  padding: 60px 24px;
}

.impact__inner {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 24px;
}

.impact__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  color: white;
}

.impact__number {
  font-family: var(--font-titulo);
  font-size: clamp(3rem, 8vw, 5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: 8px;
}

.impact__number--percent::after {
  content: '%';
  font-size: 0.55em;
  vertical-align: super;
}

.impact__label {
  font-size: 0.95rem;
  font-weight: 500;
  opacity: 0.88;
  letter-spacing: 0.03em;
}

/* ============================================================
   QUIÉNES SOMOS
   ============================================================ */
.about {
  padding: 100px 0;
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 48px;
  align-items: center;
}

.about__text p {
  font-size: 1.05rem;
  color: #3a3530;
  line-height: 1.8;
  max-width: 560px;
}

/* ============================================================
   LO QUE HACEMOS
   ============================================================ */
.services {
  padding: 80px 0 100px;
  background-color: white;
}

.services__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-top: 48px;
}

.service-card {
  background-color: var(--crema);
  border-radius: var(--radio);
  padding: 32px 28px;
  border: 1px solid rgba(193, 68, 14, 0.10);
  transition: transform var(--transicion), box-shadow var(--transicion);
}

.service-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sombra);
}

.service-card__icon {
  margin-bottom: 20px;
}

.service-card__title {
  font-family: var(--font-titulo);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--oscuro);
}

.service-card__desc {
  font-size: 0.95rem;
  color: #5a5248;
  line-height: 1.65;
}

/* ============================================================
   GALERÍA / CARRUSEL
   ============================================================ */
.gallery {
  padding: 80px 0 100px;
}

.carousel {
  position: relative;
  margin: 48px auto 0;
  border-radius: 16px;
  box-shadow: 0 2px 32px rgba(28, 28, 28, 0.09);
  max-width: 720px;
  border: 1px solid rgba(28, 28, 28, 0.09);
}

.carousel__viewport {
  overflow: hidden;
  border-radius: 15px;
  background: var(--oscuro);
}

.carousel__track {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: transform;
}

.carousel__slide {
  min-width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 72vw;
}

.carousel__slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.carousel__btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.90);
  color: var(--oscuro);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.20);
  transition: background 0.2s, transform 0.2s;
  z-index: 2;
}

.carousel__btn:hover {
  background: white;
  transform: translateY(-50%) scale(1.08);
}

.carousel__btn--prev { left: 16px; }
.carousel__btn--next { right: 16px; }

.carousel__counter {
  position: absolute;
  bottom: 14px;
  right: 18px;
  background: rgba(0, 0, 0, 0.50);
  color: white;
  font-size: 0.8rem;
  font-family: var(--font-cuerpo);
  padding: 4px 10px;
  border-radius: 20px;
  letter-spacing: 0.04em;
  z-index: 2;
  pointer-events: none;
}

/* placeholder para compatibilidad con el resto del CSS */
.gallery__caption {
  padding: 10px 4px 4px;
  font-size: 0.85rem;
  color: var(--gris-medio);
  text-align: center;
}

/* ============================================================
   NECESIDADES
   ============================================================ */
.needs {
  background-color: var(--verde);
  color: white;
  padding: 90px 0;
}

.needs .section-title {
  color: white;
  max-width: 600px;
  margin-bottom: 48px;
}

.needs__list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-bottom: 48px;
}

.needs__item {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.needs__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  background-color: rgba(255,255,255,0.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.needs__item p {
  font-size: 1.1rem;
  font-weight: 500;
  padding-top: 8px;
  line-height: 1.5;
}

.needs__closing {
  font-size: 1rem;
  line-height: 1.75;
  opacity: 0.88;
  max-width: 640px;
  border-left: 3px solid rgba(255,255,255,0.35);
  padding-left: 20px;
}

/* ============================================================
   DONACIÓN
   ============================================================ */
.donation {
  padding: 90px 0 100px;
}

.donation__amounts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 40px 0 48px;
}

.amount-card {
  background: white;
  border: 2px solid var(--gris-claro);
  border-radius: var(--radio);
  padding: 24px 20px;
  cursor: pointer;
  text-align: center;
  transition: border-color var(--transicion), box-shadow var(--transicion), background-color var(--transicion);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-family: inherit;
}

.amount-card:hover {
  border-color: var(--terracota);
  box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.12);
}

.amount-card.active {
  border-color: var(--terracota);
  background-color: rgba(193, 68, 14, 0.04);
  box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.18);
}

.amount-card__price {
  font-family: var(--font-titulo);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--terracota);
  display: block;
}

.amount-card__desc {
  font-size: 0.88rem;
  color: var(--gris-medio);
  display: block;
}

.amount-card--free {
  cursor: default;
}

.amount-card__input {
  margin-top: 10px;
  width: 100%;
  border: 1.5px solid var(--gris-claro);
  border-radius: var(--radio-sm);
  padding: 10px 14px;
  font-family: var(--font-cuerpo);
  font-size: 1rem;
  color: var(--oscuro);
  background: transparent;
  text-align: center;
  outline: none;
  transition: border-color var(--transicion);
}

.amount-card__input:focus {
  border-color: var(--terracota);
}

/* oculta las flechas del input number */
.amount-card__input::-webkit-inner-spin-button,
.amount-card__input::-webkit-outer-spin-button {
  -webkit-appearance: none;
}
.amount-card__input[type=number] {
  -moz-appearance: textfield;
}

.donation__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.donation__note {
  font-size: 0.85rem;
  color: var(--gris-medio);
  text-align: center;
  max-width: 400px;
  line-height: 1.6;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background-color: var(--oscuro);
  color: rgba(255,255,255,0.80);
  padding: 64px 0 40px;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
  align-items: center;
  text-align: center;
}

.footer__logo {
  font-family: var(--font-titulo);
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  display: block;
  margin-bottom: 6px;
}

.footer__location {
  font-size: 0.9rem;
  opacity: 0.65;
}

.footer__instagram {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.75);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color var(--transicion);
}

.footer__instagram:hover {
  color: white;
}

.footer__legal {
  border-top: 1px solid rgba(255,255,255,0.10);
  padding-top: 24px;
  width: 100%;
}

.footer__legal p {
  font-size: 0.8rem;
  opacity: 0.45;
  text-align: center;
}

/* ============================================================
   RESPONSIVE — Tablet  (≥ 640px)
   ============================================================ */
@media (min-width: 640px) {
  .impact__inner {
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
  }

  .donation__amounts {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel__slide {
    aspect-ratio: 3 / 2;
    max-height: 420px;
  }
}

/* ============================================================
   RESPONSIVE — Desktop  (≥ 900px)
   ============================================================ */
@media (min-width: 900px) {
  .about__grid {
    grid-template-columns: 1fr 1fr;
    gap: 80px;
  }

  .about__text p {
    max-width: none;
  }

  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .carousel__btn {
    width: 56px;
    height: 56px;
  }

  .donation__amounts {
    grid-template-columns: repeat(4, 1fr);
  }

  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
    flex-wrap: wrap;
    gap: 24px;
  }

  .footer__legal {
    width: 100%;
    text-align: center;
  }
}

@media (min-width: 1100px) {
  .services__grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================================
   RESPONSIVE — Móvil optimizado  (< 640px)
   ============================================================ */
@media (max-width: 639px) {
  .about    { padding: 56px 0; }
  .services { padding: 56px 0 68px; }
  .gallery  { padding: 56px 0 68px; }
  .needs    { padding: 60px 0; }
  .donation { padding: 60px 0 68px; }

  .impact { padding: 44px 20px; }
  .impact__inner { gap: 24px 12px; }
  .impact__number { font-size: clamp(2.4rem, 10vw, 3.8rem); }

  .about__grid { gap: 28px; }

  .services__grid { margin-top: 28px; gap: 14px; }
  .service-card { padding: 24px 20px; }

  .needs__item { gap: 14px; }
  .needs__icon { width: 44px; height: 44px; }
  .needs__item p { font-size: 1rem; }

  .carousel { margin-top: 28px; }

  .amount-card { padding: 20px 14px; }
  .amount-card__price { font-size: 1.3rem; }
  .amount-card__desc  { font-size: 0.82rem; }
}

@media (min-width: 380px) {
  .donation__amounts {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================================
   MODAL DONANTE
   ============================================================ */
.donor-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(28, 28, 28, 0.60);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.donor-overlay:not([hidden]) {
  opacity: 1;
}

.donor-overlay[hidden] {
  display: none;
}

.donor-modal {
  background: var(--crema);
  border-radius: 16px;
  box-shadow: var(--sombra-fuerte);
  width: 100%;
  max-width: 460px;
  padding: 40px 36px 36px;
  position: relative;
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.donor-overlay:not([hidden]) .donor-modal {
  transform: translateY(0);
}

.donor-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--gris-medio);
  cursor: pointer;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transicion), color var(--transicion);
}

.donor-modal__close:hover {
  background: var(--gris-claro);
  color: var(--oscuro);
}

.donor-modal__header {
  margin-bottom: 28px;
}

.donor-modal__title {
  font-family: var(--font-titulo);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--oscuro);
  margin-bottom: 10px;
  line-height: 1.2;
}

.donor-modal__subtitle {
  font-size: 0.93rem;
  color: var(--gris-medio);
  line-height: 1.6;
}

.donor-modal__form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.donor-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.donor-field__label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--oscuro);
  letter-spacing: 0.01em;
}

.donor-field__opcional {
  font-weight: 400;
  color: var(--gris-medio);
  margin-left: 4px;
}

.donor-field__input {
  border: 1.5px solid var(--gris-claro);
  border-radius: var(--radio-sm);
  padding: 11px 14px;
  font-family: var(--font-cuerpo);
  font-size: 0.97rem;
  color: var(--oscuro);
  background: white;
  outline: none;
  transition: border-color var(--transicion), box-shadow var(--transicion);
}

.donor-field__input:focus {
  border-color: var(--terracota);
  box-shadow: 0 0 0 3px rgba(193, 68, 14, 0.12);
}

.donor-field__input.error {
  border-color: #c0392b;
  box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.10);
}

.donor-field__error {
  font-size: 0.8rem;
  color: #c0392b;
  display: none;
}

.donor-field__error.visible {
  display: block;
}

.donor-modal__submit {
  margin-top: 4px;
  font-size: 1rem;
  padding: 15px 24px;
}

.donor-modal__privacy {
  font-size: 0.78rem;
  color: var(--gris-medio);
  text-align: center;
  line-height: 1.5;
}

/* ============================================================
   CARRUSEL — Indicadores (dots)
   ============================================================ */
.carousel__dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding-top: 16px;
}

.carousel__dot {
  width: 7px;
  height: 7px;
  border-radius: 4px;
  background: var(--gris-claro);
  border: none;
  cursor: pointer;
  transition: background 0.3s ease, width 0.3s ease;
  padding: 0;
  flex-shrink: 0;
}

.carousel__dot.active {
  background: var(--terracota);
  width: 22px;
}

/* ============================================================
   ABOUT — imagen con estilo
   ============================================================ */
.about__image img {
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  width: 100%;
}

/* ============================================================
   MODAL — Móvil bottom-sheet  (< 540px)
   ============================================================ */
@media (max-width: 540px) {
  .donor-overlay {
    padding: 0;
    align-items: flex-end;
  }
  .donor-modal {
    padding: 32px 20px 28px;
    border-radius: 20px 20px 0 0;
    max-width: none;
    width: 100%;
  }
  .donor-modal__title {
    font-size: 1.45rem;
  }
  .donor-modal__form {
    gap: 16px;
  }
}
