/* ============================================================
   Single Produto
   ============================================================ */

.sp-page {
    padding: 2rem 0 4rem;
}

.sp-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 4rem;
}

/* --- Utilitários internos --- */
.sp-label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
    margin: 0;
}

.sp-secao-titulo {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #111827;
    margin: 0 0 1rem;
}

.sp-divisor {
    border: none;
    border-top: 1px solid #f3f4f6;
    margin: 0;
}

/* ============================================================
   Layout do sumário (2 colunas)
   ============================================================ */

.sp-sumario {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.sp-col-esq,
.sp-col-dir {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ============================================================
   Galeria
   ============================================================ */

.sp-galeria__principal {
    aspect-ratio: 1;
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: .75rem;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .06);
}

.sp-galeria__principal img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity .2s;
}

.sp-galeria__thumbs {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: .5rem;
    margin-top: .75rem;
}

.sp-thumb {
    aspect-ratio: 1;
    border-radius: .375rem;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    padding: 0;
    background: none;
    transition: border-color .15s;
}

.sp-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sp-thumb:hover {
    border-color: #d1d5db;
}

.sp-thumb--ativa {
    border-color: var(--e-global-color-petroleo, #0d5c63);
    box-shadow: 0 2px 6px rgba(0, 0, 0, .1);
}

/* ============================================================
   Caixa de compra
   ============================================================ */

.sp-compra {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.sp-compra__valores {
    display: flex;
    align-items: center;
    gap: .75rem;
    flex-wrap: wrap;
    margin-top: .25rem;
}

.sp-preco-atual {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
}

.sp-preco-atual .woocommerce-Price-amount {
    font-size: inherit;
}

.sp-preco-de {
    font-size: 1rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.sp-preco-de .woocommerce-Price-amount {
    font-size: inherit;
}

.sp-badges-preco {
    display: flex;
    flex-direction: column;
    gap: .4rem;
    margin-top: .5rem;
}

.sp-badge-preco {
    display: flex;
    justify-content: center;
    background: #dc2626;
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    border-radius: 999px;
    padding: .35rem .75rem;
}

.sp-compra .sp-btn-comprar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    height: 3.5rem;
    background: var(--e-global-color-cor-destaque, #e63946);
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    border-radius: .75rem;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    transition: opacity .2s;
}

.sp-btn-comprar:hover {
    opacity: .88;
    color: #fff;
}

.sp-compra__seguro {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
    text-align: center;
    margin: 0;
}

/* ============================================================
   Info do produto
   ============================================================ */

.sp-cabecalho {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.sp-titulo {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.2;
    margin: 0 0 .25rem;
}

.sp-subtitulo {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
    margin: 0;
}

/* --- Rating --- */
.sp-rating {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.sp-stars {
    display: flex;
    gap: 1px;
}

.sp-star {
    font-size: 1rem;
    color: #d1d5db;
    position: relative;
    line-height: 1;
}

.sp-star--cheia {
    color: #facc15;
}

.sp-star--meia {
    color: #d1d5db;
}

.sp-star--meia::after {
    content: '★';
    position: absolute;
    left: 0;
    top: 0;
    color: #facc15;
    clip-path: inset(0 50% 0 0);
}

.sp-rating__nota {
    font-size: .875rem;
    color: #111827;
}

.sp-rating__count {
    font-size: .875rem;
    color: #9ca3af;
}

/* --- Flags --- */
.sp-flags {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.sp-flag {
    display: inline-flex;
    align-items: center;
    gap: .375rem;
    font-size: .7rem;
    font-weight: 700;
    border-radius: .625rem;
    padding: .4rem .75rem;
    border: 1px solid;
}

.sp-flag--tea {
    background: #eff6ff;
    color: #1d4ed8;
    border-color: #dbeafe;
}

.sp-flag--didatico {
    background: #fff7ed;
    color: #c2410c;
    border-color: #fed7aa;
}

.sp-flag--colored {
    background: #f0fdf4;
    color: #15803d;
    border-color: #bbf7d0;
}

.sp-flag img {
    width: 1.125rem;
    height: 1.125rem;
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Outras versões --- */
.sp-outras-versoes {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sp-versoes {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.sp-versao {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .5rem;
    padding: .5rem 1rem;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    text-decoration: none;
    font-size: .8rem;
    font-weight: 700;
    color: #374151;
    transition: border-color .15s, background .15s;
}

.sp-versao:hover {
    border-color: var(--e-global-color-petroleo, #0d5c63);
    background: #f9fafb;
    color: #374151;
}

.sp-versao svg:first-child {
    color: #9ca3af;
    flex-shrink: 0;
}

.sp-versao svg:last-child {
    color: #d1d5db;
    flex-shrink: 0;
}

/* --- Sinopse --- */
.sp-sinopse__texto {
    font-size: 1.05rem;
    color: #4b5563;
    line-height: 1.7;
}

/* --- Detalhes --- */
.sp-detalhes__grade {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.sp-detalhe {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.sp-detalhe__icone {
    padding: .6rem;
    background: #f9fafb;
    border-radius: .5rem;
    color: var(--e-global-color-petroleo, #0d5c63);
    flex-shrink: 0;
    display: flex;
}

.sp-detalhe__valor {
    font-size: .875rem;
    font-weight: 700;
    color: #111827;
    margin: .15rem 0 0;
}

/* --- Criadores --- */
.sp-criadores {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
}

.sp-criador {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: .75rem 1rem;
    border-radius: 1rem;
    border: 1px solid transparent;
    text-decoration: none;
    transition: background .15s, border-color .15s;
}

.sp-criador:hover {
    background: #f9fafb;
    border-color: #f3f4f6;
}

.sp-criador__foto {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
    transition: border-color .15s;
    flex-shrink: 0;
}

.sp-criador:hover .sp-criador__foto {
    border-color: var(--e-global-color-petroleo, #0d5c63);
}

.sp-criador__nome {
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 .15rem;
    transition: color .15s;
}

.sp-criador:hover .sp-criador__nome {
    color: var(--e-global-color-petroleo, #0d5c63);
}

/* ============================================================
   Seção (avaliacoes / relacionados / do-mesmo-autor)
   ============================================================ */

.sp-secao {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.sp-secao__cabecalho {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sp-secao__titulo {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #111827;
    white-space: nowrap;
    margin: 0;
}

.sp-secao__cabecalho::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f3f4f6;
}

/* ============================================================
   Grade de produtos (carousel scroll-snap)
   ============================================================ */

.sp-grade {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: none;
}

.sp-grade::-webkit-scrollbar {
    display: none;
}

/* ============================================================
   Card de produto
   ============================================================ */

.sp-card {
    flex: 0 0 75%;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: .625rem;
    overflow: hidden;
    transition: box-shadow .2s, transform .2s;
}

.sp-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.sp-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
}

.sp-card__img {
    aspect-ratio: 1;
    background: #f9fafb;
    overflow: hidden;
}

.sp-card__img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s;
}

.sp-card:hover .sp-card__img img {
    transform: scale(1.05);
}

.sp-card__info {
    padding: .875rem;
    display: flex;
    flex-direction: column;
    gap: .375rem;
    flex: 1;
}

.sp-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem;
}

.sp-card__badge {
    font-size: .6rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .08em;
    padding: .15rem .4rem;
    border-radius: .25rem;
    background: #f3f4f6;
    color: var(--e-global-color-petroleo, #0d5c63);
    border: 1px solid #e5e7eb;
}

.sp-card__badge--sale {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}

.sp-card__nome {
    font-size: .8rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.35;
    margin: .25rem 0 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    transition: color .15s;
    min-height: 2.2rem;
}

.sp-card:hover .sp-card__nome {
    color: var(--e-global-color-petroleo, #0d5c63);
}

.sp-card__preco {
    display: flex;
    align-items: baseline;
    gap: .4rem;
    margin-top: auto;
    padding-top: .5rem;
}

.sp-card__preco-atual {
    font-size: .95rem;
    font-weight: 700;
    color: #111827;
}

.sp-card__preco-atual .woocommerce-Price-amount {
    font-size: inherit;
}

.sp-card__preco-de {
    font-size: .75rem;
    color: #9ca3af;
    text-decoration: line-through;
}

.sp-card__preco-de .woocommerce-Price-amount {
    font-size: inherit;
}

/* ============================================================
   Desktop (≥ 768 px)
   ============================================================ */

@media (min-width: 768px) {

    .sp-sumario {
        flex-direction: row;
        align-items: flex-start;
        gap: 3rem;
    }

    .sp-col-esq {
        width: 33.333%;
        flex-shrink: 0;
        position: sticky;
        top: 6rem;
    }

    .sp-col-dir {
        flex: 1;
    }

    .sp-titulo {
        font-size: 2.25rem;
    }

    .sp-criadores {
        grid-template-columns: 1fr 1fr;
    }

    .sp-versoes {
        flex-direction: row;
    }

    .sp-detalhes__grade {
        grid-template-columns: repeat(3, 1fr);
    }

    .sp-card {
        flex-basis: calc(50% - .5rem);
    }
}

@media (min-width: 1024px) {

    .sp-titulo {
        font-size: 2.75rem;
    }

    .sp-card {
        flex-basis: calc(25% - .75rem);
    }
}

/* ============================================================
   Avaliações  (.av)
   ============================================================ */

.av {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* --- Cabeçalho de seção reutilizável --- */
.av__cabecalho {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.av__cabecalho::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #f3f4f6;
}

.av__titulo {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #111827;
    white-space: nowrap;
    margin: 0;
}

/* --- Carrossel de cards --- */
.av__carrossel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: .5rem;
    scrollbar-width: none;
}

.av__carrossel::-webkit-scrollbar {
    display: none;
}

/* --- Card de avaliação --- */
.av__card {
    flex: 0 0 90%;
    scroll-snap-align: start;
    background: #fff;
    border: 1px solid #f3f4f6;
    border-radius: 1rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .04);
    transition: box-shadow .2s;
}

.av__card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, .08);
}

.av__card-autor {
    display: flex;
    align-items: center;
    gap: .75rem;
}

.av__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid #f3f4f6;
    object-fit: cover;
    flex-shrink: 0;
}

.av__nome {
    display: block;
    font-size: .875rem;
    font-weight: 700;
    color: #111827;
}

.av__data {
    display: block;
    font-size: .6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
}

.av__estrelas {
    display: flex;
    gap: 1px;
}

.av__estrela {
    font-size: .75rem;
    color: #d1d5db;
    line-height: 1;
}

.av__estrela--cheia {
    color: #facc15;
}

.av__texto {
    font-size: .875rem;
    color: #4b5563;
    line-height: 1.65;
    font-style: italic;
    margin: 0;
}

/* ============================================================
   Formulário de avaliação
   ============================================================ */

.av__formulario {
    background: #f9fafb;
    border: 1px solid #f3f4f6;
    border-radius: 1.5rem;
    padding: 2rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.av__formulario-intro {
    text-align: center;
}

.av__formulario-titulo {
    font-size: 1.25rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: #111827;
    margin: 0 0 .375rem;
}

.av__formulario-descricao {
    font-size: .875rem;
    color: #6b7280;
    margin: 0;
}

/* Contêiner gerado pelo comment_form() */
.av-form-container {
    width: 100%;
}

.av-form__body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Campos de texto */
.av-form__campo {
    display: flex;
    flex-direction: column;
    gap: .375rem;
    margin: 0;
}

.av-form__campo label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: #9ca3af;
}

.av-form__campo input,
.av-form__campo textarea {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: .75rem 1rem;
    font-size: .875rem;
    color: #111827;
    background: #fff;
    outline: none;
    transition: border-color .15s;
    box-sizing: border-box;
}

.av-form__campo input:focus,
.av-form__campo textarea:focus {
    border-color: var(--e-global-color-petroleo, #0d5c63);
}

.av-form__campo input {
    height: 3rem;
}

.av-form__campo textarea {
    min-height: 8rem;
    resize: none;
}

/* Linha de campos em grid em telas maiores */
.av-form__campos-duplos {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

/* Rating - gerado pelo WC via comment_form_top */
.av-form__body .comment-form-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .625rem;
    margin: 0;
}

.av-form__body .comment-form-rating label {
    font-size: .65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .2em;
    color: #9ca3af;
}

.av-form__body .stars {
    display: flex;
    gap: .375rem;
}

.av-form__body .stars a {
    font-size: 0;
    width: 2rem;
    height: 2rem;
    display: inline-block;
    position: relative;
    color: #d1d5db;
    transition: transform .1s;
}

.av-form__body .stars a::before {
    content: '★';
    font-size: 2rem;
    line-height: 1;
    transition: color .1s;
}

.av-form__body .stars span:hover a::before,
.av-form__body .stars span:hover a:hover~a::before {
    color: #d1d5db;
}

.av-form__body .stars span:hover a:not(:hover ~ a)::before {
    color: #facc15;
}

.av-form__body .stars .active a::before {
    color: #facc15;
}

.av-form__body .stars select {
    display: none;
}

/* Botão de envio */
.av-form__submit-linha {
    margin: 0;
}

.av-form__submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    width: 100%;
    height: 3.5rem;
    background: var(--e-global-color-petroleo, #0d5c63);
    color: #fff;
    font-size: .8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    border: none;
    border-radius: .75rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
    transition: background .2s;
}

.av-form__submit:hover {
    background: #111827;
}

/* ============================================================
   Avaliações — Desktop (≥ 768 px)
   ============================================================ */

@media (min-width: 768px) {
    .av__card {
        flex-basis: calc(50% - .5rem);
    }

    .av__formulario {
        padding: 3rem;
    }

    .av-form__body {
        max-width: 42rem;
        margin: 0 auto;
    }

    /* Campos nome/email lado a lado */
    .av-form__body .comment-form-author,
    .av-form__body .comment-form-email {
        display: inline-flex;
        flex-direction: column;
        gap: .375rem;
        width: calc(50% - .625rem);
        vertical-align: top;
        margin: 0;
    }

    .av-form__body .comment-form-author {
        margin-right: 1.25rem;
    }
}

@media (min-width: 1024px) {
    .av__card {
        flex-basis: calc(33.333% - .667rem);
    }
}