/* ================================
   ESTADO GLOBAL QUANDO OVERLAY ABRE
=================================== */
body.cmo-no-scroll {
    overflow: hidden;
}

/* ================================
   GRID DE MINIATURAS - THUMBS UNIFORMES
=================================== */
.cmo-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.cmo-thumb {
    border: 0;
    padding: 0;
    background: none;
    cursor: pointer;
    display: block;
    aspect-ratio: 1; /* Quadrado perfeito */
    overflow: hidden;
}

.cmo-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop inteligente */
    display: block;
}

/* Responsivo */
@media (max-width: 768px) {
    .cmo-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
}


/* ================================
   OVERLAY FULLSCREEN - Z-INDEX MÁXIMO
=================================== */
.cmo-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: none;
    z-index: 2147483647;
}

.cmo-overlay.cmo-open {
    display: block;
}

/* Fundo escurecido */
.cmo-overlay-backdrop {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #EAEAEA;
    z-index: 0;
}

/* Container interno em duas colunas */
.cmo-overlay-inner {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    display: flex;
    box-sizing: border-box;
    padding: 32px 40px;
    color: #fff;
    font-family: inherit;
}

/* ================================
   BOTÃO FECHAR
=================================== */
.cmo-close {
    position: absolute;
    top: 16px;
    right: 20px;
    border: 0;
    background: #666;
    color: #fff;
    font-size: 32px;
    line-height: 1;
    cursor: pointer;
	border-radius: 10px;
    z-index: 3;
}

.cmo-close:hover {
    opacity: 0.7;
}

/* ================================
   NAVEGAÇÃO (SETAS)
=================================== */
.cmo-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: #666;
    color: #fff;
    font-size: 28px;
    width: 44px;
    height: 44px;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: opacity 0.2s;
}

.cmo-nav:hover {
    opacity: 0.8;
    background: rgba(0, 0, 0, 0.8);
}

.cmo-prev {
    left: 16px;
}

.cmo-next {
    right: 64px;
}

/* ================================
   COLUNAS ESQUERDA/DIREITA
=================================== */
.cmo-overlay-left {
    width: 50%;
    padding: 50px;
    box-sizing: border-box;
    overflow-y: auto;
	background-color: #fff;
	display: flex;
    align-items: center;
    justify-content: center;
}

.cmo-overlay-right {
    width: 50%;
    padding: 24px;
    box-sizing: border-box;
    overflow-y: auto;
    background: #EAEAEA;
    backdrop-filter: blur(4px);
	position: relative;
}

.cmo-overlay-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    display: block;
    object-fit: contain; /* MOSTRA IMAGEM INTEIRA */
}

.cmo-overlay-caption {
    font-size: 16px;
    line-height: 1.6;
    white-space: pre-line;
    color: #666;
    position: absolute;        /* Adicionado */
    bottom: 24px;              /* Ajustado para coincidir com padding do container */
    left: 24px;                /* Ajustado para coincidir com padding */
    right: 24px;
    max-width: 50%;
    margin: 0;
}

/* ================================
   DIVI - FORÇAR TUDO ABAIXO DO OVERLAY
=================================== */
body.cmo-no-scroll [class*="et_pb_"],
body.cmo-no-scroll .et_pb_section,
body.cmo-no-scroll .et_pb_row,
body.cmo-no-scroll .et_pb_column,
body.cmo-no-scroll .et_pb_module,
body.cmo-no-scroll header,
body.cmo-no-scroll nav,
body.cmo-no-scroll .sidebar,
body.cmo-no-scroll .widget,
body.cmo-no-scroll .widget-area {
    z-index: 0 !important;
    position: relative !important;
}

/* ================================
   RESPONSIVIDADE
=================================== */
@media (max-width: 1024px) {
    .cmo-overlay-inner {
        padding: 24px 20px;
    }
    .cmo-prev { left: 8px; }
    .cmo-next { right: 52px; }
}

@media (max-width: 768px) {
    .cmo-overlay-inner {
        flex-direction: column;
        padding: 16px 12px 24px;
    }
    .cmo-overlay-left,
    .cmo-overlay-right {
        width: 100%;
        max-height: 50vh;
        padding: 16px 12px;
    }
    .cmo-nav { display: none; }
    .cmo-close {
        top: 8px;
        right: 12px;
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .cmo-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 8px;
    }
    .cmo-overlay-caption {
        font-size: 14px;
    }
}

/* ================================
   SEÇÃO WHATSAPP ENQUIRE
=================================== */
.cmo-enquire-section {
    position: absolute;        /* Adicionado */
    top: 24px;                 /* Adicionado: fixo no topo, respeitando padding */
    left: 24px;                /* Adicionado: alinhado com padding */
    right: 24px;               /* Adicionado: largura total interna */
    margin-top: 0;             /* Removido margin-top desnecessário */
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.cmo-enquire-section h3 {
    margin: 0 0 16px 0;
    font-size: 36px;
    color: #666;
}

.cmo-whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: #25D366;
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.cmo-whatsapp-btn:hover {
    background: #128C7E;
    transform: translateY(-1px);
}

.cmo-whatsapp-btn img {
    width: 24px;
    height: 24px;
}

@media (max-width: 768px) {
    .cmo-enquire-section {
        margin-top: 16px;
        padding-top: 16px;
    }
}

/* ================================
   PAINEL ADMIN - BULK EDIT
=================================== */

.cmo-bulk-table {
    table-layout: fixed;
}

.cmo-bulk-table td {
    vertical-align: top;
    padding: 12px 8px;
}

.cmo-bulk-table .cmo-textarea {
    width: 100% !important;
    height: 80px !important;
    box-sizing: border-box;
    resize: vertical;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px;
}

.cmo-thumb-preview {
    max-width: 60px !important;
    max-height: 60px !important;
    object-fit: cover;
    border-radius: 4px;
}

.cmo-bulk-table td {
    word-break: break-word;
}

.cmo-bulk-table th {
    white-space: nowrap;
    font-weight: 600;
}

.cmo-bulk-table tr:hover {
    background-color: #f9f9f9;
}