/*=========================================================
    CARD DE PRODUTO + PÁGINA DO PRODUTO
    Carregado DEPOIS de style.css e mobile.css.

    O card do celular já estava resolvido em mobile.css, então
    o redesenho do card vive em `min-width: 768px` e só alguns
    ajustes pontuais entram no bloco de celular do fim deste
    arquivo (que vence o mobile.css por vir depois).
===========================================================*/

/*------------------------------------------------------
    Card do produto (listagens, home, relacionados)
------------------------------------------------------*/
@media only screen and (min-width: 768px) {
    .product {
        display: flex;
        flex-direction: column;
        margin: 0 0 26px;
        overflow: hidden;
        background: #fff;
        border: 1px solid #e9edf2;
        border-radius: 12px;
        box-shadow: none;
        transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
    }
    .product:hover {
        border-color: #dfe5ec;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .12);
        transform: translateY(-3px);
    }

    /* moldura de altura fixa: cards da mesma linha terminam alinhados */
    .product .pc-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 230px;
        padding: 14px;
        overflow: hidden;
        background: #fff;
    }
    .product .pc-thumb img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        object-fit: contain;
        transition: transform .35s ease;
    }
    .product:hover .pc-thumb img { transform: scale(1.06); }

    .product .product-body { padding: 14px 16px 4px; text-align: left; }
    .product .product-body .product-category {
        margin: 0 0 6px;
        font-size: 11px;
        letter-spacing: .04em;
    }
    .product-name-box { height: 40px; }
    .product .product-body .product-name {
        margin: 0;
        font-size: 14px;
        line-height: 1.4;
        text-transform: none;
    }
    .product .product-body .product-name > a { color: #2b2d42; }

    .pc-price { min-height: 52px; margin-top: 10px; }
    .product .product-body .product-price { margin: 0; font-size: 20px; font-weight: 700; }

    /* botão deixa de flutuar (ficava atrás do corpo do card, invisível) */
    .product .add-to-cart,
    .product:hover .add-to-cart {
        position: static;
        margin-top: auto;
        padding: 0 16px 16px;
        background: transparent;
        transform: none;
    }
    .product .add-to-cart .add-to-cart-btn,
    .product .add-to-cart .add-to-cart-btn:hover {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        height: 42px;
        padding: 0;
        border-radius: 10px;
        font-size: 12px;
        line-height: 1;
    }
    .product .add-to-cart .add-to-cart-btn > i {
        position: static;
        width: auto;
        height: auto;
        line-height: 1;
        color: inherit;
        opacity: 1;
        visibility: visible;
    }
    .product .add-to-cart .add-to-cart-btn:hover {
        background-color: #fff;
        border-color: var(--primary_color);
        color: var(--primary_color);
    }

    /* etiquetas: pílulas empilháveis no alto do card */
    .product .product-img .product-label {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        top: 10px;
        left: 10px;
        right: 10px;
    }
    .product .product-img .product-label > span {
        padding: 4px 10px;
        border: none;
        border-radius: 999px;
        font-size: 11px;
        font-weight: 700;
        box-shadow: 0 2px 6px rgba(15, 23, 42, .12);
    }
}

/* comuns às duas larguras */
.product .pc-thumb { position: relative; text-decoration: none; }
.product .pc-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: #cbd5e1;
    font-size: 30px;
}
.product .product-body .product-name > a:hover,
.product .product-body .product-name > a:focus { color: var(--primary_color); }
.pc-unit { font-size: 12px; font-weight: 600; color: #8d99ae; }
.pc-cash { min-height: 17px; margin: 3px 0 0; color: #64748b; font-size: 12px; }
.pc-cash strong { color: #475569; font-weight: 700; }
.product .product-body .product-price.pc-price-off { color: #94a3b8; font-size: 16px; }
.product .product-img .product-label > span.pc-tag-warn { background: #f59e0b; color: #fff; }

/* "Tenho interesse" abre o WhatsApp: mesma cor do botão da tela de favoritos */
.product .add-to-cart .add-to-cart-btn.btn-warning,
.product .add-to-cart .add-to-cart-btn.btn-warning:hover {
    background-color: #22c55e;
    border-color: #22c55e;
    color: #fff;
}
.product .product-img .product-label > span.label-danger { background: #ef4444; color: #fff; }

@media only screen and (max-width: 767px) {
    .product .pc-thumb {
        display: flex;
        align-items: center;
        justify-content: center;
        height: 150px;
        padding: 6px;
        overflow: hidden;
    }
    .product .pc-thumb img {
        width: auto;
        height: auto;
        max-width: 100%;
        max-height: 100%;
        padding: 0;
        object-fit: contain;
    }
    .product .product-body .product-name { text-transform: none; }

    /* mesmas pílulas do desktop, em escala de celular */
    .product .product-img .product-label {
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        top: 6px;
        left: 6px;
        right: 6px;
        text-align: left;
    }
    .product .product-img .product-label > span {
        padding: 3px 8px;
        border: none;
        border-radius: 999px;
        font-size: 10px;
        font-weight: 700;
        box-shadow: 0 1px 4px rgba(15, 23, 42, .12);
    }
    .pc-price { min-height: 46px; }
    .pc-cash { font-size: 11px; }
}

/*------------------------------------------------------
    Página do produto — galeria
------------------------------------------------------*/
#product-main-img .product-preview {
    overflow: hidden;
    background: #fff;
    border: 1px solid #eef1f5;
    border-radius: 14px;
}
#product-main-img .product-preview img {
    width: 100%;
    height: 420px;
    padding: 18px;
    object-fit: contain;
}
#product-main-img .slick-prev,
#product-main-img .slick-next { z-index: 3; }

#product-imgs .product-preview {
    margin: 0 0 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 10px;
    cursor: pointer;
}
#product-imgs .product-preview img {
    width: 100%;
    height: 92px;
    padding: 6px;
    object-fit: contain;
}
#product-imgs .product-preview.slick-current { border-color: var(--primary_color); }

/* produto cadastrado sem nenhuma foto */
#product-main-img .product-preview.pd-no-photo {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 420px;
    color: #cbd5e1;
}
.pd-no-photo i { font-size: 46px; }
.pd-no-photo span { color: #94a3b8; font-size: 13px; }

.pd-zoom-hint {
    margin: 10px 0 0;
    color: #94a3b8;
    font-size: 12px;
    text-align: center;
}

/*------------------------------------------------------
    Página do produto — coluna de compra
------------------------------------------------------*/
.product-details .product-name {
    margin: 0 0 10px;
    color: #1e293b;
    font-size: 24px;
    line-height: 1.25;
    text-transform: none;
}

.pd-meta-top { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.pd-meta-top .product-rating { margin: 0; }
.pd-meta-top .review-link { color: #64748b; }
.pd-sku { color: #94a3b8; font-size: 12px; }

.pd-box {
    padding: 18px 20px;
    background: #fff;
    border: 1px solid #e9edf2;
    border-radius: 14px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}

.pd-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.product-details .pd-box .product-price {
    margin: 0;
    font-size: 30px;
    font-weight: 700;
    line-height: 1.1;
}
.pd-price-unit { color: #8d99ae; font-size: 13px; font-weight: 600; }
.pd-cash { margin: 6px 0 0; color: #475569; font-size: 14px; }
.pd-cash strong { color: var(--primary_color); }

.pd-stock {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}
.pd-stock.ok { background: #ecfdf5; color: #047857; }
.pd-stock.low { background: #fffbeb; color: #b45309; }
.pd-stock.off { background: #fef2f2; color: #b91c1c; }

.pd-resumo { margin: 16px 0 0; color: #475569; font-size: 14px; line-height: 1.6; }
.pd-resumo p:last-child { margin-bottom: 0; }

.product-details .pd-box .add-to-cart {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin: 18px 0 0;
}
.product-details .pd-box .add-to-cart .qty-label { flex: 0 0 110px; margin: 0; }
.product-details .pd-box .add-to-cart .qty-label label {
    display: block;
    margin-bottom: 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
}
.product-details .pd-box .add-to-cart .qty-label .input-number { width: 110px; }
.product-details .pd-box .add-to-cart .add-to-cart-btn,
.product-details .pd-box .add-to-cart .add-to-cart-btn:hover {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 48px;
    padding: 0 18px;
    border-radius: 10px;
    font-size: 14px;
}
.product-details .pd-box .add-to-cart .add-to-cart-btn > i {
    position: static;
    width: auto;
    height: auto;
    line-height: 1;
    color: inherit;
    opacity: 1;
    visibility: visible;
}
/* "Tenho interesse" abre o WhatsApp — verde, como nos cards e nos favoritos */
.product-details .pd-box .add-to-cart .add-to-cart-btn.pd-interesse,
.product-details .pd-box .add-to-cart .add-to-cart-btn.pd-interesse:hover {
    background-color: #22c55e;
    border-color: #22c55e;
    color: #fff;
}

/* produto sem preço de venda: "Sob consulta" não deve competir com um preço */
.product-details .pd-box .product-price.pc-price-off { color: #64748b; font-size: 24px; }

.pd-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.pd-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 38px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid #e4e7ed;
    border-radius: 999px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: .18s all;
}
.pd-action:hover,
.pd-action:focus {
    border-color: var(--primary_color);
    color: var(--primary_color);
    text-decoration: none;
}
.pd-action i { font-size: 15px; }
.pd-action-wpp:hover { border-color: #22c55e; color: #16a34a; }
.pd-action-fb:hover { border-color: #2563eb; color: #2563eb; }

.pd-info { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid #f1f5f9; }
.pd-info li {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
}
.pd-info li span { color: #94a3b8; }
.pd-info li strong { color: #334155; font-weight: 600; text-align: right; }
.pd-info li a { color: var(--primary_color); font-weight: 600; }

.pd-extra { margin-top: 16px; }
.pd-extra .btn { border-radius: 10px; font-weight: 700; }

@media only screen and (min-width: 992px) {
    /* a coluna de compra acompanha a rolagem da descrição/galeria */
    .pd-sticky { position: sticky; top: 16px; }
}

@media only screen and (max-width: 767px) {
    #product-main-img .product-preview { border-radius: 12px; }
    #product-main-img .product-preview img { height: 290px; padding: 10px; }
    #product-main-img .product-preview.pd-no-photo { height: 240px; }
    #product-imgs { margin-bottom: 18px; }
    #product-imgs .product-preview img { height: 70px; }
    .pd-zoom-hint { display: none; }

    .product-details .product-name { font-size: 19px; }
    .pd-box { padding: 14px; border-radius: 12px; }
    .product-details .pd-box .product-price { font-size: 25px; }
    .product-details .pd-box .add-to-cart { flex-wrap: wrap; }
    .product-details .pd-box .add-to-cart .qty-label { flex: 0 0 100px; }
    .product-details .pd-box .add-to-cart .qty-label .input-number { width: 100px; }
    /* rótulo longo ("Adicionar ao carrinho") não cabe ao lado do seletor de
       quantidade em 375px: o botão ganha a linha inteira */
    .product-details .pd-box .add-to-cart .add-to-cart-btn,
    .product-details .pd-box .add-to-cart .add-to-cart-btn:hover { flex: 1 1 100%; height: 46px; }
    .pd-action { flex: 1 1 auto; justify-content: center; }
}
