/* Shared KuBeyond header / footer brand logos
 * Header + footer use premium-logo.svg (tight crop 1006×260).
 * Favicon / PWA icons live in assets/logo/ (ico, svg, png pack).
 */

/* —— Header: optically ~+25% vs menu (~16–18px) —— */
header .header-brand-logo,
header .logo .header-brand-logo,
header a.logo .header-brand-logo,
header .logo-container .header-brand-logo {
    height: 32px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    object-position: left center;
    border: 0;
    vertical-align: middle;
}

@media (min-width: 769px) {
    header .header-brand-logo,
    header .logo .header-brand-logo,
    header a.logo .header-brand-logo,
    header .logo-container .header-brand-logo {
        /* premium crop is tight — 40px reads larger than menu without dominating */
        height: 40px !important;
    }
}

@media (max-width: 480px) {
    header .header-brand-logo,
    header .logo .header-brand-logo,
    header a.logo .header-brand-logo,
    header .logo-container .header-brand-logo {
        height: 30px !important;
    }
}

/* Keep logo on the same horizontal axis as menu / controls */
header .logo,
header nav .logo,
header .header-inner .logo,
header a.logo,
header .logo .logo-container,
header .logo .logo-container a,
header a.logo {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
}

header .logo .logo-container a,
header a.logo {
    text-decoration: none;
    line-height: 0;
}

header .logo .logo-text,
header a.logo .logo-text,
header .logo-container .logo-text {
    margin: 0 !important;
}

/* Icon-only class kept for rare icon uses (not wordmark) */
header .header-brand-icon,
header .logo .header-brand-icon,
header a.logo .header-brand-icon,
header .logo-container .header-brand-icon {
    width: 32px !important;
    height: 32px !important;
    display: block !important;
    flex-shrink: 0 !important;
    margin: 0 11px 0 0 !important;
    padding: 0 !important;
    object-fit: contain;
    border: 0;
}

body.rtl-language header .header-brand-icon,
html[dir="rtl"] header .header-brand-icon,
body.rtl-language header .logo .header-brand-icon,
html[dir="rtl"] header .logo .header-brand-icon {
    margin: 0 0 0 11px !important;
}

/* Auth / payment modal brand mark */
.unified-modal-logo img.header-brand-logo,
.unified-modal-logo .header-brand-logo,
.unified-modal-logo > img {
    height: 44px;
    width: auto;
    max-width: min(260px, 70vw);
    display: block;
    margin: 0 auto;
    object-fit: contain;
}

/* —— Footer: logo + copyright grouped on the left (not near Контакти) —— */
footer.site-footer .footer-main {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 8px 12px !important;
    flex: 0 1 auto !important;
    width: auto !important;
    max-width: 100%;
}

footer.site-footer .footer-brand-logo {
    /* premium-logo tight crop — ~+15–20% over copyright (~13px → ~18–22px) */
    height: 18px !important;
    width: auto !important;
    max-width: none !important;
    max-height: none !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
    object-fit: contain;
    object-position: left center;
    border: 0;
    flex: 0 0 auto !important;
    align-self: center !important;
    vertical-align: middle;
}

footer.site-footer .footer-main > p[data-lang-key="copyright"],
footer.site-footer .footer-main > p,
footer.site-footer .footer-bottom .footer-main > p {
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1.2 !important;
    align-self: center !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: none !important;
    text-align: left !important;
    white-space: nowrap;
}

footer.site-footer .footer-main > .footer-toggle {
    margin-left: auto !important;
    align-self: center !important;
    flex: 0 0 auto !important;
}

@media (min-width: 769px) {
    footer.site-footer .footer-main {
        justify-content: flex-start !important;
        flex: 0 1 auto !important;
        width: auto !important;
    }

    footer.site-footer .footer-brand-logo {
        height: 20px !important;
    }
}

@media (max-width: 480px) {
    footer.site-footer .footer-brand-logo {
        height: 16px !important;
    }

    footer.site-footer .footer-main > p[data-lang-key="copyright"],
    footer.site-footer .footer-main > p {
        white-space: normal;
    }
}

/* Light + dark theme footer — keep original SVG colors (no invert blob) */
body.light-theme footer.site-footer .footer-brand-logo,
body:not(.light-theme) footer.site-footer .footer-brand-logo {
    filter: none;
    opacity: 1;
}

body.rtl-language footer.site-footer .footer-brand-logo,
html[dir="rtl"] footer.site-footer .footer-brand-logo {
    margin: 0 !important;
}

body.rtl-language footer.site-footer .footer-main > .footer-toggle,
html[dir="rtl"] footer.site-footer .footer-main > .footer-toggle {
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Brand (logo) → first menu item spacing */
@media (min-width: 769px) {
    header nav > ul.desktop-only {
        margin-left: 28px !important;
    }

    header .header-inner > .logo + nav {
        margin-left: 28px !important;
    }

    body.rtl-language header nav > ul.desktop-only,
    html[dir="rtl"] header nav > ul.desktop-only {
        margin-left: 0 !important;
        margin-right: 28px !important;
    }

    body.rtl-language header .header-inner > .logo + nav,
    html[dir="rtl"] header .header-inner > .logo + nav {
        margin-left: 0 !important;
        margin-right: 28px !important;
    }
}
