/* Contenedor principal */
.sas-container {
    display: flex;
    flex-direction: row;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* Cada ítem (columna) */
.sas-item {
    position: relative;
    flex: 1 1 25%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 24px 16px;
    box-sizing: border-box;
    transition: all 0.4s ease-in-out;
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    z-index: 1;
    overflow: visible;
}

.sas-item:last-child {
    border-right: none;
}

/* Capa de fondo para el hover */
.sas-item-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    transition: background 0.4s ease-in-out;
    z-index: -1;
}

/* Contenido textual y gráfico */
.sas-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
}

/* Título */
.sas-title {
    color: #ffffff;
    font-weight: 700;
    margin: 0;
    max-height: 3em;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
}

/* Subtítulo */
.sas-subtitle {
    color: #ffffff;
    font-style: italic;
    margin: 0;
    max-height: 2.5em;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, margin 0.4s ease;
}

/* ---- Contenedor de iconos ---- */
.sas-icons {
    display: grid;
    grid-template-areas: "icon";
    justify-items: center;
    align-items: center;
    width: 100%;
    flex: 1;
    min-height: 0;
}

/* Ambas imágenes ocupan la misma celda */
.sas-icon,
.sas-icon-hover {
    grid-area: icon;
    display: block;
    object-fit: contain;
    transition: all 0.4s ease-in-out;
}

/* Normal visible, hover oculto */
.sas-icon {
    opacity: 1;
}
.sas-icon-hover {
    opacity: 0;
}

/* Colapsar textos */
.sas-item:hover .sas-title,
.sas-item:hover .sas-subtitle {
    max-height: 0;
    opacity: 0;
    margin: 0;
}

/* Intercambio de imágenes */
.sas-item:hover .sas-icon {
    opacity: 0;
}

.sas-item:hover .sas-icon-hover {
    opacity: 1;
}

/* ---- Responsive (móvil) ---- */
@media (max-width: 767px) {
    .sas-container {
        flex-direction: column;
    }

    .sas-item {
        flex: 1 1 100%;
        border-right: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.3);
        padding: 20px 16px;
    }

    .sas-item:last-child {
        border-bottom: none;
    }
}