/* Card Bootstrap Dynamic - Sistema Independente */
.cbd-wrapper {
    margin: 20px 0;
}

.cbd-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.cbd-row > [class*="col-"] {
    padding: 0 15px;
    margin-bottom: 30px;
    box-sizing: border-box;
}

/* Grid System próprio */
.col-12 { width: 100%; }
.col-12.col-md-6 { width: 100%; }
.col-12.col-lg-4 { width: 100%; }
.col-12.col-lg-3 { width: 100%; }

@media (min-width: 768px) {
    .col-12.col-md-6 { width: 50%; }
}

@media (min-width: 992px) {
    .col-12.col-md-6.col-lg-4 { width: 33.333%; }
    .col-12.col-md-6.col-lg-3 { width: 25%; }
}

/* Card Styles */
.cbd-card {
    background: #fff;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.cbd-style-hover-shadow .cbd-card {
    transition: box-shadow 0.3s ease;
}

.cbd-style-hover-shadow .cbd-card:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Card Image */
.cbd-card-image {
    overflow: hidden;
    position: relative;
}

.cbd-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.cbd-style-hover-shadow .cbd-card:hover .cbd-card-image img {
    transform: scale(1.05);
}

/* Card Body */
.cbd-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.cbd-card-title {
    margin: 0 0 15px 0;
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
}

.cbd-card-description {
    margin-bottom: 20px;
    line-height: 1.6;
}

.cbd-card-description p:last-child {
    margin-bottom: 0;
}

/* Card Button */
.cbd-card-button {
    display: inline-block;
    padding: 8px 20px;
    background: #0073aa;
    color: #fff;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s ease;
    text-align: center;
    margin-top: auto;
    align-self: flex-start;
}

.cbd-card-button:hover {
    background: #005a87;
    color: #fff;
    text-decoration: none;
}

/* Modal Styles - Totalmente independente */
.cbd-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: none;
}

.cbd-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.cbd-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
}

.cbd-modal-container {
    position: relative;
    z-index: 2;
    width: 90%;
    max-width: 800px;
    animation: cbd-modal-slide 0.3s ease;
}

.cbd-modal-container.size-sm { max-width: 400px; }
.cbd-modal-container.size-lg { max-width: 900px; }
.cbd-modal-container.size-xl { max-width: 1140px; }

@keyframes cbd-modal-slide {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.cbd-modal-content {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0,0,0,0.3);
}

.cbd-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.cbd-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.cbd-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    transition: color 0.3s ease;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.cbd-modal-close:hover {
    color: #333;
}

.cbd-modal-body {
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.cbd-modal-body img {
    max-width: 100%;
    height: auto;
    margin-bottom: 20px;
}

.cbd-modal-body p:last-child {
    margin-bottom: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .cbd-card-body {
        padding: 15px;
    }
    
    .cbd-card-title {
        font-size: 1.1rem;
    }
    
    .cbd-modal-container {
        width: 95%;
    }
    
    .cbd-modal-body {
        max-height: 60vh;
    }
}
/* ═══════════════════════════════════════════════════════════════
   VIEW: BLOCKS — Cards agrupados por categoria em seções
   ═══════════════════════════════════════════════════════════════ */

.cbd-view-blocks .cbd-category-block {
    margin-bottom: 40px;
}

.cbd-category-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    margin-bottom: 20px;
    border-left: 5px solid #0073aa;
    background: #f8f9fa;
    border-radius: 0 6px 6px 0;
}

.cbd-category-dot {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cbd-category-title {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    flex: 1;
}

.cbd-category-count {
    font-size: 0.8rem;
    background: rgba(0,0,0,0.08);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    color: #555;
}

/* ═══════════════════════════════════════════════════════════════
   VIEW: ACCORDION — Categorias colapsáveis
   ═══════════════════════════════════════════════════════════════ */

.cbd-view-accordion {
    margin: 20px 0;
}

.cbd-acc-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.cbd-acc-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: #fff;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    transition: background 0.2s ease;
    border-left: 5px solid var(--acc-color, #0073aa);
}

.cbd-acc-trigger:hover {
    background: #f8f9fa;
}

.cbd-acc-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.cbd-acc-label {
    flex: 1;
}

.cbd-acc-count {
    background: rgba(0,0,0,0.08);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 20px;
    color: #555;
    min-width: 24px;
    text-align: center;
}

.cbd-acc-arrow {
    font-size: 1.4rem;
    line-height: 1;
    transition: transform 0.25s ease;
    color: #888;
    display: inline-block;
    transform: rotate(0deg);
}

.cbd-acc-item.cbd-acc-open .cbd-acc-arrow {
    transform: rotate(90deg);
}

.cbd-acc-panel {
    padding: 20px;
    border-top: 1px solid #eee;
    background: #fdfdfd;
    animation: cbd-acc-slide 0.25s ease;
}

.cbd-acc-panel[hidden] {
    display: none;
}

@keyframes cbd-acc-slide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Responsivo accordion */
@media (max-width: 768px) {
    .cbd-acc-trigger { padding: 12px 15px; font-size: 0.95rem; }
    .cbd-category-header { padding: 10px 14px; }
    .cbd-category-title { font-size: 1.1rem; }
}
