/**
 * Footer Mobile Layout Fix
 * Ensures proper column layout on mobile devices
 */

/* DEBUG: Simple test to verify CSS is loading */
@media (max-width: 575px) {
    .footer-one {
        border: 3px solid red !important;
        background: rgba(255, 0, 0, 0.1) !important;
    }

    .footer-one .footer-brand {
        border: 2px solid blue !important;
        background: rgba(0, 0, 255, 0.1) !important;
    }
}

/* ================================
   FOOTER ONE MOBILE LAYOUT FIX
   ================================ */

/* Base mobile footer adjustments */
@media (max-width: 767px) {
    .footer-one .row {
        display: flex;
        flex-direction: column;
    }

    /* Reorder footer sections for better mobile flow */
    .footer-one .footer-brand {
        order: 1;
        margin-bottom: 30px;
    }

    .footer-one .col-lg-4:nth-child(2) {
        order: 2;
        margin-bottom: 30px;
    }

    .footer-one .col-lg-1 {
        display: none;
    }

    .footer-one .col-lg-3 {
        order: 3;
    }
}

/* Small mobile specific adjustments */
@media (max-width: 575px) {
    /* Fix the two columns to stay on same row - HIGH SPECIFICITY */
    .footer-section .footer-one .row,
    footer .footer-one .row,
    .footer-one .row {
        display: flex !important;
        flex-direction: column !important;
    }

    /* Target the specific row containing the two columns */
    .footer-one .footer-brand + .col-lg-4 .row,
    .footer-one .col-lg-4:nth-child(2) .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        gap: 20px !important;
        flex-direction: row !important;
    }

    /* Ensure the two widget columns don't wrap - HIGH SPECIFICITY */
    .footer-one .footer-brand + .col-lg-4 .col-lg-6,
    .footer-one .col-lg-4:nth-child(2) .col-lg-6,
    .footer-one .col-lg-6.col-md-6 {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: none !important;
        width: auto !important;
        padding: 0 10px !important;
        display: block !important;
    }

    /* Remove left padding on first column for better spacing */
    .footer-one .footer-brand + .col-lg-4 .col-lg-6:first-child,
    .footer-one .col-lg-4:nth-child(2) .col-lg-6:first-child {
        padding-left: 0 !important;
    }

    /* Remove right padding on second column for better spacing */
    .footer-one .footer-brand + .col-lg-4 .col-lg-6:last-child,
    .footer-one .col-lg-4:nth-child(2) .col-lg-6:last-child {
        padding-right: 0 !important;
    }

    /* Adjust footer widget titles for better mobile display */
    .footer-one .footer-widget .title {
        font-size: 16px;
        margin-bottom: 15px;
    }

    /* Adjust list items spacing */
    .footer-one .footer-widget ul li {
        margin-bottom: 8px;
    }

    /* Footer social links mobile optimization */
    .footer-one .footer-social {
        margin-top: 20px;
    }

    .footer-one .social-link {
        margin-right: 15px;
        font-size: 14px;
    }

    /* Newsletter section mobile optimization */
    .footer-one .nletter {
        margin-top: 0;
    }

    .footer-one .newsletter-form .form-group {
        position: relative;
    }

    .footer-one .newsletter-form input[type="email"] {
        padding-right: 50px;
        height: 45px;
        font-size: 14px;
    }

    .footer-one .newsletter-form button {
        position: absolute;
        right: 5px;
        top: 50%;
        transform: translateY(-50%);
        width: 35px;
        height: 35px;
        padding: 0;
        background: var(--secondary-color, #C9302C);
        border: none;
        border-radius: 50%;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .footer-one .newsletter-form button i {
        font-size: 14px;
    }

    .footer-one .notify {
        margin-top: 15px;
        padding: 10px 15px;
        background: rgba(255, 255, 255, 0.05);
        border-radius: 8px;
        font-size: 13px;
    }

    .footer-one .notify .icon {
        margin-right: 8px;
    }
}

/* EXTRA HIGH SPECIFICITY RULES - FORCE OVERRIDE */
@media (max-width: 575px) {
    /* Force columns to stay on same row using multiple selectors */
    .footer-one .footer-brand + div[class*="col-lg-4"] .row,
    div[class*="footer-brand"] + div[class*="col-lg-4"] .row,
    .footer-one .row .row {
        display: flex !important;
        flex-wrap: nowrap !important;
        flex-direction: row !important;
        gap: 20px !important;
    }

    /* Force the individual columns */
    .footer-one .footer-brand + div[class*="col-lg-4"] div[class*="col-lg-6"],
    div[class*="footer-brand"] + div[class*="col-lg-4"] div[class*="col-lg-6"],
    .footer-one div[class*="col-lg-6"] {
        flex: 1 !important;
        min-width: 0 !important;
        max-width: 50% !important;
        width: 50% !important;
        display: block !important;
        float: none !important;
        padding: 0 10px !important;
    }

    /* Hide any elements that might interfere */
    .footer-one .col-lg-1.md-d-none {
        display: none !important;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .footer-one .footer-brand + .col-lg-4 .row,
    .footer-one .footer-brand + div[class*="col-lg-4"] .row {
        gap: 15px !important;
    }

    .footer-one .footer-widget .title {
        font-size: 15px;
    }

    .footer-one .footer-widget ul li {
        font-size: 13px;
    }

    .footer-one .social-link {
        margin-right: 12px;
        font-size: 13px;
    }

    .footer-one .newsletter-form input[type="email"] {
        height: 40px;
        font-size: 13px;
        padding-right: 45px;
    }

    .footer-one .newsletter-form button {
        width: 30px;
        height: 30px;
        right: 5px;
    }

    .footer-one .newsletter-form button i {
        font-size: 12px;
    }
}

/* Ensure footer brand section is properly styled on mobile */
@media (max-width: 767px) {
    .footer-one .footer-brand {
        text-align: center;
        padding-bottom: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        margin-bottom: 25px;
    }

    .footer-one .footer-logo {
        display: inline-block;
        margin-bottom: 15px;
    }

    .footer-one .footer-logo img {
        max-height: 50px;
        width: auto;
    }

    .footer-one .brand-header .text {
        font-size: 14px;
        line-height: 1.6;
        margin-bottom: 20px;
    }

    .footer-one .footer-social {
        justify-content: center;
        display: flex;
        gap: 15px;
    }
}