/* ==========================================================================
   iHERD - FOOTER STYLES
   ========================================================================== */

.footer {
    position: relative;
    background-color: var(--clr-secondary, #0f2537); /* Fallback dark color */
    background-size: cover;
    background-position: center;
    color: #ffffff;
    font-family: var(--font-primary, 'Montserrat', sans-serif);
    margin-top: auto;
}

.footer__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Richer gradient overlay for better readability than a flat tint */
    background: linear-gradient(135deg, rgba(15, 37, 55, 0.95) 0%, rgba(23, 111, 145, 0.85) 100%);
    z-index: 1;
}

.footer__container {
    position: relative;
    z-index: 2;
    padding: 5rem 1.5rem 2rem 1.5rem;
}

/* --- Top Row: Contact Links --- */
.footer__top {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer__contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer__contact-icon {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: var(--transition-smooth, all 0.3s ease);
}

.footer__contact-item:hover .footer__contact-icon {
    background-color: var(--clr-primary, #176f91);
    transform: scale(1.1);
}

.footer__contact-icon svg {
    width: 20px;
    height: 20px;
}

.footer__contact-text {
    display: flex;
    flex-direction: column;
}

.footer__contact-label {
    color: var(--clr-primary, #176f91);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer__contact-value {
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    transition: color 0.3s ease;
}

.footer__contact-value:hover {
    color: var(--clr-primary, #176f91);
}

/* --- Divider --- */
.footer__divider {
    border: none;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
    margin-bottom: 4rem;
}

/* --- Main Links Section --- */
.footer__main {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1.5fr;
    gap: 2rem;
    margin-bottom: 4rem;
}

.footer__logo {
    max-width: 140px;
    margin-bottom: 1.5rem;
    border-radius: 12px;
}

.footer__socials {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.footer__social-link {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth, all 0.3s ease);
}

.footer__social-link:hover {
    background-color: var(--clr-primary, #176f91);
    transform: translateY(-3px);
}

.footer__social-link svg {
    width: 16px;
    height: 16px;
}

.footer__heading {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer__heading::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--clr-primary, #176f91);
}

.footer__list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer__list li {
    margin-bottom: 0.75rem;
}

.footer__list a {
    color: #d1d5db; /* Light grey for unselected state */
    font-size: 0.95rem;
    transition: var(--transition-smooth, all 0.3s ease);
    display: inline-block;
}

.footer__list a:hover {
    color: var(--clr-primary, #176f91);
    transform: translateX(5px);
}

/* --- Bottom Section (Copyright & Button) --- */
.footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer__copyright {
    color: #9ca3af;
    font-size: 0.85rem;
}

.footer__back-to-top {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000000;
    color: #ffffff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth, all 0.3s ease);
}

.footer__back-to-top:hover {
    background-color: var(--clr-primary, #176f91);
    transform: translateY(-5px);
}

.footer__back-to-top svg {
    width: 20px;
    height: 20px;
}

/* ==========================================================================
   FLOATING WIDGETS (WHATSAPP & BACK TO TOP)
   ========================================================================== */

.floating-widgets {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
}

/* --- BACK TO TOP BUTTON --- */
.back-to-top-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--clr-primary, #176f91);
    color: #ffffff;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover {
    background-color: var(--clr-primary-hover, #125570);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(23, 111, 145, 0.4);
}

.back-to-top-btn svg {
    width: 22px;
    height: 22px;
}

/* --- WHATSAPP WIDGET --- */
.whatsapp-widget {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-end;

    /* Keep widget above all page content */
    z-index: 2147483647;
}

/* Trigger Button */
.whatsapp-widget__trigger {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background-color: #25d366;
    border: none;
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Keep button above everything */
    position: relative;
    z-index: 2147483647;
}

.whatsapp-widget__trigger:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
}

.whatsapp-widget__trigger .whatsapp-icon {
    width: 30px;
    height: 30px;
}

/* Pop-up Chat Card Box */
.whatsapp-widget__box {
    position: absolute;
    bottom: 70px;
    right: 0;
    width: 320px;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px) scale(0.95);
    transform-origin: bottom right;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Keep popup above everything */
    z-index: 2147483647;
}

.whatsapp-widget__box.is-active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

/* Header */
.whatsapp-widget__header {
    background-color: #075e54;
    color: #ffffff;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
}

.whatsapp-widget__avatar-wrapper {
    position: relative;
    width: 45px;
    height: 45px;
    flex-shrink: 0;
}

.whatsapp-widget__avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    background-color: #ffffff;
    border: 2px solid #ffffff;
}

.whatsapp-widget__badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 12px;
    height: 12px;
    background-color: #4cd964;
    border: 2px solid #075e54;
    border-radius: 50%;
}

.whatsapp-widget__info {
    display: flex;
    flex-direction: column;
}

.whatsapp-widget__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.whatsapp-widget__status {
    font-size: 0.75rem;
    opacity: 0.85;
}

.whatsapp-widget__close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.whatsapp-widget__close:hover {
    opacity: 1;
}

/* Chat Area */
.whatsapp-widget__body {
    padding: 1.25rem 1rem;
    background-color: #e5ddd5; /* Classic WhatsApp Chat BG */
    background-image: radial-gradient(rgba(0, 0, 0, 0.03) 1px, transparent 0);
    background-size: 10px 10px;
}

.whatsapp-widget__chat-bubble {
    background-color: #ffffff;
    padding: 0.85rem 1rem;
    border-radius: 0px 12px 12px 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    max-width: 85%;
    position: relative;
}

.whatsapp-widget__chat-bubble p {
    color: #303030;
    font-size: 0.875rem;
    line-height: 1.4;
    margin: 0;
}

.whatsapp-widget__time {
    display: block;
    text-align: right;
    font-size: 0.65rem;
    color: #8c8c8c;
    margin-top: 4px;
}

/* CTA Action Button */
.whatsapp-widget__action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: #25d366;
    color: #ffffff;
    text-decoration: none;
    padding: 0.85rem;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    transition: background-color 0.2s;
}

.whatsapp-widget__action-btn:hover {
    background-color: #128c7e;
}

/* Responsive Scaling for Mobile */
@media screen and (max-width: 480px) {
    .floating-widgets {
        bottom: 15px;
        right: 15px;

        /* Keep floating widget above all content */
        position: fixed;
        z-index: 2147483647;
    }

    .whatsapp-widget__box {
        width: 280px;
        right: -10px;
    }
}

/* --- Responsive Adjustments --- */
@media screen and (max-width: 992px) {
    .footer__main {
        grid-template-columns: repeat(2, 1fr);
        gap: 3rem;
    }
    .footer__col--brand {
        grid-column: 1 / -1; /* Brand spans full width on tablets */
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    .footer__heading::after {
        left: 0; /* Keep underline aligned left for links */
    }
}

@media screen and (max-width: 768px) {
    .footer__top {
        flex-direction: column;
        gap: 2rem;
    }
    .footer__main {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .footer__bottom {
        flex-direction: column-reverse;
        text-align: center;
        gap: 1.5rem;
    }
}