/* Altahany Safe Performance + Layout Stabilizer */
html {
    scroll-behavior: smooth;
}

body {
    overflow-x: hidden;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* Prevent oversized images/logos/icons from breaking layout */
img,
svg,
video {
    max-width: 100%;
}

header img,
footer img,
.at-live-header img,
.at-live-footer img,
.site-header img,
.site-footer img {
    max-height: 72px;
    width: auto;
    object-fit: contain;
}

header .logo img,
footer .logo img,
.logo img,
.brand img,
[class*="logo"] img {
    max-width: 170px;
    max-height: 82px;
    object-fit: contain;
}

/* Social icons consistent sizing */
.social img,
.social svg,
[class*="social"] img,
[class*="social"] svg,
a[href*="instagram"] img,
a[href*="tiktok"] img,
a[href*="facebook"] img,
a[href*="wa.me"] img {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
    object-fit: contain !important;
    vertical-align: middle;
}

/* Stable sections */
section,
.container-x,
[class*="container"] {
    max-width: 100%;
}

.card,
[class*="card"] {
    overflow-wrap: anywhere;
}

/* Better image rendering without layout jumps */
img[loading="lazy"] {
    content-visibility: auto;
}

img:not([width]):not([height]) {
    aspect-ratio: auto;
}

/* Gallery image safety */
.gallery img,
[class*="gallery"] img,
[class*="media"] img,
figure img {
    background: #fff4de;
}

/* Buttons unified */
a[class*="btn"],
button[class*="btn"],
.btn-gold,
.btn-wa {
    font-family: Arial, Tahoma, sans-serif;
    font-weight: 900;
}

/* Keep floating buttons apart */
.btn-wa,
a[href*="wa.me"].fixed {
    z-index: 60 !important;
}

.at-fav-mini-link {
    z-index: 70 !important;
}

/* Avoid old noisy bottom/floating nav covering content if it exists */
body > .bottom-nav,
body > .mobile-bottom-nav,
body > .floating-bottom-menu,
body > [class*="bottom"][class*="nav"] {
    max-width: calc(100% - 24px);
}

/* Mobile comfort */
@media (max-width: 720px) {
    header img,
    footer img,
    .at-live-header img,
    .at-live-footer img,
    .site-header img,
    .site-footer img {
        max-height: 56px;
    }

    header .logo img,
    footer .logo img,
    .logo img,
    .brand img,
    [class*="logo"] img {
        max-width: 138px;
        max-height: 60px;
    }

    body {
        padding-bottom: env(safe-area-inset-bottom);
    }
}
