.app-footer {
    background-color: transparent;
    margin-top: auto;
    flex-shrink: 0;
    padding: 32px 40px 24px 40px;
}

/* Masaüstü Ekranlarda Mesajlar Kutusu (Chat Dock: 320px + tampon) Güvenli Bölgesi */
@media (min-width: 992px) {
    .app-footer {
        padding-bottom: 84px;
    }
    .footer-top,
    .footer-divider,
    .footer-bottom {
        padding-right: 360px;
        box-sizing: border-box;
    }
}

.footer-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.footer-logos {
    display: flex;
    align-items: center;
    gap: 16px;
}

.footer-logos img {
    height: 22px;
    width: auto;
    object-fit: contain;
}

.payment-logo {
    height: 28px;
    width: auto;
    filter: grayscale(100%) opacity(0.5);
    transition: filter 0.3s, opacity 0.3s;
}

.payment-logo:hover {
    filter: grayscale(0%) opacity(1);
}

.footer-divider {
    height: 1px;
    background-color: var(--border);
    opacity: 0.6;
    margin-bottom: 16px;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-contact {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-muted);
}

.footer-contact i {
    margin-right: 4px;
}

.footer-links-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.footer-legal-links {
    display: flex;
    gap: 12px;
}

.footer-legal-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-legal-links a:hover {
    color: var(--brand-primary);
}

.footer-socials {
    display: flex;
    gap: 12px;
    padding-left: 20px;
    border-left: 1px solid var(--border);
}

.footer-socials a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s, transform 0.2s;
}

.footer-socials a:hover {
    color: var(--brand-primary);
    transform: translateY(-2px);
}

@media (max-width: 991px) {
    .app-footer {
        padding: 24px 20px 100px 20px;
    }
    .footer-top, .footer-bottom, .footer-divider {
        padding-right: 0 !important;
    }
    .footer-top, .footer-bottom {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 16px;
    }
    .footer-contact {
        flex-direction: column;
        gap: 8px;
    }
    .footer-links-group {
        flex-direction: column;
        gap: 12px;
    }
    .footer-socials {
        padding-left: 0;
        border-left: none;
        border-top: 1px solid var(--border);
        padding-top: 12px;
    }
}

/* --- Mobile Specific Overrides (max-width: 576px) --- */
@media (max-width: 576px) {
    .app-footer {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 32px !important;
        padding: 40px 24px 100px 24px !important;
        text-align: center !important;
        background: transparent !important;
        margin-top: 32px !important;
        border-top: 1px solid var(--border) !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* Flatten the hierarchy to freely reorder elements */
    .footer-top, 
    .footer-bottom, 
    .footer-links-group {
        display: contents !important;
    }

    /* 1. Brand (Highest Priority) */
    .footer-logos {
        order: 1 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 12px !important;
        width: 100% !important;
    }
    .footer-logos img {
        height: 22px !important;
    }
    .footer-logos span {
        display: inline-block !important; /* Restore separator */
        opacity: 0.3 !important;
    }

    /* 2. Legal Links (High Priority for Trust) */
    .footer-legal-links {
        order: 2 !important;
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        width: 100% !important;
    }
    .footer-legal-links a {
        font-size: 13px !important;
        padding: 8px 4px !important;
        color: var(--text-muted) !important;
        background: var(--card-bg) !important;
        border: 1px solid var(--border) !important;
        border-radius: 8px !important;
        text-decoration: none !important;
    }

    /* 3. Contact Information (Secondary) */
    .footer-contact {
        order: 3 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
        width: 100% !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
    }
    .footer-contact span {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
        font-size: 13px !important;
        color: var(--text-muted) !important;
    }
    .footer-contact i {
        font-size: 14px !important;
        color: var(--text-muted) !important;
        opacity: 0.8 !important;
    }
    .footer-contact span.d-none {
        display: none !important;
    }

    /* 4. Social Media (Secondary) */
    .footer-socials {
        order: 4 !important;
        display: flex !important;
        justify-content: center !important;
        gap: 16px !important;
        width: 100% !important;
        border: none !important;
        padding: 0 !important;
    }
    .footer-socials a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 40px !important;
        height: 40px !important;
        border-radius: 50% !important; /* Elegant circles */
        background: var(--input-bg) !important;
        border: none !important;
        font-size: 16px !important;
        color: var(--text-main) !important;
        box-shadow: none !important;
    }

    /* 5. Divider */
    .footer-divider {
        order: 5 !important;
        margin: 0 !important;
        width: 80% !important;
        opacity: 0.3 !important;
    }

    /* 6. Payment Badge (Bottom-most Trust Signal) */
    .footer-payment {
        order: 6 !important;
        display: flex !important;
        justify-content: center !important;
        width: 100% !important;
    }
    .payment-logo {
        height: 24px !important;
        opacity: 0.5 !important;
    }
}
