/* ===== HOME PAGE - REDISEÑO ===== */

/* --- Ocultar barra de categorias en home (desktop y mobile) --- */
body.pagina-home .navmenucont {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    visibility: hidden !important;
    overflow: hidden !important;
}

body.pagina-home .row-categorias-mobile {
    display: none !important;
}

/* --- Layout de banners: grid 70/30 --- */
.home-banners {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 12px;
    width: 95%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 4px 0 12px;
    min-height: 0;
    align-items: stretch;
}

/* Slider principal (columna izquierda) */
.banner-main {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    min-width: 0; /* Prevenir overflow en grid */
}

/* Forzar que el slider se adapte al contenedor del grid */
.banner-main .contenedor_2 {
    margin: 0 !important;
    padding: 0 !important;
}

.banner-main .corpconcept6 {
    margin: 0 !important;
    padding: 0 !important;
}

/* Ocultar div .fx que agrega altura extra */
.banner-main .fx {
    display: none !important;
}

.banner-main .owl-stage-outer {
    border-radius: 10px;
}

/* Reducir min-height del owl carousel dentro del grid */
.banner-main .owl-carousel {
    min-height: 0 !important;
}

/* CLAVE: Altura del banner principal */
.banner-main .rel {
    padding-bottom: 35% !important;
}

/* Nav buttons mas compactos dentro del grid */
.banner-main .owl-nav button {
    width: 40px !important;
    height: 40px !important;
    font-size: 16px !important;
}

.banner-main .owl-prev {
    left: 15px !important;
}

.banner-main .owl-next {
    right: 15px !important;
}

.banner-main .owl-dots {
    bottom: 10px !important;
    gap: 8px !important;
}

.banner-main .owl-dot {
    width: 10px !important;
    height: 10px !important;
}

/* Columna derecha: 2 banners apilados */
.banner-side {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

/* Cada banner lateral ocupa la mitad de la altura */
.banner-side-item {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #0f2389 0%, #1a3ab5 50%, #3498db 100%);
    min-height: 0;
}

.banner-side-item a {
    position: absolute;
    inset: 0;
    display: block;
}

.banner-side-item img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.4s ease;
}

.banner-side-item:hover img {
    transform: scale(1.05);
}

.banner-side-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    transition: background 0.3s ease;
}

.banner-side-item:hover .banner-side-overlay {
    background: rgba(0, 0, 0, 0.45);
}

.banner-side-overlay i {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.banner-side-overlay span {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Placeholder cuando no hay imagen */
.banner-side-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #0f2389 0%, #1a3ab5 50%, #3498db 100%);
    color: white;
    text-decoration: none;
    padding: 20px;
    text-align: center;
    transition: opacity 0.2s ease;
}

.banner-side-placeholder:hover {
    opacity: 0.9;
}

.banner-side-placeholder i {
    font-size: 2rem;
    margin-bottom: 10px;
    opacity: 0.9;
}

.banner-side-placeholder span {
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

/* --- Categorias circulares --- */
.categories-circles {
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 15px 0 10px;
}

.categories-circles-title {
    display: none;
}

.categories-circles-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 0 10px;
}

.category-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    width: 150px;
    transition: transform 0.2s ease;
}

.category-item:hover {
    transform: translateY(-4px);
}

.category-icon {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #f0f4ff;
    border: 3px solid #e0e8f5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    overflow: hidden;
    padding: 6px;
}

.category-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.category-icon i {
    font-size: 2.5rem;
    color: #0f2389;
    transition: color 0.2s ease;
}

.category-item:hover .category-icon {
    border-color: #0f2389;
    box-shadow: 0 4px 15px rgba(15, 35, 137, 0.3);
}

.category-item:hover .category-icon i {
    color: #ffffff;
}

.category-label {
    font-size: 0.82rem;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
    line-height: 1.2;
    word-break: normal;
    max-width: 145px;
}

.category-item:hover .category-label {
    color: #0f2389;
}

/* --- RESPONSIVE --- */

/* Tablet grande */
@media (max-width: 1200px) {
    .home-banners {
        gap: 10px;
    }

    .banner-main .rel {
        padding-bottom: 34% !important;
    }

    .category-icon {
        width: 100px;
        height: 100px;
        padding: 6px;
    }

    .category-icon i {
        font-size: 2rem;
    }

    .category-item {
        width: 130px;
    }

    .category-label {
        font-size: 0.78rem;
        font-weight: 700;
    }
}

/* Tablet */
@media (max-width: 992px) {
    .home-banners {
        grid-template-columns: 1fr;
        gap: 10px;
        width: 100%;
        padding: 10px;
    }

    .banner-main .rel {
        padding-bottom: 40% !important;
    }

    /* Banners laterales en fila horizontal en tablet */
    .banner-side {
        flex-direction: row;
    }

    .banner-side-item {
        height: 150px;
    }

    .categories-circles {
        width: 100%;
        padding: 15px 10px 10px;
    }

    .categories-circles-grid {
        gap: 10px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Home no tiene fila de categorías, quitar padding-bottom extra del header */
    body.pagina-home .header-principal {
        padding-bottom: 0 !important;
    }

    .home-banners {
        grid-template-columns: 1fr;
        gap: 4px;
        padding: 0 2px;
        width: 100%;
    }

    .banner-main .rel {
        padding-bottom: 50% !important;
    }

    .banner-main .owl-stage-outer {
        border-radius: 8px;
    }

    /* Banners laterales apilados en movil */
    .banner-side {
        flex-direction: column;
    }

    .banner-side-item {
        height: 120px;
        border-radius: 8px;
    }

    /* Categorias: grid 4x2 en mobile - todas visibles */
    .categories-circles {
        padding: 10px 8px 8px;
        width: 100%;
    }

    .categories-circles-grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 10px 6px;
        padding: 0 4px;
        justify-items: center;
    }

    .category-item {
        width: auto;
        min-width: 0;
    }

    .category-icon {
        width: 80px;
        height: 80px;
        padding: 10px;
        margin-bottom: 6px;
    }

    .category-icon i {
        font-size: 1.8rem;
    }

    .category-label {
        font-size: 0.68rem;
        font-weight: 700;
        max-width: 80px;
        line-height: 1.15;
    }
}

@media (max-width: 576px) {
    .banner-side-item {
        height: 100px;
    }

    .category-icon {
        width: 70px;
        height: 70px;
        padding: 8px;
    }

    .category-icon i {
        font-size: 1.5rem;
    }

    .category-label {
        font-size: 0.62rem;
        max-width: 70px;
    }
}
