/**
 * Estilos da Vitrine de Cursos Moodle (Edwiser Bridge & Elementor)
 * Totalmente isolados sob o namespace .ebs-wrapper
 */

*,
*::before,
*::after {
    box-sizing: border-box;
}

.ebs-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1e293b;
    background-color: #f8fafc;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    flex: 1 0 auto;
}

.ebs-wrapper *,
.ebs-wrapper *::before,
.ebs-wrapper *::after {
    box-sizing: border-box;
}

/* 1. Header Fixo/Sticky Permanente */
.ebs-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 990;
    box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.05);
    transition: top 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

/* Compensação para a Barra de Administração do WordPress (Admin Bar) */
.admin-bar .ebs-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ebs-header {
        top: 46px;
    }
}

@media screen and (max-width: 600px) {
    .admin-bar .ebs-header {
        top: 0;
    }
}

.ebs-header-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    box-sizing: border-box;
    width: 100%;
}

.ebs-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex-shrink: 0;
    order: 1;
}

.ebs-brand .custom-logo-link,
.ebs-brand .ebs-brand-link {
    display: flex;
    align-items: center;
}

.ebs-brand .custom-logo,
.ebs-logo-img {
    max-height: 68px;
    width: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease;
}

.ebs-logo-icon {
    width: 38px;
    height: 38px;
    background-color: #A30000;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fef08a;
    box-shadow: 0 2px 4px rgba(163, 0, 0, 0.2);
}

.ebs-brand-title {
    font-size: 15px;
    font-weight: 900;
    color: #0f172a;
    display: block;
    line-height: 1.2;
}

.ebs-highlight-red {
    color: #A30000;
}

.ebs-brand-sub {
    font-size: 10px;
    color: #64748b;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: block;
}

.ebs-header-search {
    flex: 1 1 auto;
    max-width: 500px;
    min-width: 0;
    order: 2;
    box-sizing: border-box;
}

.ebs-search-box {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.ebs-icon-search {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

.ebs-input-search {
    width: 100%;
    box-sizing: border-box;
    background-color: #f1f5f9;
    border: 1px solid transparent;
    border-radius: 9999px;
    padding: 9px 16px 9px 36px;
    font-size: 13px;
    color: #1e293b;
    outline: none;
    transition: all 0.2s;
}

.ebs-input-search:focus {
    background-color: #ffffff;
    border-color: #A30000;
    box-shadow: 0 0 0 3px rgba(163, 0, 0, 0.12);
}

.ebs-header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    order: 3;
}

.ebs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.ebs-btn-red {
    background-color: #A30000;
    color: #ffffff !important;
}

.ebs-btn-red:hover {
    background-color: #850000;
}

.ebs-btn-outline-red {
    background-color: transparent;
    border-color: #fca5a5;
    color: #A30000 !important;
}

.ebs-btn-outline-red:hover {
    background-color: #fef2f2;
}

.ebs-auth-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #A30000;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 6px;
}

.ebs-auth-link:hover {
    background-color: #fef2f2;
}

.ebs-user-avatar {
    width: 32px;
    height: 32px;
    background-color: #0f172a;
    color: #ffffff;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
}

/* 2. Banner Panorâmico Oficial CBMMT */
.ebs-hero-banner-wrap {
    width: 100%;
    max-width: 1280px;
    margin: 20px auto 16px;
    padding: 0 24px;
    box-sizing: border-box;
    align-self: center;
}

.ebs-panoramic-banner {
    width: 100% !important;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    display: block;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    object-fit: cover;
}


/* 3. Catálogo e Filtros */
.ebs-catalog-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 24px 48px;
    width: 100%;
    box-sizing: border-box;
    flex: 1 0 auto;
}

.ebs-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
    padding-bottom: 20px;
}

.ebs-category-pills {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ebs-cat-btn {
    border: 1px solid #d1d5db;
    background-color: #ffffff;
    color: #374151;
    padding: 8px 22px;
    border-radius: 9999px;
    font-size: 13.5px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.ebs-cat-btn:hover {
    background-color: #f3f4f6;
    border-color: #9ca3af;
}

.ebs-cat-btn.active {
    background-color: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.ebs-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ebs-select {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    color: #334155;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 13px;
    outline: none;
    cursor: pointer;
}

.ebs-status-bar {
    padding: 12px 0 18px;
    font-size: 12px;
    color: #64748b;
}

.ebs-status-bar strong {
    color: #0f172a;
}

/* 4. Grid de Cursos (Estilo Mockup 5 Colunas) */
.ebs-grid {
    display: grid;
    gap: 16px;
}

.ebs-cols-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.ebs-cols-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.ebs-cols-4 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ebs-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }

@media (max-width: 1200px) {
    .ebs-cols-5 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 960px) {
    .ebs-cols-5 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .ebs-cols-2, .ebs-cols-3, .ebs-cols-4, .ebs-cols-5 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 480px) {
    .ebs-cols-2, .ebs-cols-3, .ebs-cols-4, .ebs-cols-5 {
        grid-template-columns: 1fr;
    }
}

.ebs-card {
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.ebs-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px -4px rgba(0, 0, 0, 0.08);
}

.ebs-card-thumb {
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    position: relative;
    height: 130px;
    background: #0f172a;
    overflow: hidden;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

/* Fallback sutil caso a imagem falhe (desativado para não sobrepor logos transparentes) */
.ebs-card-thumb::before {
    display: none;
}

.ebs-card-thumb img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.35s ease, opacity 0.3s;
    font-size: 0;
    color: transparent;
}

.ebs-card:hover .ebs-card-thumb img {
    transform: scale(1.04);
}

.ebs-badge-cat {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #1e293b;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 4px;
    backdrop-filter: blur(4px);
    z-index: 3;
}

.ebs-card-body {
    padding: 12px 14px 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.ebs-card-main-info {
    flex: 1;
}

.ebs-card-title-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.ebs-card-title {
    font-size: 13.5px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.2s ease;
}

.ebs-card-title:hover,
.ebs-card-title-link:hover .ebs-card-title {
    color: #15803d;
}

.ebs-card-excerpt {
    font-size: 11.5px;
    color: #475569;
    line-height: 1.45;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ebs-card-footer {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-top: 8px;
    padding-top: 0;
    border-top: none;
}

/* Botão Verde Oficial CBM-MT (Mockup) */
.ebs-btn-details-green {
    background-color: #16a34a;
    color: #ffffff !important;
    border: none;
    border-radius: 6px;
    padding: 6px 14px;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.ebs-btn-details-green:hover {
    background-color: #15803d;
    box-shadow: 0 2px 6px rgba(22, 163, 74, 0.35);
    transform: translateY(-1px);
}

/* 5. Modal de Detalhes */
.ebs-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.ebs-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    backdrop-filter: blur(4px);
}

.ebs-modal-box {
    position: relative;
    background: #ffffff;
    border-radius: 20px;
    max-width: 600px;
    width: 100%;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    z-index: 10;
}

.ebs-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 20;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 9999px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
}

.ebs-modal-header {
    position: relative;
    height: 180px;
    background: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ebs-modal-header img {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    opacity: 0.9;
    font-size: 0;
    color: transparent;
    transition: opacity 0.3s;
}

.ebs-modal-header-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, #0f172a, transparent);
}

.ebs-modal-header-info {
    position: absolute;
    bottom: 16px;
    left: 20px;
    right: 20px;
}

.ebs-modal-badge {
    background: #A30000;
    color: #ffffff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 6px;
}

.ebs-modal-title {
    font-size: 18px;
    font-weight: 800;
    color: #ffffff;
    margin: 0;
}

.ebs-modal-body {
    padding: 20px;
}

.ebs-modal-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    padding-bottom: 12px;
    border-bottom: 1px solid #f1f5f9;
}

.ebs-modal-rating {
    color: #d97706;
    font-weight: 700;
}

.ebs-modal-desc-box {
    margin-top: 14px;
}

.ebs-modal-desc-box h4 {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 6px 0;
}

.ebs-modal-desc-box p {
    font-size: 13px;
    color: #475569;
    line-height: 1.5;
    margin: 0;
}

.ebs-modal-moodle-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 12px;
    margin-top: 14px;
}

.ebs-modal-moodle-box h4 {
    font-size: 12px;
    font-weight: 700;
    color: #A30000;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ebs-modal-moodle-box p {
    font-size: 11px;
    color: #475569;
    margin: 0;
}

.ebs-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #f1f5f9;
}

.ebs-modal-price-label {
    display: block;
    font-size: 11px;
    color: #94a3b8;
}

.ebs-modal-price-val {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.ebs-btn-primary {
    background: #16a34a;
    color: #ffffff !important;
    padding: 10px 22px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.ebs-btn-primary:hover {
    background: #15803d;
    transform: translateY(-1px);
}

/* ==========================================================================
   Rodapé Oficial CBM-MT (Governo do Estado de Mato Grosso)
   ========================================================================== */
.cbmmt-site-footer {
    background-color: #A30000;
    color: #ffffff;
    padding: 44px 24px 36px;
    margin-top: auto;
    font-family: inherit;
    width: 100%;
    flex-shrink: 0;
}

.cbmmt-footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-start;
    gap: 32px;
}

.cbmmt-footer-main {
    flex: 1;
    min-width: 280px;
    max-width: 720px;
}

h2.cbmmt-footer-title,
.cbmmt-footer-title {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 10px 0;
    letter-spacing: normal;
    line-height: 1.45;
}

.cbmmt-footer-unit {
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 16px;
}

.cbmmt-footer-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    font-size: 14px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
}

.cbmmt-footer-item {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cbmmt-footer-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: rgba(255, 255, 255, 0.9);
}

.cbmmt-footer-icon svg {
    display: block;
    width: 18px;
    height: 18px;
}

.cbmmt-footer-label {
    font-weight: 600;
    color: #ffffff;
    margin-right: 4px;
}

.cbmmt-footer-val {
    color: rgba(255, 255, 255, 0.95);
}

.cbmmt-footer-link {
    color: #ffffff;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s;
}

.cbmmt-footer-link:hover {
    opacity: 0.85;
}

.cbmmt-footer-side {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
}

@media (min-width: 768px) {
    .cbmmt-footer-side {
        align-items: flex-end;
        text-align: right;
    }
}

.cbmmt-emergency-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 0, 0, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    padding: 10px 18px;
    border-radius: 12px;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, transform 0.2s;
}

.cbmmt-emergency-badge:hover {
    background: rgba(0, 0, 0, 0.35);
    transform: translateY(-1px);
    color: #ffffff !important;
}

.cbmmt-emergency-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.cbmmt-footer-copy {
    font-size: 12px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.82);
}

/* Responsividade do Header e Navegação Mobile */
@media (max-width: 768px) {
    .ebs-header-inner {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        padding: 10px 16px;
        gap: 10px;
        box-sizing: border-box;
        width: 100%;
    }

    .ebs-brand {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 115px);
        display: flex;
        align-items: center;
    }

    .ebs-brand .custom-logo,
    .ebs-logo-img {
        max-height: 44px;
        max-width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
    }

    .ebs-header-auth {
        order: 2;
        flex: 0 0 auto;
        margin-left: auto;
        display: flex;
        align-items: center;
    }

    .ebs-header-auth .ebs-btn {
        padding: 7px 15px;
        font-size: 13px;
        font-weight: 700;
        white-space: nowrap;
    }

    .ebs-header-search {
        order: 3;
        flex: 1 1 100%;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        margin-top: 2px;
        box-sizing: border-box;
    }

    .ebs-search-box {
        width: 100%;
        box-sizing: border-box;
    }

    .ebs-input-search {
        width: 100%;
        box-sizing: border-box;
        padding: 8px 14px 8px 36px;
        font-size: 13px;
    }

    .ebs-hero-banner-wrap {
        margin: 12px auto 10px;
        padding: 0 14px;
        box-sizing: border-box;
        width: 100%;
    }

    .ebs-panoramic-banner {
        border-radius: 12px;
        width: 100%;
        height: auto;
    }

    .ebs-catalog-container {
        padding: 16px 14px 36px;
        box-sizing: border-box;
    }
}

@media (max-width: 420px) {
    .ebs-header-inner {
        padding: 8px 12px;
        gap: 8px;
    }

    .ebs-brand {
        max-width: calc(100% - 100px);
    }

    .ebs-logo-img {
        max-height: 38px;
    }

    .ebs-header-auth .ebs-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .ebs-input-search {
        padding: 7px 12px 7px 32px;
        font-size: 12px;
    }

    .ebs-hero-banner-wrap {
        padding: 0 10px;
    }

    .ebs-panoramic-banner {
        border-radius: 10px;
    }

    .ebs-catalog-container {
        padding: 12px 10px 30px;
    }
}


