/* ============================================
   GOALLOGIC PROFESSIONAL FOOTER
============================================ */

/* Main Footer Container */
.site-footer {
    /* Hardcoded dark mode palette for consistency across themes */
    --surface-card: #0f172a;
    --bg-primary: #0f172a;
    --bg-secondary: rgba(255, 255, 255, 0.05);
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);

    background: #0f172a;
    color: var(--text-primary);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    border-top: 3px solid var(--accent-green, #22c55e);
    margin-top: 60px;
    position: relative;
    overflow-x: clip;
    overflow-y: visible;
    transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

/* Compact footer for narrow phones */
@media (max-width: 380px) {
    .site-footer {
        margin-top: 24px;
        overflow: hidden;
    }

    .footer-inner {
        width: calc(100% - 20px);
        padding: 20px 0 12px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-logo {
        max-width: 148px;
    }

    .footer-tagline,
    .footer-links a,
    .footer-contact li,
    .newsletter-text {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    .footer-column h4 {
        margin-bottom: 8px;
        font-size: 0.82rem;
    }

    .footer-links,
    .footer-contact {
        gap: 7px;
    }

    .social-icons {
        gap: 8px;
    }

    .social-icon {
        width: 34px;
        height: 34px;
    }

    .newsletter-input-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .newsletter-input,
    .newsletter-button {
        min-width: 0;
        box-sizing: border-box;
    }

    .newsletter-button {
        padding-inline: 11px;
    }

    .trust-badges {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .trust-badges .badge {
        width: auto;
        max-width: 100%;
        padding: 7px 10px;
        font-size: 0.69rem;
    }

    .footer-bottom {
        gap: 10px;
        padding-top: 14px;
        font-size: 0.68rem;
        text-align: left;
    }

    .payment-icons {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-green, #22c55e), transparent);
}

/* Footer Inner Container */
.footer-inner {
    width: min(1265px, calc(100% - 32px));
    max-width: 100%;
    margin: 0 auto;
    padding: clamp(32px, 4vw, 50px) 0 30px;
    box-sizing: border-box;
}

/* Footer Grid Layout */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: clamp(20px, 3vw, 40px);
    margin-bottom: 40px;
}

/* Footer Sections */
.footer-section h3 {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent-green, #22c55e);
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--accent-yellow, #facc15);
}

/* Footer Links */
.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary, #475569);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-links a:hover {
    color: var(--accent-green, #22c55e);
    transform: translateX(5px);
}

.footer-links a i {
    font-size: 12px;
    opacity: 0.7;
}

/* Brand Section */
.footer-brand {
    max-width: 100%;
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 20px;
}

.footer-logo img {
    width: 52px;
    height: 52px;
    object-fit: contain;
    filter: brightness(1.1);
    transform: scale(2.7);
    transform-origin: left center;
}

.footer-logo-dark {
    display: none;
}

.dark-mode .footer-logo-light {
    display: none;
}

.dark-mode .footer-logo-dark {
    display: block;
}

.footer-logo-text {
    margin-left: -9px;
    font-size: clamp(20px, 2vw, 24px);
    font-weight: 800;
    color: var(--text-primary, #0f172a);
    letter-spacing: -0.5px;
    transition: color 0.25s ease;
}

.footer-tagline {
    font-size: 15px;
    color: var(--text-secondary, #475569);
    line-height: 1.6;
    margin-bottom: 25px;
}

/* Social Media */
.footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

.social-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bg-secondary, #f8f9fa);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary, #475569);
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 15px;
}

.social-icon:hover {
    background: var(--accent-green, #22c55e);
    color: white;
    transform: translateY(-3px);
}

/* Contact Info */
.contact-info {
    list-style: none;
    padding: 0;
    margin: 0;
}

.contact-info li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 15px;
    color: var(--text-secondary, #475569);
    font-size: 14px;
}

.contact-info i {
    color: var(--accent-green, #22c55e);
    margin-top: 2px;
}

/* Newsletter */
.newsletter-form {
    margin-top: 20px;
}

.newsletter-form p {
    color: var(--text-secondary, #475569);
    font-size: 14px;
    margin-bottom: 15px;
}

.newsletter-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    min-width: 0;
}

.newsletter-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: var(--bg-secondary, #f8f9fa);
    color: var(--text-primary, #0f172a);
    font-size: 14px;
}

.newsletter-input:focus {
    outline: none;
    border-color: var(--accent-green, #22c55e);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1);
}

.newsletter-btn {
    flex: 0 0 auto;
    padding: 12px 24px;
    background: var(--accent-green, #22c55e);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.newsletter-btn:hover {
    background: #16a34a;
    transform: translateY(-2px);
}

.newsletter-note {
    font-size: 12px;
    color: var(--text-tertiary, #64748b);
    margin-top: 8px;
}

/* Bottom Bar */
.footer-bottom {
    border-top: 1px solid var(--border-color, #e5e7eb);
    padding-top: 25px;
    margin-top: 40px;
}

.bottom-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    min-width: 0;
}

.copyright {
    font-size: 14px;
    color: var(--text-secondary, #475569);
    min-width: 220px;
    flex: 1 1 260px;
}

.copyright a {
    color: var(--accent-green, #22c55e);
    text-decoration: none;
}

.copyright a:hover {
    text-decoration: underline;
}

.footer-legal {
    display: flex;
    flex: 2 1 420px;
    flex-wrap: wrap;
    gap: 12px 22px;
    justify-content: center;
}

.footer-legal a {
    color: var(--text-secondary, #475569);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.3s ease;
}

.footer-legal a:hover {
    color: var(--accent-green, #22c55e);
}

.payment-methods {
    display: flex;
    flex: 1 1 220px;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    justify-content: flex-end;
}

.payment-methods span {
    font-size: 12px;
    color: var(--text-secondary, #475569);
    margin-right: 10px;
}

.payment-icon {
    font-size: 20px;
    color: var(--text-tertiary, #64748b);
    opacity: 0.8;
}

/* Badges */
.trust-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 25px;
}

.badge {
    background: var(--bg-secondary, #f8f9fa);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-secondary, #475569);
    display: flex;
    align-items: center;
    gap: 8px;
}

.badge i {
    color: var(--accent-yellow, #facc15);
}

/* Removed .dark-mode .site-footer as it's now permanently dark */

@media (max-width: 1100px) {
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 768px) {
    .site-footer {
        margin-top: 34px;
        padding-bottom: calc(64px + var(--gl-mobile-nav-safe-bottom, 0px));
    }

    .footer-inner {
        width: min(100% - 24px, 1265px);
        padding: 26px 0 18px;
    }

    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px 14px;
        margin-bottom: 22px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }

    .footer-logo {
        margin-bottom: 12px;
    }

    .footer-logo img {
        width: 42px;
        height: 42px;
        transform: scale(3);
    }

    .footer-logo-text {
        margin-left: 2px;
    }

    .footer-tagline {
        margin-bottom: 14px;
        font-size: 13px;
        line-height: 1.45;
    }

    .footer-social,
    .trust-badges {
        margin-top: 14px;
        gap: 8px;
    }

    .social-icon {
        width: 34px;
        height: 34px;
    }

    .footer-section h3 {
        margin-bottom: 12px;
        padding-bottom: 7px;
        font-size: 14px;
    }

    .footer-section h3::after {
        width: 28px;
    }

    .footer-links li,
    .contact-info li {
        margin-bottom: 8px;
    }

    .footer-links a,
    .contact-info li,
    .newsletter-form p {
        font-size: 12px;
        line-height: 1.35;
    }

    .newsletter-form {
        margin-top: 12px;
    }
    
    .bottom-content {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }

    /*
     * Desktop flex-basis values become vertical reserved space once the footer
     * switches to a column. Reset them so each mobile row uses content height.
     */
    .bottom-content > .copyright,
    .bottom-content > .footer-legal,
    .bottom-content > .payment-methods {
        width: 100%;
        min-width: 0;
        flex: 0 0 auto;
    }

    .footer-bottom {
        margin-top: 22px;
        padding-top: 16px;
    }

    .copyright {
        min-width: 0;
        flex-basis: auto;
        font-size: 12px;
    }
    
    .footer-legal {
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 14px;
    }

    .footer-legal a {
        font-size: 12px;
    }

    .payment-methods {
        justify-content: center;
        gap: 8px;
    }

    .payment-methods span {
        width: 100%;
        margin: 0 0 2px;
        text-align: center;
    }
    
    .newsletter-input-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .newsletter-btn {
        width: 100%;
        padding: 10px 16px;
    }

    .newsletter-input {
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .footer-inner {
        width: min(100% - 24px, 1265px);
        padding: 24px 0 16px;
    }
    
    .footer-section h3 {
        font-size: 13px;
    }
    
    .footer-links a {
        font-size: 11.5px;
        gap: 6px;
    }

    .footer-links a i {
        font-size: 10px;
    }

    .badge {
        padding: 7px 10px;
        font-size: 11px;
    }

    .payment-methods span {
        width: 100%;
        margin-right: 0;
    }
}

/* Final narrow-mobile footer cascade */
@media (max-width: 380px) {
    .site-footer {
        margin-top: 24px;
        overflow: hidden;
    }

    .footer-inner {
        width: calc(100% - 20px);
        padding: 20px 0 12px;
    }

    .footer-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }

    .footer-brand {
        grid-column: auto;
    }

    .footer-logo {
        max-width: 148px;
    }

    .footer-tagline,
    .footer-links a,
    .contact-info li,
    .newsletter-form p {
        font-size: 0.75rem;
        line-height: 1.45;
    }

    .footer-section h3 {
        margin-bottom: 8px;
        font-size: 0.82rem;
    }

    .footer-links,
    .contact-info {
        gap: 7px;
    }

    .footer-social {
        gap: 8px;
    }

    .social-icon {
        width: 34px;
        height: 34px;
    }

    .newsletter-input-group {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 6px;
    }

    .newsletter-input,
    .newsletter-btn {
        min-width: 0;
        box-sizing: border-box;
    }

    .newsletter-btn {
        padding-inline: 11px;
    }

    .trust-badges {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .trust-badges .badge {
        width: auto;
        max-width: 100%;
        padding: 7px 10px;
        font-size: 0.69rem;
    }

    .footer-bottom,
    .bottom-content {
        gap: 10px;
        font-size: 0.68rem;
        text-align: center;
    }

    .footer-bottom {
        padding-top: 14px;
    }

    .footer-legal,
    .payment-methods {
        justify-content: center;
        flex-wrap: wrap;
    }
}
