/* Conteúdo Final para: static/pedidos_farma_rocha_core/css/product_card_v2.css */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;900&display=swap');

.product-card {
    font-family: 'Roboto', sans-serif;
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.product-card.out-of-stock {
    filter: grayscale(90%);
    opacity: 0.8;
}

.product-card.out-of-stock::after {
    content: 'Produto Esgotado';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(255, 255, 255, 0.8);
    color: #333;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 8px;
    z-index: 10;
    text-align: center;
    font-size: 1.1rem;
}

.product-image-container {
    position: relative;
    padding: 16px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 1 / 1;
}

.product-image-container img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Base para todos os selos posicionados */
.badge {
    position: absolute;
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    z-index: 5;
}

/* NOVO: Container para selos no canto superior direito */
.top-right-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px; /* Espaço entre os selos "G" e "Oferta" */
    z-index: 6;
}

/* NOVO: Selo para Medicamento Genérico ("G") */
.badge-generic {
    position: relative; /* Para que não precise ser absoluto dentro do flex container */
    background-color: #FFEB3B; /* Amarelo Canário */
    color: #212529; /* Texto preto para contraste */
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem; /* Letra G maior */
    font-weight: 900;
    border: 2px solid rgba(0, 0, 0, 0.1);
}

/* Selo "OFERTA" */
.badge-offer {
    position: relative; /* Não precisa mais de posicionamento absoluto */
    background-color: #e74c3c;
    animation: blink-animation 1.5s infinite;
}

/* Selo de Economia (continua no mesmo lugar) */
.badge-savings {
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: #3498db;
    white-space: nowrap;
}

/* Selo de Desconto % - ALTERADO para canto superior esquerdo */
.badge-discount {
    top: 10px;
    left: 10px; /* Movido da direita para a esquerda */
    background-color: #f39c12;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 13px;
}

@keyframes blink-animation {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.7; transform: scale(1.05); }
}

/* RESTANTE DO CÓDIGO (sem alterações) */
.product-info { padding: 0 16px 16px 16px; display: flex; flex-direction: column; flex-grow: 1; }
.product-title { font-size: 15px; font-weight: 500; color: #2c3e50; margin: 0; height: 38px; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }
.product-lab { font-size: 13px; color: #7f8c8d; font-weight: 400; margin: 4px 0 0 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.product-rating { display: flex; align-items: center; gap: 6px; margin-top: 8px; }
.product-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; }
.product-price { display: flex; flex-direction: column; align-items: flex-start; }
.product-price--current { color: #00529e; font-size: 26px; font-weight: 700; line-height: 1; }
.product-price--old { text-decoration: line-through; color: #95a5a6; font-size: 14px; margin-top: 2px; }
.product-action { position: relative; width: 120px; height: 48px; }
.buy-button, .quantity-control { position: absolute; right: 0; top: 0; transition: opacity 0.3s ease, transform 0.3s ease; }
.quantity-control { opacity: 0; transform: translateY(10px); pointer-events: none; }
.product-action.quantity-mode-active .buy-button { opacity: 0; transform: translateY(10px); pointer-events: none; }
.product-action.quantity-mode-active .quantity-control { opacity: 1; transform: translateY(0); pointer-events: auto; }
.buy-button { background-color: #007d43; color: #ffffff; border: none; border-radius: 50%; width: 48px; height: 48px; display: flex; justify-content: center; align-items: center; cursor: pointer; }
.buy-button svg { width: 24px; height: 24px; fill: white; }
.quantity-control { display: flex; justify-content: space-between; align-items: center; border: 2px solid #e0e0e0; border-radius: 24px; padding: 4px; width: 120px; box-sizing: border-box; background-color: #fff; }
.quantity-control button { background-color: #f4f4f4; color: #00529e; font-size: 18px; font-weight: 700; border: none; border-radius: 50%; cursor: pointer; width: 32px; height: 32px; line-height: 1; }
.quantity-value { font-size: 18px; font-weight: 700; color: #333; }

/* =================================================================== */
/* AJUSTES FINOS PARA VISUALIZAÇÃO EM MOBILE (NOVO)                    */
/* Estas regras só aplicam em telas com largura máxima de 576px.       */
/* =================================================================== */
/* =================================================================== */
/* AJUSTES FINOS PARA VISUALIZAÇÃO EM MOBILE (VERSÃO FINAL)            */
/* Estas regras só aplicam em telas com largura máxima de 576px.       */
/* =================================================================== */
@media (max-width: 576px) {

    /* 1. Diminui o tamanho dos selos (badges) */
    .badge-discount, .badge-generic {
        width: 32px;
        height: 32px;
        font-size: 12px;
        border-width: 1px;
    }
    .badge-generic {
        font-size: 1.2rem;
    }
    .badge-offer {
        padding: 2px 6px;
        font-size: 10px;
    }
    .top-right-badges {
        gap: 5px;
    }

    /* 2. Ajusta as fontes para melhor legibilidade */
    .product-title {
        font-size: 14px;
        height: 34px;
    }
    .product-lab {
        font-size: 12px;
    }
    .product-price--current {
        font-size: 22px;
    }
    .product-price--old {
        font-size: 13px;
    }

    /* 3. Reorganiza e compacta a área de preço e botão */
    .product-bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    .product-price {
        text-align: center;
        align-items: center;
    }
    .product-action {
        width: 100%;
        height: auto; /* NOVO: Altura se ajusta ao conteúdo */
    }
    .buy-button, .quantity-control {
        position: relative;
    }
    
    /* NOVO: Diminui o tamanho da "cestinha" e do seletor */
    .buy-button {
        width: 100%;
        height: 36px; /* Altura do botão diminuída */
        border-radius: 18px;
    }
    .buy-button svg {
        width: 18px; /* Ícone da cesta menor */
        height: 18px;
    }
    .quantity-control {
        padding: 2px; /* Seletor mais compacto */
        border-width: 1px;
    }
    .quantity-control button {
        width: 30px; /* Botões +/- menores */
        height: 30px;
        font-size: 16px;
    }
    .quantity-value {
        font-size: 16px; /* Número da quantidade menor */
    }
}