/**
 * Card sections (contragents, foreigners, persons): sticky footer on short pages.
 * body flex column + growing main-container pushes footer to viewport bottom.
 * Scoped to .site-card-body — sidebar + .content flex row inside .main-container unchanged.
 */

html {
    height: 100%;
}

body.site-card-body {
    min-height: 100vh;
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

body.site-card-body > .main-container {
    flex: 1 0 auto;
    width: 100%;
}

body.site-card-body > .footer,
body.site-card-body > .site-footer {
    flex-shrink: 0;
    margin-top: auto;
}

/* footer_public.php uses .footer-inner (not .container) — match site container gutters */
body.site-card-body > .footer .footer-inner,
body.site-card-body > .site-footer .footer-inner {
    width: 100%;
    max-width: 1920px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}

@media (min-width: 1400px) {
    body.site-card-body > .footer .footer-inner,
    body.site-card-body > .site-footer .footer-inner {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (max-width: 768px) {
    body.site-card-body > .footer .footer-inner,
    body.site-card-body > .site-footer .footer-inner {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 480px) {
    body.site-card-body > .footer .footer-inner,
    body.site-card-body > .site-footer .footer-inner {
        padding-left: 6px;
        padding-right: 6px;
    }
}

body.site-card-body .main-container .content {
    min-width: 0;
    flex: 1 1 auto;
}

/* Mobile left menu: one scrollport pinned to the visual viewport (not 100vh),
   with safe-area room so last items stay reachable / tappable. */
@media (max-width: 992px) {
    body.site-card-body .sidebar {
        top: 0;
        bottom: 0;
        height: auto;
        max-height: 100vh;
        max-height: 100dvh;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        touch-action: pan-y;
        padding-top: env(safe-area-inset-top, 0px);
        padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px));
    }

    body.site-card-body .sidebar-nav {
        max-height: none;
        overflow: visible;
        -webkit-overflow-scrolling: auto;
        padding-bottom: 8px;
    }

    body.site-card-body .sidebar-nav ul {
        padding-bottom: 16px;
    }

    /* Mobile: contact «show more» toggles must not keep desktop label indent */
    body.site-card-body .contact-toggle-phones,
    body.site-card-body .contact-toggle-emails,
    body.site-card-body .contact-toggle-websites,
    body.site-card-body .contact-toggle-socials {
        margin-left: 0;
    }
}

/* Keep stacked labels from ≤992px (section CSS wrongly reset width at ≤768) */
@media (max-width: 768px) {
    body.site-card-body .info-label,
    body.site-card-body .requisites-row p.text-sm.text-gray-500 {
        width: 100%;
        max-width: 100%;
    }
}
