/* ============================================================
   AWA B2B — FASE 6: Conversão & SEO Hardening
   Back-to-Top | 404 Page | Lazy Loading | OG
   ============================================================ */

/* ============================================================
   1. Back-to-Top Button
   ============================================================ */
.awa-back-to-top {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 997;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color, #b73337);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background 0.2s ease;
}

.awa-back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.awa-back-to-top:hover {
    background: #8b1a1e;
    box-shadow: 0 6px 20px rgba(183, 51, 55, 0.35);
    transform: translateY(-2px);
}

.awa-back-to-top:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(183, 51, 55, 0.3);
}

/* ============================================================
   2. Lazy Loading — Native hint via CSS
   ============================================================ */
.product-image-photo,
.product-item-photo img,
.gallery-placeholder img {
    content-visibility: auto;
}

/* ============================================================
   3. Custom 404 Page
   ============================================================ */
.awa-404-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 40px 20px;
}

.awa-404-page__content {
    text-align: center;
    max-width: 520px;
}

.awa-404-page__icon {
    color: var(--primary-color, #b73337);
    margin-bottom: 20px;
}

.awa-404-page__title {
    font-family: var(--awa-font-heading, 'Lexend', sans-serif);
    font-size: 28px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 12px;
}

.awa-404-page__text {
    font-size: 15px;
    color: #64748b;
    line-height: 1.6;
    margin-bottom: 28px;
}

.awa-404-page__search {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.awa-404-page__search:focus-within {
    border-color: var(--primary-color, #b73337);
    box-shadow: 0 0 0 3px rgba(183, 51, 55, 0.1);
}

.awa-404-page__search input {
    flex: 1;
    padding: 12px 16px;
    border: none;
    font-size: 14px;
    font-family: var(--awa-font-body, 'Source Sans 3', sans-serif);
    outline: none;
}

.awa-404-page__search button {
    padding: 12px 16px;
    background: var(--primary-color, #b73337);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background 0.15s;
}

.awa-404-page__search button:hover {
    background: #8b1a1e;
}

.awa-404-page__links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
}

.awa-404-page__links a {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    text-decoration: none;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.awa-404-page__links a:hover {
    border-color: var(--primary-color, #b73337);
    color: var(--primary-color, #b73337);
    background: rgba(183, 51, 55, 0.04);
}

@media (prefers-reduced-motion: reduce) {
    .awa-back-to-top {
        transition: none;
    }
}
