/* =========================================
   FOOTER VARIABLES
========================================= */

:root {
    --footer-bg: #0f1115;
    --footer-primary: #214f99;
    --footer-secondary: #5e832a;
    --footer-text: #cfcfcf;
    --footer-muted: #999999;
    --footer-white: #ffffff;
    --footer-border: rgba(255, 255, 255, 0.1);
    --footer-transition: 0.3s ease;
}

/* =========================================
   FOOTER BASE
========================================= */

.site-footer,
.site-footer *,
.site-footer *::before,
.site-footer *::after {
    box-sizing: border-box;
}

.site-footer {
    width: 100%;
    padding-top: 80px;
    color: var(--footer-white);
    background: var(--footer-bg);
}

.footer-main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.2fr;
    gap: 50px;
}

.footer-main > * {
    min-width: 0;
}

/* =========================================
   COMPANY INFORMATION
========================================= */

.footer-company img {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 90px;
    margin-bottom: 20px;
    padding: 10px;
    object-fit: contain;
    background: var(--footer-white);
    border-radius: 10px;
}

.footer-tagline {
    margin: 0 0 15px;
    color: var(--footer-secondary);
    font-size: 16px;
    font-weight: 600;
}

.footer-company p {
    margin: 0 0 16px;
    color: var(--footer-text);
    font-size: 15px;
    line-height: 1.8;
}

/* =========================================
   FOOTER HEADINGS
========================================= */

.footer-links h3,
.footer-contact h3 {
    position: relative;
    margin: 0 0 25px;
    padding-bottom: 12px;
    color: var(--footer-white);
    font-size: 21px;
    font-weight: 700;
    line-height: 1.3;
}

.footer-links h3::after,
.footer-contact h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 42px;
    height: 3px;
    background: var(--footer-secondary);
    border-radius: 10px;
}

/* =========================================
   FOOTER LINKS
========================================= */

.footer-links ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.footer-links li {
    margin: 0 0 13px;
}

.footer-links a {
    display: inline-block;
    color: var(--footer-text);
    font-size: 15px;
    line-height: 1.5;
    text-decoration: none;
    transition:
        color var(--footer-transition),
        transform var(--footer-transition);
}

.footer-links a:hover,
.footer-links a:focus-visible {
    color: var(--footer-secondary);
    transform: translateX(5px);
}

/* =========================================
   CONTACT INFORMATION
========================================= */

.footer-contact p {
    margin: 0 0 16px;
    color: var(--footer-text);
    font-size: 15px;
    line-height: 1.7;
    overflow-wrap: anywhere;
}

.footer-contact i {
    display: inline-block;
    width: 24px;
    color: var(--footer-secondary);
}

.footer-contact a {
    color: var(--footer-text);
    text-decoration: none;
    transition: color var(--footer-transition);
}

.footer-contact a:hover,
.footer-contact a:focus-visible {
    color: var(--footer-secondary);
}

/* =========================================
   SOCIAL LINKS
========================================= */

.footer-social {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-top: 25px;
}

.footer-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
    color: var(--footer-white);
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    background: var(--footer-primary);
    border: 2px solid var(--footer-primary);
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.18);
    transition:
        color var(--footer-transition),
        background var(--footer-transition),
        border-color var(--footer-transition),
        transform var(--footer-transition),
        box-shadow var(--footer-transition);
}

.footer-social a:hover,
.footer-social a:focus-visible {
    color: var(--footer-primary);
    background: var(--footer-white);
    border-color: var(--footer-white);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25);
    transform: translateY(-4px);
}

/* =========================================
   TRUST BADGES
========================================= */

.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 25px;
}

.trust-badges span {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 7px 14px;
    color: var(--footer-text);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
}

/* =========================================
   FOOTER BOTTOM
========================================= */

.footer-bottom {
    margin-top: 60px;
    padding: 25px 0;
    border-top: 1px solid var(--footer-border);
}

.footer-bottom-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.footer-bottom p {
    margin: 0;
    color: var(--footer-muted);
    font-size: 14px;
    line-height: 1.6;
}

.footer-bottom-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 10px 20px;
}

.footer-bottom-links a {
    color: var(--footer-muted);
    font-size: 14px;
    line-height: 1.5;
    text-decoration: none;
    transition: color var(--footer-transition);
}

.footer-bottom-links a:hover,
.footer-bottom-links a:focus-visible {
    color: var(--footer-secondary);
}

/* =========================================
   FLOATING ACTION BUTTONS
========================================= */

.floating-actions {
    position: fixed;
    right: 20px;
    bottom: calc(90px + env(safe-area-inset-bottom));
    z-index: 9998;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.float-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    color: #ffffff;
    font-size: 18px;
    line-height: 1;
    text-decoration: none;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition:
        color var(--footer-transition),
        transform var(--footer-transition),
        box-shadow var(--footer-transition);
}

.float-btn:hover,
.float-btn:focus-visible {
    color: #ffffff;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    transform: translateY(-4px) scale(1.08);
}

.call-btn {
    background: linear-gradient(135deg, #214f99, #3067bf);
}

.whatsapp-btn {
    background: linear-gradient(135deg, #25d366, #1fa851);
    animation: whatsappPulse 2s infinite;
}

.email-btn {
    background: linear-gradient(135deg, #5e832a, #7fb337);
}

/* =========================================
   FLOAT BUTTON TOOLTIP
========================================= */

.float-btn::before {
    content: attr(data-title);
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    padding: 8px 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    pointer-events: none;
    background: #111111;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transform: translate(8px, -50%);
    transition:
        opacity var(--footer-transition),
        visibility var(--footer-transition),
        transform var(--footer-transition);
}

.float-btn::after {
    content: "";
    position: absolute;
    top: 50%;
    right: calc(100% + 5px);
    pointer-events: none;
    border-width: 6px 0 6px 7px;
    border-style: solid;
    border-color: transparent transparent transparent #111111;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-50%);
    transition:
        opacity var(--footer-transition),
        visibility var(--footer-transition);
}

.float-btn:hover::before,
.float-btn:focus-visible::before,
.float-btn:hover::after,
.float-btn:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

.float-btn:hover::before,
.float-btn:focus-visible::before {
    transform: translate(0, -50%);
}

/* =========================================
   WHATSAPP PULSE
========================================= */

@keyframes whatsappPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.5);
    }

    70% {
        box-shadow: 0 0 0 13px rgba(37, 211, 102, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* =========================================
   BACK TO TOP BUTTON
========================================= */

#backToTop {
    position: fixed;
    right: 20px;
    bottom: calc(25px + env(safe-area-inset-bottom));
    z-index: 9998;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    color: #ffffff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    background: linear-gradient(135deg, #214f99, #5e832a);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transition:
        transform var(--footer-transition),
        box-shadow var(--footer-transition),
        opacity var(--footer-transition),
        visibility var(--footer-transition);
}

#backToTop:hover,
#backToTop:focus-visible {
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
    transform: translateY(-4px) scale(1.08);
}

/* Optional JS visibility classes */

#backToTop.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(15px);
}

#backToTop.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

/* =========================================
   ACCESSIBILITY
========================================= */

.site-footer a:focus-visible,
.float-btn:focus-visible,
#backToTop:focus-visible {
    outline: 3px solid rgba(94, 131, 42, 0.55);
    outline-offset: 4px;
}

/* =========================================
   SMALL DESKTOP
========================================= */

@media (max-width: 1199px) {
    .footer-main {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 45px 40px;
    }
}

/* =========================================
   TABLET
========================================= */

@media (max-width: 991px) {
    .site-footer {
        padding-top: 70px;
    }

    .footer-main {
        gap: 40px 35px;
    }

    .footer-bottom {
        margin-top: 50px;
    }

    .footer-bottom-content {
        flex-direction: column;
        justify-content: center;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }
}

/* =========================================
   MOBILE
========================================= */

@media (max-width: 767px) {
    .site-footer {
        padding-top: 55px;
    }

    .footer-main {
        grid-template-columns: 1fr;
        gap: 38px;
    }

    .footer-company img {
        max-height: 78px;
    }

    .footer-links h3,
    .footer-contact h3 {
        margin-bottom: 20px;
        font-size: 20px;
    }

    .footer-bottom {
        margin-top: 45px;
        padding: 22px 0;
    }

    .footer-bottom-content {
        gap: 15px;
    }

    .floating-actions {
        right: 15px;
        bottom: calc(80px + env(safe-area-inset-bottom));
        gap: 10px;
    }

    .float-btn,
    #backToTop {
        width: 44px;
        height: 44px;
        font-size: 16px;
    }

    #backToTop {
        right: 15px;
        bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* =========================================
   TOUCH DEVICES
========================================= */

@media (hover: none) {
    .float-btn::before,
    .float-btn::after {
        display: none;
    }

    .footer-links a:hover {
        transform: none;
    }
}

/* =========================================
   SMALL MOBILE
========================================= */

@media (max-width: 575px) {
    .footer-company img {
        max-width: 210px;
        max-height: 72px;
    }

    .footer-company p,
    .footer-contact p,
    .footer-links a {
        font-size: 14px;
    }

    .footer-social a {
        width: 42px;
        height: 42px;
        font-size: 16px;
    }

    .trust-badges span {
        padding: 6px 11px;
        font-size: 12px;
    }

    .footer-bottom-links {
        flex-direction: column;
        gap: 8px;
    }
}

/* =========================================
   VERY SMALL MOBILE
========================================= */

@media (max-width: 360px) {
    .floating-actions,
    #backToTop {
        right: 10px;
    }

    .float-btn,
    #backToTop {
        width: 42px;
        height: 42px;
    }

    .footer-social {
        gap: 9px;
    }
}

/* =========================================
   REDUCED MOTION
========================================= */

@media (prefers-reduced-motion: reduce) {
    .site-footer *,
    .site-footer *::before,
    .site-footer *::after,
    .float-btn,
    #backToTop {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}