/* ============================================================
   PLOMELCO · Capa de modernización visual y animaciones
   Paleta basada en el logo: azul marino + dorado (rayo) + gris techo.
   Se carga DESPUÉS de Bootstrap y de las hojas de estilo existentes
   de cada página, así que sus reglas tienen prioridad y "envuelven"
   el diseño anterior sin romper el HTML original.
   ============================================================ */

:root {
  --primary: #1c3f73;
  --primary-dark: #0b2140;
  --primary-darker: #071729;
  --primary-mid: #2f6bb0;
  --accent: #ffc72c;
  --accent-dark: #e0a600;
  --ink: #10202f;
  --muted: #5c6b78;
  --bg-soft: #f2f6fb;
  --line: rgba(11, 33, 64, 0.08);
  --radius-lg: 20px;
  --radius-md: 14px;
  --shadow-soft: 0 10px 30px rgba(7, 23, 41, 0.10);
  --shadow-hover: 0 20px 44px rgba(7, 23, 41, 0.22);
  --ease: cubic-bezier(0.22, 0.9, 0.32, 1);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  opacity: 0;
}

body.page-loaded {
  opacity: 1;
  transition: opacity 0.45s var(--ease);
}

body.pp {
  background-color: var(--bg-soft) !important;
}

.container-fluid,
.container-fluid2 {
  background-color: transparent !important;
}

h1, h2, h3, h4, h5, .titulo, .subtitulo, .card-title {
  font-family: "Poppins", "Inter", ui-sans-serif, system-ui, sans-serif;
}

::selection {
  background: var(--accent);
  color: var(--primary-darker);
}

/* ---------- Navbar ---------- */
.navbar {
  background: linear-gradient(100deg, var(--primary-darker), var(--primary-dark) 60%, var(--primary)) !important;
  position: sticky;
  top: 0;
  z-index: 1030;
  padding-top: 0.6rem;
  padding-bottom: 0.6rem;
  transition: box-shadow 0.35s var(--ease), padding 0.35s var(--ease);
}

.navbar.scrolled {
  box-shadow: 0 10px 28px rgba(4, 14, 26, 0.35);
  padding-top: 0.3rem;
  padding-bottom: 0.3rem;
}

.navbar-collapse {
  background-color: transparent !important;
}

.navbar-brand {
  background: #fff;
  padding: 6px 12px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 6px 16px rgba(4, 14, 26, 0.28);
}

.navbar-brand img {
  transition: transform 0.35s var(--ease);
}

.navbar-brand:hover img {
  transform: scale(1.06) rotate(-1deg);
}

.navbar-nav .nav-item img {
  transition: transform 0.3s var(--ease);
  filter: brightness(0) invert(1);
  opacity: 0.85;
}

.navbar-nav .nav-item:hover img {
  transform: translateY(-2px) scale(1.08);
  opacity: 1;
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.88) !important;
  transition: color 0.25s ease, opacity 0.25s ease !important;
}

.navbar-nav .nav-link::after {
  background: var(--accent) !important;
  height: 3px !important;
  border-radius: 3px;
}

.navbar-nav .nav-link:hover {
  opacity: 1 !important;
  color: var(--accent) !important;
}

.navbar-nav .nav-link.active {
  color: var(--accent) !important;
  font-weight: 700;
}

.navbar-nav .nav-link.active::after {
  transform: scaleX(1);
}

.collapse .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
}

/* ---------- Hero (página principal) ---------- */
.hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(150deg, var(--primary-darker) 0%, var(--primary-dark) 45%, var(--primary) 100%);
  padding: 76px 20px 96px;
  text-align: center;
  color: #fff;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(115deg, rgba(255, 255, 255, 0.05) 0 2px, transparent 2px 34px);
  pointer-events: none;
}

.hero-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
  opacity: 0.22;
  pointer-events: none;
}

.hero-blob.gold {
  width: 260px;
  height: 260px;
  top: -110px;
  right: 8%;
  background: var(--accent);
  animation: floatBlob 10s ease-in-out infinite;
}

.hero-blob.blue {
  width: 320px;
  height: 320px;
  bottom: -160px;
  left: 4%;
  background: var(--primary-mid);
  opacity: 0.35;
  animation: floatBlob 12s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(24px) scale(1.08); }
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 0 auto;
}

.hero-logo {
  width: 128px;
  height: auto;
  margin-bottom: 24px;
  border-radius: 16px;
  background: #fff;
  padding: 12px;
  box-shadow: var(--shadow-soft);
  animation: heroPop 0.8s var(--ease) both;
}

.hero-eyebrow {
  display: inline-block;
  padding: 6px 18px;
  border-radius: 50px;
  background: rgba(255, 199, 44, 0.15);
  border: 1px solid rgba(255, 199, 44, 0.4);
  color: var(--accent);
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: 18px;
  animation: heroRise 0.8s 0.05s var(--ease) both;
}

.hero-title {
  font-size: clamp(1.7rem, 3.4vw, 2.7rem);
  font-weight: 700;
  margin-bottom: 14px;
  animation: heroRise 0.8s 0.1s var(--ease) both;
}

.hero-subtitle {
  font-size: 1.08rem;
  color: rgba(255, 255, 255, 0.86);
  margin-bottom: 32px;
  animation: heroRise 0.8s 0.2s var(--ease) both;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 36px;
  animation: heroRise 0.8s 0.3s var(--ease) both;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  justify-content: center;
  animation: heroRise 0.8s 0.38s var(--ease) both;
}

.hero-stat {
  min-width: 120px;
}

.hero-stat strong {
  display: block;
  font-family: "Poppins", sans-serif;
  font-size: 1.6rem;
  color: var(--accent);
}

.hero-stat span {
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.75);
}

@keyframes heroPop {
  from { opacity: 0; transform: scale(0.7); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes heroRise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

.btn-hero {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  padding: 13px 30px;
  border-radius: 50px;
  font-weight: 600;
  text-decoration: none;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}

.btn-hero-primary {
  background: var(--accent);
  color: var(--primary-darker);
  box-shadow: 0 14px 28px rgba(255, 199, 44, 0.35);
}

.btn-hero-primary:hover {
  background: #fff;
  transform: translateY(-3px);
  box-shadow: 0 18px 34px rgba(255, 199, 44, 0.4);
  color: var(--primary-darker);
}

.btn-hero-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(4px);
}

.btn-hero-secondary:hover {
  background: #fff;
  color: var(--primary-dark);
  transform: translateY(-3px);
}

/* ---------- Títulos de sección ---------- */
.titulo-container {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary)) !important;
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft);
  position: relative;
  overflow: hidden;
  padding: 18px !important;
}

.titulo-container::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.14), transparent 60%);
  pointer-events: none;
}

.titulo-container::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 4px;
  background: var(--accent);
  border-radius: 0 4px 0 0;
}

.subtitulo {
  border: none !important;
  border-radius: var(--radius-md) !important;
  background: linear-gradient(120deg, var(--accent-dark), var(--accent)) !important;
  color: var(--primary-darker) !important;
  box-shadow: var(--shadow-soft);
  font-weight: 700;
}

/* ---------- Tarjetas ---------- */
.card {
  border: none !important;
  border-top: 4px solid var(--accent) !important;
  border-radius: var(--radius-lg) !important;
  overflow: hidden;
  background-color: #fff !important;
  box-shadow: var(--shadow-soft) !important;
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease) !important;
}

.card:hover {
  transform: translateY(-8px) scale(1.02) !important;
  box-shadow: var(--shadow-hover) !important;
}

.card-body {
  background-color: #fff !important;
}

.card-img-top {
  transition: transform 0.5s var(--ease);
}

.card:hover .card-img-top {
  transform: scale(1.06);
}

.card-title {
  color: var(--primary-darker);
}

.card-title i {
  color: var(--accent-dark);
  margin-right: 6px;
}

/* La primera sección de contenido "flota" sobre el borde inferior del hero */
.hero-overlap {
  position: relative;
  z-index: 2;
  margin-top: -46px;
}

.hero-overlap .first-title {
  margin-top: 0 !important;
}

.hero-overlap .titulo-container {
  box-shadow: var(--shadow-hover);
}

.list-group-item {
  border: none;
  border-bottom: 1px solid var(--line) !important;
  padding-left: 2rem !important;
  position: relative;
  transition: background 0.25s ease, padding-left 0.25s ease;
}

.list-group-item::before {
  content: "\f00c";
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  color: var(--accent-dark);
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
}

.list-group-item:hover {
  background: var(--bg-soft);
  padding-left: 2.4rem !important;
}

/* ---------- Galería de proyectos: badge "ver galería" ---------- */
.card-img-wrap {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.card-img-badge {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  padding-bottom: 16px;
  background: linear-gradient(180deg, rgba(11, 33, 64, 0) 40%, rgba(11, 33, 64, 0.9) 100%);
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.main-card:hover .card-img-badge {
  opacity: 1;
  transform: translateY(0);
}

.main-card {
  cursor: pointer;
}

/* ---------- Botones / CTAs existentes ---------- */
.whatsapp-button,
.facebook-button,
.f,
.button2,
.form-container button {
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background-color 0.3s var(--ease) !important;
}

.whatsapp-button:hover,
.facebook-button:hover,
.form-container button:hover {
  transform: translateY(-3px) scale(1.03);
}

/* ---------- Formulario (empleo) ---------- */
.form-container {
  max-width: 860px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg) !important;
  box-shadow: var(--shadow-soft) !important;
  overflow: hidden;
  padding: 0 !important;
}

.form-header {
  background: linear-gradient(120deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 30px 34px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.form-header-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  border-radius: 50%;
  background: rgba(255, 199, 44, 0.18);
  border: 1px solid rgba(255, 199, 44, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--accent);
}

.form-header h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.form-header p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.form-container form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 26px;
  padding: 30px 34px 8px;
}

.form-container .form-group:has(input[type="file"]),
.form-container .boton {
  grid-column: 1 / -1;
}

.form-container .form-group {
  margin-bottom: 18px;
}

.form-container label {
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--primary-dark);
  font-weight: 700;
}

input, select, textarea {
  border: 1.5px solid var(--line) !important;
  border-radius: 10px !important;
  padding: 10px 14px !important;
  transition: border-color 0.25s ease, box-shadow 0.25s ease !important;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 4px rgba(28, 63, 115, 0.14) !important;
}

.form-container .form-group:has(input[type="file"]) {
  border: 1.6px dashed var(--primary-mid);
  border-radius: var(--radius-md);
  padding: 16px !important;
  background: var(--bg-soft);
}

.form-container button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 50px !important;
  padding: 13px 34px !important;
  background: var(--accent) !important;
  color: var(--primary-darker) !important;
  font-weight: 700 !important;
  box-shadow: 0 12px 26px rgba(255, 199, 44, 0.35);
}

.form-container button:hover {
  background: var(--accent-dark) !important;
}

.boton {
  padding: 8px 20px 26px !important;
}

@media (max-width: 700px) {
  .form-container form {
    grid-template-columns: 1fr;
    padding: 26px 22px 6px;
  }
  .form-header {
    padding: 24px 22px;
  }
}

/* ---------- Ofertas de empleo: galería de puestos ---------- */
.jobs-section {
  padding-top: 20px;
}

.job-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.job-card {
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 1px solid var(--line);
  transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
  position: relative;
}

.job-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.5s var(--ease);
}

.job-card::after {
  content: "Ver en grande";
  font-family: "Inter", sans-serif;
  font-weight: 600;
  position: absolute;
  right: 12px;
  bottom: 12px;
  background: rgba(11, 33, 64, 0.82);
  color: #fff;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 50px;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.job-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

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

.job-card:hover::after {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Contacto ---------- */
.contact-lead {
  color: var(--muted);
  max-width: 560px;
  margin: 0 auto 32px;
}

.contact-grid {
  align-items: stretch;
}

.contact-info-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-soft);
  border-top: 4px solid var(--accent);
  padding: 32px 28px;
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.contact-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.contact-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--primary-dark), var(--primary));
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  box-shadow: 0 8px 16px rgba(11, 33, 64, 0.22);
}

.contact-item h6 {
  margin: 0 0 4px;
  color: var(--primary-darker);
  font-family: "Poppins", sans-serif;
  font-weight: 700;
}

.contact-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.contact-whatsapp {
  margin-top: auto;
  justify-content: center;
  text-align: center;
}

.map-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  border: 6px solid #fff;
  height: 100%;
  min-height: 320px;
}

.map-card iframe {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: block;
  border: none !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}

/* ---------- Tabla de contacto (fallback si se conserva) ---------- */
.table th {
  color: var(--primary-darker);
}

/* ---------- Modales de proyectos: lightbox ---------- */
.modal {
  backdrop-filter: blur(4px);
  background-color: rgba(6, 16, 28, 0.65) !important;
  animation: fadeIn 0.25s ease;
}

.modal-content {
  border: none !important;
  border-radius: var(--radius-lg) !important;
  box-shadow: 0 30px 70px rgba(4, 14, 26, 0.45) !important;
  animation: modalPop 0.35s var(--ease);
  padding: 0 !important;
  overflow: hidden;
  position: relative;
  display: flex !important;
  max-height: 82vh;
  width: 92% !important;
  max-width: 780px !important;
  margin: 4vh auto !important;
}

.modal-text {
  background: linear-gradient(165deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 40px 32px;
  min-width: 260px;
  max-width: 320px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.modal-text h2 {
  color: #fff;
  font-size: 1.4rem;
  text-align: left !important;
}

.modal-text h5 {
  color: var(--accent);
  font-weight: 600;
  font-size: 1rem;
}

.modal-images {
  background: var(--bg-soft);
  padding: 24px;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 210px));
  justify-content: center;
  gap: 14px;
  align-content: start;
  flex: 1;
}

.modal-images img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  object-fit: contain !important;
  background: #fff;
  padding: 6px;
  border: 1px solid var(--line);
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
  box-shadow: 0 4px 12px rgba(7, 23, 41, 0.08);
}

.modal-images img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 22px rgba(7, 23, 41, 0.18);
}

.close {
  position: absolute;
  top: 16px;
  right: 18px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff !important;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  z-index: 2;
  float: none !important;
  transition: transform 0.25s ease, background 0.25s ease;
}

.close:hover {
  transform: rotate(90deg);
  background: var(--accent);
  color: var(--primary-darker) !important;
}

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

@keyframes modalPop {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 768px) {
  .modal-content {
    flex-direction: column;
    max-height: 88vh;
    width: 92% !important;
  }
  .modal-text {
    max-width: 100%;
    padding: 60px 24px 20px;
  }
  .modal-images {
    max-height: 50vh;
  }
}

/* ---------- Mapa / iframe genérico ---------- */
.img-fluid {
  transition: box-shadow 0.35s var(--ease), transform 0.35s var(--ease) !important;
}

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
  will-change: opacity, transform;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Footer ---------- */
footer.footer {
  background: linear-gradient(120deg, var(--primary-darker), var(--primary-dark) 70%, var(--primary)) !important;
  position: relative;
}

footer.footer h5 {
  position: relative;
  padding-bottom: 8px;
}

footer.footer h5::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 42px;
  height: 3px;
  border-radius: 3px;
  background: var(--accent);
}

footer.footer a {
  transition: color 0.25s ease, transform 0.25s ease;
  display: inline-block;
}

footer.footer a:hover {
  color: var(--accent) !important;
  transform: translateX(4px);
}

/* ---------- Botón flotante volver arriba ---------- */
.back-to-top {
  position: fixed;
  right: 22px;
  bottom: 92px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--primary-dark);
  color: #fff;
  font-size: 17px;
  line-height: 1;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.3s var(--ease), transform 0.3s var(--ease), background 0.3s ease;
  z-index: 1040;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--accent);
  color: var(--primary-darker);
}

/* ---------- WhatsApp flotante ---------- */
.whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 24px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: #25d366;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45);
  z-index: 1040;
  animation: pulseWhats 2.6s ease-in-out infinite;
  transition: transform 0.3s var(--ease);
}

.whatsapp-fab img {
  width: 28px;
  height: 28px;
}

.whatsapp-fab:hover {
  transform: scale(1.08);
}

@keyframes pulseWhats {
  0%, 100% { box-shadow: 0 10px 26px rgba(37, 211, 102, 0.45); }
  50% { box-shadow: 0 10px 26px rgba(37, 211, 102, 0.75), 0 0 0 10px rgba(37, 211, 102, 0.12); }
}

@media (max-width: 576px) {
  .back-to-top { right: 14px; bottom: 84px; width: 42px; height: 42px; }
  .whatsapp-fab { right: 14px; bottom: 18px; width: 50px; height: 50px; }
  .hero { padding: 56px 16px 64px; }
  .modal-text { padding-top: 64px; }
}
