/**
 * Footer Styling — Mobile-First with Accordion
 * Location: /var/www/saafee/public/css/footer.css
 */

.footer {
    background: #f5f5f5;
    color: #333;
    margin-top: auto;
    border-top: 1px solid #e0e0e0;
    padding: 40px 0 0;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 16px 16px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

/* ── About section ── */
.footer-about h4 {
    color: #E44335;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 8px;
}

.footer-about p {
    color: #666;
    line-height: 1.6;
    margin: 0 0 16px;
    font-size: 13px;
}

/* ── Accordion toggle (mobile) ── */
.footer-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 48px;
    padding: 12px 0;
    background: none;
    border: none;
    border-top: 1px solid #e0e0e0;
    cursor: pointer;
    color: #E44335;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    text-align: left;
}

.footer-toggle:focus-visible {
    outline: 2px solid #E44335;
    outline-offset: 2px;
    border-radius: 4px;
}

.footer-chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
    color: #999;
}

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

/* ── Collapsible panel ── */
.footer-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.footer-panel.open {
    max-height: 300px;
}

.footer-panel ul {
    list-style: none;
    padding: 0 0 8px;
    margin: 0;
}

.footer-panel ul li {
    margin-bottom: 6px;
}

.footer-panel ul li a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s ease;
    min-height: 36px;
    display: inline-flex;
    align-items: center;
}

.footer-panel ul li a:hover {
    color: #E44335;
}

/* Desktop heading — hidden on mobile */
.footer-heading-desktop {
    display: none;
    color: #E44335;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 16px;
}

/* ── Premium upsell CTA ── */
.footer-premium-cta {
    background: linear-gradient(135deg, #D4A017, #F2C94C);
    border-radius: 12px;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 16px;
}

.footer-premium-content {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.footer-premium-icon {
    font-size: 22px;
    flex-shrink: 0;
}

.footer-premium-cta p {
    margin: 0;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.footer-premium-cta a {
    display: inline-flex;
    align-items: center;
    background: #fff;
    color: #D4A017;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    transition: background 0.2s ease, transform 0.2s ease;
}

.footer-premium-cta a:hover {
    background: #fffbe6;
    transform: translateY(-1px);
}

/* ── Social section ── */
.footer-social {
    border-top: 1px solid #e0e0e0;
    padding-top: 16px;
    margin-top: 4px;
}

.footer-social h4 {
    color: #E44335;
    font-size: 15px;
    font-weight: 600;
    margin: 0 0 12px;
}

.footer-social-icons {
    display: flex;
    gap: 12px;
    padding-bottom: 8px;
}

.footer-social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    color: #666;
    background: #fff;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.footer-social-icons a:hover {
    color: #E44335;
    border-color: #E44335;
}

.footer-social-icons a svg {
    width: 18px;
    height: 18px;
}

/* ── Copyright bar ── */
.footer-bottom {
    background: #fff;
    border-top: 1px solid #e0e0e0;
    padding: 16px;
    text-align: center;
    color: #7A7A7A;
    font-size: 13px;
}

.footer-bottom p {
    margin: 0;
}

/* ── RTL support ── */
[dir="rtl"] .footer-toggle {
    flex-direction: row-reverse;
    text-align: right;
}

[dir="rtl"] .footer-social-icons {
    direction: rtl;
}

/* ── Desktop (768px+) ── */
@media (min-width: 768px) {
    .footer-container {
        grid-template-columns: 2fr 1fr 1fr 1fr;
        gap: 30px;
        padding: 0px 20px 40px;
        align-items: start;
    }

    .footer-premium-cta + .footer-about,
    .footer-premium-cta + .footer-about ~ .footer-accordion,
    .footer-premium-cta + .footer-about ~ .footer-social {
        padding-top: 10px;
    }

    .footer-about h4,
    .footer-social h4,
    .footer-heading-desktop {
        font-size: 16px;
    }

    .footer-about p {
        font-size: 14px;
        margin-bottom: 0;
    }

    /* Hide mobile accordion toggles */
    .footer-toggle {
        display: none;
    }

    /* Show desktop headings */
    .footer-heading-desktop {
        display: block;
    }

    /* Panels always open */
    .footer-panel {
        max-height: none;
        overflow: visible;
    }

    .footer-panel ul {
        padding-bottom: 0;
    }

    .footer-panel ul li a {
        min-height: 44px;
    }

    /* Accordion sections need no top border on desktop */
    .footer-accordion {
        border: none;
    }

    /* Social section no top border on desktop */
    .footer-social {
        border-top: none;
        padding-top: 0;
        margin-top: 0;
        align-self: start;
    }

    /* Premium CTA spans full width at top of grid */
    .footer-premium-cta {
        grid-column: 1 / -1;
        margin: 0 0 10px;
        padding: 20px 28px;
    }

    .footer-premium-cta p {
        font-size: 15px;
    }

    .footer-premium-cta a {
        font-size: 14px;
        padding: 10px 28px;
    }
}
