#revista-digital-app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0 40px;
}

.revista-header {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 20px;
}

.revista-header h1 {
    text-align: center;
    font-family: Georgia, 'Times New Roman', serif;
    margin: 0;
}

.revista-indice-toggle {
    position: absolute;
    right: 0;
    top: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 14px;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 6px;
}

.revista-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.revista-indice-panel {
    flex: 0 0 220px;
    background: #fafafa;
    border: 1px solid #eee;
    border-radius: 4px;
    max-height: 640px;
    overflow-y: auto;
    position: sticky;
    top: 20px;
}

.revista-indice-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.revista-indice-cerrar {
    display: none;
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    color: #888;
    line-height: 1;
}

.revista-indice-lista {
    list-style: none;
    margin: 0;
    padding: 6px 0;
}

.revista-indice-lista li {
    padding: 9px 14px;
    cursor: pointer;
    font-size: 14px;
    border-left: 3px solid transparent;
}

.revista-indice-lista li a {
    color: #333;
    text-decoration: none;
    display: block;
}

.revista-indice-lista li:hover {
    background: #f0f0f0;
}

.revista-indice-lista li.activo {
    border-left-color: #1a47b2;
    background: rgba(26, 71, 178, .12);
    font-weight: 600;
}

.revista-viewer-wrap {
    flex: 1 1 auto;
    min-width: 0;
}

/* Mobile: el índice se oculta y se muestra como panel deslizante desde la izquierda */
@media (max-width: 782px) {
    .revista-indice-toggle {
        display: inline-flex;
    }

    .revista-layout {
        display: block;
    }

    .revista-indice-panel {
        position: fixed;
        top: 0;
        left: -280px;
        width: 260px;
        height: 100%;
        max-height: none;
        z-index: 10002;
        transition: left .25s ease;
        border-radius: 0;
        box-shadow: 2px 0 10px rgba(0, 0, 0, .2);
    }

    .revista-indice-panel.abierto {
        left: 0;
    }

    .revista-indice-cerrar {
        display: block;
    }

    /* Título alineado a la izquierda en mobile (en vez de centrado) */
    .revista-header {
        justify-content: flex-start;
        padding-right: 100px; /* deja lugar al botón de Índice, que sigue en la esquina */
    }

    .revista-header h1 {
        text-align: left;
        font-size: 20px;
    }

    /* El visor ocupa todo el ancho; las flechas quedan flotando sobre la imagen */
    #revista-digital-app {
        padding-left: 0;
        padding-right: 0;
    }

    .revista-viewer {
        display: block;
        padding: 0;
        background: none;
        border-radius: 0;
    }

    .revista-pagina-actual {
        width: 100%;
        box-shadow: none;
    }

    .revista-nav-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        z-index: 5;
        margin: 0;
        width: 36px;
        height: 36px;
        opacity: .9;
    }

    #revista-prev {
        left: 8px;
    }

    #revista-next {
        right: 8px;
    }

    .revista-thumbs,
    .revista-indicador {
        padding-left: 10px;
        padding-right: 10px;
    }

    /* Botón de "Agregar al carrito" más compacto en pantallas chicas */
    .revista-hotspot-pin {
        padding: 5px 10px 5px 8px;
        font-size: 11px;
        gap: 4px;
    }

    .revista-hotspot-pin .material-icons {
        font-size: 14px;
    }

    .revista-hotspot-extra {
        display: none;
    }
}

.revista-viewer {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #efefef;
    padding: 10px;
    border-radius: 4px;
}

.revista-pagina-actual {
    position: relative;
    max-width: 100%;
    line-height: 0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .18);
}

.revista-pagina-actual img {
    max-width: 100%;
    height: auto;
    display: block;
    user-select: none;
}

.revista-nav-btn {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 12px;
}

.revista-nav-btn:hover {
    background: #f2f2f2;
}

.revista-nav-btn:disabled {
    opacity: .3;
    cursor: default;
}

.revista-hotspot-pin {
    position: absolute;
    transform: translate(-50%, -50%);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    color: #1a47b2;
    border: 1.5px solid #1a47b2;
    border-radius: 999px;
    padding: 7px 14px 7px 10px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .25);
    animation: revista-pulse 1.8s infinite;
    transition: background .15s ease, color .15s ease;
}

.revista-hotspot-pin .material-icons {
    font-size: 17px;
    color: #1a47b2;
    transition: color .15s ease;
}

.revista-hotspot-pin:hover,
.revista-hotspot-pin:focus {
    background: #1a47b2;
    color: #fff;
}

.revista-hotspot-pin:hover .material-icons,
.revista-hotspot-pin:focus .material-icons {
    color: #fff;
}

@keyframes revista-pulse {
    0% { box-shadow: 0 0 0 0 rgba(26, 71, 178, .45), 0 2px 8px rgba(0, 0, 0, .25); }
    70% { box-shadow: 0 0 0 9px rgba(26, 71, 178, 0), 0 2px 8px rgba(0, 0, 0, .25); }
    100% { box-shadow: 0 0 0 0 rgba(26, 71, 178, 0), 0 2px 8px rgba(0, 0, 0, .25); }
}

.revista-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    margin-top: 16px;
    padding-bottom: 6px;
}

.revista-thumbs img {
    height: 70px;
    border: 2px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    opacity: .6;
}

.revista-thumbs img.activa {
    border-color: #dc4949;
    opacity: 1;
}

.revista-indicador {
    text-align: center;
    margin-top: 8px;
    color: #777;
    font-size: 13px;
}

.revista-modal {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, .55);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.revista-quickview-contenido {
    background: #fff;
    border-radius: 6px;
    padding: 24px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
}

.revista-cerrar-qv {
    position: absolute;
    top: 10px;
    right: 14px;
    background: none;
    border: none;
    font-size: 26px;
    cursor: pointer;
    line-height: 1;
    color: #888;
}

.revista-qv-flex {
    display: flex;
    gap: 18px;
}

.revista-qv-flex img {
    width: 160px;
    height: 160px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 4px;
}

.revista-qv-precio {
    font-size: 20px;
    font-weight: 600;
    margin: 8px 0;
}

.revista-qv-agregar {
    margin-top: 12px;
}

.revista-qv-agotado {
    color: #b93030;
    font-weight: 600;
}

.revista-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #333;
    color: #fff;
    padding: 12px 18px;
    border-radius: 4px;
    z-index: 10001;
}
