/* 
 * Estilos específicos para el servicio Unir PDF
 * Parte de la arquitectura Clean + Vertical Slice
 */

/* === VARIABLES Y CONFIGURACIÓN GLOBAL === */
:root {
  --unir-primary: rgb(0, 112, 192);
  --unir-secondary: #2ecc71;
  --unir-success: #27ae60;
  --unir-warning: #f39c12;
  --unir-danger: #e74c3c;
  --unir-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* === LAYOUT BASE === */
html, body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

.pdf-service-section {
  width: 100vw;
  margin: 0;
  padding: 0;
  background-color: white;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* === ANIMACIONES === */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* === ESTADOS DE PANTALLA === */
.pantalla-activa {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

.pantalla-oculta {
  display: none;
}

/* === ZONA DE PDFs === */
.zona-pdfs {
  position: relative;
  width: 100%;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: #fafafa;
  scrollbar-color: #0070C0 #f0f8ff;
  scrollbar-width: thin;
}

.zona-pdfs::-webkit-scrollbar {
  width: 8px;
}

.zona-pdfs::-webkit-scrollbar-track {
  background: #f0f8ff;
  border-radius: 10px;
}

.zona-pdfs::-webkit-scrollbar-thumb {
  background: #0070C0;
  border-radius: 10px;
  border: 2px solid #f0f8ff;
}

.zona-pdfs::-webkit-scrollbar-thumb:hover {
  background: #005a9e;
}

/* === GRID Y CONTENEDOR DE ARCHIVOS === */
.files-container {
  max-height: 800px;
  overflow-y: auto;
  padding: 20px;
  background: transparent;
  margin-top: -15px;
  height: 100%;
  box-sizing: border-box;
  position: relative;
}

.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 15px;
  padding: 15px;
  position: relative;
}

/* === TARJETAS PDF === */
.pdf-card {
  width: 198px;
  height: 244px;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
  border: 1px solid #e0e0e0;
  transition: all 0.2s ease;
  user-select: none;
  cursor: grab;
}

/* === ESTILOS PARA SORTABLEJS === */
.sortable-chosen {
  opacity: 0.8;
  transform: scale(1.02);
}

.sortable-ghost {
  opacity: 0.4;
  background: #f0f0f0;
  border: 2px dashed #0070C0;
}

.sortable-drag {
  opacity: 0.7;
  transform: scale(1.05) rotate(2deg);
  z-index: 1000;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  cursor: grabbing;
}

.pdf-card.dragging {
  opacity: 0.7;
  transform: scale(1.05) rotate(2deg);
  z-index: 1000;
  box-shadow: 0 8px 16px rgba(0,0,0,0.2);
  cursor: grabbing;
}

.pdf-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.pdf-card canvas {
  width: 100%;
  height: 190px;
  object-fit: contain;
  display: block;
  background: #f9f9f9;
  transition: transform 0.3s ease;
}

.pdf-card .nombre-pdf {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  padding: 8px;
  font-size: 11px;
  color: #333;
  text-align: center;
  word-break: break-word;
  line-height: 1.2;
  border-top: 1px solid #e0e0e0;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* === BOTONES DE ACCIÓN === */
.pdf-action {
  position: absolute;
  top: 8px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  pointer-events: auto;
}

.pdf-action.rotate {
  right: 44px;
  background: var(--unir-primary);
}

.pdf-action.delete {
  right: 8px;
  background: var(--unir-danger);
}

.pdf-action:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

/* === BOTÓN AGREGAR MÁS === */
#btnAgregarMas {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--unir-danger);
  border: none;
  color: white;
  font-size: 24px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 15px;
  right: 15px;
  box-shadow: 0 2px 6px rgba(231, 76, 60, 0.3);
  transition: all 0.2s ease;
  z-index: 10;
}

#btnAgregarMas:hover {
  transform: scale(1.1);
  box-shadow: 0 4px 8px rgba(231, 76, 60, 0.4);
}

#btnAgregarMas:active {
  transform: scale(0.95);
}

#btnAgregarMas::before {
  content: '+';
  line-height: 1;
}

/* === PANEL DE SERVICIO === */
.PANEL_SERVICIO {
  background: white;
  border-radius: 12px;
  box-shadow: var(--unir-shadow);
  padding: 0 15px 25px 15px;
  height: fit-content;
  position: sticky;
  top: 0;
  width: 100%;
  margin-top: 0;
  box-sizing: border-box;
  overflow: visible;
  min-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-panel-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 0;
  padding-top: 0;
}

.service-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--unir-primary);
  margin: 0;
}

.service-message {
  background: #f8fafc;
  padding: 15px;
  border-radius: 8px;
}

.service-stats {
  display: flex;
  flex-direction: row;
  gap: 30px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 8px;
  flex-wrap: wrap;
  font-size: 0.975rem;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: none;
}

.stat-label {
  font-weight: 500;
  color: #7f8c8d;
  white-space: nowrap;
}

.stat-value {
  font-weight: 700;
  color: var(--unir-primary);
  margin-left: 2px;
}

/* === CONTADOR DE PDFs === */
#total-files {
  position: absolute;
  top: -5px;
  right: -5px;
  background: #e74c3c;
  color: white;
  min-width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  padding: 0 6px;
  z-index: 10;
}

.service-actions {
  margin-top: 10px;
}

.service-button {
  width: 100%;
  background: linear-gradient(45deg, var(--unir-primary), var(--unir-secondary));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: var(--unir-shadow);
}

.service-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

.service-button:disabled {
  background: #bdc3c7;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* === ESTADOS DE CARGA === */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid var(--unir-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* === PANTALLA 3 - ACCIONES === */
.pantalla3-actions {
  display: flex;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  flex-wrap: wrap;
}

.boton-secundario {
  background: linear-gradient(45deg, #95a5a6, #7f8c8d) !important;
  color: white !important;
}

.boton-secundario:hover {
  background: linear-gradient(45deg, #7f8c8d, #6c7b7d) !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
}

/* Botón circular pequeño para volver a empezar */
#btnVolverEmpezar {
  width: 50px !important;
  height: 50px !important;
  border-radius: 50% !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 20px !important;
  min-width: 50px !important;
  background: #0070C0 !important;
}

#btnVolverEmpezar .button-icon {
  margin: 0 !important;
  font-size: 20px !important;
}

#btnVolverEmpezar img {
  filter: brightness(0) invert(1) !important;
}

.button-icon {
  font-size: 1.2em;
  margin-right: 8px;
}

.button-text {
  font-weight: 600;
}

/* === PANTALLA LOADER === */
#pantalla-loader {
  background: #f8f9fa;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  margin: 0;
  padding: 20px;
  box-sizing: border-box;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);

}

#pantalla-loader.pantalla-activa {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.loader-content {
  text-align: center;
  max-width: 500px;
  width: 90%;
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.23, 1, 0.32, 1);
  margin-top: -250px;
}

#pantalla-loader.pantalla-activa .loader-content {
  transform: translateY(0);
}

.loader-content h2 {
  color: #156AAD;
  font-size: 3.5rem;
  margin-bottom: 40px;
  font-weight: 600;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.2s forwards;
}

.progress-container {
  width: 100%;
  height: 64px;
  background: #ffffff;
  border-radius: 40px;
  overflow: hidden;
  border: 1px solid #d0d0d0;
  position: relative;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
  opacity: 0;
  animation: fadeInUp 0.6s ease 0.4s forwards;
}

.progress-bar {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #156AAD, #1C8ED9);
  transition: width 0.8s cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: left;
  border-radius: inherit;
  position: relative;
}

.progress-fill::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
  transform: translateX(-100%);
  transition: transform 0.8s ease;
}

.progress-fill.animating::before {
  transform: translateX(100%);
}

.progress-message {
  text-align: center;
  font-size: 18px;
  color: #666;
  font-weight: 500;
  min-height: 25px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
  animation: fadeInUp 0.6s ease 0.6s forwards;
}

/* Animaciones de entrada */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Responsive para móviles */
@media (max-width: 768px) {
  .loader-content h2 {
    font-size: 2rem;
    margin-bottom: 30px;
  }
  
  .progress-container {
    height: 56px;
    margin-bottom: 25px;
  }
  
  .progress-message {
    font-size: 16px;
  }
}

/* === MEDIA QUERIES === */
@media (max-width: 768px) {
  #pantalla-2 {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 10px;
  }

  .zona-pdfs {
    padding: 10px;
  }

  .PANEL_SERVICIO {
    position: relative;
    order: -1;
    min-height: auto;
    padding: 15px;
  }

  .files-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .pantalla3-actions {
    flex-direction: column;
    gap: 15px;
  }

  .pantalla3-actions .boton-servicio {
    width: 100%;
    max-width: 300px;
  }
}

@media (max-width: 480px) {
  .service-stats {
    flex-direction: column;
    gap: 8px;
  }
  
  .stat-item {
    justify-content: space-between;
    width: 100%;
  }
}

/* === REGLAS DE PANTALLA ORIGINALES (MANTENER HASTA VERIFICAR) === */
/* Pantallas del workflow */
.pantalla-activa {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

.pantalla-oculta {
  display: none;
}

/* Pantalla 1 - Inicio */
#pantalla-1 {
  width: 100vw;
  margin: 0;
  padding: 20px;
  padding-top: 0;
  box-sizing: border-box;
}

/* Pantalla 2 - Área de trabajo */
#pantalla-2 {
  display: grid;
  grid-template-columns: 70% 30%; 
  gap: 5px;
  min-height: 600px;
  background-color: white;
  width: 100vw;
  margin: 0;
  padding: 10px;
  padding-top: 0;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* Pantalla 3 - Resultado */
#pantalla-3 {
  justify-content: start;
  align-items: center;
  text-align: center;
  padding: 60px 20px;
  padding-top: 0;
}

#pantalla-3 h2 { /*debe ser color azul*/
  color: var(--unir-primary);
  font-size: 3.5rem;
  margin-bottom: 15px;
  margin-top: 30px;
}

#descargarLink {
  font-size: 18px;
}

/* Área de drop */
.drop-area {
  border: none;
  border-radius: 12px;
  padding: 20px 20px;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  margin: 10px 0;
}

/* Hover del área de drag eliminado según solicitud */

.drop-area.drag-over {
  border-color: var(--unir-success);
  background: #d4edda;
  transform: scale(1.02);
}

.boton-servicio {
  background: linear-gradient(45deg, var(--unir-primary), var(--unir-secondary));
  color: white;
  padding: 20px 40px;
  border: none;
  border-radius: 8px;
  font-size: 24px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  box-shadow: var(--unir-shadow);
}

/* Hover eliminado según solicitud */

/* Eliminar padding y margin en pantalla 2 */
#pantalla-2 .pdf-service-section {
  padding: 0;
  margin: 0;
  max-width: none;
}

/* === OVERLAY DE ARRASTRE (COPIADO DESDE BACKUP) === */
.drop-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  visibility: hidden;
}

.drop-overlay.active {
  opacity: 1;
  visibility: visible;
  /* Mantener pointer-events: none para no interferir con drag */
  pointer-events: none;
}

.drop-overlay-content {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  border: 3px dashed #0070C0;
}

.drop-overlay-content .icon {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
}

.drop-overlay-content .message {
  font-size: 24px;
  font-weight: bold;
  color: #0070C0;
  margin: 0;
}

.drop-overlay-content .submessage {
  font-size: 16px;
  color: #666;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 768px) {
  #pantalla-2 {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .files-header {
    flex-direction: column;
    gap: 0.9375rem; /* 15px en rem */
    align-items: flex-start;
  }
  
  .files-grid {
    gap: 0.75rem; /* 12px en rem */
    max-width: none;
  }
  
  .files-grid .pdf-card {
    flex-basis: 8.75rem; /* 140px en rem */
    width: 8.75rem;
    max-width: 8.75rem;
  }
  
  .service-panel-content {
    padding: 1rem; /* 16px en rem */
  }
  
  .service-title {
    font-size: 1.125rem; /* 18px en rem */
  }
  
  .service-stats {
    padding: 1rem; /* 16px en rem */
    margin-bottom: 1.25rem; /* 20px en rem */
  }
  
  .stat-item {
    padding: 0.375rem 0; /* 6px en rem */
  }
  
  .stat-label {
    font-size: 0.75rem; /* 12px en rem */
  }
  
  .stat-value {
    font-size: 0.8125rem; /* 13px en rem */
    padding: 0.1875rem 0.375rem; /* 3px 6px en rem */
  }
  
  .service-button {
    padding: 0.75rem 1rem; /* 12px 16px en rem */
    font-size: 0.875rem; /* 14px en rem */
    min-height: 3rem; /* 48px en rem */
  }
  
  .drop-area {
    padding: 1.875rem 1.25rem; /* 30px 20px en rem */
    min-height: 15.625rem; /* 250px en rem */
  }
  
  .drop-overlay-content {
    padding: 1.875rem 1.25rem; /* 30px 20px en rem */
    margin: 0 1.25rem; /* 20px en rem */
  }
  
  .drop-overlay-content .message {
    font-size: 1.25rem; /* 20px en rem */
  }
}

/* === PANTALLA 2 - LAYOUT PRINCIPAL === */
#pantalla-2 {
  display: grid;
  flex-direction: row;
  height: 100%;
}

/* === ZONA DE PDFs (IZQUIERDA) - SCROLL EXCLUSIVO === */


/* === CONTENEDOR DE ARCHIVOS === */
.files-container {
  height: 100%;
  overflow: visible; /* El scroll lo maneja zona-pdfs */
}

/* === GRID DE ARCHIVOS === */
.files-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr));
  gap: 1rem;
  padding: 1rem 0;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  #pantalla-2 {
    flex-direction: column;
    height: auto;
    max-height: none;
  }

  .zona-pdfs {
    width: 100%;
    max-height: 60vh;
    position: relative;
  }

}

/* === AJUSTES PARA EVITAR SCROLL VERTICAL DE TODA LA PÁGINA === */
.pdf-service-section {
  padding: 0;
  height: calc(100vh - 90px); /* Altura del viewport menos el header */
  max-height: calc(100vh - 90px);
  overflow: hidden; /* Evitar scroll vertical */
  display: flex;
  flex-direction: column;
}

.service-panel-content {
  padding-top: 0;
}

/* === OCULTAR FOOTER CUANDO PANTALLA 2 O 3 ESTÁN ACTIVAS === */
#pantalla-2.pantalla-activa ~ footer,
#pantalla-3.pantalla-activa ~ footer,
body:has(#pantalla-2.pantalla-activa) footer,
body:has(#pantalla-3.pantalla-activa) footer {
  display: none !important;
}

/* === AJUSTE DE ALTURA COMPLETA PARA PANTALLA 2 === */
#pantalla-2.pantalla-activa {
  display: flex;
  height: 100%;
  max-height: 100%;
}

#pantalla-2.pantalla-activa .PANEL_SERVICIO {
  top: 90px; /* Ajustar según altura real del header */
  height: calc(100vh - 90px);
}

/* === PANTALLAS DEL SERVICIO === */
#pantalla-1,
#pantalla-3 {
  flex: 1;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
}

/* === ZONA DE PDFs (IZQUIERDA) - SCROLL EXCLUSIVO === */
.zona-pdfs {
  width: 100%;
  height: 92%;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem;
  background: #fafafa;
  scrollbar-color: #0070C0 #f0f8ff;
  scrollbar-width: thin;
  margin-top: -10px; 
}

/* === PANEL DE SERVICIO (DERECHA) - COMPLETAMENTE FIJO === */


/* === RESPONSIVE === */
@media (max-width: 768px) {
  .pdf-service-section {
    height: auto;
    max-height: none;
  }

  #pantalla-2.pantalla-activa {
    flex-direction: column;
    height: auto;
  }

  .zona-pdfs {
    width: 100%;
    max-height: 60vh;
  }

  .PANEL_SERVICIO {
    position: static;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 2px solid #0070C0;
    margin-top: 1rem;
  }
}

/* === AJUSTES DEL CONTENEDOR PRINCIPAL === */
.main-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Cuando el footer está oculto (pantallas 2 y 3) */
.main-container:has(#pantalla-2.pantalla-activa),
.main-container:has(#pantalla-3.pantalla-activa) {
  height: 100vh;
  overflow: hidden;
}

/* === CONTENEDOR DEL SERVICIO === */
.pdf-service-section {
  padding: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Cuando está en pantalla 2 o 3 */
#pantalla-2.pantalla-activa ~ footer,
#pantalla-3.pantalla-activa ~ footer {
  display: none;
}

#pantalla-2.pantalla-activa .pdf-service-section,
#pantalla-3.pantalla-activa .pdf-service-section {
  height: calc(100vh - 90px);
  overflow: hidden;
}

/* === PANTALLAS DEL SERVICIO === */
#pantalla-1,
#pantalla-3 {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* === AJUSTES ESPECÍFICOS PANTALLA 2 === */
#pantalla-2.pantalla-activa {
  display: flex;
  height: 100%;
}




/* === RESPONSIVE === */
@media (max-width: 768px) {
  .main-container:has(#pantalla-2.pantalla-activa),
  .main-container:has(#pantalla-3.pantalla-activa) {
    height: auto;
    overflow: visible;
  }

  .pdf-service-section {
    height: auto;
  }

  #pantalla-2.pantalla-activa {
    flex-direction: column;
    height: auto;
  }

  .zona-pdfs {
    width: 100%;
    max-height: 60vh;
  }

  .PANEL_SERVICIO {
    position: static;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 2px solid #0070C0;
    margin-top: 1rem;
  }
}

/* === AJUSTES GLOBALES === */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

/* === CONTENEDOR PRINCIPAL === */
.main-container {
  height: 100vh;
  max-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* === SECCIÓN DE SERVICIO PDF === */
.pdf-service-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* === PANTALLAS === */
.pantalla-activa {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
}

.pantalla-oculta {
  display: none !important;
}

/* === PANTALLA 1 === */
#pantalla-1 {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  height: 100%;
  padding: 2rem;
}

/* === PANTALLA 3 === */
#pantalla-3 {
  justify-content: start;
  align-items: center;
  text-align: center;
}

/* === FOOTER CONTROL === */
footer {
  display: block;
}

#pantalla-2.pantalla-activa ~ footer,
#pantalla-3.pantalla-activa ~ footer {
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .main-container {
    height: 100%;
    overflow-y: auto;
  }

  #pantalla-2 {
    flex-direction: column;
  }

  .zona-pdfs {
    width: 100%;
    max-height: 60vh;
  }

  .PANEL_SERVICIO {
    position: static;
    width: 100%;
    height: auto;
    border-left: none;
    border-top: 2px solid #0070C0;
    margin-top: 1rem;
  }
}

/* === Ajuste del título y descripción */
#pantalla-1 h1 {
  margin: 0;
  padding-top: 2rem;
}

#pantalla-1 p {
  margin: 1rem 0 0.5rem 0;
  color: #666;
}