/* =========================================================
   Imwelfare — Hoja de estilos consolidada y modernizada
   Paleta y estructura originales conservadas.
   ========================================================= */

:root {
  /* Paleta naranja */
  --primary-color: #f97316;
  --primary-dark: #ea580c;
  --primary-gradient: linear-gradient(135deg, #f97316 0%, #ea580c 100%);

  /* Superficies y texto */
  --bg-color: #f8fafc;
  --bg-alt: #f1f5f9;
  --surface-color: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-soft: rgba(15, 23, 42, 0.06);

  /* Radios, sombras y transiciones */
  --border-radius: 24px;
  --radius-sm: 14px;
  --soft-shadow: 0 10px 40px -10px rgba(15, 23, 42, 0.08);
  --hover-shadow: 0 20px 45px -12px rgba(249, 115, 22, 0.28);
  --transition-speed: 0.35s;

  --header-height: 80px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: var(--header-height); }

body {
  font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  margin: 0;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

a { color: var(--primary-color); text-decoration: none; transition: color 0.3s ease; }
a:hover { color: var(--primary-dark); }

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

/* Utilidades de texto (no incluidas en bootstrap-grid) */
.text-center { text-align: center !important; }

/* ====================== HEADER / NAVBAR ====================== */
#header {
  position: sticky;
  top: 0;
  z-index: 997;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.8);
  transition: background var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

#header.header-scrolled {
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 6px 30px rgba(15, 23, 42, 0.08);
}

#header .logo { line-height: 0; margin: 0; }
#header .logo h1 { margin: 0; font-size: 0; }
#header .logo img {
  max-height: 48px;
  width: auto;
  border-radius: 8px;
}

/* Navegación de escritorio */
.navbar { padding: 0; }
.navbar ul {
  margin: 0;
  padding: 0;
  display: flex;
  list-style: none;
  align-items: center;
  gap: 4px;
}
.navbar li { position: relative; }
.navbar a,
.navbar a:focus {
  display: block;
  padding: 10px 16px;
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--text-muted);
  position: relative;
  white-space: nowrap;
}
.navbar a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  background: var(--primary-gradient);
  bottom: 2px;
  left: 16px;
  transition: width 0.3s ease;
  border-radius: 2px;
}
.navbar a:hover,
.navbar .active { color: var(--primary-color); }
.navbar a:hover::after,
.navbar .active::after { width: calc(100% - 32px); }

/* Botón hamburguesa */
.mobile-nav-toggle {
  color: var(--text-main);
  font-size: 28px;
  cursor: pointer;
  display: none;
  line-height: 0;
  transition: 0.3s;
  background: transparent;
  border: 0;
}

/* ====================== MENÚ MÓVIL ====================== */
@media (max-width: 991px) {
  .mobile-nav-toggle { display: block; z-index: 9999; }

  .navbar ul {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: auto;
    height: 100vh;
    height: 100dvh;
    width: min(78vw, 320px);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 90px 20px 30px;
    background: #ffffff;
    box-shadow: -10px 0 40px rgba(15, 23, 42, 0.15);
    transform: translateX(100%);
    transition: transform 0.35s ease;
    overflow-y: auto;
  }

  .navbar.navbar-mobile ul {
    display: flex;
    transform: translateX(0);
  }

  .navbar.navbar-mobile a {
    padding: 14px 16px;
    font-size: 1.05rem;
    border-radius: var(--radius-sm);
  }
  .navbar.navbar-mobile a::after { display: none; }
  .navbar.navbar-mobile a:hover,
  .navbar.navbar-mobile .active {
    background: var(--bg-alt);
    color: var(--primary-color);
  }

  /* Capa oscura de fondo */
  body.mobile-nav-active { overflow: hidden; }
  body.mobile-nav-active::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 998;
  }
  .navbar.navbar-mobile { position: relative; z-index: 9999; }
}

/* ====================== SECCIONES ====================== */
section { padding: 90px 0; scroll-margin-top: var(--header-height); }
.section-bg { background-color: var(--bg-alt); }

.section-title { text-align: center; margin-bottom: 50px; }
.section-title h2 {
  font-weight: 800;
  color: var(--text-main);
  position: relative;
  padding-bottom: 22px;
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  letter-spacing: -0.5px;
}
.section-title h2::after {
  content: '';
  position: absolute;
  width: 80px;
  height: 6px;
  background: var(--primary-gradient);
  bottom: 0;
  left: calc(50% - 40px);
  border-radius: 10px;
}
.section-title p {
  color: var(--text-muted);
  font-size: 1.02rem;
  max-width: 720px;
  margin: 20px auto 0;
  line-height: 1.75;
}

/* ====================== HERO ====================== */
#hero {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  min-height: calc(70vh - var(--header-height));
  padding: 60px 0;
  overflow: hidden;
  /* Imagen de cielo con nubes incluida en el proyecto */
  background-image: url("../img/hero-clouds.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
/* Velo claro para que el logo se lea bien sobre la foto */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.10) 0%, rgba(255,255,255,0.28) 100%);
  pointer-events: none;
}

#hero .container { position: relative; z-index: 2; display: flex; justify-content: center; }
#hero img {
  width: min(75%, 620px);
  height: auto;
  animation: heroFade 1s ease both;
}
/* Logo del hero sobre la foto, con realce suave */
#hero .hero-logo {
  filter: drop-shadow(0 6px 16px rgba(15, 23, 42, 0.30));
}
@keyframes heroFade {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ====================== QUIENES SOMOS (ABOUT) ====================== */
.about .about-img {
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  width: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}
.about .about-img:hover { transform: translateY(-5px); }

.about .about-intro {
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 30px;
  font-size: clamp(1.6rem, 3.5vw, 2rem);
}

.icon-box {
  background: var(--surface-color);
  padding: 32px;
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  margin-bottom: 24px;
  border: 1px solid var(--border-soft);
  transition: box-shadow var(--transition-speed), transform var(--transition-speed);
}
.icon-box:hover { box-shadow: var(--hover-shadow); transform: translateY(-4px); }
.icon-box .icon i {
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 38px;
  display: inline-block;
  margin-bottom: 10px;
}
.icon-box .title {
  color: var(--text-main);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0 0 8px;
}
.icon-box .description {
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0;
}

/* ====================== QUÉ HACEMOS (VALUES) ====================== */
.values .card {
  border: none;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  min-height: 340px;
  width: 100%;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.values .card:hover { transform: translateY(-6px); box-shadow: var(--hover-shadow); }
.values .card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.78) 100%);
  z-index: 1;
}
.values .card-body {
  position: relative;
  z-index: 2;
  padding: 36px 28px;
  width: 100%;
}
.values .card-title {
  color: #fff;
  font-weight: 800;
  font-size: 1.4rem;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 6px rgba(0,0,0,0.6);
}
.values .card-text {
  color: #f1f5f9;
  font-size: 0.95rem;
  line-height: 1.6;
  font-weight: 400;
  margin: 0;
  text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ====================== PUBLICACIONES (PORTFOLIO) ====================== */
.portfolio-item { margin-bottom: 40px; }
.portfolio-card {
  height: 100%;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  background: var(--surface-color);
  border: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}
.portfolio-card:hover { transform: translateY(-6px); box-shadow: var(--hover-shadow); }
.portfolio-wrap {
  overflow: hidden;
  position: relative;
  aspect-ratio: 1 / 1.05;
}
.portfolio-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-speed);
}
.portfolio-card:hover .portfolio-wrap img { transform: scale(1.06); }
.portfolio-info {
  padding: 24px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}
.portfolio-info h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 16px;
  line-height: 1.4;
  flex: 1 1 auto;
}
.portfolio-lightbox {
  align-self: center;
  background: var(--bg-alt);
  color: var(--primary-color);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.3s;
}
.portfolio-lightbox:hover {
  background: var(--primary-gradient);
  color: #fff;
  transform: scale(1.08);
}

/* ====================== BOTONES ====================== */
.btn-primary,
button[type="submit"] {
  background: var(--primary-gradient);
  border: none;
  padding: 14px 36px;
  border-radius: 50px;
  font-weight: 600;
  letter-spacing: 0.4px;
  color: #fff;
  cursor: pointer;
  box-shadow: 0 10px 22px -10px rgba(249, 115, 22, 0.55);
  transition: transform var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}
.btn-primary:hover,
button[type="submit"]:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 28px -10px rgba(249, 115, 22, 0.7);
  color: #fff;
}

/* ====================== CONTACTO ====================== */
.contact .info-box {
  background: var(--surface-color);
  padding: 36px 26px;
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  text-align: center;
  height: 100%;
  border: 1px solid var(--border-soft);
}
.contact .info-box i {
  font-size: 30px;
  color: #fff;
  margin-bottom: 18px;
  background: var(--primary-gradient);
  width: 68px;
  height: 68px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 8px 20px -5px rgba(249, 115, 22, 0.4);
}
.contact .info-box h3 {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 6px;
}
.contact .info-box p { color: var(--text-muted); font-size: 0.95rem; margin: 0; }

/* Bloque de datos de contacto (columna izquierda) */
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 20px;
  height: 100%;
}
.contact-details .info-box {
  text-align: left;
  display: grid;
  grid-template-columns: 68px 1fr;
  align-items: center;
  column-gap: 18px;
  row-gap: 2px;
  padding: 22px 26px;
}
.contact-details .info-box i { grid-row: 1 / 3; align-self: center; margin-bottom: 0; }
.contact-details .info-box h3 { align-self: end; }
.contact-details .info-box p { align-self: start; }

/* Mapa fluido y responsive */
.map-responsive {
  position: relative;
  width: 100%;
  padding-bottom: 70%;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--soft-shadow);
}
.map-responsive iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
/* Mapa que ocupa toda la altura de la columna de contacto */
.map-full {
  padding-bottom: 0;
  height: 100%;
  min-height: 380px;
  border-radius: var(--border-radius);
}
.map-full iframe { position: absolute; inset: 0; height: 100%; }

/* Formulario */
.php-email-form {
  background: var(--surface-color);
  padding: clamp(28px, 5vw, 50px);
  border-radius: var(--border-radius);
  box-shadow: var(--soft-shadow);
  border: 1px solid var(--border-soft);
}
.php-email-form .form-control {
  width: 100%;
  border-radius: 12px;
  padding: 14px 18px;
  border: 2px solid transparent;
  background: var(--bg-color);
  color: var(--text-main);
  font-size: 0.95rem;
  font-family: inherit;
  transition: all 0.3s ease;
}
.php-email-form .form-control::placeholder { color: #94a3b8; }
.php-email-form .form-control:focus {
  border-color: var(--primary-color);
  background: var(--surface-color);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
  outline: none;
}
.php-email-form .loading,
.php-email-form .error-message,
.php-email-form .sent-message { display: none; }
.php-email-form .loading { color: var(--text-muted); }
.php-email-form .error-message {
  color: #b91c1c; background: #fef2f2; padding: 12px 16px; border-radius: 10px;
}
.php-email-form .sent-message {
  color: #166534; background: #f0fdf4; padding: 12px 16px; border-radius: 10px;
}

/* ====================== FOOTER ====================== */
#footer {
  background: #0f172a;
  color: #cbd5e1;
  padding: 60px 0 0;
  font-size: 0.95rem;
}
#footer .footer-top { padding-bottom: 40px; }
#footer h4 {
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 18px;
}
#footer .footer-about p { color: #94a3b8; line-height: 1.7; margin: 0 0 8px; }
#footer .footer-logo { max-height: 54px; margin-bottom: 18px; border-radius: 8px; }
#footer ul { list-style: none; padding: 0; margin: 0; }
#footer .footer-contact li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 12px;
  color: #cbd5e1;
}
#footer .footer-contact i { color: var(--primary-color); font-size: 18px; margin-top: 2px; }
#footer .footer-links li { margin-bottom: 10px; }
#footer .footer-links a { color: #cbd5e1; }
#footer .footer-links a:hover { color: var(--primary-color); padding-left: 4px; }
#footer .social-links { display: flex; gap: 10px; margin-top: 6px; }
#footer .social-links a {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 18px;
  transition: all 0.3s;
}
#footer .social-links a:hover { background: var(--primary-gradient); transform: translateY(-3px); }
#footer .footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding: 22px 0;
  margin-top: 20px;
  text-align: center;
  color: #94a3b8;
  font-size: 0.88rem;
}

/* ====================== BACK TO TOP ====================== */
.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 996;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 8px 20px -6px rgba(249, 115, 22, 0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s;
}
.back-to-top:hover { color: #fff; transform: translateY(-3px); }
.back-to-top.active { opacity: 1; visibility: visible; }

/* ====================== RESPONSIVE ====================== */
@media (max-width: 991px) {
  section { padding: 70px 0; }
  .about .about-img { margin-bottom: 30px; max-width: 520px; }
}

@media (max-width: 767px) {
  section { padding: 56px 0; }
  #hero { min-height: 52vh; }
  #hero img { width: 88%; }
  .icon-box { padding: 26px; }
  .values .card { min-height: 300px; }
  .values .card-body { padding: 28px 22px; }
  #footer { text-align: center; }
  #footer .footer-contact li { justify-content: center; }
  #footer .social-links { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; scroll-behavior: auto !important; }
}
