/* TrucksBuses — modern site footer (CommonFooter.ascx) */
.tb-footer {
    --tb-footer-red: #d81416;
    --tb-footer-text: #12263a;
    --tb-footer-muted: #6b7280;
    --tb-footer-border: #eceef1;
    background: #ffffff;
    color: #4b5563;
    font-size: 14px;
    line-height: 1.55;
}

.tb-footer a {
    color: #4b5563;
    text-decoration: none;
    transition: color .2s ease;
}

.tb-footer a:hover,
.tb-footer a:focus {
    color: var(--tb-footer-red);
}

.tb-footer-main {
    padding: 48px 0 32px;
    border-bottom: 1px solid var(--tb-footer-border);
    background: #ffffff;
}

.tb-footer-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
    gap: 28px 24px;
}

.tb-footer-brand .tb-footer-logo {
    display: inline-block;
    margin-bottom: 16px;
}

/* Override legacy site-footer / footer-image rules */
footer.tb-footer,
footer.tb-footer p,
footer.tb-footer h4,
footer.tb-footer .widget_services ul li a {
    color: inherit;
}

footer.tb-footer.footer-image .footer-top,
footer.tb-footer.footer-image .footer-bottom {
    background: transparent;
    padding: 0;
    border: none;
}

footer.tb-footer.footer-image h4 {
    color: var(--tb-footer-text);
}

.tb-footer-brand .tb-footer-logo img {
    max-width: 200px;
    height: auto;
    display: block;
}

.tb-footer-tagline {
    margin: 0 0 20px;
    color: var(--tb-footer-muted);
    max-width: 280px;
}

.tb-footer-contact {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tb-footer-contact-item {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--tb-footer-text);
    font-weight: 500;
}

.tb-footer-contact-item i {
    width: 18px;
    color: var(--tb-footer-red);
    text-align: center;
}

.tb-footer-heading {
    margin: 0 0 14px;
    font-size: 15px;
    font-weight: 700;
    color: var(--tb-footer-text);
    letter-spacing: .02em;
}

.tb-footer-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.tb-footer-nav li {
    margin: 0 0 8px;
    padding: 0;
    border: none;
}

.tb-footer-nav li::before {
    display: none !important;
}

.tb-footer-nav a {
    color: var(--tb-footer-muted);
    font-size: 13px;
}

.tb-footer-nav a:hover {
    color: var(--tb-footer-red);
}

.tb-footer-app-badge {
    display: inline-block;
    margin-bottom: 18px;
    transition: opacity .2s ease;
}

.tb-footer-app-badge:hover {
    opacity: .88;
}

.tb-footer-app-badge img {
    max-width: 148px;
    height: auto;
    display: block;
}

.tb-footer-social {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 18px;
}

.tb-footer-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: #f3f4f6;
    border: 1px solid var(--tb-footer-border);
    color: #4b5563;
    font-size: 15px;
}

.tb-footer-social a:hover {
    background: var(--tb-footer-red);
    border-color: var(--tb-footer-red);
    color: #fff;
}

.tb-footer-whatsapp {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 10px;
    color: var(--tb-footer-text);
    transition: background .2s ease, border-color .2s ease;
}

.tb-footer-whatsapp:hover {
    background: #dcfce7;
    border-color: #86efac;
    color: var(--tb-footer-text);
}

.tb-footer-whatsapp img {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
}

.tb-footer-whatsapp-text {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
}

.tb-footer-whatsapp-text span {
    display: block;
    font-size: 11px;
    font-weight: 400;
    color: #16a34a;
    margin-top: 2px;
}

.tb-footer-bottom {
    padding: 20px 0;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
    background: #f8f9fb;
    border-top: 1px solid var(--tb-footer-border);
}

.tb-footer-bottom-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
}

.tb-footer-copy {
    margin: 0;
    font-size: 13px;
    color: var(--tb-footer-muted);
}

.tb-footer-copy strong {
    color: var(--tb-footer-text);
    font-weight: 600;
}

.tb-footer-legal {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.tb-footer-legal a {
    font-size: 13px;
    color: var(--tb-footer-muted);
}

.tb-footer-legal a:hover {
    color: var(--tb-footer-red);
}

/* Accordion toggle — desktop hidden */
.tb-footer-toggle {
    display: none;
    appearance: none;
    border: 0;
    background: transparent;
    padding: 0;
    margin: 0;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font: inherit;
    color: inherit;
}

.tb-footer-toggle:focus {
    outline: none;
}

.tb-footer-toggle:focus-visible {
    outline: 2px solid var(--tb-footer-red);
    outline-offset: 2px;
    border-radius: 4px;
}

.tb-footer-panel {
    display: block;
}

/* Override legacy footer-image rules inside new footer */
.tb-footer.footer-image .footer-top,
.tb-footer .widget_services ul li {
    border: none;
    padding: 0;
}

@media (max-width: 1199px) {
    .tb-footer-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .tb-footer-brand {
        grid-column: 1 / -1;
    }

    .tb-footer-app-col {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: start;
    }
}

@media (max-width: 991px) {
    .tb-footer-main {
        padding: 36px 0 24px;
    }

    .tb-footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 20px 16px;
    }

    .tb-footer-app-col {
        grid-column: 1 / -1;
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 767px) {
    .tb-footer-main {
        padding: 28px 0 8px;
    }

    .tb-footer-grid {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .tb-footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        padding: 0 0 20px;
        margin-bottom: 4px;
        border-bottom: 1px solid var(--tb-footer-border);
    }

    .tb-footer-brand .tb-footer-logo {
        margin-left: auto;
        margin-right: auto;
    }

    .tb-footer-brand .tb-footer-logo img {
        max-width: 160px;
    }

    .tb-footer-tagline {
        max-width: 320px;
        margin: 0 auto 16px;
        font-size: 13px;
        line-height: 1.5;
    }

    .tb-footer-contact {
        align-items: stretch;
        max-width: 320px;
        margin: 0 auto;
        gap: 8px;
    }

    .tb-footer-contact-item {
        justify-content: center;
        min-height: 44px;
        padding: 10px 14px;
        background: #f8f9fb;
        border: 1px solid var(--tb-footer-border);
        border-radius: 10px;
        font-size: 14px;
    }

    /* Accordion columns */
    .tb-footer-col {
        grid-column: 1 / -1;
        padding: 0;
        border-bottom: 1px solid var(--tb-footer-border);
    }

    .tb-footer-col .tb-footer-heading {
        display: none;
    }

    .tb-footer-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        min-height: 48px;
        padding: 12px 2px;
        font-size: 15px;
        font-weight: 700;
        color: var(--tb-footer-text);
    }

    .tb-footer-toggle::after {
        content: "";
        width: 8px;
        height: 8px;
        flex-shrink: 0;
        border-right: 2px solid #9ca3af;
        border-bottom: 2px solid #9ca3af;
        transform: rotate(45deg);
        margin-top: -4px;
        transition: transform .2s ease;
    }

    .tb-footer-col.is-open .tb-footer-toggle::after {
        transform: rotate(-135deg);
        margin-top: 4px;
        border-color: var(--tb-footer-red);
    }

    .tb-footer-panel {
        display: none;
        padding: 0 0 12px;
    }

    .tb-footer-col.is-open .tb-footer-panel {
        display: block;
    }

    .tb-footer-nav li {
        margin: 0;
    }

    .tb-footer-nav a {
        display: block;
        padding: 11px 4px;
        font-size: 14px;
        color: #4b5563;
        border-top: 1px solid #f3f4f6;
        min-height: 44px;
        line-height: 22px;
    }

    .tb-footer-nav a:active {
        background: #f9fafb;
        color: var(--tb-footer-red);
    }

    /* App / social / WhatsApp — always visible */
    .tb-footer-app-col {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 0 8px;
        border-bottom: none;
        text-align: center;
    }

    .tb-footer-app-col .tb-footer-heading {
        display: block;
        margin-bottom: 12px;
        font-size: 14px;
    }

    .tb-footer-app-col .tb-footer-toggle {
        display: none;
    }

    .tb-footer-app-col .tb-footer-panel {
        display: block !important;
        padding: 0;
    }

    .tb-footer-app-badge {
        margin-left: auto;
        margin-right: auto;
        margin-bottom: 14px;
    }

    .tb-footer-app-badge img {
        max-width: 160px;
    }

    .tb-footer-social {
        justify-content: center;
        gap: 10px;
        margin-bottom: 0;
    }

    .tb-footer-social a {
        width: 44px;
        height: 44px;
        font-size: 18px;
        border-radius: 10px;
    }

    .tb-footer-whatsapp {
        max-width: 340px;
        margin: 0 auto;
        min-height: 56px;
        padding: 12px 16px;
        text-align: left;
    }

    .tb-footer-bottom {
        padding: 18px 0;
        padding-bottom: max(18px, env(safe-area-inset-bottom));
    }

    .tb-footer-bottom-inner {
        flex-direction: column;
        text-align: center;
        gap: 14px;
    }

    .tb-footer-copy {
        font-size: 12px;
        line-height: 1.5;
        padding: 0 8px;
    }

    .tb-footer-legal {
        justify-content: center;
        gap: 8px 0;
        width: 100%;
    }

    .tb-footer-legal a {
        flex: 1 1 40%;
        min-width: 120px;
        padding: 10px 8px;
        font-size: 13px;
        font-weight: 500;
        background: #fff;
        border: 1px solid var(--tb-footer-border);
        border-radius: 8px;
        margin: 0 4px;
        text-align: center;
    }
}
