/* Keep the main navigation in one row; collapse before its content would wrap. */
#agNavbar>.container-fluid{flex-wrap:wrap}
#agNavbar .navbar-brand{margin-right:18px}
@media(min-width:1400px){
    #agNavbar>.container-fluid{flex-wrap:nowrap;column-gap:12px}
    #agNavbar .navbar-brand{font-size:1.2rem;gap:8px;margin-right:8px}
    #agNavbar .navbar-collapse{min-width:0;flex-grow:1}
    #agNavbar .navbar-nav{flex-direction:row;flex-wrap:nowrap!important;column-gap:2px!important}
    #agNavbar .nav-link{font-size:.82rem!important;padding:8px 7px!important}
    #agNavbar .ag-btn-nav{font-size:.82rem;padding:10px 15px;white-space:nowrap}
    #agNavbar .ag-theme-toggle{flex-shrink:0}
}
/* The footer intentionally keeps a dark surface in both themes. */
html[data-theme] .ag-footer{background:#030712;color:#b6c2d4;--ag-text:#f8fafc;--ag-text-muted:#b6c2d4;--ag-heading:#f8fafc;--ag-accent:#38bdf8}
html[data-theme] .ag-footer .text-white{color:#f8fafc!important}
html[data-theme] .ag-footer .text-white-50{color:#b6c2d4!important}
html[data-theme] .ag-footer .ag-footer-title{color:#f8fafc}
html[data-theme] .ag-footer .ag-footer-links a{color:#b6c2d4}
html[data-theme] .ag-footer .ag-footer-links a:hover,html[data-theme] .ag-footer a.hover-white:hover{color:#fff!important}
html[data-theme] .ag-footer .btn-outline-success{color:#4ade80;border-color:#22c55e}
html[data-theme] .ag-footer .btn-outline-success:hover{background:#166534;color:#fff;border-color:#22c55e}
html[data-theme] .ag-footer .text-success{color:#4ade80!important}
html[data-theme] .ag-footer .text-info{color:#38bdf8!important}
html[data-theme] .ag-footer a:focus-visible{outline:2px solid #38bdf8;outline-offset:4px;border-radius:3px}

/* A compact top strip and readable navigation in both color themes. */
.ag-top-ticker-message { min-width:0; }
.ag-top-ticker-message .badge { flex-shrink:0; white-space:nowrap; }
#agNavbar .ag-nav-toggle-btn { display:grid; place-items:center; width:44px; height:44px; padding:0; color:var(--ag-heading); background:rgba(125,125,125,.1); border-radius:9px; }
#agNavbar .ag-nav-toggle-btn i { color:var(--ag-heading)!important; }
#agNavbar .ag-nav-toggle-btn:focus-visible { outline:2px solid var(--ag-accent); outline-offset:3px; box-shadow:none; }
@media(max-width:1399.98px) {
    .ag-top-ticker>.container-fluid { flex-wrap:nowrap!important; gap:12px!important; }
    .ag-top-ticker a { white-space:nowrap; min-height:32px; }
    #agNavbar .navbar-collapse { max-height:calc(100vh - 76px); max-height:calc(100dvh - 76px); overflow-y:auto!important; }
    #agNavbar .navbar-nav { align-items:stretch; gap:5px!important; }
    #agNavbar .nav-link { display:block; padding:10px 12px!important; }
}
@media(max-width:991.98px) {
    .ag-hero-subtitle { margin-left:auto; margin-right:auto; text-align:center; }
}
@media(max-width:575.98px) {
    .ag-top-ticker>.container-fluid { gap:6px!important; }
    .ag-top-ticker-message .badge { font-size:.57rem!important; padding:5px 6px!important; }
    .ag-top-ticker a { font-size:.65rem; }
    #agNavbar .navbar-brand { font-size:clamp(.85rem,3.7vw,1.05rem); gap:6px; margin-right:4px; }
    #agNavbar .ag-brand-icon { width:30px; height:30px; font-size:.95rem; }
    #agNavbar .ag-nav-toggle-btn,#agNavbar .ag-theme-toggle { width:38px; height:40px; min-width:38px; padding:0; }
    #agNavbar>.container-fluid>.d-flex { gap:4px!important; }
    .ag-hero .ag-pill-badge { max-width:100%; white-space:normal; font-size:.7rem; }
}

/* Floating actions stop at the beginning of the footer. */
.ag-floating-whatsapp { bottom:calc(25px + var(--ag-footer-lift,0px)); transition-property:transform,background-color,box-shadow,color; }
.ag-back-to-top { bottom:calc(85px + var(--ag-footer-lift,0px)); transition-property:transform,opacity,visibility,background-color,box-shadow,color; }
@media(max-width:767.98px) {
    .ag-floating-whatsapp { bottom:calc(20px + var(--ag-footer-lift,0px)); }
    .ag-back-to-top { bottom:calc(85px + var(--ag-footer-lift,0px)); }
}
/* Wide tablets: two comfortable columns instead of four cramped columns. */
@media(min-width:992px) and (max-width:1399.98px) {
    .ag-footer .ag-footer-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-areas:"brand contact" "navigation portals"; gap:32px 48px; margin-left:0; margin-right:0; }
    .ag-footer-columns>.ag-footer-brand-column { grid-area:brand; }
    .ag-footer-columns>.ag-footer-contact-column { grid-area:contact; }
    .ag-footer-columns>.ag-footer-navigation-column { grid-area:navigation; }
    .ag-footer-columns>.ag-footer-portals-column { grid-area:portals; }
    .ag-footer .ag-footer-columns>div { width:auto; min-width:0; padding:0; margin:0; }
    .ag-footer-brand-column p { padding-right:0!important; max-width:440px; }
    .ag-footer-contact-column p { max-width:420px; }
    .ag-footer-contact-column .btn { max-width:420px; }
    .ag-footer .ag-footer-links a { overflow-wrap:anywhere; }
}
