/* ============================================
   PATAGANG - PRODUCT CARD V3
   Card de produto compacto e limpo.
   Escopo: Categoria, Busca, Produtos Similares, 404.
   Substitui estilos antigos de item-product.
   ============================================ */

/* ---- GRID ---- */

.pg-product-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: start;
    justify-content: center;
    /* Centraliza quando <4 itens */
    /* Reset: remove float/flex antigos */
    float: none !important;
}




/* ---- CARD ---- */

.pg-card {
    background: #FFFFFF;
    border-radius: 16px;
    padding: 8px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;

    /* Reset: limpar herança de .item e .col */
    float: none !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-bottom: 0 !important;
    text-align: center;
    /* V3: centraliza todo o conteúdo */
    flex: none !important;
}

.pg-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ---- IMAGEM ---- */

.pg-card__image-link {
    display: block;
    text-decoration: none !important;
}

.pg-card__image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #F9F9F9;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px;
}

/* Container interno (gerado pelo componente Nuvemshop) */
.pg-card__image-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 100%;
    overflow: hidden;
    border-radius: 12px;
}

.pg-card__image-container>div {
    padding-bottom: 100% !important;
}

.pg-card__image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    /* Mostra imagem completa sem cortar */
    object-position: center;
    display: block;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

/* Imagem principal */
.pg-card__img-featured {
    z-index: 1;
}

/* Imagem hover */
.pg-card__img-hover {
    z-index: 2;
    opacity: 0 !important;
}

.pg-card__img-hover.lazyloaded {
    opacity: 0 !important;
}

.pg-card:hover .pg-card__img-featured {
    opacity: 0 !important;
}

.pg-card:hover .pg-card__img-hover,
.pg-card:hover .pg-card__img-hover.lazyloaded {
    opacity: 1 !important;
}

/* Labels (desconto, novo, etc) */
.pg-card__image .labels {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 5;
}

.pg-card__image .label {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 6px;
    margin-bottom: 4px;
}

/* ---- INFO/* Info */
.pg-card__info {
    padding: 4px 4px 0;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    text-align: center;
    /* Centraliza texto */
}

.pg-card__link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

/* Nome */
.pg-card__name {
    font-family: 'Familjen Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #000;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    /* Padrão para compatibilidade */
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 31px;
    /* 2 linhas para alinhamento consistente */
}

/* Preço principal */
.pg-card__price {
    display: flex;
    align-items: baseline;
    justify-content: center;
    /* Centraliza preços */
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 2px;
}

.pg-card__price-old {
    font-size: 11px;
    color: #888;
    text-decoration: line-through;
    order: 1;
}

.pg-card__price-main {
    font-family: 'Familjen Grotesk', sans-serif;
    font-size: 16px;
    font-weight: 700;
    color: #000;
    order: 0;
}

/* Desconto PIX/Boleto */
.pg-card__discount {
    font-size: 11px;
    color: #2d3a00 !important;
    font-weight: 600;
    margin-bottom: 2px;
    line-height: 1.3;
    text-align: center;
    /* Centraliza texto */
}

.pg-card__discount .text-accent {
    color: #2d3a00 !important;
    font-weight: 600 !important;
    font-size: 11px !important;
}



/* Parcelas */
.pg-card__installments {
    font-family: 'Familjen Grotesk', sans-serif;
    font-size: 10px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.3;
    text-align: center;
    /* Centraliza texto */
}

/* ---- BOTÃO ---- */

.pg-card__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 36px;
    padding: 8px 12px;
    margin-top: auto;

    font-family: 'Familjen Grotesk', sans-serif;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-align: center;
    text-decoration: none !important;

    background: #EAFE67;
    color: #000 !important;
    border: none;
    border-radius: 8px;

    transition: all 0.2s ease;
    cursor: pointer;
}

.pg-card__btn:hover {
    background: #D4E600;
    transform: translateY(-2px);
    color: #000 !important;
    text-decoration: none !important;
}

.pg-card__btn-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.pg-card__btn--dev {
    background: #EAFE67;
    font-size: 10px;
    letter-spacing: 0.08em;
}

.pg-card__btn--disabled {
    background: #E8E8E8;
    color: #999 !important;
    cursor: not-allowed;
}

.pg-card__btn--disabled:hover {
    background: #E8E8E8;
    transform: none;
}

/* ---- .item RESET ----
   Neutraliza herança de .item da base do tema */

.pg-card.item {
    margin-bottom: 0 !important;
    text-align: center;
}

/* ---- RESPONSIVO ---- */

@media (max-width: 1200px) {
    .pg-product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }

    .pg-404-products__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .pg-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pg-404-products__grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .pg-card__name {
        font-size: 11px;
        min-height: 28px;
    }

    .pg-card__price-main {
        font-size: 14px;
    }

    .pg-card__btn {
        min-height: 32px;
        font-size: 10px;
        padding: 6px 10px;
    }
}

@media (max-width: 480px) {
    .pg-product-grid {
        grid-template-columns: 1fr;
        max-width: 360px;
        margin: 0 auto;
    }

    .pg-404-products__grid {
        grid-template-columns: 1fr;
        max-width: 360px;
        margin: 0 auto;
    }
}

/* ---- ANTI-BLUR ----
   Proteção contra blur do lazy-loader (.blur-up) */

.pg-card img {
    filter: none !important;
    image-rendering: auto;
}

/* ---- PLACEHOLDER ---- */

.pg-card .placeholder-fade {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: pg-card-skeleton 1.5s ease-in-out infinite;
    border-radius: 12px;
}

@keyframes pg-card-skeleton {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}