/* Global Dark Background to prevent white flashes or gaps */
html,
body {
  background-color: #1a1a1a !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
}

/* ===== CONTACT COVER LAYOUT ===== */

.contact-cover-main {
  background-color: transparent;
  min-height: var(--scaled-vh, 100vh);
  width: 100%;
  overflow-x: hidden;
  margin: 0;
  padding: 0;
}

@media (min-width: 1025px) {
  .contact-cover-main {
    padding-top: 0;
    /* ELIMINADO: padding que causaba línea negra */
  }

  .header-productos-desktop {
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.9), transparent);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    height: 100px;
    display: flex;
    align-items: center;
    transition: transform 0.3s ease-in-out;
  }

  .header-productos-desktop.hidden {
    transform: translateY(-100%);
  }

  .header-container-productos-desktop {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
    padding: 0 10px;
  }

  .logo-link-productos {
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-left: -60px;
  }

  .logo-img-productos {
    height: 40px;
  }

  .logo-text-productos {
    font-size: 1.5rem;
    font-weight: 700;
    margin-left: 10px;
    color: #fff;
  }

  .nav-link-productos {
    color: #fff;
    text-decoration: none;
    margin: 0 15px;
    transition: color 0.3s;
  }

  .nav-link-productos:hover {
    color: #f9751c;
  }

  .simple-header {
    display: none;
  }
}

/* Simple Header Styling */
.simple-header {
  position: absolute;
  top: 0 !important;
  left: 0;
  width: 100%;
  z-index: 100;
  padding: 10px 60px;
}

.header-flex {
  display: flex;
  align-items: center;
}

/* Estilos para el botón de retroceso */
.back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(26, 26, 26, 0.6);
  color: white;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(26, 26, 26, 0.6);
}

.back-button:hover {
  background: rgba(26, 26, 26, 0.9);
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(26, 26, 26, 0.3);
  border-color: rgba(26, 26, 26, 0.9);
}

.back-button:hover .flecha-retorno {
  filter: brightness(0) saturate(100%) invert(52%) sepia(86%) saturate(1769%) hue-rotate(359deg) brightness(98%) contrast(92%);
  transform: rotate(0deg);
}

.back-button .flecha-retorno {
  height: 16px;
  vertical-align: middle;
}

.back-link {
  display: flex;
  align-items: center;
  gap: 15px;
  text-decoration: none;
  color: white;
  transition: transform 0.3s ease;
  /* Removed background/blur for pure integration as requested */
  padding: 10px 0;
}

.back-link:hover {
  transform: translateX(-5px);
}

.back-icon {
  font-size: 28px;
  line-height: 1;
  color: var(--naranja-industrial);
  font-weight: bold;
  text-shadow: 0 2px 4px rgba(26, 26, 26, 0.5);
  /* Visibility against image */
}

.simple-logo {
  height: 60px;
  /* Match Main Header Logo Size */
  width: auto;
  filter: drop-shadow(0 2px 4px rgba(26, 26, 26, 0.5));
  /* Visibility */
}

/* Adjust Hero for new header */
.contact-cover-hero {
  background:
    linear-gradient(rgba(26, 26, 26, 0.3), rgba(26, 26, 26, 0.3)),
    url("../Images/contacto/img-contacto.png");
  background-size: cover;
  background-position: center;
  min-height: var(--scaled-vh, 100vh) !important;
  height: var(--scaled-vh, 100vh) !important;
  width: 100%;
  position: relative;
  padding-top: 0 !important;
  margin-top: 0 !important;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  z-index: 1;
  pointer-events: none;
}

.hero-layout-flex {
  flex: 1;
  /* Disable Flex Space-Between to allow absolute positioning control */
  display: block;
  height: 100%;
  position: relative;
  z-index: 2;
  padding-top: 0;

  /* OVERRIDE CONTAINER CENTERING */
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Top Right Quote */
.hero-quote-container {
  /* Absolute Position for Stability */
  position: absolute;
  top: 140px;
  /* Fixed distance from top */
  right: 80px;
  /* Restore Original 1920px Inset */
  display: flex;
  justify-content: flex-end;
  padding-top: 0;
  margin: 0;
}

.hero-quote-box {
  background: rgba(26, 26, 26, 0.65);
  /* More transparent for glass effect */
  backdrop-filter: blur(15px);
  /* Stronger blur */
  -webkit-backdrop-filter: blur(15px);
  padding: 48px 30px;
  border-radius: 20px;
  max-width: 400px;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
  /* Softer, deeper shadow */
  border: 1px solid rgba(255, 255, 255, 0.1);
  /* Subtle glass border */
  animation: fadeInRight 0.8s ease-out;
  position: relative;
}

/* Borde en L (superior y derecho) ornamentado - Ajustado al largo total del recuadro */
.hero-quote-box::before {
  content: none;
}

.hero-quote-box p {
  color: #fff;
  font-size: 22px;
  font-style: normal;
  line-height: 1.5;
  margin: 0;
  font-weight: 500;
}

.quote-line {
  display: none;
}

/* Bottom Navigation */
.contact-bottom-nav {
  /* Absolute Position for Stability */
  position: absolute;
  bottom: 40px;
  /* Fixed distance from bottom */
  left: 60px;
  /* Restore Original 1920px Inset */
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: flex-start;
  padding-left: 0;
  margin: 0;
}

.contact-nav-item {
  background: rgba(26, 26, 26, 0.85);
  color: #fff;
  text-decoration: none;
  padding: 12px 25px;
  border-radius: 8px;
  border-left: 3px solid transparent;
  transition: all 0.3s ease;
  min-width: 160px;
  text-align: center;
  backdrop-filter: blur(4px);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-nav-item:hover {
  background: rgba(26, 26, 26, 0.95);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(26, 26, 26, 0.3);
}

.contact-nav-item.area-interest-toggle {
  position: relative;
}

/* Botones de área de interés */
.area-interest-buttons {
  position: absolute;
  bottom: 120%;
  left: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.area-interest-buttons.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
}

.area-interest-buttons:not(.hidden) {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.area-btn {
  background: rgba(26, 26, 26, 0.85);
  color: white;
  border: none;
  padding: 12px 25px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 160px;
  text-align: center;
}

.area-btn:hover {
  background: rgba(26, 26, 26, 0.95);
  transform: translateY(-3px);
  box-shadow: 0 5px 15px rgba(26, 26, 26, 0.3);
}

/* Override Premium Effects white backgrounds for this page */
.toast,
.accordion-item,
.accordion-header {
  background-color: #2a2a2a !important;
  color: #fff !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
}

.accordion-header:hover {
  background-color: #333 !important;
}

/* Ensure no white space from nav-panel */
.nav-panel-content {
  background: rgba(26, 26, 26, 0.98) !important;
}

/* Media queries móviles eliminados para evitar conflictos con universal-responsive.css */

@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ===== MODAL PARA FORMULARIOS ===== */
.form-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: none;
  align-items: center;
  justify-content: center;
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
}

.modal-content {
  position: relative;
  width: 90%;
  max-width: 800px;
  height: 90vh;
  background: #1a1a1a;
  border-radius: 20px;
  overflow: hidden;
  z-index: 10001;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
  animation: modalSlideUp 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes modalSlideUp {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.close-modal {
  position: absolute;
  top: 15px;
  right: 20px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: white;
  font-size: 32px;
  cursor: pointer;
  z-index: 10002;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.close-modal:hover {
  background: var(--naranja-industrial, #f9751c);
  transform: rotate(90deg);
}

.iframe-container {
  width: 100%;
  height: 100%;
  padding-top: 60px;
  /* Espacio para el botón de cierre */
}

.iframe-container iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  /* El formulario suele ser blanco, evitamos saltos de color */
}

@media (max-width: 1024px) {

  /* FORCE SIMPLE HEADER ON TABLET FOR CONTACT PAGE */
  body.contact-page .header-productos-desktop {
    display: none !important;
  }

  body.contact-page .simple-header {
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    z-index: 100 !important;
    padding: 10px 30px !important;
    /* Match index spacing (approx) */
  }

  /* Adjust logo size for tablet to match Index */
  body.contact-page .mobile-logo-img {
    height: 45px !important;
    /* Index size */
    width: auto !important;
  }

  body.contact-page .mobile-logo-link {
    text-decoration: none !important;
    color: white !important;
  }

  body.contact-page .mobile-logo-section {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
  }

  body.contact-page .mobile-logo-text {
    font-family: "Neo Sans", "Arial", sans-serif !important;
    font-weight: 500 !important;
    font-size: 1.1rem !important;
    color: #fff !important;
    margin-left: -5px !important;
    line-height: 1 !important;
    position: relative !important;
    top: 0 !important;
    text-transform: uppercase !important;
  }

  /* Tablet Layout - Flex Column instead of Absolute */
  body.contact-page .hero-layout-flex {
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    padding: 100px 40px !important;
    gap: 60px !important;
  }

  body.contact-page .hero-quote-container {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    order: 1 !important;
  }

  body.contact-page .hero-quote-box {
    max-width: 100% !important;
    margin: 0 !important;
    text-align: center !important;
  }

  body.contact-page .contact-bottom-nav {
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    width: 100% !important;
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 15px !important;
    order: 2 !important;
    justify-items: center !important;
  }

  body.contact-page .contact-nav-item {
    width: 100% !important;
    max-width: 320px !important;
  }
}

@media (max-width: 768px) {
  .modal-content {
    width: 100%;
    height: 100%;
    border-radius: 0;
  }

  .iframe-container {
    padding-top: 50px;
  }

  /* DISEÑO FULLSCREEN - MÓVILES - Actualizado para flujo correcto */
  html body .contact-cover-main,
  html body main.contact-cover-main {
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    min-height: 100vh !important;
    height: auto !important;
  }

  html body .contact-cover-hero {
    position: relative !important;
    height: auto !important;
    min-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none !important;
  }

  html body .hero-overlay {
    display: none !important;
  }

  /* Reseteo crítico del posicionamiento para móvil */
  html body .hero-quote-container {
    position: relative !important;
    position: static !important;
    top: auto !important;
    right: auto !important;
  }

  html body .contact-bottom-nav {
    position: relative !important;
    position: static !important;
    bottom: auto !important;
    left: auto !important;
  }
}

/* APPLY CORRECT SCALING TO FORM MODAL CONTENT */
@media (min-width: 1024px) {
  .form-modal .modal-content {
    zoom: var(--desktop-scale, 1) !important;
    transform: none !important;

    @supports not (zoom: 1) {
      transform: scale(var(--desktop-scale, 1)) !important;
      transform-origin: center center !important;
    }

    backface-visibility: hidden !important;
    will-change: transform;
  }
}