/* --- RESET Y VARIABLES --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

:root {
    /* Visor */
    --azul-fca: #1a3052;
    --blanco: #ffffff;
    --dorado-unam: #d4af37;
    --bg-visor: #1e1e1e;
    --bg-toolbar: rgba(26, 48, 82, 0.95);

    /* Encabezado / pie */
    --primary: #1a1a1a;
    --accent: #c5a059;
    --nav-dark: #021024;
    --fca-dorado: #c5a059;
    --fb-color: #1877F2;
    --x-color: #000000;
    --ig-gradient: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);

    /* Menú */
    --fca-azul: #002B54;
    --fca-azul-brillante: #007bff;
    --fca-oro: #D4AF37;
    --fca-oro-brillante: #F1C40F;
    --fca-glass-dark: rgba(4, 14, 27, 0.94);
    --fca-border: rgba(212, 175, 55, 0.2);
    --fca-border-light: rgba(255, 255, 255, 0.08);
    --fca-transition: cubic-bezier(0.16, 1, 0.3, 1);

    /* Proporción de página (la sobrescribe index.php con la medida real) */
    --pagina-ancho: 5;
    --pagina-alto: 7;
}

body {
    font-family: 'Manrope', sans-serif;
    overflow: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--bg-visor);
}

/* --- CONTENEDOR DEL VISOR --- */
.viewer-main {
    background-image: url('../img/yac_final.jpg'); /* se cambia en editar_nueva_revista.php */
    background-size: cover;
    background-position: center;
    flex: 1;
    display: flex;
    justify-content: center;
    /* Alinea el contenido arriba para que la revista quede pegada al header */
    align-items: flex-start; 
    position: relative;
    padding: 0; /* Quitamos el padding para eliminar la separación superior e inferior */
    overflow: hidden;
}

/* Contenedor del libro (tamaño visual adaptativo) */
.book-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;           /* Ocupa todo el alto entre header y footer */
    max-height: 100%;
    width: auto;
    max-width: 100%;        
    min-width: 0;
    min-height: 0;          
    aspect-ratio: calc(var(--pagina-ancho) * 2) / var(--pagina-alto); /* Vista doble (se ajusta sola) */
    overflow: visible;
}

/* Estilos de las páginas insertadas */
.page {
    background-color: white;
    box-shadow: inset 0 0 15px rgba(0,0,0,0.1);
    overflow: hidden;
}

.page img {
    width: 100%;
    height: 100%;
    object-fit: fill;
    pointer-events: none;
    user-select: none;
}

/* Sombra profunda para la zona central del libro (lomo) */
.page.--left { 
    border-right: 1px solid rgba(0,0,0,0.1); 
    box-shadow: inset -10px 0 20px rgba(0,0,0,0.1); 
    margin-bottom: 20%; 
}
.page.--right { 
    border-left: 1px solid rgba(0,0,0,0.1); 
    box-shadow: inset 10px 0 20px rgba(0,0,0,0.1); 
    margin-bottom: 20%; 
}

/* Transición suave al recentrar el libro */
#revista {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* --- VISTA RESPONSIVA (MÓVILES Y TABLETAS) --- */
@media (max-width: 768px) {

    /* 1. Control de capas para evitar solapamientos */
    .fca-header          { z-index: 1000; }
    .fca-sidebar-overlay { z-index: 1100; }
    .fca-sidebar         { z-index: 1200; }
    .fca-share-container { z-index: 1300; }
    .viewer-main,
    .book-wrapper        { z-index: 1; }

    /* 2. Pegar el visor al header */
    .viewer-main {
        align-items: flex-start; /* Pega el contenedor al borde superior */
        padding-top: 20px;          /* Elimina cualquier margen/relleno con el header */
        padding-bottom: 10px;
    }

    /* 3. Conservar tamaño móvil y proporción de 1 página */
    .book-wrapper {
        /* Mantiene una altura contenida para que no crezca demasiado */
        height: min(calc(100vh - 200px), 480px); 
        width: auto;
        max-width: 90vw;         /* Evita que toque las orillas laterales */
        aspect-ratio: var(--pagina-ancho) / var(--pagina-alto); /* 1 página en móvil */
        margin: 0 auto;          /* Centrado horizontal */
    }
}

/* =========================================================
   ENCABEZADO Y BOTÓN COMPARTIR
   ========================================================= */
/* HEADER ESTILO ALGOMÁS */
.fca-header {
  position: sticky;
  top: 0;
  z-index: 1000; 
  background-color: var(--nav-dark);
  border-bottom: 1px solid var(--fca-dorado);
  box-shadow: 0 8px 22px rgba(0,0,0,.18);
  width: 100%;
  transition: all 0.35s ease;
}

.fca-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px; 
  padding: 0 5%;
}

.fca-brand {
  display: flex;
  align-items: center;
  text-decoration: none;
}

.fca-logo-unam, .fca-logo-fca {
  height: 60px; 
  width: auto;
  object-fit: contain;
}

.fca-brand-divider {
  width: 1px;
  height: 40px;
  background: rgba(255,255,255,0.25);
  margin: 0 20px;
}

.fca-main-title {
  color: #fff;
  font-size: 1.1rem; 
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.fca-algomas-logo {
  height: 50px;
  width: auto;
  object-fit: contain;
}

/* BOTÓN FLOTANTE COMPARTIR */
.fca-share-container {
  position: fixed;
  bottom: 30px;
  left: 30px;
  z-index: 9999;
}

.fca-share-btn {
  width: 55px;
  height: 55px;
  background-color: var(--fca-dorado);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
  border: none;
  transition: transform 0.2s ease;
}

.fca-share-btn:hover {
  transform: scale(1.05);
  background-color: #ffd58c;
  color: var(--nav-dark);
}

.fca-share-menu {
  position: absolute;
  bottom: 70px;
  left: 0;
  background: white;
  width: 260px;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(15px);
  transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.fca-share-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fca-share-options {
  display: flex;
  justify-content: space-around;
  margin-bottom: 15px;
}

.fca-share-link {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white !important;
  text-decoration: none;
  font-size: 18px;
  transition: opacity 0.2s;
}

.fca-share-link:hover { opacity: 0.85; }
.fca-share-fb { background-color: var(--fb-color); }
.fca-share-x { background-color: var(--x-color); }
.fca-share-ig { background: var(--ig-gradient); }

/* BLOQUE DE COPIADO MANUAL */
.fca-share-manual {
  border-top: 1px solid #eee;
  padding-top: 15px;
  margin-top: 5px;
}

.fca-share-manual-label {
  font-size: 11px;
  color: #666;
  margin-bottom: 6px;
  display: block;
  font-weight: 600;
}

.fca-share-textarea {
  width: 100%;
  height: 65px;
  font-family: inherit;
  font-size: 11px;
  color: #333;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 8px;
  resize: none;
  background-color: #f9f9f9;
  box-sizing: border-box;
}

.fca-share-textarea:focus {
  outline: none;
  border-color: var(--fca-dorado);
}

.fca-btn-copy {
  width: 100%;
  background-color: var(--nav-dark);
  color: #fff;
  border: 1px solid var(--fca-dorado);
  padding: 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.fca-btn-copy:hover {
  background-color: var(--fca-dorado);
  color: var(--nav-dark);
}

.fca-share-note {
  font-size: 10px;
  color: #888;
  text-align: center;
  border-top: 1px solid #eee;
  padding-top: 10px;
  margin: 0;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .fca-algomas-logo { height: 40px; }
  .fca-header-inner { height: 70px; }
  .fca-logo-unam, .fca-logo-fca { height: 45px; }
  .fca-brand-divider { margin: 0 12px; }

  /* Elevar el botón de compartir por encima del menú inferior */
  .fca-share-container {
    bottom: 95px; 
    left: 15px;
  }
  .fca-share-btn {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  .fca-share-menu {
    width: 240px;
    padding: 15px;
    bottom: 60px; /* Ajuste del menú desplegable para no salir de pantalla */
  }
}

@media (max-width: 480px) {
  .fca-share-container {
    bottom: 85px; /* Ajuste fino para teléfonos muy pequeños */
    left: 10px;
  }
}

/* =========================================================
   MENÚ, ÍNDICE, IMPRESIÓN Y ZOOM
   ========================================================= */
/* Barra de desplazamiento del índice */
.grid-items::-webkit-scrollbar {
    width: 8px;
}
.grid-items::-webkit-scrollbar-track {
    background: rgba(210, 203, 0, 0.2);
}
.grid-items::-webkit-scrollbar-thumb {
    background: rgba(220, 169, 0, 0.55);
    border-radius: 4px;
}
.grid-items::-webkit-scrollbar-thumb:hover {
    background: var(--fca-oro);
}

/* Toolbar Principal - ADAPTACIÓN A MONITORES */
.side-toolbar {
    position: fixed;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    height: auto;
    max-height: calc(100vh - 100px);
    /* Se adapta usando clamp(minimo, preferido, maximo) */
    width: clamp(48px, 3.8vw, 70px);
    background: linear-gradient(135deg, rgba(0, 43, 84, 0.8), rgba(2, 16, 32, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--fca-border);
    border-radius: 50px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    /* Padding escalable a lo alto */
    padding: clamp(10px, 1.5vh, 18px) 0;
    z-index: 1000;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 
                inset 0 1px 2px rgba(255, 255, 255, 0.15);
    transition: all 0.3s var(--fca-transition);
}

.toolbar-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.toolbar-group:not(:last-child)::after {
    content: '';
    width: 24px;
    height: 1px;
    background: var(--fca-border-light);
    margin: 6px 0;
}

/* Botones - ADAPTACIÓN A MONITORES */
.tool-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    /* Tamaño de fuente escalable */
    font-size: clamp(0.85rem, 1vw, 1.1rem);
    cursor: pointer;
    /* Dimensiones escalables */
    width: clamp(34px, 2.5vw, 44px);
    height: clamp(34px, 2.5vw, 44px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.4s var(--fca-transition);
    position: relative;
}

.tool-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--fca-oro-brillante);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
}

.tool-btn:active {
    transform: scale(0.95);
}

.tool-btn.is-active {
    color: var(--fca-oro-brillante);
    background: rgba(241, 196, 15, 0.1);
    border: 1px solid rgba(241, 196, 15, 0.3);
    box-shadow: inset 0 0 8px rgba(241, 196, 15, 0.2);
}

/* Indicador - ADAPTACIÓN A MONITORES */
.page-indicator {
    font-family: 'Montserrat', sans-serif;
    color: var(--fca-oro);
    font-weight: 500;
    /* Fuente escalable */
    font-size: clamp(0.65rem, 0.8vw, 0.8rem);
    letter-spacing: 0px;
    width: 100%;
    text-align: center;
    margin: 4px 0;
    padding: 4px 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    /* Ancho escalable */
    max-width: clamp(48px, 4vw, 65px);
}

/* Ventanas emergentes (base) */
.grid-overlay {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -48%) scale(0.96);
    width: 94%;
    height: 88%;
    background: var(--fca-glass-dark);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    z-index: 2000;
    border-radius: 24px;
    border: 1px solid var(--fca-border-light);
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transition: all 0.5s var(--fca-transition);
    box-shadow: 0 50px 100px rgba(0, 0, 0, 0.8),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.grid-overlay.is-open {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, -50%) scale(1);
}

/* --- CONTROL DE TAMAÑO (Estilo FCA) - ADAPTACIÓN A MONITORES --- */
.size-control-bubble {
    position: fixed;
    right: 24px;
    bottom: 35px;
    z-index: 2500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(0, 43, 84, 0.8), rgba(2, 16, 32, 0.95));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--fca-border);
    border-radius: 50px;
    /* Padding escalable */
    padding: clamp(4px, 0.8vh, 8px) clamp(8px, 0.8vw, 14px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5), 
                inset 0 1px 2px rgba(255, 255, 255, 0.15);
    transition: all 0.3s var(--fca-transition);
}

.size-control-text {
    font-family: 'Montserrat', sans-serif;
    color: var(--fca-oro);
    font-weight: 700;
    /* Fuente escalable */
    font-size: clamp(0.6rem, 0.7vw, 0.75rem);
    letter-spacing: 0.5px;
    text-align: center;
    /* Ancho escalable */
    min-width: clamp(34px, 3vw, 50px);
    padding: 4px 6px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    white-space: nowrap;
}

.size-control-btn {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    /* Tamaño de fuente y dimensiones escalables */
    font-size: clamp(0.8rem, 1vw, 1rem);
    width: clamp(28px, 2vw, 36px);
    height: clamp(28px, 2vw, 36px);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    transition: all 0.4s var(--fca-transition);
}

.size-control-btn:hover {
    background: rgba(212, 175, 55, 0.15);
    color: var(--fca-oro-brillante);
    transform: scale(1.08);
    box-shadow: 0 0 15px rgba(241, 196, 15, 0.2);
}

.size-control-btn:active {
    transform: scale(0.95);
}

.size-control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    color: rgba(255, 255, 255, 0.3);
    background: transparent;
}

.grid-panel-header {
    padding: 25px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--fca-border-light);
}

.grid-panel-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.clear-bookmarks-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid var(--fca-oro);
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.clear-bookmarks-btn:hover {
    background: var(--fca-oro);
    transform: translateY(-1px);
}

.grid-panel-title {
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5rem;
    margin: 0;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    background: linear-gradient(180deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid-items {
    flex-grow: 1;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    column-gap: 48px;
    row-gap: 190px;
    padding: 48px 56px 56px;
    overflow-y: auto;
}

.grid-thumb {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 3/4;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    background: #111;
    border: 2px solid transparent;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.grid-thumb:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.5);
}

.grid-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.7;
    transition: 0.3s;
}

.grid-thumb:hover img {
    opacity: 1;
}

.grid-thumb.is-current {
    border-color: var(--fca-azul-brillante);
    box-shadow: 0 0 20px rgba(0, 123, 255, 0.4);
    transform: scale(1.05);
}

.grid-thumb.is-current img {
    opacity: 1;
}

.grid-thumb.is-bookmarked {
    border-color: var(--fca-oro-brillante) !important;
    box-shadow: 0 0 22px rgba(241, 196, 15, 0.6) !important;
}

.grid-thumb.is-bookmarked img {
    opacity: 0.95;
}

.grid-thumb-num {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 4;
    min-width: 2.5rem;
    padding: 0.35rem 0.55rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.78);
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 10px;
    pointer-events: none;
}

.grid-thumb.is-bookmarked::after {
    content: '\f02e';
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    font-weight: 900;
    position: absolute;
    top: -2px;
    right: 12px;
    color: var(--fca-oro-brillante);
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.8));
    z-index: 5;
}

/* Ventana de impresión */
.print-modal {
    max-width: 520px;
    height: auto;
    min-height: auto;
    border-radius: 24px;
}

.print-body {
    padding: 40px 50px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    color: #fff;
    font-family: 'Montserrat', sans-serif;
}

.print-option {
    display: flex;
    flex-direction: column;
}

.print-option-label {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    padding: 14px 18px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.print-option-label:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(212, 175, 55, 0.3);
}

.print-option input[type="radio"] {
    accent-color: var(--fca-oro-brillante);
    transform: scale(1.3);
    cursor: pointer;
}

.print-option span {
    font-weight: 600;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.9);
}

.range-inputs {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    background: rgba(0, 0, 0, 0.4);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 0.9rem;
    color: rgba(255,255,255,0.6);
    animation: fadeIn 0.3s var(--fca-transition);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

.range-inputs input[type="number"] {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    width: 80px;
    text-align: center;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s;
}

.range-inputs input[type="number"]:focus {
    outline: none;
    border-color: var(--fca-oro);
    background: rgba(255, 255, 255, 0.12);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.2);
}

.btn-action {
    background: linear-gradient(135deg, var(--fca-oro) 0%, #B89225 100%);
    color: #040e1b;
    border: none;
    padding: 16px 24px;
    font-size: 1rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    border-radius: 14px;
    cursor: pointer;
    margin-top: 12px;
    transition: all 0.3s var(--fca-transition);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.25);
}

.btn-action:hover {
    background: linear-gradient(135deg, var(--fca-oro-brillante) 0%, var(--fca-oro) 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(241, 196, 15, 0.4);
}

#print-container {
    display: none;
}

@media print {
    body > * {
        display: none !important;
    }
    #print-container {
        display: block !important;
        margin: 0;
        padding: 0;
    }
    #print-container img {
        max-width: 100%;
        max-height: 100vh;
        page-break-after: always;
        display: block;
        margin: 0 auto;
    }
    @page {
        margin: 0;
    }
}

/* Backdrop Global */
.grid-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(2, 8, 16, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 1999;
}

.grid-overlay.is-open ~ .grid-backdrop {
    opacity: 1;
    visibility: visible;
}

/* Responsivo del menú */
@media (max-width: 768px) {
    .side-toolbar {
        top: auto;
        bottom: 16px;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        max-width: 540px;
        height: 62px;
        max-height: none;
        flex-direction: row;
        padding: 0 20px;
        border-radius: 40px;
        box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6), 
                    inset 0 1px 2px rgba(255, 255, 255, 0.15);
    }
    .toolbar-group {
        flex-direction: row;
        gap: 8px;
        width: auto;
    }
    .toolbar-group:not(:last-child)::after {
        width: 1px;
        height: 22px;
        margin: 0 6px;
    }
    .tool-btn {
        width: 34px;
        height: 34px;
        font-size: 0.95rem;
    }
    .page-indicator {
        max-width: 55px;
        font-size: 0.6rem;
        padding: 3px;
        margin: 0;
    }
    .grid-overlay {
        width: 96%;
        height: 90%;
    }
    .grid-panel-header {
        padding: 15px 24px;
    }
    .print-body {
        padding: 24px;
    }

    /* Control de zoom elevado para no chocar con el menú inferior */
    .size-control-bubble {
        bottom: 95px; 
        right: 15px;
        padding: 5px 8px;
    }
    .size-control-btn {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }
    .size-control-text {
        min-width: 36px;
        padding: 3px 5px;
        font-size: 0.65rem;
    }
}

@media (max-width: 480px) {
    .side-toolbar {
        padding: 0 10px;
        bottom: 12px;
        gap: 2px;
    }
    .toolbar-group {
        gap: 4px;
    }
    .tool-btn {
        width: 30px;
        height: 30px;
        font-size: 0.85rem;
    }
    .page-indicator {
        max-width: 48px;
        font-size: 0.55rem;
        padding: 2px 1px;
    }
    .toolbar-group:not(:last-child)::after {
        margin: 0 2px;
    }

    /* Ajuste fino del zoom para pantallas menores a 480px */
    .size-control-bubble {
        bottom: 85px; 
        right: 10px;
        gap: 4px;
    }
}

/* --- NUEVO: ESTILOS GLOBO DE TEXTO (ZOOM) --- */
.zoom-tooltip {
    position: absolute;
    bottom: calc(100% + 15px);
    right: 0;
    width: 220px;
    background: rgba(0, 43, 84, 0.95);
    border: 1px solid var(--fca-border);
    color: rgba(255, 255, 255, 0.9);
    padding: 10px 14px;
    border-radius: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 0.75rem;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    pointer-events: none; /* Evita bloquear los clics en elementos de atrás */
    animation: fadeOutTooltip 0.5s ease-in 5s forwards;
}

.zoom-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    right: 25px; /* Alineado al centro del control de la burbuja */
    border-width: 6px;
    border-style: solid;
    border-color: rgba(0, 43, 84, 0.95) transparent transparent transparent;
}

@keyframes fadeOutTooltip {
    0% { opacity: 1; visibility: visible; }
    100% { opacity: 0; visibility: hidden; }
}

/* =========================================================
   PIE DE PÁGINA
   ========================================================= */
.fca-footer {
    background-color: var(--nav-dark);
    border-top: 1px solid var(--fca-dorado);
    width: 100%;
    margin-top: auto;
}

.fca-footer-inner {
    height: 40px;
    padding: 0 5%;
}

@media (max-width: 768px) {
    .fca-footer-inner { height: 70px; }
}
