.produto-card {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: all 0.25s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.produto-card:hover {
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
    transform: translateY(-4px);
}

.produto-img-container {
    position: relative;
    background-color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 10px;
    width: 100%;
    height: auto;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.produto-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
}

.produto-info {
    text-align: center;
    padding: 10px 12px 16px;
}

.produto-nome {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    min-height: 38px;
    margin-bottom: 6px;
}

.btn-add-cart {
    margin: 12px auto 0;
    background-color: var(--cor-principal);
    /* Ex: amarelo */
    color: #000;
    border: none;
    border-radius: 10px;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
}

.produto-card:hover .btn-add-cart {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.btn-add-cart:hover {
    background-color: #000;
    color: var(--cor-principal);
    transform: scale(1.05);
}

.btn-add-cart i {
    color: inherit;
    font-size: 1.6rem;
    line-height: 0;
}


.produto-desconto {
    position: absolute;
    top: 10px;
    left: 10px;
    background-color: var(--cor-principal);
    ;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 4px 8px;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
    z-index: 2;
}

/* --- Botão de favorito (coração) --- */
.btn-favorito {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 2;
}

/* Ícone do coração */
.btn-favorito i {
    color: #d32f2f;
    font-size: 1.2rem;
    line-height: 0;
}

/* Efeito hover no botão de favorito */
.btn-favorito:hover {
    background-color: #ffe4e4;
    transform: scale(1.1);
}

/* Produto já está na lista de desejos */
.btn-favorito.ativo {
    background-color: #d32f2f;
}

.btn-favorito.ativo i {
    color: #fff;
}

.btn-favorito.ativo:hover {
    background-color: #b71c1c;
    transform: scale(1.1);
}

/* --- PREÇOS --- */
.produto-precos {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.preco-atual {
    color: var(--cor-preco);
    font-weight: 700;
    font-size: 1.1rem;
}

.preco-promocional {
    color: var(--cor-preco);
    font-size: 1.1rem;
}

.preco-antigo {
    text-decoration: line-through;
    color: #888;
    font-size: 0.9rem;
    opacity: 0.8;
}

.preco-desconto-badge {
    position: absolute;
    top: 15px;
    left: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background-color: #ffe58f;
    color: #000;
    padding: 4px 12px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}

@media (max-width: 1024px) {
    .produto-card {
        flex-direction: row !important;
        align-items: center;
        padding: 8px;
        min-height: 120px;
        gap: 12px;
    }

    .produto-img-container {
        width: 100px !important;
        height: 100px !important;
        min-width: 100px;
        padding: 0;
        aspect-ratio: unset;
    }

    .produto-img {
        width: 100% !important;
        height: 100% !important;
        object-fit: contain !important;
    }

    .produto-info {
        flex: 1;
        text-align: left;
        padding: 0;
    }

    .produto-nome {
        font-size: 0.85rem;
        min-height: auto;
        margin-bottom: 4px;
        line-height: 1.2;
    }

    .produto-precos {
        justify-content: flex-start;
        margin-bottom: 0;
    }

    .preco-atual {
        font-size: 1rem;
    }

    .preco-antigo {
        font-size: 0.8rem;
    }

    .btn-add-cart {
        position: absolute;
        bottom: 8px;
        right: 8px;
        opacity: 1 !important;
        transform: none !important;
        pointer-events: auto !important;
        width: 42px;
        height: 42px;
        font-size: 1.2rem;
        margin: 0;
    }

    .btn-favorito {
        width: 30px;
        height: 30px;
        top: 5px;
        right: 5px;
    }

    .btn-favorito i {
        font-size: 1rem;
    }

    .preco-desconto-badge {
        top: 5px;
        left: 5px;
        padding: 2px 8px;
        font-size: 0.7rem;
    }
}

/* Novo: Forçar layout mobile via classe injetada pelo PHP (DeviceHelper) */
.device-mobile .produto-card {
    flex-direction: row !important;
    align-items: center;
    padding: 8px;
    min-height: 120px;
    gap: 12px;
}

.device-mobile .produto-img-container {
    width: 100px !important;
    height: 100px !important;
    min-width: 100px;
    padding: 0;
    aspect-ratio: unset;
}

.device-mobile .produto-info {
    flex: 1;
    text-align: left;
    padding: 0;
}

.device-mobile .produto-nome {
    font-size: 0.85rem;
    min-height: auto;
    margin-bottom: 4px;
    line-height: 1.2;
}

.device-mobile .produto-precos {
    justify-content: flex-start;
    margin-bottom: 0;
}

.device-mobile .btn-add-cart {
    position: absolute;
    bottom: 8px;
    right: 8px;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto !important;
    width: 42px;
    height: 42px;
}

.device-mobile .btn-favorito {
    width: 30px;
    height: 30px;
    top: 5px;
    right: 5px;
}

.device-mobile .preco-desconto-badge {
    top: 5px;
    left: 5px;
    padding: 2px 8px;
    font-size: 0.7rem;
}

/* Estilos para produtos esgotados */
.produto-card.esgotado {
    opacity: 0.8;
    cursor: default;
}

.produto-card.esgotado .produto-img {
    filter: grayscale(0.5);
}

.btn-esgotado-placeholder {
    margin: 12px auto 0;
    background-color: #f8285a;
    color: #fff;
    border: none;
    border-radius: 8px;
    width: 100%;
    max-width: 120px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

@media (max-width: 767.98px) {
    .btn-esgotado-placeholder {
        position: absolute;
        bottom: 8px;
        right: 8px;
        width: 80px;
        height: 32px;
        margin: 0;
    }
}