/* =========================================
   VARIABLES DE COLOR / TIPOGRAFÍA
   ========================================= */
:root {
  --fg: #f9fafb;
  --muted: #9ca3af;
  --brand: #252894;
  --card: #111827;
  --border: #1f2933;
  --shadow: 0 20px 45px rgba(0, 0, 0, 0.45);

  --texto-claro: #f9fafb;
  --dorado: #d4af37;
  --radius-full: 999px;
}

/* =========================================
   RESET BÁSICO
   ========================================= */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

body {
  background: #000;
  color: var(--fg);
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
}


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

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

a:hover {
  text-decoration: underline;
}

/* Contenedor genérico */
.container {
  width: min(1200px, 92vw);
  margin-inline: auto;
}

/* =========================================
   TOPBAR CONTACTO
   ========================================= */
.topbar {
  background: #4b5563;
  color: #e5e7eb;
  font-size: 0.88rem;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
}

.topbar__inner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-block: 0.5rem;
}

.topbar__contact {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}

.topbar__contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #e5e7eb;
}

.topbar__contact a:hover {
  text-decoration: underline;
}

.topbar .separator {
  margin-inline: 0.75rem;
  opacity: 0.6;
}

.topbar__icon img {
  width: 16px;
  height: 16px;
}

/* =========================================
   HEADER / NAVEGACIÓN
   ========================================= */
.main-header {
  position: sticky;
  top: 32px; /* justo debajo de la topbar fija */
  z-index: 60;
  background: #111827;
}

/* Topbar + header alineados exactamente igual */
.topbar .container,
.main-header .container {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding-inline: 3.5rem;
}

.header__inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between; /* logo izq, acciones dcha */
  padding-block: 0.7rem;
}

/* ---------- Botón Inicio ---------- */
.mobile-home {
  display: none;
}

/* ---------- Menú horizontal ---------- */
.nav {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.nav__list {
  display: flex;
  gap: 1.6rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav__list a {
  font-size: 0.9rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #f9fafb;
}

.nav__list a:hover {
  color: var(--dorado);
}

/* ---------- Acciones derecha (lupa + menú) ---------- */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Buscador en el header */
.header-search {
  position: relative;
  overflow: hidden;
  transition: width 0.25s ease, opacity 0.25s ease;
  width: 0;
  opacity: 0;
}

.header-search input {
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #020617;
  color: #e5e7eb;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  outline: none;
  width: 100%;
}

.header-search input::placeholder {
  color: #9ca3af;
}

/* estado abierto (cuando se hace click en la lupa) */
.header-search.is-open {
  width: 180px;
  opacity: 1;
}

/* Botones redondos (lupa y menú) */
.circle-button {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(229, 231, 235, 0.4);
  background: #020617;
  cursor: pointer;
  position: relative;
  flex-shrink: 0;
}

/* Icono lupa */
.icon-search::before {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid #ffffff;
  inset-block-start: 11px;
  inset-inline-start: 11px;
}

.icon-search::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
  inset-block-start: 22px;
  inset-inline-start: 22px;
  transform: rotate(45deg);
}

/* Icono menú hamburguesa */
.icon-menu::before,
.icon-menu::after,
.icon-menu span {
  content: "";
  position: absolute;
  inset-inline: 11px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.icon-menu::before {
  inset-block-start: 13px;
}

.icon-menu::after {
  inset-block-start: 18px;
}

.icon-menu span {
  inset-block-start: 23px;
}

/* =========================================
   HERO
   ========================================= */
.hero {
  position: relative;
  min-height: calc(100vh - 96px); /* alto de viewport menos cabecera aprox. */
  background: url("../img/images/fondo.jpg") center center / cover no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f9fafb;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.85),
    rgba(0, 0, 0, 0.2)
  );
}

.hero__content {
  position: relative;
  z-index: 1;
  padding: 3rem 0 4rem;
  width: 100%;
  text-align: center;
}

.hero h1 {
  font-size: clamp(2.2rem, 4vw, 3.2rem);
  margin-bottom: 0.6rem;
  letter-spacing: 0.16em;
  font-family: "Adobe Arabic";
}

.hero p {
  font-size: 1.4rem;
  max-width: 620px;
  margin-inline: auto;
  color: #e5e7eb;
}

/* =========================================
   SECCIONES GENÉRICAS
   ========================================= */
.section {
  padding: 3.5rem 0;
  background: #111827;
}

.section--alt {
  background: #020617;
}

.section__inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.section__header h2 {
  font-size: 2.5rem;
  margin: 0;
  /*text-transform: uppercase;*/
  letter-spacing: 0.14em;
  font-family: "Adobe Arabic"; 
  text-align: center;
}

.section__body p {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--muted);
  line-height: 1.7;
}

.footer__legal{
  margin-top: 10px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  /*font-size: 0.95rem;*/
  font-size: 1.1rem;
}

.footer__legal a{
  color: var(--dorado);
  text-decoration: none;
  border-bottom: 1px solid rgba(212,175,55,.35);
}

.footer__legal a:hover{
  border-bottom-color: rgba(212,175,55,.9);
}

.footer__sep{
  color: var(--muted);
}

/* Grids genéricas */
.grid {
  display: grid;
  gap: 1.5rem;
}

.grid--3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Cards genéricas */
.card {
  background: #020617;
  padding: 1.6rem 1.5rem;
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-top: 0;
  margin-bottom: 0.7rem;
  font-size: 1.05rem;
}

.card p {
  margin: 0;
  color: var(--muted);
}

/* Noticias */
.card--news .news__date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9ca3af;
}

.card--news h3 {
  font-size: 1.05rem;
}

.link-more {
  font-size: 0.9rem;
  color: var(--dorado);
}

.link-more:hover {
  text-decoration: underline;
}

/* Botón "Ver todas las noticias" en el index (resumen-noticias) */
.news-summary-footer {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

.btn-news-summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.6rem 1.8rem;
  border-radius: var(--radius-full);
  border: 1px solid var(--dorado);
  color: var(--dorado);
  background: transparent;
  font-size: 0.9rem;
  text-decoration: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.btn-news-summary:hover {
  background: var(--dorado);
  color: #000;
  transform: translateY(-1px);
}


/* Imagen de "Nuestra historia" más pequeña y centrada */
.historia-img {
  max-width: 700px;   /* tamaño máximo en escritorio */
  width: 100%;        /* que se adapte en pantallas pequeñas */
  display: block;
  margin: 1.5rem auto 0;  /* separada del texto y centrada */
  border-radius: 0.8rem;  /* opcional, esquinas suaves */
  box-shadow: var(--shadow); /* mismo estilo de las cards */
}

.destacado-nombre {
  font-size: 1.15em;
  font-weight: 600;
}


#nuestra-historia {
  scroll-margin-top: 140px;
  padding-bottom: 11rem;
}

#resumen-servicios {
  scroll-margin-top: 110px;
  padding-bottom: 11rem;
}

#contacto {
  scroll-margin-top: 100px;
  padding-top: 3.5rem;
}

#resumen-noticias {
  scroll-margin-top: 120px;
  padding-top: 1.7rem;
}

/* =========================================
   EQUIPO
   ========================================= */
.team-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.8rem;
}

.team-member {
  text-align: center;
}

.team-member__photo {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 0.9rem;
  box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}

.team-member__name {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
  font-weight: 600;
  font-family: "Adobe Arabic";
}

.team-member__role {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

/* =========================================
   SERVICIOS (BLOQUES CON FOTO)
   ========================================= */
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
}

.service-item {
  position: relative;
  display: block;
  overflow: hidden;
  cursor: pointer;
  min-height: 260px;
}

.service-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1);
  transition: transform 0.4s ease, filter 0.3s ease;
  position: relative;
  z-index: 0;
  filter: brightness(1.22) contrast(1.02);
}

/* Capa oscura / color encima de la foto */
.service-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  transition: background 0.3s ease;
  z-index: 1;
}

/* Texto centrado horizontalmente pero algo más abajo */
.service-label {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 18%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding-inline: 1rem;
  text-align: center;
  color: #ffffff;
  font-size: 1.1rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
  transform: scale(1);
  transition: transform 0.3s ease;
  z-index: 2;
}

/* Efecto hover */
.service-item:hover img {
  transform: scale(1.05);
  filter: brightness(1.28) contrast(1.03);
}

.service-item:hover::before {
  background: rgba(37, 40, 148, 0.20);
}

.service-item:hover .service-label {
  transform: scale(1.08);
}

/* =========================================
   CONTACTO
   ========================================= */
.contact-text {
  width: 100%;
  max-width: none;
}

.contact-text h2 {
  font-size: 2.5rem;
  margin: 0 0 1.5rem;
  letter-spacing: 0.14em;
  font-family: "Adobe Arabic";
  text-align: center;
}

.contact-text p {
  margin: 0;
  text-align: left;
}

.contact-data {
  max-width: 340px;
}

.contact-data p {
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 1.15rem;
}

.contact-data a {
  color: var(--dorado);
  font-size: 1.15rem;
}

.contact-form-wrapper {
  width: 100%;
  max-width: 820px;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.contact-message {
  width: 100%;
  max-width: 820px;
  padding: 1rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  line-height: 1.5;
}

.contact-message--success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  color: #065f46;
}

.contact-message--error {
  background: #fef2f2;
  border: 1px solid #ef4444;
  color: #991b1b;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.form-group label {
  color: #374151;
  font-size: 0.9rem;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  background: #ffffff;
  color: #111827;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-group input {
  min-height: 48px;
}

.form-group textarea {
  min-height: 170px;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--dorado);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.12);
}

.form-privacy {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  color: #4b5563;
  font-size: 0.85rem;
  line-height: 1.5;
}

.form-privacy input {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--dorado);
}

.form-privacy a {
  color: var(--dorado);
  text-decoration: underline;
}

.contact-submit {
  align-self: flex-start;
  margin-top: 0.4rem;
  padding: 0.75rem 2.2rem;
  border: 1px solid var(--dorado);
  border-radius: 999px;
  background: var(--dorado);
  color: #111827;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.contact-submit:hover {
  background: #111827;
  border-color: #111827;
  color: #ffffff;
  transform: translateY(-1px);
}

.form-honeypot {
  position: absolute;
  left: -9999px;
  opacity: 0;
  pointer-events: none;
}

/* =========================================
   FOOTER
   ========================================= */
.footer {
  background: #ffffff;
  color: #9ca3af;
  padding: 1.4rem 0;
  font-size: 0.85rem;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 0.5rem;
}

.footer__inner img {
  max-width: 320px;
  height: auto;
}

/* =========================================
   OVERLAY MENÚ (HAMBURGUESA)
   ========================================= */
.overlay-menu {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(1px);
  display: none;
  z-index: 120;
}

.overlay-menu.is-open {
  display: block;
}

.overlay-inner {
  margin-left: auto;
  height: 100%;
  width: min(420px, 30vw);
  background: #020617;
  padding: 32px 40px;
  display: flex;
  flex-direction: column;
}

.overlay-close {
  align-self: flex-end;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(229, 231, 235, 0.4);
  background: transparent;
  cursor: pointer;
  position: relative;
}

.overlay-close::before,
.overlay-close::after {
  content: "";
  position: absolute;
  inset-inline: 11px;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.overlay-close::before {
  transform: rotate(45deg);
  inset-block-start: 19px;
}

.overlay-close::after {
  transform: rotate(-45deg);
  inset-block-start: 19px;
}

.overlay-list {
  list-style: none;
  margin: auto 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.overlay-list a {
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--texto-claro);
}

.overlay-list a:hover {
  color: var(--dorado);
}

/* =========================================
   MODAL DE SERVICIOS
   ========================================= */
.service-modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}

.service-modal.is-open {
  display: flex;
}

.service-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(3px);
}

.service-modal__dialog {
  position: relative;
  margin: 0;
  background: #020617;
  color: #f9fafb;
  border-radius: 0.8rem;
  padding: 1.8rem 2rem;
  width: min(540px, 92vw);
  max-height: calc(100vh - 4rem);
  overflow-y: auto;
}

.service-modal__dialog h3 {
  margin-top: 0;
  margin-bottom: 0.9rem;
  font-size: 1.25rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.service-modal__dialog p {
  margin: 0;
  line-height: 1.7;
  color: var(--muted);
  white-space: pre-line; /* respeta los \n del JS */
}

/* Botón de cierre */
.service-modal__close {
  position: absolute;
  top: 0.75rem;
  right: 0.9rem;
  background: transparent;
  border: 0;
  color: #f9fafb;
  font-size: 1.2rem;
  cursor: pointer;
}

.service-modal__close:hover {
  background: rgba(148, 163, 184, 0.2);
}

/* =========================================
   RESPONSIVE
   ========================================= */

/* Escritorio: ocultamos el botón hamburguesa */
#btnMenu {
  display: none;
}

/* Hasta 900px: tablet + móvil */
@media (max-width: 900px) {

  /* Menú */
  .nav__list {
    display: none;
  }

  .nav {
    position: static;
    transform: none;
  }

  #btnMenu {
    display: block;
  }

  .mobile-home {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    border: 1px solid rgba(229, 231, 235, 0.4);
    background: #020617;
    color: #ffffff;
    flex-shrink: 0;
  }

  .mobile-home svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }
}
  
/* Hasta 600px: móvil */
@media (max-width: 600px) {

  .main-header {
    top: 55px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    border-bottom: 1px solid rgba(15, 23, 42, 0.7);
  }

  .header__inner {
    padding-block: 0.5rem;
  }

  /* Buscador más estrecho */
  .header-search.is-open {
    width: 130px;
  }

  /* Topbar con email encima del teléfono */
  .topbar__inner {
    justify-content: center;
    text-align: center;
  }

  .topbar__contact {
    flex-direction: column;
    gap: 0.25rem;
  }

  .topbar .separator {
    display: none;
  }

  /* Hero algo más compacto */
  .hero__content {
    padding: 2.2rem 1.2rem 3rem;
  }

  .hero h1 {
    font-size: 1.8rem;
    letter-spacing: 0.14em;
    line-height: 1.2;
  }

  .hero p {
    font-size: 0.9rem;
    max-width: 18rem;
    margin-top: 0.7rem;
    margin-inline: auto;
    line-height: 1.5;
  }

  /* Modal algo más compacto */
  .service-modal__dialog {
    padding: 1.4rem 1.5rem;
    width: 92vw;
    max-height: 80vh;
  }

  .service-modal__dialog h3 {
    font-size: 1.05rem;
  }

  /* Menú lateral ocupando todo el ancho en móvil */
  .overlay-inner {
    width: 100%;
    max-width: none;
    margin-left: 0;
    padding: 24px 20px;
  }
}