/* =========================================================================
   ESTRUTURA DE 5 COLUNAS POR LINHA (CCMI PREMIUM GRID)
   ========================================================================= */

/* Desktop Extra Grande (5 por linha) */
@media (min-width: 1200px) {
    .col-ccmi-5 { 
        flex: 0 0 20% !important; 
        max-width: 20% !important; 
        width: 20% !important; 
    }
}

/* Laptops e Desktops Padrão (4 por linha) */
@media (min-width: 992px) and (max-width: 1199px) {
    .col-ccmi-5 { 
        flex: 0 0 25% !important; 
        max-width: 25% !important; 
    }
}

/* Tablets em modo Paisagem (3 por linha) */
@media (min-width: 768px) and (max-width: 991px) {
    .col-ccmi-5 { 
        flex: 0 0 33.333% !important; 
        max-width: 33.333% !important; 
    }
}

/* Telemóveis / Mobile (1 por linha - CORRIGIDO) */
@media (max-width: 767px) {
    .col-ccmi-5 { 
        flex: 0 0 100% !important; 
        max-width: 100% !important; 
        width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* =========================================================================
   COMPONENTES DA GALERIA E MODAL ESCURO
   ========================================================================= */
.sector-hero-gal {
    background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.65)), url('../images/bg_galeria.jpg');
    background-size: cover; 
    background-position: center; 
    padding: 80px 0; 
    color: #ffffff;
}

.ccmi-gal-card {
    border: 1px solid #eef2f8; 
    border-radius: 10px; 
    transition: transform 0.2s, box-shadow 0.2s; 
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.01); 
    overflow: hidden; 
    margin-bottom: 25px;
}

.ccmi-gal-card:hover { 
    transform: translateY(-4px); 
    box-shadow: 0 12px 25px rgba(141, 34, 34, 0.06) !important; 
    border-color: #fde8e8; 
}

.ccmi-gal-img-box { 
    width: 100%; 
    height: 180px; 
    overflow: hidden; 
    background: #f4f7fe; 
    position: relative; 
}

.ccmi-gal-img-box img { 
    width: 100%; 
    object-fit: cover; 
}

.ccmi-gal-info { 
    padding: 15px; 
}

.ccmi-gal-title-text { 
    font-size: 14px; 
    font-weight: 700; 
    color: #1a202c; 
    line-height: 1.4; 
    margin-bottom: 6px; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    height: 40px; 
}

.ccmi-gal-counter { 
    font-size: 12px; 
    color: #718096; 
}

.btn-open-gallery {
    padding: 10px 12px; 
    font-size: 13px; 
    font-weight: 600; 
    border-radius: 6px;
    background-color: #a92d2d; 
    color: #ffffff; 
    border: none; 
    display: inline-block; 
    width: 100%; 
    text-align: center; 
    cursor: pointer; 
    transition: background 0.2s;
}

.btn-open-gallery:hover { 
    background-color: #8d2222; 
    color: #ffffff; 
}

/* MODAL ESCURO (IMAGE_4F4BC3.JPG DESIGN) */
.ccmi-dark-gallery-modal .modal-content { background-color: #1a1a1a !important; border-radius: 12px !important; border: none !important; color: #ffffff; overflow: hidden; }
.ccmi-dark-gallery-modal .modal-header { border-bottom: 1px solid #2d2d2d !important; padding: 15px 20px !important; }
.ccmi-dark-gallery-modal .modal-title { font-size: 16px !important; color: #ffffff !important; font-weight: 600 !important; }
.ccmi-viewer-main-wrapper { position: relative; width: 100%; height: 420px; background: #111; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ccmi-viewer-main-wrapper img { max-width: 100%; max-height: 100%; object-fit: contain; }
.ccmi-viewer-arrow { position: absolute; top: 50%; transform: translateY(-50%); background: rgba(0,0,0,0.5); color: #fff; border: none; width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; font-size: 20px; cursor: pointer; border-radius: 4px; transition: background 0.2s; z-index: 10; }
.ccmi-viewer-arrow:hover { background: #a92d2d; color: #fff; }
.ccmi-arrow-left { left: 15px; }
.ccmi-arrow-right { right: 15px; }
.ccmi-viewer-thumbs-strip { background: #222; padding: 15px; display: flex; gap: 8px; justify-content: center; overflow-x: auto; border-top: 1px solid #2d2d2d; }
.ccmi-viewer-thumb-item { width: 70px; height: 50px; object-fit: cover; border-radius: 4px; border: 2px solid transparent; cursor: pointer; opacity: 0.5; transition: all 0.2s; }
.ccmi-viewer-thumb-item:hover, .ccmi-viewer-thumb-item.active { opacity: 1; border-color: #a92d2d; }

@media (max-width: 768px) {
    .ccmi-viewer-main-wrapper { height: 260px; }
    .ccmi-viewer-thumb-item { width: 55px; height: 40px; }

    .d-none{ display:none!important; }
}