/* ============================================
   Cards de Produtos - Estilo Astro
   ============================================ */

/* Container do produto */
.js-item-product {
    display: flex;
    flex-direction: column;
    padding: 5px;
    background: #fff;
    position: relative;
    box-shadow: 0 0 4px 1px #ccc;
    transition: box-shadow 0.3s ease, z-index 0s;
    height: 100%;
}

.js-item-product:hover {
    z-index: 99;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Wrapper da imagem */
.js-item-product .item-image {
    position: relative;
    width: 100%;
    padding-bottom: 100%;
    overflow: hidden;
    background: #f5f5f5;
}

.js-item-product .item-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* Tag de desconto */
.product-labels {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    pointer-events: none;
}

.label-accent {
    width: 49px;
    height: 49px;
    background: #f94101;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 16px;
    line-height: 1;
}

.label-accent .h6 {
    font-size: 11px;
    font-weight: 600;
    margin: 0;
    text-transform: uppercase;
}

/* Informações do produto */
.item-info-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px;
    position: relative;
}

/* Nome do produto */
.item-name {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 44px;
    margin: 0 0 10px 0;
    font-family: "Montserrat", sans-serif;
    font-size: 13px;
    font-weight: 500;
    line-height: 14px;
}

.item-name a {
    color: #4a4a4f;
    text-decoration: none;
    transition: color 0.3s ease;
}

.item-name a:hover {
    color: #999;
}

/* Preços */
.item-price {
    margin-top: auto;
    padding-bottom: 50px;
}

.price-compare {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
    margin-bottom: 5px;
}

.item-price .price {
    font-family: "Montserrat", sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #0072bc;
    margin-bottom: 3px;
}

/* Parcelamento */
.custom-installments {
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    color: #58585a;
    margin-top: 3px;
}

.custom-installments strong {
    font-weight: 700;
}

/* Botão de comprar no hover */
.item-buy-button {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(5px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.js-item-product:hover .item-buy-button {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.item-buy-button .btn-buy {
    display: block;
    width: 100%;
    padding: 10px 0;
    background: #f1f9f1;
    border: 1px solid #fff;
    border-radius: 5px;
    color: #549f4d;
    font-family: "Montserrat", sans-serif;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;
    -moz-border-radius: 5px;
    -ms-border-radius: 5px;
    -o-border-radius: 5px;
}

.item-buy-button .btn-buy:hover {
    background: #5eb05e;
    color: #fff;
}

.item-buy-button .btn-buy:before {
    content: '\e837';
    font-family: "fontello";
    margin-right: 8px;
    display: inline-block;
    font-size: 16px;
}

/* Mobile */
@media only screen and (max-width: 769px) {
    .item-info-container {
        padding: 8px;
    }

    .item-name {
        font-size: 12px;
        height: 38px;
        margin-bottom: 8px;
    }

    .item-price {
        padding-bottom: 0;
    }

    .item-price .price {
        font-size: 15px;
    }

    .custom-installments {
        font-size: 12px;
    }

    .label-accent {
        width: 40px;
        height: 40px;
        font-size: 13px;
    }

    .label-accent .h6 {
        font-size: 9px;
    }

    /* No mobile, mostrar sempre o botão */
    .item-buy-button {
        position: relative;
        bottom: auto;
        left: auto;
        right: auto;
        opacity: 1;
        visibility: visible;
        transform: none;
        pointer-events: auto;
        margin-top: 10px;
    }
}

/* Grid de produtos - alinhamento */
.products-grid,
.js-product-table {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 25px;
}

@media only screen and (max-width: 769px) {

    .products-grid,
    .js-product-table {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

/* Garantir que todos os cards tenham a mesma altura */
.products-grid .js-item-product,
.js-product-table .js-item-product {
    display: flex;
    flex-direction: column;
}

/* Ajustes para sliders */
.swiper-slide .js-item-product {
    height: 100%;
}

.swiper-products-slider {
    display: flex;
}

/* Ajustes para vitrines da home */
.section-featured-home .js-item-product {
    height: 100%;
}

/* Remover espaçamentos extras do tema */
.js-item-product .mb-3,
.js-item-product .mb-2,
.js-item-product .mt-3,
.js-item-product .mt-2 {
    margin: 0 !important;
}

.js-item-product .pt-3,
.js-item-product .pb-2 {
    padding: 0 !important;
}
