/* Access Grid */
.cd-widget-grid-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.cd-widget-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%; /* Equal height */
}

.cd-widget-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

.cd-widget-icon {
    margin-bottom: 15px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cd-widget-icon img {
    max-height: 100%;
    width: auto;
}

/* Dashicon styling in grid */
.cd-widget-dashicon {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--cd-primary, #005baa);
}

.cd-widget-title {
    font-size: 20px;
    margin: 0 0 10px 0;
    font-weight: 700;
    color: var(--cd-secondary, #005baa);
}

.cd-widget-desc {
    font-size: 14px;
    color: #6c757d;
    margin: 0;
    line-height: 1.4;
}

/* Banners Grid */
.cd-banners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    width: 100%;
}

.cd-banner-item {
    transition: transform 0.2s;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.cd-banner-item:hover {
    transform: translateY(-5px);
}

.cd-banner-item img {
    width: 100%;
    height: auto;
    display: block;
}

/* Slider */
.cd-widget-swiper {
    width: 100%;
    height: auto;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    max-width: 1400px; /* Max width constraint */
    margin: 0 auto;    /* Center if container is wider */
}

.cd-widget-swiper .swiper-slide img {
    width: 100%;
    height: 300px; /* Fixed height constraint */
    display: block;
    object-fit: cover; /* Maintain aspect ratio */
}

.cd-swiper-controls {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 10;
    background: rgba(0,0,0,0.5);
    border-radius: 20px;
    padding: 5px;
    display: flex;
    gap: 5px;
}

.cd-swiper-controls button {
    background: transparent;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

.cd-swiper-controls button:hover {
    background: rgba(255,255,255,0.2);
}

.cd-swiper-controls .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* MOBILE – imagem sem corte */
@media (max-width: 768px) {
    .cd-widget-swiper .swiper-slide img {
        height: auto !important;
        object-fit: contain !important; /* exibe a imagem inteira */
    }

    /* Fix para evitar rolagem horizontal em telas pequenas */
    .cd-banners-grid {
        grid-template-columns: 1fr;
        box-sizing: border-box;
    }

    .cd-widget-swiper {
        max-width: 100%;
        box-sizing: border-box;
    }
}

/* DESKTOP – mantém o visual recortado */
@media (min-width: 769px) {
    .cd-widget-swiper .swiper-slide img {
        height: 300px;
        object-fit: cover;
    }
}


/* Recent Items Widget */
.cd-widget-recentes {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.cd-recentes-header {
    background: var(--cd-primary, #005baa);
    color: #fff;
    margin: 0;
    padding: 15px 20px;
    font-size: 18px;
}

.cd-recentes-list {
    display: flex;
    flex-direction: column;
}

.cd-recentes-item {
    display: flex;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    text-decoration: none;
    color: inherit;
    align-items: center;
    transition: background 0.2s;
}

.cd-recentes-item:last-child {
    border-bottom: none;
}

.cd-recentes-item:hover {
    background: #f8f9fa;
}

.cd-recentes-icon {
    margin-right: 15px;
    color: var(--cd-secondary, #003366);
}

.cd-recentes-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.cd-recentes-meta {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.cd-recentes-title {
    font-size: 15px;
    margin: 0;
    color: #333;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 992px) {
    .cd-widget-grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .cd-widget-grid-container {
        grid-template-columns: 1fr;
    }
}
