/* =================================================
   GRID
================================================= */
.ccph-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 28px;
}

/* =================================================
   CARD
================================================= */
.ccph-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 18px;
    position: relative;
    transition: all .3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    height: 100%;
}

.ccph-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.08);
}

/* =================================================
   BADGE OFERTA
================================================= */
.ccph-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: #0081FA;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 999px;
    letter-spacing: .3px;
    z-index: 2;
}

/* =================================================
   IMAGEM
================================================= */
.ccph-card img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 0 auto 14px auto;
    border-radius: 12px;
}

/* =================================================
   TÍTULO
================================================= */
.ccph-card h3 {
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    margin: 8px 0 10px;
    min-height: 42px;
}

/* =================================================
   AVALIAÇÕES
================================================= */
.ccph-rating {
    margin-bottom: 8px;
}

/* =================================================
   PREÇOS (EMPILHADOS)
================================================= */
.ccph-price {
    margin-top: 12px;
    margin-bottom: 12px;
}

/* Preço antigo */
.ccph-price del {
    display: block;
    color: #94a3b8;
    font-size: 14px;
    margin-bottom: 4px;
}

/* Preço atual */
.ccph-price ins {
    display: block;
    text-decoration: none;
    color: #0081FA;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

/* =================================================
   PIX
================================================= */
.ccph-pix {
    display: block;
    font-size: 14px;
    color: #0081FA;
    font-weight: 600;
    margin-top: 4px;
}

/* =================================================
   PARCELAMENTO
================================================= */
.ccph-installments {
    display: block;
    font-size: 13px;
    color: #475569;
    margin-top: 2px;
}

/* =================================================
   BOTÃO
================================================= */
.ccph-card .button,
.ccph-card button,
.ccph-card a.button {
    margin-top: 14px;
    width: 100%;
    max-width: 220px;
    background: #0081FA;
    color: #ffffff;
    border-radius: 999px;
    padding: 14px 16px;
    font-weight: 600;
    font-size: 14px;
    text-align: center;
    transition: all .3s ease;
}

.ccph-card .button:hover,
.ccph-card button:hover,
.ccph-card a.button:hover {
    background: #006AD1;
    transform: scale(1.03);
}

/* =================================================
   MOBILE
================================================= */
@media (max-width: 768px) {

    .ccph-grid {
        gap: 18px;
    }

    .ccph-card {
        padding: 16px;
    }

    .ccph-card h3 {
        font-size: 14px;
        min-height: auto;
    }

    .ccph-price ins {
        font-size: 18px;
    }
}




/* BOTÃO ESPIAR */
.ccph-spiar {
    margin-top: 10px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #0081FA;
    font-weight: 600;
    cursor: pointer;
    transition: all .25s ease;
}

.ccph-spiar:hover {
    color: #006AD1;
    transform: translateY(-1px);
}



.ccph-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.55);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.ccph-modal {
    background: #fff;
    border-radius: 20px;
    padding: 24px;
    max-width: 520px;
    width: 90%;
    position: relative;
    animation: ccphFade .3s ease;
}

.ccph-close {
    position: absolute;
    top: 12px;
    right: 16px;
    font-size: 22px;
    cursor: pointer;
}

@keyframes ccphFade {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
    .ccph-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
    }

    .ccph-card {
        min-width: 85%;
        scroll-snap-align: center;
    }

    .ccph-grid::-webkit-scrollbar {
        display: none;
    }
}


.ccph-card img {
    transition: transform .35s ease;
}

.ccph-card:hover img {
    transform: scale(1.04);
}

.ccph-card h3 {
    transition: color .25s ease;
}

.ccph-card:hover h3 {
    color: #0081FA;
}




/* ===============================
   MODAL OVERLAY
================================ */
.ccph-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

/* ===============================
   MODAL CONTAINER
================================ */
.ccph-modal {
    background: #ffffff;
    border-radius: 24px;
    max-width: 900px;
    width: 92%;
    padding: 32px;
    position: relative;
    animation: ccphModalIn .35s ease;
}

/* ANIMAÇÃO */
@keyframes ccphModalIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* FECHAR */
.ccph-close {
    position: absolute;
    top: 18px;
    right: 22px;
    font-size: 22px;
    cursor: pointer;
}

/* ===============================
   MODAL GRID
================================ */
.ccph-modal-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

/* ===============================
   GALERIA
================================ */
.ccph-modal-gallery img {
    width: 100%;
    border-radius: 16px;
}

.ccph-thumbs {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

.ccph-thumbs img {
    width: 70px;
    border-radius: 10px;
    cursor: pointer;
    border: 2px solid transparent;
}

.ccph-thumbs img:hover {
    border-color: #0081FA;
}

/* ===============================
   INFO
================================ */
.ccph-modal-info h2 {
    font-size: 22px;
    margin-bottom: 10px;
}

.ccph-modal-price ins {
    font-size: 24px;
    color: #0081FA;
    font-weight: 700;
}

.ccph-modal-description {
    margin: 14px 0;
    color: #475569;
    font-size: 14px;
}

/* ===============================
   AÇÕES
================================ */
.ccph-modal-actions .button {
    width: 100%;
    border-radius: 999px;
    padding: 14px;
    background: #0081FA;
    color: #ffffff;
    font-weight: 600;
    text-align: center;
    transition: all .3s ease;
}

.ccph-modal-actions .button:hover {
    background: #006AD1;
    transform: scale(1.03);
}

.ccph-view-product {
    display: block;
    margin-top: 10px;
    text-align: center;
    color: #0081FA;
    font-weight: 600;
}

/* ===============================
   MOBILE
================================ */
@media (max-width: 768px) {
    .ccph-modal-inner {
        grid-template-columns: 1fr;
    }
}



/* ===============================
   GALERIA – BASE
================================ */
.ccph-modal-gallery {
    width: 100%;
}

.ccph-gallery-track {
    display: flex;
    gap: 0;
}

/* Cada slide */
.ccph-gallery-item {
    flex: 0 0 100%;
}

.ccph-gallery-item img {
    width: 100%;
    border-radius: 16px;
}

/* ===============================
   DESKTOP
================================ */
@media (min-width: 769px) {

    .ccph-gallery-track {
        display: block;
    }

    .ccph-gallery-item {
        display: none;
    }

    .ccph-gallery-item:first-child {
        display: block;
    }

}

/* ===============================
   MOBILE – SWIPE
================================ */
@media (max-width: 768px) {

    .ccph-gallery-track {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .ccph-gallery-item {
        scroll-snap-align: center;
        padding-right: 12px;
    }

    .ccph-gallery-track::-webkit-scrollbar {
        display: none;
    }

    /* Esconde thumbs no mobile */
    .ccph-thumbs {
        display: none;
    }

}



@media (max-width: 768px) {

    .ccph-modal-gallery::after {
        content: "← Arraste para ver mais →";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #64748b;
        margin-top: 6px;
    }

}



/* =================================================
   MODAL – SCROLL MOBILE
================================================= */
@media (max-width: 768px) {

    .ccph-modal {
        max-height: 90vh;              /* nunca ultrapassa a tela */
        overflow: hidden;              /* impede scroll externo */
        padding: 20px;
        border-radius: 20px;
    }

    .ccph-modal-inner {
        max-height: calc(90vh - 40px); /* desconta padding */
        overflow-y: auto;              /* SCROLL AQUI */
        -webkit-overflow-scrolling: touch;
    }

}


@media (max-width: 768px) {

    .ccph-modal-gallery img {
        max-height: 260px;
        object-fit: contain;
    }

}


@media (max-width: 768px) {

    .ccph-modal-inner::before {
        content: "↓ Arraste para ver mais ↓";
        display: block;
        text-align: center;
        font-size: 12px;
        color: #64748b;
        margin-bottom: 10px;
    }

}


/* =========================================
   MODAL – AJUSTES DE CTA (UX)
========================================= */

/* Área de ações */
.ccph-modal-actions {
    margin-top: 24px;          /* separa da descrição */
    padding-top: 20px;
    border-top: 1px solid #e5e7eb; /* cria divisão visual */
}

/* Botão principal */
.ccph-modal-actions .button {
    margin-top: 0;
    margin-bottom: 14px;       /* espaço do link secundário */
    width: 100%;
    max-width: 100%;
    font-size: 15px;
}

/* Link secundário */
.ccph-view-product {
    display: block;
    text-align: left;          /* remove sensação estranha */
    font-size: 14px;
    font-weight: 600;
    color: #0081FA;
    padding-left: 15px;
    padding-top: : 3px;
}

/* Hover elegante no link */
.ccph-view-product:hover {
    text-decoration: underline;
}

/* Mobile – mais conforto visual */
@media (max-width: 768px) {

    .ccph-modal-actions {
        margin-top: 28px;
        padding-top: 22px;
    }

}
