﻿/* ============================================
   ESTILOS GLOBALES
   ============================================ */
:root {
  --primario: #024d9e;
  --secundario: #e61917;
  --acento: #f2a700;
  --texto: #1e1b1f;
  --fondo-inverso: #f7f7f7;
  --blanco: #ffffff;
  --fondo: #f7f7f7;

  --font-titulos: 'Montserrat', sans-serif;
  --font-texto: 'Open Sans', sans-serif;
  --text-size: 1rem;
  --line-height-titulos: 1.1;
  --line-height-texto: 1.4;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-texto);
  background: var(--fondo-inverso);
  color: var(--texto);
  font-size: var(--text-size);
  line-height: var(--line-height-texto);
}

h1,
h2,
h3 {
  font-family: var(--font-titulos);
  line-height: var(--line-height-titulos);
}

h4,
h5,
h6,
p {
  font-family: var(--font-texto);
  line-height: var(--line-height-texto);
}


/* ============================================
   ESTILOS GENERALES
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.95rem 1.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.95;
}

.btn-primary {
  background: var(--primario);
  color: var(--blanco);
  border: 2px solid transparent;
}

.btn-secondary {
  background: transparent;
  color: var(--primario);
  border: 2px solid var(--primario);
}


/* ============================================
   SIDEBAR
   ============================================ */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 250px;
  height: 100vh;
  background: var(--blanco);
  color: var(--texto);
  padding: 2rem 1.25rem;
  box-shadow: 2px 0 12px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
}

.sidebar.mobile-open {
  transform: translateX(0);
}

.sidebar-brand {
  margin-bottom: 2rem;
  display: flex;
  justify-content: center;
}

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

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  align-items: center;
}

.sidebar-nav a {
  position: relative;
  color: var(--texto);
  text-decoration: none;
  font-weight: 700;
  padding: 0.35rem 0;
}

.sidebar-nav a::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 0;
  height: 3px;
  background: var(--acento);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.sidebar-nav a:hover,
.sidebar-nav a.active {
  color: var(--primario);
}

.sidebar-nav a:hover::after,
.sidebar-nav a.active::after {
  width: 100%;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.social-links {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 1rem;
}

.social-links a {
  color: var(--primario);
  font-size: 1.2rem;
  transition: color 0.3s ease;
}

.social-links a:hover {
  color: var(--secundario);
}

.copyright {
  margin-top: 0.5rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--texto);
}

/* Mobile Header */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 70px;
  background: var(--blanco);
  padding: 0 1rem;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  align-items: center;
  justify-content: space-between;
  z-index: 20;
}

.mobile-brand img {
  max-height: 40px;
}

.mobile-menu-toggle {
  width: 28px;
  height: 28px;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  padding: 0;
}

.mobile-menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 999px;
  background: var(--texto);
}


/* ============================================
   MAIN / CONTENIDO GENERAL
   ============================================ */
.content {
  margin-left: 250px;
}

.section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding: 8rem 0;
  scroll-margin-top: 0;
}

.section:last-child {
  border-bottom: none;
}

.section h2 {
  margin-top: 0;
  margin-bottom: 0.75rem;
  font-weight: 700;
  color: var(--primario);
}


/* ============================================
   SECCION: INICIO (HERO)
   ============================================ */
.section-hero {
  min-height: 100vh;
  background: url('../img/hero.webp') center center / cover no-repeat;
  display: flex;
  justify-content: center;
  padding: 0;
  margin: 0;
  position: relative;
  width: 100%;
}

.hero-content {
  max-width: 960px;
  text-align: left;
  padding: 0 2rem 0 160px;
}

.hero-content h1 {
  margin: 0 0 1rem;
  color: var(--primario);
  font-size: clamp(2.5rem, 5vw, 4rem);
}

.hero-subtitle {
  margin: 0 auto 2rem;
  color: #1e1b1f;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-mobile-profile {
  display: none;
  max-width: 180px;
  width: 100%;
  margin: 2rem auto 0;
}


/* ============================================
   SECCION: NOSOTROS
   ============================================ */
.about-header {
  max-width: 760px;
  margin: 0 auto 2rem;
  text-align: center;
}

.about-header h2 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.about-subtitle {
  color: var(--secundario);
  margin-bottom: 0.35rem;
  margin-top: 0;
}

.about-divider {
  display: block;
  width: 88px;
  height: 4px;
  margin: 0 auto 1rem;
  background: var(--acento);
  border-radius: 999px;
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  max-width: 1100px;
  margin: 0 auto;
}

.about-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 24px;
  object-fit: cover;
}

.about-copy p {
  font-size: 1rem;
  margin: 0 0 1.25rem;
  color: var(--texto);
  line-height: 1.85;
  text-align: justify;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
  max-width: 1100px;
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.about-card {
  width: 100%;
  background: var(--blanco);
  padding: 2rem;
  border-radius: 24px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 55px rgba(0, 0, 0, 0.12);
}

.card-title {
  margin: 0 0 1rem;
  color: var(--primario);
  font-size: 1.45rem;
}

.card-divider {
  display: block;
  width: 56px;
  height: 4px;
  margin-bottom: 1.25rem;
  background: var(--acento);
  border-radius: 999px;
}

.card-text {
  margin: 0;
  color: var(--texto);
  font-size: 1rem;
  line-height: 1.8;
}


/* ============================================
   SECCION: SERVICIOS
   ============================================ */
.section-services {
  background: var(--primario);
  color: var(--blanco);
  text-align: center;
}

.section-services .section-subtitle {
  margin: 0 auto 0.6rem;
  color: var(--blanco);
}

.section-services .section-divider {
  display: block;
  width: 88px;
  height: 4px;
  margin: 0 auto 1rem;
  background: var(--acento);
  border-radius: 999px;
}

.section-services h2 {
  color: var(--blanco);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.section-services .section-description {
  max-width: 760px;
  margin: 0 auto 3rem;
  color: var(--blanco);
  font-size: 1rem;
  line-height: 1.8;
}

.section-services .services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.section-services .services-grid > * {
  width: 100%;
}

.service-card {
  background: var(--blanco);
  border-radius: 24px;
  padding: 2rem;
  color: var(--texto);
  min-height: 320px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 1.25rem;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.12);
}

.service-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 88px;
  height: 88px;
  margin: 0 auto;
  border-radius: 50%;
  background: transparent;
  color: var(--primario);
  font-size: 2.4rem;
}

.service-title {
  margin: 0;
  color: var(--primario);
  font-size: 1.3rem;
}

.service-text {
  margin: 0;
  color: var(--texto);
  font-size: 1rem;
  line-height: 1.8;
}


/* ============================================
   SECCION: PORTAFOLIO
   ============================================ */
.section-portfolio {
  background: var(--blanco);
}

.section-portfolio .section-header {
  text-align: center;
  margin-bottom: 2rem;
}

.section-portfolio .section-subtitle {
  margin: 0 auto 0.6rem;
  color: var(--secundario);
}

.section-portfolio .section-divider {
  display: block;
  width: 88px;
  height: 4px;
  margin: 0 auto 1rem;
  background: var(--acento);
  border-radius: 999px;
}

.section-portfolio h2 {
  color: var(--primario);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.portfolio-tabs {
  max-width: 1100px;
  margin: 0 auto;
}

.portfolio-tab-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 2rem;
}

.portfolio-tab {
  border: 2px solid var(--primario);
  background: transparent;
  color: var(--primario);
  border-radius: 10px;
  padding: 0.8rem 1rem;
  font-family: var(--font-texto);
  font-size: 1rem;
  font-weight: 400;
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
}

.portfolio-tab.active,
.portfolio-tab:hover {
  background: var(--primario);
  color: var(--blanco);
}

.portfolio-panels {
  min-height: 320px;
}

.portfolio-panel {
  display: none;
}

.portfolio-panel.active {
  display: block;
}

.portfolio-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.portfolio-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  aspect-ratio: 1 / 1;
}

.portfolio-link {
  display: block;
  width: 100%;
  height: 100%;
}

.portfolio-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

.portfolio-item::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 2;
}

.portfolio-item::after {
  content: attr(data-hover);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.95);
  font-size: 1rem;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  z-index: 3;
}

.portfolio-item:hover img {
  transform: scale(1.04);
}

.portfolio-item:hover::before,
.portfolio-item:hover::after {
  opacity: 1;
}

/* Lightbox / Modal */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 2000;
}

.lightbox-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-card {
  display: flex;
  flex-direction: row;
  width: auto;
  max-width: min(92vw, 1200px);
  max-height: 88vh;
  background: var(--blanco);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
  transform: scale(0.96);
  transition: transform 0.3s ease;
}

.lightbox-overlay.open .modal-card {
  transform: scale(1);
}

/* Columna del Slider (Izquierda en desktop) */
.modal-slider-wrapper {
  position: relative;
  background: #0d0d0f;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex: 1 1 auto;
  min-width: 0;
  max-height: 88vh;
}

.modal-slider {
  width: 100%;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-slide {
  display: none;
  width: 100%;
  height: 100%;
  align-items: center;
  justify-content: center;
}

.modal-slide.active {
  display: flex;
}

.modal-slide img {
  max-width: 100%;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

.slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--blanco);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: background 0.25s ease, transform 0.25s ease;
  z-index: 10;
}

.slider-btn:hover {
  background: rgba(0, 0, 0, 0.85);
  transform: translateY(-50%) scale(1.08);
}

.slider-prev {
  left: 12px;
}

.slider-next {
  right: 12px;
}

/* Columna Blanca de Informacion (Derecha en desktop) */
.modal-info-column {
  position: relative;
  background: var(--blanco);
  padding: 2.25rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 360px;
  flex-shrink: 0;
  max-height: 88vh;
  overflow-y: auto;
  color: var(--texto);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  font-size: 1.75rem;
  line-height: 1;
  color: #777777;
  cursor: pointer;
  padding: 0.25rem;
  transition: color 0.2s ease;
  z-index: 20;
}

.modal-close:hover {
  color: var(--texto);
}

.modal-brand-header {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-right: 2.5rem;
}

.modal-brand-logo {
  max-height: 52px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  display: block;
}

.modal-body-text {
  flex: 1;
  margin-bottom: 1.5rem;
}

.modal-title {
  margin: 0 0 0.85rem;
  font-size: 1.25rem;
  color: var(--primario);
  font-family: var(--font-titulos);
  font-weight: 700;
}

.modal-body-text p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #444444;
}

.modal-action-wrapper {
  margin-top: auto;
  padding-top: 1rem;
}

.btn-website-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.8rem 1.5rem;
  background: var(--primario);
  color: var(--blanco);
  font-family: var(--font-texto);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 10px;
  text-decoration: none;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
}

.btn-website-link:hover {
  background: var(--secundario);
  color: var(--blanco);
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.btn-website-link i {
  font-size: 0.85rem;
}

.modal-footer-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid #eeeeee;
  font-size: 0.85rem;
  color: #777777;
}

.modal-counter {
  font-weight: 600;
  color: #555555;
}

.meta-divider {
  color: #cccccc;
}

.modal-meta-link {
  color: #666666;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: color 0.2s ease;
}

.modal-meta-link:hover {
  color: var(--primario);
}


/* ============================================
   SECCION: TESTIMONIOS
   ============================================ */
.section-testimonials {
  background: var(--primario);
}

.section-testimonials .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-testimonials .section-subtitle {
  margin: 0 auto 0.4rem;
  color: var(--blanco);
  font-size: 1.05rem;
}

.section-testimonials .section-divider {
  display: block;
  width: 88px;
  height: 4px;
  margin: 0 auto 0.8rem;
  background: var(--acento);
  border-radius: 999px;
}

.section-testimonials h2 {
  color: var(--blanco);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.75rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.testimonial-card {
  background: var(--blanco);
  border-radius: 20px;
  padding: 2.5rem 1.75rem 2rem;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.09);
}

.testimonial-avatar {
  position: relative;
  width: 100px;
  height: 100px;
  margin-bottom: 1.25rem;
}

.testimonial-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--acento);
  display: block;
}

.quote-icon {
  position: absolute;
  left: -22px;
  top: 50%;
  transform: translateY(-50%);
  font-family: Georgia, serif;
  font-size: 3.2rem;
  line-height: 1;
  color: #dbe4f0;
  pointer-events: none;
  user-select: none;
}

.testimonial-name {
  margin: 0 0 0.25rem;
  color: var(--acento);
  font-family: var(--font-titulos);
  font-size: 1.25rem;
  font-weight: 800;
}

.testimonial-company {
  margin: 0 0 1.25rem;
  color: var(--primario);
  font-family: var(--font-titulos);
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.testimonial-quote {
  margin: 0;
  color: #555555;
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
}


/* ============================================
   SECCION: CONTACTO
   ============================================ */
.section-contact {
  background: var(--fondo-inverso);
  color: var(--texto);
}

.section-contact .section-header {
  text-align: center;
  margin-bottom: 3rem;
}

.section-contact .section-subtitle {
  margin: 0 auto 0.6rem;
  color: var(--secundario);
  font-size: 1rem;
}

.section-contact .section-divider {
  display: block;
  width: 88px;
  height: 4px;
  margin: 0 auto 1rem;
  background: var(--acento);
  border-radius: 999px;
}

.section-contact h2 {
  color: var(--primario);
  font-size: clamp(2.5rem, 4vw, 3.5rem);
}

.contact-container {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 3.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
  align-items: start;
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
}

.contact-brand img {
  max-width: 200px;
  height: auto;
  margin-bottom: 1.5rem;
  display: block;
}

.contact-copy {
  margin: 0 0 1.75rem;
  color: var(--texto);
  font-size: 1rem;
  line-height: 1.7;
}

.contact-informes-title {
  position: relative;
  font-family: var(--font-titulos);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--texto);
  margin: 0 0 1.25rem;
  padding-bottom: 0.5rem;
  width: 100%;
}

.contact-informes-title::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--acento);
  border-radius: 999px;
}

.contact-links {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  width: 100%;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--primario);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.25s ease;
}

.contact-links a i {
  font-size: 1.2rem;
  width: 24px;
  text-align: center;
  color: var(--acento);
}

.contact-links a:hover {
  color: var(--acento);
}

.contact-links a:hover i {
  color: var(--acento);
}

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

.contact-form .form-group {
  width: 100%;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: transparent;
  border: 1.5px solid var(--primario);
  border-radius: 12px;
  padding: 0.9rem 1.25rem;
  color: var(--texto);
  font-family: var(--font-texto);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: #777777;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--texto);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15);
}

.contact-form textarea {
  resize: vertical;
  min-height: 140px;
}

.contact-form .btn-submit {
  align-self: flex-start;
  font-family: var(--font-titulos);
  font-size: 16px;
  font-weight: 500;
  color: var(--blanco);
  border: 2px solid var(--secundario);
  cursor: pointer;
  background: var(--secundario);
  padding: 0.85rem 2.25rem;
}

.privacy-field {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 0.15rem;
}

.privacy-field input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--secundario);
  margin-top: 0.28rem;
  flex-shrink: 0;
}

.privacy-label {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  color: var(--texto);
  font-size: 0.96rem;
  line-height: 1.5;
  margin: 0;
}

.privacy-link {
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--primario);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.privacy-link:hover,
.privacy-link:focus-visible {
  color: var(--secundario);
  outline: none;
}

#contact-message {
  margin: 0;
  min-height: 1.5em;
  color: var(--primario);
  font-size: 0.95rem;
  font-weight: 600;
}

#contact-message.error {
  color: #b42318;
}

.privacy-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
  z-index: 2100;
}

.privacy-modal-overlay.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.privacy-modal {
  width: min(92vw, 760px);
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: var(--blanco);
  border-radius: 18px;
  box-shadow: 0 26px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

.privacy-modal-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.5rem 1rem;
  background: var(--blanco);
  border-bottom: 1px solid rgba(20, 40, 60, 0.12);
}

.privacy-modal-header h3 {
  margin: 0;
  font-family: var(--font-titulos);
  font-size: clamp(1.55rem, 3vw, 2rem);
  color: var(--primario);
}

.privacy-modal-close {
  border: none;
  background: transparent;
  color: #7a7a7a;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease;
}

.privacy-modal-close:hover,
.privacy-modal-close:focus-visible {
  color: var(--primario);
  outline: none;
}

.privacy-modal-body {
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1rem;
  max-height: calc(80vh - 120px);
}

.privacy-note {
  margin: 0 0 1rem;
  padding: 0.85rem 1rem;
  border-left: 4px solid var(--acento);
  background: rgba(19, 43, 63, 0.04);
  color: #2d3c4e;
  font-size: 0.96rem;
  line-height: 1.6;
}

.privacy-modal-body h4 {
  margin: 1.4rem 0 0.6rem;
  color: var(--primario);
  font-family: var(--font-titulos);
  font-size: 1.05rem;
}

.privacy-modal-body p {
  margin: 0;
  color: #444444;
  line-height: 1.7;
  font-size: 0.95rem;
}

.privacy-modal-footer {
  padding: 1rem 1.5rem 1.35rem;
  border-top: 1px solid rgba(20, 40, 60, 0.12);
  display: flex;
  justify-content: flex-end;
}


/* ============================================
   MEDIA QUERIES: TABLET
   ============================================ */
@media (min-width: 641px) {
  .sidebar-nav {
    margin-top: auto;
    margin-bottom: auto;
  }
}

@media (max-width: 940px) {

  .section-services .services-grid,
  .testimonials-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contact-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

@media (max-width: 768px) {

  /* Modal en tablet */
  .modal-card {
    flex-direction: column-reverse;
    width: 100%;
    max-height: 90vh;
  }

  .modal-info-column {
    width: 100%;
    max-height: none;
    flex-shrink: 1;
    padding: 1.5rem 1.25rem 1rem;
  }

  .modal-slider-wrapper {
    max-height: 50vh;
    min-height: 260px;
  }
}


/* ============================================
   MEDIA QUERIES: MOBILE (max-width: 640px)
   ============================================ */
@media (max-width: 640px) {

  /* Sidebar en mobile */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    padding-top: 7rem;
    z-index: 19;
    background: var(--primario);
  }

  .sidebar-brand {
    display: none;
  }

  .sidebar-nav {
    align-items: center;
    gap: 0.5rem;
  }

  .sidebar-nav a {
    display: inline-block;
    width: auto;
    padding: 1rem 1.5rem;
    color: var(--blanco) !important;
    background: transparent;
    border-radius: 0.75rem;
    text-align: center;
    position: relative;
  }

  .sidebar-nav a::after {
    content: '';
    position: absolute;
    left: 50%;
    bottom: 2px;
    width: 0;
    height: 3px;
    background: var(--acento);
    transition: all 0.3s ease;
    transform: translateX(-50%);
  }

  .sidebar-nav a:hover,
  .sidebar-nav a.active {
    color: var(--blanco);
    background: transparent;
  }

  .sidebar-nav a:hover::after,
  .sidebar-nav a.active::after {
    width: 100%;
  }

  .sidebar-footer {
    margin-top: auto;
  }

  .social-links a {
    color: var(--blanco) !important;
  }

  .sidebar-footer .copyright {
    color: var(--blanco) !important;
  }

  /* Mobile header */
  .mobile-header {
    display: flex;
  }

  .mobile-brand {
    order: 1;
  }

  .mobile-menu-toggle {
    order: 2;
  }

  /* Main content en mobile */
  .content {
    margin-left: 0 !important;
    padding: 0 !important;
    max-width: none;
    width: 100%;
  }

  /* Hero en mobile */
  .section-hero {
    background: url('../img/fondo-hero-mobile.png') center center / cover no-repeat;
    min-height: auto;
    height: auto;
    padding-top: 5rem;
  }

  .hero-content {
    padding: 2rem 1rem 0;
    text-align: center;
  }

  .hero-subtitle {
    margin: 0 auto 1.75rem;
  }

  .hero-actions {
    flex-direction: row;
    justify-content: center;
    gap: 1rem;
  }

  .btn {
    width: auto;
    margin: 0;
  }

  .hero-mobile-profile {
    display: block;
    max-width: 360px;
    margin: 2.5rem auto 0;
  }

  /* Nosotros en mobile */
  #nosotros {
    padding-left: 20px;
    padding-right: 20px;
  }

  .about-header {
    margin-bottom: 1.75rem;
  }

  .about-divider {
    margin-bottom: 0.95rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: stretch;
  }

  .about-copy {
    order: 1;
  }

  .about-image {
    order: 2;
  }

  .about-copy p {
    text-align: left;
  }

  .about-cards {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 2rem;
  }

  /* Servicios en mobile */
  .section-services {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .section-services .services-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
  }

  .section-services .section-description {
    margin-bottom: 2rem;
  }

  /* Portafolio en mobile */
  .portfolio-tabs {
    padding: 0 1rem;
  }

  .portfolio-gallery {
    grid-template-columns: 1fr;
  }

  .section-portfolio .section-buttons {
    grid-template-columns: 1fr;
    max-width: 100%;
  }

  .section-portfolio .section-button {
    min-width: 0;
    width: 100%;
  }

  /* Modal en mobile */
  .modal-card {
    display: flex;
    flex-direction: column-reverse;
    max-height: 88vh;
    overflow-y: auto;
    border-radius: 16px;
  }

  .modal-slider-wrapper {
    min-height: 280px;
    height: 280px;
    width: 100%;
  }

  .modal-info-column {
    padding: 1.5rem 1.25rem;
  }

  /* Testimonios en mobile */
  .section-testimonials,
  .section-contact {
    padding-left: 20px;
    padding-right: 20px;
  }

  /* Contacto en mobile: formulario primero, datos de empresa despues */
  .contact-container {
    display: flex;
    flex-direction: column;
  }

  .contact-form {
    order: 1;
  }

  .contact-info {
    order: 2;
  }
}
