/* ============================================================
   SICOV - FOOTER
   Archivo:
   static/css/footer.css

   Este archivo debe cargarse DESPUÉS de base.css.
   ============================================================ */

/* ============================================================
   ESTRUCTURA GENERAL
   ============================================================ */

.rto-footer {
    --footer-bg-start: #1e293b;
    --footer-bg-end: #0f172a;
    --footer-text: #cbd5e1;
    --footer-title: #ffffff;
    --footer-border: rgba(255, 255, 255, 0.16);
    --footer-link-hover: var(--rto-verde-acento, #22c55e);

    width: 100%;
    flex: 0 0 auto;
    margin-top: auto;
    padding: 20px 0 12px;
    background: linear-gradient(
        135deg,
        var(--footer-bg-start) 0%,
        var(--footer-bg-end) 100%
    );
    color: var(--footer-text);
    font-size: 12px;
    line-height: 1.45;
}

.rto-footer__grid {
    display: grid;
    grid-template-columns: repeat(
        auto-fit,
        minmax(min(100%, 240px), 1fr)
    );
    align-items: start;
    gap: 22px 32px;
}

.rto-footer__section {
    min-width: 0;
}

.rto-footer__title {
    margin: 0 0 8px;
    color: var(--footer-title);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
    letter-spacing: 0.02em;
}

.rto-footer__title--main {
    font-size: 16px;
}

.rto-footer__text {
    margin: 0 0 5px;
    color: var(--footer-text);
}

.rto-footer__text:last-child {
    margin-bottom: 0;
}


/* ============================================================
   LISTAS Y ENLACES
   ============================================================ */

.rto-footer__links {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rto-footer__links li {
    min-width: 0;
    margin: 0;
    padding: 0;
}

/*
   Los links útiles se distribuyen por filas:
   1 link:  una celda a la izquierda.
   2 links: una fila de dos columnas.
   3 links: dos arriba y uno abajo.
   4 links: dos filas de dos columnas.
   5 links: dos filas completas y uno abajo.
   6 links: tres filas de dos columnas.
*/
.rto-footer__links--useful {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 20px;
    row-gap: 7px;
}

.rto-footer__link {
    color: var(--footer-text);
    text-decoration: none;
    text-underline-offset: 3px;
    overflow-wrap: anywhere;
    transition:
        color 0.15s ease,
        text-decoration-color 0.15s ease;
}

.rto-footer__link:hover,
.rto-footer__link:focus-visible {
    color: var(--footer-link-hover);
    text-decoration: underline;
}

.rto-footer__link:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.72);
    outline-offset: 3px;
    border-radius: 2px;
}


/* ============================================================
   BLOQUE INFERIOR
   ============================================================ */

.rto-footer__bottom {
    margin-top: 4px;
    padding-top: 2px;
    text-align: center;
}

.rto-footer__bottom--separated {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--footer-border);
}

.rto-footer__legal {
    margin: 0 0 4px;
    color: var(--footer-text);
}

.rto-footer__legal:last-child {
    margin-bottom: 0;
}

.rto-footer__developer-link {
    color: #ffffff;
    font-weight: 700;
}

.rto-footer__version {
    margin: 0;
    color: var(--footer-text);
    font-size: 10.5px;
    letter-spacing: 0.02em;
    opacity: 0.78;
}


/* ============================================================
   WHATSAPP FLOTANTE
   ============================================================ */

.whatsapp-float {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 9999;
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #22c55e;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 50%;
    box-shadow: 0 7px 20px rgba(0, 0, 0, 0.30);
    color: #ffffff;
    font-size: 29px;
    line-height: 1;
    text-decoration: none;
    transition:
        transform 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}

.whatsapp-float:hover,
.whatsapp-float:focus-visible {
    background: #16a34a;
    color: #ffffff;
    text-decoration: none;
    transform: translateY(-2px) scale(1.04);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.whatsapp-float:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.85);
    outline-offset: 3px;
}


/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 991.98px) {
    .rto-footer {
        padding-top: 18px;
    }

    .rto-footer__grid {
        gap: 20px 26px;
    }
}

@media (max-width: 575.98px) {
    .rto-footer {
        padding-top: 16px;
        padding-bottom: 10px;
        font-size: 11.5px;
    }

    .rto-footer__grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .rto-footer__links--useful {
        grid-template-columns: 1fr;
        gap: 7px;
    }

    .rto-footer__bottom--separated {
        margin-top: 14px;
        padding-top: 10px;
    }

    .whatsapp-float {
        right: 12px;
        bottom: 12px;
        width: 43px;
        height: 43px;
        font-size: 27px;
    }
}


/* ============================================================
   IMPRESIÓN
   ============================================================ */

@media print {
    .rto-footer,
    .whatsapp-float {
        display: none !important;
    }
}
