/* Tooca Loja 2026-07-20 V3: otimização sem alterar o layout original. */
.card.product img,
.category-top-item img,
.hero-product-card img,
.featured-category-card img,
.card.cat img {
    background: #fff;
}

.card.product > img {
    aspect-ratio: 1 / 1;
    object-fit: contain;
}

.product-card-description {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 3.9em;
}

/* Aviso de atualização sempre dentro e centralizado no card. */
.product-freshness {
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    margin: 5px auto 12px;
    padding: 7px 10px;
    border-radius: 999px;
    font-size: .74rem;
    font-weight: 800;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
}

.product-freshness.fresh { background: #dcfce7; color: #166534; }
.product-freshness.attention { background: #fef3c7; color: #92400e; }
.product-freshness.unknown { background: #f1f5f9; color: #475569; }

.load-more-wrap {
    display: flex;
    justify-content: center;
    margin: 24px 0 8px;
}

.load-more-btn {
    min-width: 220px;
    border: 0;
    border-radius: 14px;
    padding: 12px 17px;
    background: #111827;
    color: #fff;
    font-weight: 900;
    cursor: pointer;
}

.load-more-count {
    display: block;
    margin-top: 4px;
    font-size: .72rem;
    opacity: .72;
}

.hero-performance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.mobile-campaign-link { display: none; }

.initial-loader {
    min-height: 55vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 32px;
    color: #334155;
    text-align: center;
}

.initial-loader small { color: #64748b; }

.initial-loader-spinner {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 4px solid #e2e8f0;
    border-top-color: #10b981;
    animation: tooca-spin .8s linear infinite;
}

@keyframes tooca-spin { to { transform: rotate(360deg); } }

/* CTA móvel fixo apenas na página individual do produto. */
.mobile-product-cta { display: none; }

/* Painel administrativo visível no desktop. */
@media (min-width: 769px) {
    .header nav .admin-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        white-space: nowrap;
        padding: 8px 13px;
        font-size: .82rem;
        box-shadow: 0 5px 14px rgba(124, 58, 237, .20);
    }
}

@media (max-width: 768px) {
    /* Topo móvel como o layout original, agora com a seta de voltar. */
    .header {
        grid-template-columns: auto minmax(0, 1fr) auto !important;
    }

    .header .mobile-back {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        min-width: 42px;
        padding: 0;
        border: 1px solid #dbe3ef;
        border-radius: 12px;
        background: #f8fafc;
        color: #111827;
        font-size: 1.35rem;
        line-height: 1;
        position: relative;
        z-index: 1203;
    }

    /* A campanha continua disponível dentro do menu para não apertar o topo. */
    .header-campaign-btn { display: none !important; }
    .mobile-campaign-link { display: flex !important; }

    .header nav .admin-btn {
        display: flex !important;
        width: 100%;
        justify-content: center;
        margin-top: 5px;
        padding: 12px 14px;
    }

    .product-card-description {
        -webkit-line-clamp: 2;
        min-height: 2.7em;
    }

    .product-freshness {
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* O botão do grupo nunca mais vira somente o ícone de fogo. */
    .whatsapp-float,
    .whatsapp-float.is-compact {
        width: auto !important;
        height: auto !important;
        min-width: 0 !important;
        max-width: calc(100vw - 24px) !important;
        padding: 11px 14px !important;
        border-radius: 999px !important;
        overflow: visible !important;
        font-size: .82rem !important;
        white-space: nowrap;
    }

    .whatsapp-float.is-compact::before { content: none !important; }

    .grid.products { gap: 18px !important; }

    .mobile-product-cta {
        position: fixed;
        left: 10px;
        right: 10px;
        bottom: calc(8px + env(safe-area-inset-bottom, 0px));
        z-index: 9800;
        display: grid;
        grid-template-columns: minmax(0, .8fr) minmax(150px, 1.2fr);
        align-items: center;
        gap: 10px;
        padding: 10px;
        border: 1px solid rgba(15, 23, 42, .12);
        border-radius: 18px;
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 18px 45px rgba(15, 23, 42, .22);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
    }

    .mobile-product-cta-price {
        min-width: 0;
        padding-left: 4px;
    }

    .mobile-product-cta-price small,
    .mobile-product-cta-price strong { display: block; }

    .mobile-product-cta-price small {
        color: #64748b;
        font-size: .68rem;
        font-weight: 800;
        text-transform: uppercase;
    }

    .mobile-product-cta-price strong {
        overflow: hidden;
        color: #111827;
        font-size: 1.05rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .mobile-product-cta button {
        width: 100%;
        min-height: 48px;
        border: 1px solid #e5d200;
        border-radius: 13px;
        background: #fff159;
        color: #111827;
        font-size: .95rem;
        font-weight: 950;
        cursor: pointer;
    }

    body.product-route .whatsapp-float { display: none !important; }
    body.product-route .footer { padding-bottom: 112px; }
}
