@layer components {
    /* Back to Top Button */
    .btn-back-to-top {
        position: fixed;
        bottom: 30px;
        right: 30px;
        z-index: 99;
        border-radius: 50%;
        width: 45px;
        height: 45px;
        display: flex;
        align-items: center;
        justify-content: center;
        box-shadow: 0 4px 6px rgba(0,0,0,0.15);
        transition: opacity 0.2s ease-in-out, transform 0.2s ease-in-out;
    }
    .btn-back-to-top:hover { transform: scale(1.1); }
    html.acessibilidade-alto-contraste .btn-back-to-top {
        outline: 2px solid #ffff00;
        background-color: #000000 !important;
        color: #ffffff !important;
    }

    /* Search Button */
    .header-search-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 44px;
        width: 44px;
        border-radius: 50%;
        border: 1px solid #eaeaea;
        background-color: #ffffff;
        color: var(--tenant-primary, #444);
        font-size: 1.15rem;
        text-decoration: none;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        cursor: pointer;
    }
    .header-search-btn:hover {
        background-color: var(--tenant-primary, #1075ad);
        color: #ffffff !important;
        border-color: var(--tenant-primary, #1075ad);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(29, 78, 216, 0.25);
    }
    .header-search-btn:focus, .js-portal-search-input:focus {
        outline: 3px solid var(--tenant-accent, #fbbf24);
        outline-offset: 2px;
        border-color: var(--tenant-primary, #1075ad);
    }
    .header-search-btn[aria-expanded="true"] {
        background-color: var(--tenant-primary, #1075ad);
        color: #ffffff !important;
    }
    .js-portal-search-input::placeholder { color: #bbb; }

    /* Search Dropdown */
    .search-dropdown-menu {
        display: none;
        position: absolute;
        right: 0;
        top: 120%;
        background: #fff;
        padding: 15px;
        border-radius: 8px;
        z-index: 1050;
        min-width: 320px;
        border: 1px solid #f0f0f0;
    }

    /* Footer Grid */
    .footer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.5rem;
    }
    .footer-grid-item { display: flex; flex-direction: column; }
    @supports (grid-template-rows: subgrid) {
        .footer-grid { grid-template-rows: auto auto; }
        .footer-grid > .footer-grid-item { display: grid; grid-row: span 2; grid-template-rows: subgrid; }
    }

    /* Main Section */
    .main-header-content h1 { margin-top: 0; }
    .prose { color: #333; line-height: 1.6; }
    .prose h1, .prose h2, .prose h3 { margin-top: 1.5rem; margin-bottom: 1rem; color: #111; }
    .prose p { margin-bottom: 1.25rem; }

    /* Pagination */
    .pagination .page-item.active .page-link { background-color: var(--tenant-primary) !important; border-color: var(--tenant-primary) !important; color: #fff !important; }
    .pagination .page-link { color: var(--tenant-primary); }
    .pagination .page-link:hover { color: #fff; background-color: var(--tenant-primary); border-color: var(--tenant-primary); }
    .pagination .page-item.active .page-link:hover { color: #fff; }

    /* Footer */
    .footer-cms-badge { user-select: none; color: #888; }
    .footer-cms-badge .font-family-mono { font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.65rem; }
    .footer-maxima-link { color: #aaa; text-decoration: none; border-bottom: 1px solid transparent; transition: color 0.2s ease, border-color 0.2s ease; }
    .footer-maxima-link:hover, .footer-maxima-link:focus { color: #fff; border-color: #666; }
    html.acessibilidade-alto-contraste .footer-maxima-link { color: #ffdd00 !important; border-color: #ffdd00 !important; }
    .text-light-hover:hover { color: #ffffff !important; }

    /* Global Banner */
    .js-global-banner-link:hover .js-global-banner-img { transform: scale(1.01); }
    .js-global-banner-link:focus { outline: 3px solid var(--tenant-accent, #fbbf24); box-shadow: 0 0 0 3px var(--tenant-accent, #fbbf24); }
    @media (prefers-reduced-motion: reduce) {
        .js-global-banner-img { transition: none !important; }
        .js-global-banner-link:hover .js-global-banner-img { transform: none !important; }
    }

    /* Hover Shadow for Search */
    .hover-shadow { transition: transform 0.2s ease, box-shadow 0.2s ease; }
    .hover-shadow:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08) !important; }
    .hover-text-primary:hover { color: var(--tenant-primary) !important; }

    /* Logo Group */
    .group:hover .bg-primary { background-color: var(--tenant-secondary) !important; }
    .group:hover .text-dark { color: var(--tenant-primary) !important; }
    html.acessibilidade-alto-contraste .js-logo-normal { display: none !important; }
    html.acessibilidade-alto-contraste .js-logo-contraste { display: block !important; }
}
