/* --- GERAL E LAYOUT DO PAINEL --- */
#jornal-reserva-app {
    display: flex;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f7f9;
    border: 1px solid #e0e4e8;
    border-radius: 8px;
    max-width: 900px;
    margin: 40px auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    position: relative;
    z-index: 1;
}

.reserva-sidebar {
    width: 100%;
    background-color: #ffffff;
    padding: 25px;
    border-bottom: 1px solid #e0e4e8;
}

.reserva-main-content {
    width: 100%;
    padding: 25px;
}

.sidebar-header {
    text-align: center;
    margin-bottom: 20px;
}

.sidebar-header h2 {
    font-size: 22px;
    color: #005a87;
    margin: 0 0 5px 0;
}

.highlight-text {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    background-color: #ff8800;
    padding: 8px 15px;
    border-radius: 5px;
    display: inline-block;
    margin-top: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); }
    50% { transform: scale(1.03); box-shadow: 0 0 15px rgba(255, 136, 0, 0.7); }
    100% { transform: scale(1); box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); }
}

/* --- ESTRUTURA DE COLUNAS --- */
.jrp-row {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 20px;
    margin-bottom: 20px;
    border-top: 1px solid #e9ecef;
    padding-top: 25px;
}

.jrp-col {
    flex: 1;
    min-width: 300px;
}

.filtros-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.filtro-grupo {
    width: 100%;
}

.filtro-grupo.filtro-paginas {
    margin-top: 20px;
}

.filtro-grupo label {
    display: block;
    font-weight: 600;
    color: #343a40;
    margin-bottom: 8px;
    font-size: 16px;
}

#jornal-reserva-app #filtro-bairro {
    width: 100% !important;
    padding: 10px !important;
    border: 1px solid #ced4da !important;
    border-radius: 4px !important;
    font-size: 14px !important;
    background-color: #fff !important;
    background-image: none !important;
    appearance: auto !important;
    -webkit-appearance: menulist !important;
    -moz-appearance: menulist !important;
    box-sizing: border-box !important;
}

#jornal-reserva-app #filtro-bairro optgroup {
    font-weight: bold;
    font-style: italic;
    background-color: #f4f7f9;
    color: #005a87;
    padding: 5px 0;
}

/* --- CORREÇÃO FINAL DO SCROLL DO MENU DE PÁGINAS --- */
.page-nav {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 10px;
    border-bottom: 1px solid #ced4da;
}

.page-nav .page-nav-button {
    flex: 0 0 auto;
    text-align: center;
    padding: 12px 20px;
    border: 1px solid transparent;
    background-color: #f8f9fa;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: 500;
    color: #495057;
    transition: all 0.2s ease-in-out;
    white-space: nowrap;
    margin-bottom: -11px;
}

.page-nav .page-nav-button:hover {
    background-color: #e9ecef;
    color: #005a87;
}

.page-nav .page-nav-button.active {
    background-color: #ffffff;
    color: #0073aa;
    border-color: #ced4da #ced4da #ffffff;
    font-weight: 600;
}

.main-header {
    padding-bottom: 15px;
    border-bottom: 1px solid #e0e4e8;
    margin-bottom: 20px;
    text-align: center;
}

.main-header h3 {
    margin: 0;
    color: #343a40;
    font-size: 20px;
}

/* --- CORREÇÃO DA GRADE E IMAGEM --- */
.page-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    border-radius: 4px;
    overflow: hidden;
    aspect-ratio: 4 / 5;
}

.page-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.grid-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-template-rows: repeat(5, 1fr);
    gap: 2px;
}

.grid-overlay.disabled {
    background-color: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    z-index: 20;
}

.module {
    border: 2px dashed rgba(0, 115, 170, 0.4);
    background: transparent;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.module:hover {
    background: rgba(0, 115, 170, 0.1);
    border-style: solid;
}

.module.selected {
    background: rgba(255, 136, 0, 0.3);
    border: 2px solid #ff8800;
    transform: scale(1.05);
    z-index: 10;
}

.module.locked {
    background: rgba(108, 117, 125, 0.2);
    border: 2px dashed #6c757d;
    cursor: not-allowed;
}

.module.reserved {
    background: rgba(255, 136, 0, 0.7);
    border: 2px solid #e67a00;
    cursor: not-allowed;
    color: #ffffff;
    font-size: 14px;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

#reserva-cart { 
    padding-top: 20px; 
    border-top: 1px solid #e0e4e8; 
    margin-top: 20px; 
}

#cart-items { 
    list-style: none; 
    padding: 0; 
    margin: 0 0 15px 0; 
    max-height: 150px; 
    overflow-y: auto; 
}

#cart-items li { 
    background-color: #e9ecef; 
    padding: 8px 12px; 
    border-radius: 4px; 
    margin-bottom: 5px; 
    font-size: 14px; 
    color: #495057; 
}

#cart-total {
    font-size: 18px;
    font-weight: bold;
    color: #005a87;
    text-align: right;
    margin: 15px 0;
}

#btn-reservar-selecionados {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    display: block;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 5px;
    border: none;
    background-color: #ff8800;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

#btn-reservar-selecionados:hover {
    background-color: #e67a00;
}

.modal-overlay { 
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    background: rgba(0, 0, 0, 0.6); 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    z-index: 9999;
}

.modal-content { 
    background: #fff; 
    padding: 30px; 
    border-radius: 8px; 
    width: 90%; 
    max-width: 450px; 
    text-align: center; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    position: relative;
    z-index: 10000;
}

.modal-content h3 { 
    margin: 0 0 15px 0; 
    color: #005a87; 
    font-size: 22px; 
}

.modal-content p { 
    margin: 0 0 30px 0; 
    color: #495057; 
    font-size: 16px; 
    line-height: 1.5; 
}

.modal-actions { 
    display: flex; 
    justify-content: center; 
    gap: 15px; 
}

.modal-actions button { 
    padding: 12px 25px; 
    border: none; 
    border-radius: 5px; 
    font-size: 16px; 
    font-weight: 600; 
    cursor: pointer; 
    transition: all 0.2s ease; 
}

.btn-primary { 
    background-color: #ff8800; 
    color: #fff; 
}

.btn-primary:hover { 
    background-color: #e67a00; 
}

.btn-secondary { 
    background-color: #e9ecef; 
    color: #495057; 
}

.btn-secondary:hover { 
    background-color: #d6dbe0; 
}

/* --- ESTILOS DE MARKETING --- */

.info-exemplares {
    font-size: 15px;
    color: #495057;
    margin-top: -5px;
    margin-bottom: 15px;
    font-style: italic;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.info-exemplares .fa-newspaper {
    color: #005a87;
}

.info-exemplares strong {
    color: #005a87;
    font-weight: 700;
}

.distribuicao-info {
    text-align: left;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    height: 100%;
}

.distribuicao-info h4 {
    font-size: 16px;
    color: #005a87;
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribuicao-info ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.distribuicao-info li {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.distribuicao-info .fa-check {
    color: #28a745;
}

/* --- AJUSTES PARA MOBILE --- */
@media (max-width: 768px) {
    #jornal-reserva-app {
        width: 100vw;
        position: relative;
        left: 50%;        transform: translateX(-50%);
        max-width: 100vw;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .reserva-sidebar, .reserva-main-content {
        padding: 15px;
    }

    .jrp-row {
        flex-direction: column;
        gap: 20px;
    }
}

