/* ──────────────────────────────────────────────────────────────────────── */
/* FOOTER MODERN - Design moderne avec grille et glow effect */
/* ──────────────────────────────────────────────────────────────────────── */

:root {
    --spacing-xs: 0.375rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
}

/* ─ S'assure que le footer passe sous les modales du panier ─ */ 
#sfait-footer {
    z-index: 0;
}

/* ─ Container général ─ */
#sfait-footer.footer-modern {
    position: relative;
    overflow: hidden;
    border-top: 1px solid var(--sfait-border);
    background-color: var(--sfait-bg-white);
}

/* ─ Arrière-plan avec grille ─ */
.footer-bg-grid {
    pointer-events: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
            linear-gradient(
                    rgba(255, 255, 255, 0.02) 1px,
                    transparent 1px
            ),
            linear-gradient(
                    90deg,
                    rgba(255, 255, 255, 0.02) 1px,
                    transparent 1px
            );
    background-size: 60px 60px;
    opacity: 0.5;
}

/* ─ Glow effect ─ */
.footer-glow {
    pointer-events: none;
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    width: 600px;
    height: 256px;
    background: radial-gradient(
            ellipse at center,
            rgba(6, 182, 212, 0.08) 0%,
            transparent 70%
    );
    filter: blur(100px);
}

/* ─ Contenu relatif ─ */
.footer-content {
    position: relative;
    z-index: 10;
    margin: 0 auto;
    max-width: 1700px;
    padding: 0 24px;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* SECTION HAUTE */
/* ──────────────────────────────────────────────────────────────────────── */

.footer-top-section {
    display: grid;
    grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.55fr);
    gap: clamp(2rem, 4vw, 4rem);
    padding: var(--spacing-2xl) 0;

    @media (max-width: 1024px) {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
}

/* ─ Colonne Brand ─ */
.footer-brand-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
    max-width: 350px;

    @media (max-width: 1024px) {
        max-width: 100%;
    }
}

.footer-logo-link {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    text-decoration: none;
    transition: opacity 200ms ease;

    &:hover {
        opacity: 0.8;
    }
}

.footer-logo {
    height: 36px;
    width: auto;
    object-fit: contain;
    display: block;
}

.footer-description {
    font-size: 0.875rem;
    line-height: 1.625;
    color: var(--color-text);
    margin: 0;
    font-weight: 400;
}

.footer-description .highlight {
    font-weight: 500;
}

.footer-audience-switch {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: min(100%, 290px);
    padding: 3px;
    border: 1px solid var(--sfait-border);
    border-radius: 6px;
    background: var(--background-box);
}

.footer-audience-switch a,
.footer-audience-switch span {
    display: flex;
    min-height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    color: var(--color-text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
}

.footer-audience-switch a:hover {
    color: var(--color-accent);
}

.footer-audience-switch [aria-current="page"] {
    background: var(--background-button);
    color: #ffffff;
}

/* ─ Réseaux sociaux ─ */
.footer-socials {
    display: flex;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.social-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 1px solid var(--sfait-border);
    background-color: transparent;
    color: var(--color-text);
    border-radius: 0.5rem;
    text-decoration: none;
    transition: all 200ms ease;
    font-size: 1rem;

    &:hover {
        border-color: rgba(6, 182, 212, 0.4);
        background-color: rgba(6, 182, 212, 0.08);
        color: var(--background-button);
    }
}

/* ─ Colonnes de navigation ─ */
.footer-nav-sections {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(1.5rem, 3vw, 4rem);
    min-width: 0;

    @media (max-width: 1024px) {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--spacing-lg);
    }

    @media (max-width: 640px) {
        grid-template-columns: 1fr;
    }
}

.footer-column {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    min-width: 0;
}

.footer-column-title {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: var(--sfait-text);
    margin: 0;
    line-height: 1.3;
}

/* ─ Icône chevron toggle (mobile) ─ */
.footer-toggle-icon {
    display: none;
    font-size: 0.875rem;
    color: var(--color-text-dim);
    transition: transform 300ms ease;
    flex-shrink: 0;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* ACCORDÉON MOBILE (≤ 640px) */
/* ──────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .footer-column-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        cursor: pointer;
        padding: 0.625rem 0;
        border-bottom: 1px solid var(--color-border);
        margin-bottom: 0;
        user-select: none;
        -webkit-user-select: none;
    }

    .footer-toggle-icon {
        display: inline-flex;
    }

    .footer-column-toggle + .footer-links {
        max-height: 0;
        overflow: hidden;
        transition: max-height 300ms ease, opacity 300ms ease, padding 300ms ease;
        opacity: 0;
        padding-top: 0;
    }

    .footer-column.footer-column-open .footer-column-toggle + .footer-links {
        max-height: 500px;
        opacity: 1;
        padding-top: 0.75rem;
    }

    .footer-column.footer-column-open .footer-toggle-icon {
        transform: rotate(180deg);
    }

    .footer-column {
        gap: 0;
    }
}

/* ─ Liens du footer ─ */
.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.footer-links li {
    margin: 0;
    padding: 0;
}

.footer-links a {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--color-text);
    text-decoration: none;
    transition: color 200ms ease;
    white-space: normal;
    overflow-wrap: anywhere;

    i {
        font-size: 0.75rem;
        opacity: 0.7;
        transition: opacity 200ms ease;
    }

    &:hover {
        color: var(--color-accent);

        i {
            opacity: 1;
        }
    }
}

/* ──────────────────────────────────────────────────────────────────────── */
/* SECTION BASSE */
/* ──────────────────────────────────────────────────────────────────────── */

.footer-bottom-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    border-top: 1px solid rgba(39, 39, 42, 0.6);
    padding: var(--spacing-lg) 0;

    @media (max-width: 640px) {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-sm);
    }
}

.footer-bottom-left,
.footer-bottom-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

.footer-bottom-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.4rem 0;
    margin-right: 4.5rem;
    font-size: 0.75rem;
}

.footer-bottom-links a {
    color: var(--color-text-dim);
    text-decoration: none;
    transition: color 200ms ease;
}

.footer-bottom-links a:hover {
    color: var(--color-accent);
}

.footer-bottom-links a + a::before {
    content: "·";
    margin: 0 0.55rem;
    color: var(--color-text-dim);
    opacity: 0.55;
}

.footer-bottom-left i {
    font-size: 0.875rem;
    color: var(--background-button);
    opacity: 0.7;
}

.footer-bottom-right i {
    color: var(--background-button);
    font-size: 0.75rem;
    margin: 0 0.25rem;
}

.footer-info {
    display: inline;
    margin-left: 0.5rem;
    opacity: 0.7;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* BACK TO TOP BUTTON */
/* ──────────────────────────────────────────────────────────────────────── */

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 100;
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: var(--color-accent);
    color: var(--color-bg-dark);
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 200ms ease;
    box-shadow: 0 4px 16px rgba(6, 182, 212, 0.3);

    &:hover {
        background-color: var(--color-accent-light);
        transform: translateY(-2px);
        box-shadow: 0 6px 20px rgba(6, 182, 212, 0.4);
    }

    i {
        font-size: 1.25rem;
    }

    &.show {
        display: flex;
    }

    @media (max-width: 640px) {
        bottom: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;

        i {
            font-size: 1rem;
        }
    }
}

/* ──────────────────────────────────────────────────────────────────────── */
/* RESPONSIVE ADJUSTMENTS */
/* ──────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
    :root {
        --spacing-xl: 1.5rem;
        --spacing-2xl: 2rem;
    }

    .footer-content {
        padding: 0 16px;
    }

    .footer-top-section {
        gap: var(--spacing-xl);
    }
}

@media (max-width: 1180px) {
    .footer-top-section {
        grid-template-columns: 1fr;
    }

    .footer-brand-column {
        max-width: 100%;
    }
}

@media (max-width: 900px) {
    .footer-top-section {
        padding: var(--spacing-xl) 0;
    }

    .footer-nav-sections {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--spacing-lg) var(--spacing-xl);
    }
}

@media (max-width: 640px) {
    .footer-nav-sections {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 900px) and (max-width: 1280px) {
    .footer-content {
        padding: 0 24px;
    }

    .footer-top-section {
        grid-template-columns: minmax(220px, 0.55fr) minmax(0, 1.45fr);
        gap: clamp(1.5rem, 3vw, 3rem);
        padding: var(--spacing-xl) 0;
    }

    .footer-brand-column {
        max-width: 260px;
        gap: var(--spacing-md);
    }

    .footer-nav-sections {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: clamp(1rem, 2.1vw, 2rem);
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-links a {
        font-size: 0.82rem;
    }
}

@media (max-width: 480px) {
    .footer-bottom-section {
        flex-direction: column;
        text-align: center;
    }

    .footer-socials {
        justify-content: center;
    }

    .footer-links {
        gap: 0.5rem;
    }

    .footer-bottom-links {
        justify-content: center;
        margin-right: 0;
    }
}

/* ──────────────────────────────────────────────────────────────────────── */
/* ANIMATIONS */
/* ──────────────────────────────────────────────────────────────────────── */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#sfait-footer {
    animation: fadeInUp 600ms ease-out;
}

/* ──────────────────────────────────────────────────────────────────────── */
/* SELECTION & MISC */
/* ──────────────────────────────────────────────────────────────────────── */

#sfait-footer {
    user-select: none;
    -webkit-user-select: none;

    a {
        user-select: auto;
        -webkit-user-select: auto;
    }
}
