/* =========================================
   WooCommerce Products Grid - Elementor Widget
   Café do Mestre Edition
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Lato:wght@300;400;700&display=swap');

/* ---- WRAPPER ---- */
.wpe-products-wrapper {
    width: 100%;
    font-family: 'Lato', sans-serif;
}

/* ---- GRID ---- */
.wpe-products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ---- CARD ---- */
.wpe-product-card {
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e8ddd0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    box-shadow: 0 2px 10px rgba(44, 26, 14, 0.06);
}

.wpe-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 14px 36px rgba(44, 26, 14, 0.13);
    border-color: #b5813c;
}

/* ---- ÁREA DE IMAGEM ---- */
.wpe-product-image-wrap {
    position: relative;
    background-color: #f5ede3;
    overflow: hidden;
    /* Proporção 4:3 sem height fixo */
    aspect-ratio: 4 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wpe-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* Se a imagem for PNG/fundo transparente: object-fit contain */
.wpe-product-img[src$=".png"] {
    object-fit: contain;
    padding: 20px;
}

.wpe-product-card:hover .wpe-product-img {
    transform: scale(1.04);
}

/* ---- BADGE DE CATEGORIA (sobre a imagem) ---- */
.wpe-badge {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 7px 14px;
    font-family: 'Lato', sans-serif;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    z-index: 2;
    text-align: center;
}

.wpe-badge-sale {
    background-color: rgba(30, 17, 8, 0.82);
    color: #fff;
}

.wpe-badge-featured {
    background-color: rgba(181, 129, 60, 0.90);
    color: #fff;
}

.wpe-badge-cat {
    background-color: rgba(30, 17, 8, 0.72);
    color: #fff;
    bottom: 0;
    left: 0;
}

/* ---- INFO ÁREA ---- */
.wpe-product-info {
    padding: 20px 20px 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 10px;
    flex: 1;
}

/* ---- TÍTULO ---- */
.wpe-product-title {
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.wpe-product-title a {
    color: #1e1108;
    text-decoration: none;
    transition: color 0.2s;
}

.wpe-product-title a:hover {
    color: #b5813c;
}

/* ---- DIVISOR ---- */
.wpe-product-divider {
    width: 32px;
    height: 2px;
    background: #b5813c;
    border-radius: 2px;
    opacity: 0.5;
    flex-shrink: 0;
}

/* ---- EXCERPT ---- */
.wpe-product-excerpt {
    font-size: 13px;
    color: #8c7256;
    line-height: 1.65;
    margin: 0;
}

/* ---- PREÇO ---- */
.wpe-product-price {
    font-family: 'Lato', sans-serif;
    font-size: 19px;
    font-weight: 700;
    line-height: 1.2;
}

.wpe-product-price .woocommerce-Price-amount,
.wpe-product-price ins .woocommerce-Price-amount {
    color: #b5813c !important;
}

.wpe-product-price del {
    margin-right: 6px;
    opacity: 0.6;
}

.wpe-product-price del .woocommerce-Price-amount {
    color: #999 !important;
    font-size: 14px;
    font-weight: 400;
}

.wpe-product-price ins {
    text-decoration: none;
}

/* ---- AVALIAÇÃO ---- */
.wpe-product-rating {
    line-height: 1;
}

.wpe-product-rating .star-rating {
    font-size: 13px;
    color: #b5813c;
    margin: 0 auto;
}

/* ---- BOTÃO ADD TO CART ---- */
.wpe-add-to-cart {
    width: 100%;
    margin-top: auto;
    padding-top: 4px;
}

/* Reset agressivo - anula qualquer estilo do tema/woocommerce */
.wpe-add-to-cart a,
.wpe-add-to-cart a.button,
.wpe-add-to-cart a.wp-element-button,
.wpe-add-to-cart a.add_to_cart_button,
.wpe-add-to-cart a.product_type_simple,
.wpe-add-to-cart a.product_type_variable,
.wpe-add-to-cart a.product_type_grouped {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    padding: 13px 20px !important;
    margin: 0 !important;
    background: #b5813c !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    font-family: 'Lato', sans-serif !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    letter-spacing: 1.2px !important;
    text-decoration: none !important;
    cursor: pointer !important;
    transition: background 0.25s ease !important;
    box-sizing: border-box !important;
    line-height: 1.2 !important;
    box-shadow: none !important;
}

.wpe-add-to-cart a:hover,
.wpe-add-to-cart a.button:hover,
.wpe-add-to-cart a.add_to_cart_button:hover,
.wpe-add-to-cart a.product_type_simple:hover,
.wpe-add-to-cart a.product_type_variable:hover {
    background: #2c1a0e !important;
    color: #fff !important;
    transform: none !important;
}

.wpe-add-to-cart a.added {
    background: #7a5a2e !important;
}

/* ---- MENSAGEM VAZIA ---- */
.wpe-no-products {
    text-align: center;
    color: #8c7256;
    padding: 48px 0;
    font-family: 'Lato', sans-serif;
    font-size: 15px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 1024px) {
    .wpe-products-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .wpe-products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}
