/* ================================================
   PRINT STYLES - Páginas Legales ProSilicones64
   Optimizado para impresión en folios verticales
================================================ */

@media print {
  /* ============================================
     OCULTAR ELEMENTOS NO NECESARIOS
  ============================================ */

  /* Ocultar header completo */
  header,
  .hea-header,
  .hea-mobile,
  .language-selector,
  .lang-dropdown,
  .lang-overlay,
  .lang-mobile-panel {
    display: none !important;
  }

  /* Ocultar footer completo */
  footer,
  .footer,
  .pie-pagina {
    display: none !important;
  }

  /* Ocultar navegación y elementos interactivos */
  nav,
  .hea-nav,
  button,
  .btn-contacto,
  .cookie-banner,
  #cookie-settings-footer {
    display: none !important;
  }

  /* Ocultar buscadores */
  .buscador,
  .hea-busca,
  form[action*="buscar"] {
    display: none !important;
  }

  /* Ocultar CTAs y botones de acción */
  .cta-final,
  .bloque-cta,
  .cta-fija,
  a.btn,
  button.btn,
  .btn-principal,
  a[class*="btn-"] {
    display: none !important;
  }

  /* ============================================
     CONFIGURACIÓN GENERAL DE PÁGINA
  ============================================ */

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
  }

  @page {
    size: A4 portrait;
    margin: 2cm 1.5cm;
  }

  body {
    margin: 0;
    padding: 0;
    background: white !important;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
  }

  /* ============================================
     HERO - MANTENER COLORES Y ESTILO
  ============================================ */

  .ubicacion-hero {
    background: linear-gradient(135deg, #002244 0%, #003d66 100%) !important;
    background-color: #002244 !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    color-adjust: exact !important;
    page-break-after: avoid;
    page-break-inside: avoid;
    padding: 3rem 2rem !important;
    margin: 0 0 0 0 !important;
    border-radius: 0 !important;
  }

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

  .ubicacion-hero-content {
    text-align: center;
    color: white !important;
  }

  .ubicacion-hero-content img {
    max-width: 200px !important;
    height: auto;
    margin: 0 auto 1.5rem !important;
    display: block;
  }

  .ubicacion-hero-content h1 {
    color: white !important;
    font-size: 24pt !important;
    margin: 0 0 1rem 0 !important;
    font-weight: 700;
  }

  .ubicacion-hero-subtitle {
    color: rgba(255, 255, 255, 0.95) !important;
    font-size: 12pt !important;
    margin: 0 !important;
  }

  /* ============================================
     CONTENIDO PRINCIPAL
  ============================================ */

  .ubicacion-page,
  article {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
  }

  .p25-section,
  section {
    page-break-inside: avoid;
    margin: 0 !important;
    padding: 1.5rem 0 !important;
    border-radius: 0 !important;
  }

  .p25-section-white {
    background: white !important;
  }

  .p25-section-gray {
    background: #f8f9fa !important;
  }

  .p25-container {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* ============================================
     TIPOGRAFÍA
  ============================================ */

  h1, h2, h3, h4, h5, h6 {
    page-break-after: avoid;
    page-break-inside: avoid;
    color: #0f3a5c !important;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
  }

  h2 {
    font-size: 18pt !important;
    font-weight: 700;
    border-bottom: 2px solid #1a5490;
    padding-bottom: 0.5rem;
  }

  h3 {
    font-size: 14pt !important;
    font-weight: 600;
    color: #333 !important;
  }

  p {
    margin: 0.5rem 0 !important;
    font-size: 11pt;
    line-height: 1.6;
    orphans: 3;
    widows: 3;
  }

  strong {
    font-weight: 600;
    color: #000 !important;
  }

  /* ============================================
     LISTAS
  ============================================ */

  ul, ol {
    margin: 0.75rem 0 !important;
    padding-left: 1.5rem !important;
    page-break-inside: avoid;
  }

  li {
    margin: 0.4rem 0 !important;
    font-size: 11pt;
    line-height: 1.5;
  }

  /* ============================================
     TABLAS - COOKIES POLICY
  ============================================ */

  .cookie-policy-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 10pt;
    page-break-inside: avoid;
  }

  .cookie-policy-table thead {
    background: #1a5490 !important;
    color: white !important;
  }

  .cookie-policy-table th {
    padding: 0.5rem;
    text-align: left;
    font-weight: 600;
    border: 1px solid #ddd;
    color: white !important;
  }

  .cookie-policy-table td {
    padding: 0.5rem;
    border: 1px solid #ddd;
    vertical-align: top;
  }

  .cookie-policy-table tbody tr:nth-child(even) {
    background: #f8f9fa !important;
  }

  table code {
    background: #e9ecef !important;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 9pt;
  }

  /* ============================================
     ENLACES
  ============================================ */

  a {
    color: #1a5490 !important;
    text-decoration: underline;
  }

  a[href]:after {
    content: "";
  }

  /* Mostrar URLs importantes en pie de página */
  a[href^="http"]:not([href*="prosilicones64"]):after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    color: #666 !important;
  }

  /* ============================================
     CAJAS ESPECIALES
  ============================================ */

  /* Caja de configuración de cookies */
  div[style*="border-left: 4px solid"] {
    background: #f0f8ff !important;
    border-left: 4px solid #1a5490 !important;
    padding: 1rem !important;
    margin: 1rem 0 !important;
    page-break-inside: avoid;
  }

  /* ============================================
     CONTROL DE SALTOS DE PÁGINA
  ============================================ */

  /* Evitar que los títulos queden solos al final de página */
  h1, h2, h3 {
    page-break-after: avoid;
  }

  /* Evitar saltos dentro de elementos */
  .p25-section,
  table,
  ul,
  ol,
  blockquote {
    page-break-inside: avoid;
  }

  /* Asegurar que los párrafos no se partan mal */
  p {
    orphans: 3;
    widows: 3;
  }

  /* ============================================
     INFORMACIÓN LEGAL AL PIE
  ============================================ */

  /* Mantener la información de última actualización */
  p[style*="border-top"] {
    border-top: 1px solid #ddd !important;
    padding-top: 1rem !important;
    margin-top: 2rem !important;
    font-size: 9pt !important;
    color: #666 !important;
    page-break-before: avoid;
  }

  /* ============================================
     IMÁGENES (LOGOS)
  ============================================ */

  img {
    max-width: 100%;
    height: auto;
    page-break-inside: avoid;
  }

  /* ============================================
     ELIMINAR ELEMENTOS DE INTERACCIÓN
  ============================================ */

  /* Ocultar iconos de Bootstrap */
  .bi::before,
  i.bi {
    display: none !important;
  }

  /* Ocultar overlays y modales */
  .overlay,
  .modal,
  .popup {
    display: none !important;
  }

  /* ============================================
     AJUSTES ESPECÍFICOS
  ============================================ */

  /* Ajustar márgenes del contenido principal */
  .contenedor,
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* Eliminar sombras y efectos visuales innecesarios */
  * {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ============================================
     COMPATIBILIDAD CROSS-BROWSER
  ============================================ */

  /* Firefox */
  @-moz-document url-prefix() {
    * {
      -moz-print-color-adjust: exact !important;
    }
  }

  /* Chrome/Edge */
  @media print and (-webkit-min-device-pixel-ratio: 0) {
    * {
      -webkit-print-color-adjust: exact !important;
    }
  }
}
