/* v2.2 atualizado em 15/06/2025 */
/* v2.1 atualizado em 15/06/2025 */
/* Atualização de acessibilidade detectável – Junho 2025 */
/* Estilos Gerais */
body {
    font-family: 'Inter', sans-serif;
    background: #f0f2f5;
    color: #333;
    margin: 0;
    padding: 20px;
    line-height: 1.6;
}

/* LÓGICA DE EXIBIÇÃO PARA DESKTOP E MOBILE */
.container.desktop-header {
    display: block;
}
.hero-banner, .social-links-compact {
    display: none;
}


/* Container Principal (Cabeçalho Desktop) */
.container.desktop-header {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-pic {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid #fff;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h1 { 
    font-size: 2.25em; 
    margin: 0; 
}
.sub-headline {
    font-size: 1.1em;
    color: #666;
    margin-top: 5px;
}

/* Links Sociais e Botões */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px 25px;
    margin: 15px 0;
}

/* CORREÇÃO: Usar 'fill' para colorir os ícones preenchidos */
.social-links .social-icon, .social-links-compact .social-icon {
    width: 28px;
    height: 28px;
    fill: #111;
    transition: fill .2s ease,transform .2s ease;
}
.social-links a:hover .social-icon, .social-links-compact a:hover .social-icon {
    fill: #D33618;
    transform: scale(1.1);
}

.coupon-button {
    font-size: 0.9em !important;
    font-weight: bold;
    color: white !important;
    background-color: #D33618;
    padding: 8px 16px;
    border-radius: 20px;
    transition: background-color 0.2s ease, transform 0.2s ease;
    text-align: center;
    line-height: 1.3;
    text-decoration: none;
    white-space: nowrap;
}
.coupon-button:hover {
    background-color: #B82E14;
    color: white !important;
}

/* Conteúdo Principal */
.main-content {
    max-width: 1200px;
    margin: 0 auto 30px auto;
    text-align: center;
    background-color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.main-content .disclaimer {
    font-size: 0.75em;
    color: #999;
    margin: -15px 0 15px 0;
}

.main-content p { font-size: 1em; margin-top: 5px; margin-bottom: 30px; color: #666; }

/* Caixa de Busca */
.search-box {
    display: flex;
    justify-content: center;
    gap: 10px;
}
#product-number {
    padding: 12px;
    font-size: 1em;
    border-radius: 8px;
    border: 1px solid #ccc;
    width: 220px;
    text-align: center;
}
#search-button {
    padding: 12px 24px;
    font-size: 1em;
    font-weight: bold;
    color: white;
    background-color: #D33618;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
#search-button:hover { background-color: #B82E14; }

/* Resultado da Busca */
#search-result-container {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 20px;
    animation: fadeIn 0.5s ease;
}
.hidden { display: none; }
.product-card-result {
    width: 280px;
    padding: 15px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.product-card-result .product-image {
    width: 100%;
    object-fit: cover;
    margin-bottom: 10px;
    aspect-ratio: 1 / 1;
}
.product-card-result .link-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    background-color: #D33618;
    color: white;
    padding: 15px;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.1em;
    transition: background-color 0.2s ease;
    text-align: center;
}
.product-card-result .link-button:hover { background-color: #B82E14; }
.error-message { color: #D8000C; font-weight: bold; width: 100%; text-align: center; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Galeria de Produtos */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1200px;
    margin: 20px auto;
    padding-bottom: 30px;
}
.gallery-item, .product-card-result {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,.08);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
    color: inherit;
}
.gallery-item:hover, .product-card-result:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,.12);
}
.gallery-image, .product-card-result .product-image {
    border-radius: 12px;
}
.gallery-image {
    width: 100%;
    height: 280px;
    object-fit: cover;
    aspect-ratio: 1 / 1;
}
.gallery-title {
    padding: 15px;
    font-weight: bold;
    text-align: center;
    font-size: 0.9em;
}

#loader {
    text-align: center;
    padding: 20px;
    font-size: 1.2em;
    color: #888;
    display: block;
    margin: 0 auto 40px auto;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: white;
    cursor: default;
}

footer {
    max-width: 1200px;
    margin: 40px auto 0 auto;
    text-align: center;
    padding: 20px;
    font-size: 0.75em;
    color: #888;
    border-top: 1px solid #e0e0e0;
}
footer p {
    margin: 5px 0;
}
footer a {
    color: #555;
    font-weight: bold;
    text-decoration: none;
}
footer a:hover {
    text-decoration: underline;
}

/* Anéis de Foco para Acessibilidade */
a:focus-visible, button:focus-visible, input:focus-visible {
    outline: 3px solid #0049CE;
    outline-offset: 3px;
}

/* REGRAS PARA TELAS MENORES (CELULARES) */
@media (max-width: 768px) {
    body { padding: 10px; }

    /* Correção do layout para esconder cabeçalho do desktop */
    .container.desktop-header { display: none; }
    .hero-banner, .social-links-compact { display: flex; }

    .hero-banner {
        align-items: center;
        background-color: white;
        padding: 15px;
        border-radius: 15px;
        margin-bottom: 15px;
        box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    }
    .hero-profile-pic {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        object-fit: cover;
        margin-right: 15px;
        border: 2px solid #fff;
    }
    .hero-text { text-align: left; }
    .hero-text h2 { font-size: 1.1em; margin: 0 0 4px 0; }
    .hero-text p { font-size: 0.8em; color: #6c757d; margin: 0; }

    .social-links-compact {
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 10px 20px;
        margin-bottom: 20px;
    }
    .social-links-compact .coupon-button { font-size: 0.8em !important; padding: 6px 12px; }
    .social-links-compact a { text-decoration: none; }
    .social-links-compact .social-icon { width: 24px; height: 24px; }
    
    .main-content {
        padding: 20px;
        border-radius: 15px;
        margin-bottom: 20px;
    }
    .main-content .search-prompt { 
        font-size: 0.85em; 
        margin-bottom: 20px;
        padding: 0 10px;
    }
    
    .search-box { flex-direction: column; align-items: center; }
    #product-number, #search-button { width: 90%; margin-bottom: 10px; }
    
    #search-result-container, .gallery-grid { 
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); 
        gap: 10px; 
        padding-bottom: 20px;
    }
    .product-card-result { width: 150px; }
    .gallery-image, .product-card-result .product-image { height: 150px; }
    footer { font-size: 0.7em; }
}
/* ===== Acessibilidade & UX Updates (Jun 2025) ===== */

/* Skip‑link (visível apenas no foco) */
.skip-link {
    position: absolute;
    left: -999px;
    top: 10px;
    background: #0049CE;
    color: #fff;
    padding: 8px 16px;
    z-index: 1000;
    border-radius: 4px;
    text-decoration: none;
}
.skip-link:focus { left: 10px; }

/* Placeholder contraste AA */
::placeholder {
    color: #595959;
    opacity: 1;
}

/* Label visível no campo de busca */
.search-label {
    font-weight: bold;
    margin-right: 8px;
    align-self: center;
}

/* Lista semântica em grade */
.gallery-grid { list-style: none; padding-left: 0; }
.gallery-grid li { list-style: none; }

/* O link ocupa 100% do item para ser clicável */
.gallery-item a {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Prefere menor movimento */
@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
    .gallery-item:hover,
    .product-card-result:hover {
        transform: none !important;
    }
}


/* ===== UX Enhancements (Jun 2025) ===== */

/* 1. Larger tap‑targets for social icons (≥ 44×44 px) */
.social-links a,
.social-links-compact a {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
}

/* Icons stay visually balanced */
.social-links .social-icon,
.social-links-compact .social-icon {
    width: 24px;
    height: 24px;
}

/* 2. Smoother hover motion using Material easing */
.gallery-item,
.product-card-result {
    transition: transform .25s cubic-bezier(.4, 0, .2, 1),
                box-shadow .25s cubic-bezier(.4, 0, .2, 1);
}

/* 3. Simple CSS spinner that can be toggled with a `.loading` class */
.loading-spinner,
#loader.loading::after {
    content: '';
    display: inline-block;
    width: 32px;
    height: 32px;
    border: 4px solid #e0e0e0;
    border-top: 4px solid #D33618;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 4. Denser mobile cards (room for 3+ columns on 390 px screens) */
@media (max-width: 768px) {
    .product-card-result,
    .gallery-item {
        padding: 10px;
    }
    .gallery-title {
        font-size: 0.8em;
    }
}


/* === Hotfix 2025‑06‑15: restore coupon button size on desktop === */
.social-links a.coupon-button,
.social-links-compact a.coupon-button,
.coupon-button {
    width: auto !important;
    height: auto !important;
    display: inline-block !important;
    padding: 8px 16px !important; /* keep comfortable tap target */
}
