.aeb-frontend-cal {
    margin: 32px 0;
    font-family: inherit;
    font-size: 14px;
}

/* Cabecera */
.aeb-fe-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 14px;
}

.aeb-fe-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

/* Leyenda */
.aeb-fe-legend {
    display: flex;
    gap: 16px;
    align-items: center;
}

.aeb-fe-leg {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: #555;
}

.aeb-fe-leg::before {
    content: '';
    display: inline-block;
    width: 13px;
    height: 13px;
    border-radius: 3px;
    flex-shrink: 0;
}

.aeb-fe-leg-avail::before { background: #27ae60; }
.aeb-fe-leg-occup::before { background: #e74c3c; }

/* Navegacion */
.aeb-fe-nav {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
}

.aeb-fe-btn {
    padding: 7px 16px;
    background: #f2f2f2;
    border: 1px solid #ccc;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
    font-family: inherit;
}

.aeb-fe-btn:hover {
    background: #e5e5e5;
}

/* Contenedor de meses en fila */
.aeb-fe-months {
    display: flex;
    gap: 28px;
    flex-wrap: wrap;
}

.aeb-fe-month {
    flex: 1;
    min-width: 240px;
    max-width: 340px;
}

.aeb-fe-month-name {
    text-align: center;
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 10px;
    color: #222;
}

/* Grilla */
.aeb-fe-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 3px;
}

.aeb-fe-cell {
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-size: 13px;
    line-height: 1;
}

.aeb-fe-dayname {
    font-size: 11px;
    font-weight: 700;
    color: #999;
    aspect-ratio: auto;
    height: 22px;
}

.aeb-fe-empty {
    background: transparent;
}

.aeb-fe-neutral {
    background: #f2f2f2;
    color: #aaa;
}

.aeb-fe-past {
    background: #ebebeb;
    color: #ccc;
}

.aeb-fe-available {
    background: #27ae60;
    color: #fff;
    font-weight: 600;
}

.aeb-fe-occupied {
    background: #e74c3c;
    color: #fff;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 560px) {
    .aeb-fe-months {
        flex-direction: column;
    }
    .aeb-fe-month {
        max-width: 100%;
    }
    .aeb-fe-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Margen inferior para no pisar footer sticky/fixed */
.aeb-frontend-cal {
    margin-bottom: 40px !important;
}

/* Un solo mes: ancho máximo razonable */
.aeb-fe-month {
    max-width: 100%;
}

/* En mobile: celdas un poco más pequeñas para que entre todo */
@media (max-width: 400px) {
    .aeb-fe-cell {
        font-size: 11px;
        border-radius: 3px;
    }
    .aeb-fe-dayname {
        font-size: 10px;
    }
}

/* Refuerzo anti-solapamiento con footer:
   asegura que el calendario y su contenedor tengan separacion
   real del contenido siguiente, incluso si el footer usa
   position relative/absolute o margenes negativos. */
.aeb-frontend-cal {
    position: relative;
    z-index: 2;
    clear: both;
    overflow: visible;
    padding-bottom: 50px;
}

/* En mobile, separacion extra por seguridad */
@media (max-width: 600px) {
    .aeb-frontend-cal {
        padding-bottom: 70px;
        margin-bottom: 0 !important;
    }
}
