/* ══════════════════════════════════════════════════
   Página do produto — mesmo visual da home e de produtos
   ══════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', sans-serif;
    background: #f5f4f0;
    color: #1a1a1a;
    overflow-x: hidden;
}

.loja {
    --h-ink: #17131c;
    --h-muted: #6e6875;
    --h-line: rgba(23, 19, 28, .08);
    --h-surface: #ffffff;
    --h-soft: #efede8;
    --h-brand: var(--marca);
    --h-brand-dark: var(--marca-escura);
    --h-brand-soft: var(--marca-t90);
    --h-sale: #d9184b;
    --h-ok: #15803d;
    --h-radius: 20px;
    --h-gap: 1.25rem;
    color: var(--h-ink);
    padding-bottom: 4rem;
}

/* ── Breadcrumb ────────────────────────────────── */
.pl-crumbs {
    display: flex; align-items: center; flex-wrap: wrap; gap: .4rem;
    font-size: .78rem; color: var(--h-muted);
    padding: 1.5rem 0 1.25rem;
}

.pl-crumbs a { color: var(--h-muted); text-decoration: none; }
.pl-crumbs a:hover { color: var(--h-brand); }
.pl-crumbs i { font-size: .62rem; opacity: .6; }
.pl-crumbs span {
    color: var(--h-ink); font-weight: 600;
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ── Títulos de seção (iguais à home) ──────────── */
.h-kicker {
    display: inline-block;
    font-size: .72rem; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: var(--h-brand);
    margin-bottom: .4rem;
    text-decoration: none;
}

a.h-kicker:hover { color: var(--h-brand-dark); text-decoration: underline; }

.h-title {
    font-size: clamp(1.45rem, 3vw, 2rem);
    font-weight: 800; color: var(--h-ink);
    margin: 0; letter-spacing: -.03em; line-height: 1.1;
}

/* ── Layout principal ──────────────────────────── */
.prod-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
    gap: 2.5rem;
    align-items: start;
}

/* ── Galeria ───────────────────────────────────── */
.gallery-wrap { position: sticky; top: 84px; }

.gallery-main-wrap {
    position: relative;
    border-radius: var(--h-radius);
    overflow: hidden;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
}

.gallery-main {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
    transition: opacity .2s ease;
}

.pcard-badge,
.gallery-badge {
    position: absolute; top: 12px; left: 12px; z-index: 3;
    background: var(--h-sale); color: #fff;
    font-size: .72rem; font-weight: 800; letter-spacing: .02em;
    padding: .3rem .6rem; border-radius: 8px;
}

.gallery-badge { top: 16px; left: 16px; font-size: .82rem; padding: .35rem .7rem; }

.gallery-thumbs {
    display: flex; gap: .6rem;
    margin-top: .75rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 2px;
}

.gallery-thumbs::-webkit-scrollbar { display: none; }

.gallery-thumb {
    flex: 0 0 76px; height: 76px;
    padding: 0;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid transparent;
    background: var(--h-surface);
    box-shadow: 0 0 0 1px var(--h-line);
    cursor: pointer;
    opacity: .7;
    transition: opacity .15s, border-color .15s;
}

.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb:hover { opacity: 1; }
.gallery-thumb.active { opacity: 1; border-color: var(--h-brand); box-shadow: none; }

/* ── Informações ───────────────────────────────── */
.prod-info {
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    padding: 2rem;
}

.prod-title-row {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    margin-bottom: 1rem;
}

.prod-title {
    font-size: clamp(1.5rem, 3vw, 2.1rem);
    font-weight: 800; letter-spacing: -.03em; line-height: 1.12;
    margin: 0;
    overflow-wrap: anywhere;
}

.fav-btn {
    flex: 0 0 44px; height: 44px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-ink);
    font-size: 1.1rem;
    text-decoration: none;
    transition: color .18s, border-color .18s, transform .18s;
}

.fav-btn:hover { color: var(--h-sale); border-color: var(--h-sale); transform: scale(1.06); }
.fav-btn.active { color: var(--h-sale); border-color: #f7c5d2; background: #fff1f4; }

/* preço */
.prod-price-wrap {
    padding-bottom: 1.25rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--h-line);
}

.prod-price-row { display: flex; align-items: baseline; flex-wrap: wrap; gap: .35rem .75rem; }

.prod-price {
    font-size: 2rem; font-weight: 800; letter-spacing: -.02em; line-height: 1;
    color: var(--h-ink);
}

.prod-price.promo { color: var(--h-sale); }

.prod-price-old { font-size: 1rem; color: #9b96a0; text-decoration: line-through; }

.prod-price-off {
    align-self: center;
    font-size: .75rem; font-weight: 800;
    color: var(--h-sale); background: #fde8ee;
    border-radius: 8px; padding: .25rem .55rem;
}

.prod-price-sub { font-size: .85rem; color: var(--h-muted); margin-top: .6rem; }

.prod-desc-curta {
    font-size: .95rem; line-height: 1.65; color: #4a4550;
    margin: 0 0 1.5rem;
}

/* variações */
.var-group { margin-bottom: 1.25rem; }

.var-group-label {
    display: block;
    font-size: .78rem; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--h-ink);
    margin-bottom: .6rem;
}

.var-options { display: flex; flex-wrap: wrap; gap: .5rem; }

.var-opt {
    min-width: 48px;
    padding: .6rem 1rem;
    border-radius: 12px;
    border: 1.5px solid var(--h-line);
    background: var(--h-surface);
    font: inherit; font-size: .88rem; font-weight: 600; color: var(--h-ink);
    cursor: pointer;
    transition: border-color .15s, background .15s, color .15s;
}

.var-opt:hover { border-color: var(--h-brand); color: var(--h-brand); }

.var-opt.active {
    border-color: var(--h-brand); background: var(--h-brand); color: #fff;
}

.var-opt.disabled {
    opacity: .4; cursor: not-allowed;
    text-decoration: line-through;
}

.var-opt.disabled:hover { border-color: var(--h-line); color: var(--h-ink); }

.var-status {
    display: flex; align-items: center; gap: .5rem;
    font-size: .85rem;
    border-radius: 12px;
    padding: .7rem .9rem;
    margin-bottom: 1.25rem;
}

.var-status i { flex-shrink: 0; }
.var-status.neutral { background: var(--h-soft); color: var(--h-muted); }
.var-status.ok      { background: #ecfdf3; color: var(--h-ok); }
.var-status.danger  { background: #fff1f2; color: #9f1239; }

/* personalização */
.pers-wrap { margin-bottom: 1.25rem; }
.req { color: var(--h-sale); }

.pers-textarea {
    width: 100%; min-height: 96px;
    border: 1.5px solid var(--h-line);
    border-radius: 12px;
    padding: .75rem .9rem;
    font: inherit; font-size: .9rem; color: var(--h-ink);
    resize: vertical;
}

.pers-textarea:focus { outline: none; border-color: var(--h-brand); }

/* quantidade + carrinho */
.buy-row { display: flex; gap: .75rem; margin-bottom: 1.25rem; }

.qty-ctrl {
    display: flex; align-items: center;
    border: 1.5px solid var(--h-line);
    border-radius: 14px;
    background: var(--h-surface);
    flex-shrink: 0;
}

.qty-btn {
    width: 42px; height: 52px;
    border: none; background: transparent;
    font-size: 1.2rem; color: var(--h-ink);
    cursor: pointer;
}

.qty-btn:hover { color: var(--h-brand); }

.qty-input {
    width: 44px; height: 52px;
    border: none; background: transparent;
    text-align: center;
    font: inherit; font-size: 1rem; font-weight: 700; color: var(--h-ink);
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-input:focus { outline: none; }

.btn-add-cart {
    flex: 1;
    display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
    min-height: 56px;
    border: none; border-radius: 14px;
    background: var(--h-brand); color: #fff;
    font: inherit; font-size: 1rem; font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 28px -12px rgba(var(--marca-rgb),.7);
    transition: background .18s, transform .18s, box-shadow .18s;
}

.btn-add-cart i { font-size: 1.15rem; }

.btn-add-cart:hover:not(:disabled) {
    background: var(--h-brand-dark);
    transform: translateY(-1px);
}

.btn-add-cart:disabled {
    background: #cfcbd3; box-shadow: none; cursor: not-allowed;
}

/* frete */
.frete-box {
    background: var(--h-soft);
    border-radius: 16px;
    padding: 1.1rem 1.1rem 1rem;
    margin-bottom: 1.25rem;
}

.frete-title {
    display: flex; align-items: center; gap: .45rem;
    font-size: .88rem; font-weight: 700;
    margin-bottom: .7rem;
}

.frete-title i { color: var(--h-brand); }

.frete-row { display: flex; gap: .5rem; margin-bottom: .45rem; }

.frete-input {
    flex: 1; min-width: 0;
    border: 1.5px solid transparent;
    border-radius: 12px;
    background: var(--h-surface);
    padding: .7rem .9rem;
    font: inherit; font-size: .9rem; color: var(--h-ink);
}

.frete-input:focus { outline: none; border-color: var(--h-brand); }

.frete-btn {
    border: none; border-radius: 12px;
    padding: .7rem 1.2rem;
    background: var(--h-ink); color: #fff;
    font: inherit; font-size: .88rem; font-weight: 700;
    cursor: pointer;
}

.frete-btn:hover { background: #000; }
.frete-btn:disabled { opacity: .55; cursor: wait; }

.frete-cep-link { font-size: .76rem; color: var(--h-muted); }
.frete-cep-link:hover { color: var(--h-brand); }

.frete-result { margin-top: .8rem; display: flex; flex-direction: column; gap: .45rem; }

.frete-option {
    display: flex; align-items: center; justify-content: space-between; gap: .75rem;
    background: var(--h-surface);
    border-radius: 12px;
    padding: .7rem .9rem;
}

.frete-transportadora { font-size: .85rem; font-weight: 700; }
.frete-servico        { font-size: .75rem; color: var(--h-muted); }
.frete-prazo          { font-size: .75rem; color: var(--h-muted); }
.frete-preco          { font-size: .95rem; font-weight: 800; white-space: nowrap; }

.frete-msg-error { background: #fff1f2; border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; color: #9f1239; }
.frete-msg-load  { background: var(--h-surface); border-radius: 10px; padding: .6rem .8rem; font-size: .8rem; color: var(--h-muted); }

/* garantias */
.prod-perks {
    list-style: none; margin: 0; padding: 0;
    display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
    font-size: .82rem; color: var(--h-muted);
}

.prod-perks li { display: flex; align-items: center; gap: .4rem; }
.prod-perks i { color: var(--h-brand); font-size: 1rem; }

/* ── Descrição completa ────────────────────────── */
.prod-desc-full {
    margin-top: 3rem;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    padding: 2rem 2.25rem;
}

.prod-desc-full .h-title { margin-bottom: 1.25rem; }

.prod-desc-full-content {
    font-size: .95rem; color: #4a4550; line-height: 1.75;
    overflow-wrap: anywhere;
    max-width: 820px;
}

.prod-desc-full-content img {
    display: block; max-width: 100%; height: auto;
    margin: 1rem auto; border-radius: 12px;
}

.prod-desc-full-content p { margin: 0 0 1rem; }
.prod-desc-full-content span { max-width: 100%; }

/* ── Veja também (igual aos trilhos da home) ───── */
.h-section { padding-top: 3.5rem; }

.h-head {
    display: flex; justify-content: space-between; align-items: flex-end;
    gap: 1rem; margin-bottom: 1.5rem;
}

.h-rail-nav { display: flex; gap: .4rem; flex-shrink: 0; }

.h-rail-btn {
    width: 40px; height: 40px;
    display: grid; place-items: center;
    border-radius: 50%;
    border: 1px solid var(--h-line);
    background: var(--h-surface);
    color: var(--h-ink);
    transition: background .18s, color .18s, opacity .18s;
}

.h-rail-btn:hover:not(:disabled) { background: var(--h-ink); color: #fff; border-color: var(--h-ink); }
.h-rail-btn:disabled { opacity: .35; cursor: default; }

.h-rail {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - 3 * var(--h-gap)) / 4);
    gap: var(--h-gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scroll-padding-inline: .25rem;
    overscroll-behavior-x: contain;
    padding: .25rem .25rem 1rem;
    margin: -.25rem -.25rem 0;
    scrollbar-width: none;
}

.h-rail::-webkit-scrollbar { display: none; }
.h-rail > .pcard { scroll-snap-align: start; }

/* card de produto */
.pcard {
    position: relative;
    display: flex; flex-direction: column;
    height: 100%;
    background: var(--h-surface);
    border: 1px solid var(--h-line);
    border-radius: var(--h-radius);
    overflow: hidden;
    transition: box-shadow .25s ease, transform .25s ease;
}

.pcard:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -18px rgba(23,19,28,.35); }

.pcard-img-wrap { position: relative; overflow: hidden; flex-shrink: 0; background: var(--h-soft); }

.pcard-img {
    width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block;
    transition: opacity .35s ease, transform .5s ease;
}

.pcard-img-hover { position: absolute; inset: 0; opacity: 0; }
.pcard:hover .pcard-img-hover { opacity: 1; transform: scale(1.04); }
.pcard:hover .pcard-img-main  { opacity: 0; transform: scale(1.04); }

.pcard-body { display: flex; flex-direction: column; flex: 1; padding: 1rem 1.1rem 1.1rem; }

.pcard-title {
    font-size: .9rem; font-weight: 600;
    line-height: 1.35; min-height: 2.7em;
    margin: 0 0 .55rem;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden;
}

.pcard-title a { color: var(--h-ink); text-decoration: none; }
.pcard-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; }

.pcard-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: .1rem .5rem; margin-bottom: 1rem; }
.pcard-price-normal, .pcard-price-promo { font-size: 1.1rem; font-weight: 800; color: var(--h-ink); }
.pcard-price-promo { color: var(--h-sale); }
.pcard-price-old { font-size: .8rem; color: #9b96a0; text-decoration: line-through; }

.pcard-btn {
    position: relative; z-index: 2;
    display: flex; align-items: center; justify-content: center; gap: .4rem;
    margin-top: auto;
    padding: .65rem .75rem;
    border-radius: 12px;
    background: var(--h-brand-soft); color: var(--h-brand);
    font-size: .82rem; font-weight: 700;
    text-decoration: none;
    transition: background .18s, color .18s;
}

.pcard-btn i { transition: transform .2s; }
.pcard:hover .pcard-btn, .pcard-btn:focus-visible { background: var(--h-brand); color: #fff; }
.pcard:hover .pcard-btn i { transform: translateX(3px); }

/* ── Animação ──────────────────────────────────── */
.fade-up { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.fade-up.visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
    .fade-up { opacity: 1; transform: none; transition: none; }
    .pcard, .pcard-img { transition: none; }
}

/* ── Responsivo ────────────────────────────────── */
@media (max-width: 991.98px) {
    .prod-layout { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
    .gallery-wrap { position: static; }
    .h-rail { grid-auto-columns: calc((100% - 2 * var(--h-gap)) / 3); }
}

@media (max-width: 767.98px) {
    .loja { --h-gap: .85rem; --h-radius: 16px; padding-bottom: 2.75rem; }

    .pl-crumbs { padding: 1rem 0 .9rem; }
    .pl-crumbs span { max-width: 60vw; }

    .gallery-thumb { flex-basis: 64px; height: 64px; }

    .prod-info { padding: 1.35rem 1.2rem; }
    .prod-price { font-size: 1.75rem; }

    .buy-row { gap: .5rem; }
    .qty-btn { width: 34px; }
    .qty-input { width: 34px; }
    .btn-add-cart { font-size: .95rem; padding: 0 .75rem; white-space: nowrap; }
}

@media (max-width: 767.98px) {
    .frete-row { flex-direction: column; }

    .prod-desc-full { margin-top: 2rem; padding: 1.4rem 1.2rem; }

    .h-section { padding-top: 2.25rem; }
    .h-head { margin-bottom: 1rem; }
    .h-rail-nav { display: none; }
    .h-rail {
        grid-auto-columns: 46%;
        margin-right: calc(-1 * var(--bs-gutter-x, 1.5rem) * .5);
        padding-right: calc(var(--bs-gutter-x, 1.5rem) * .5);
    }

    .pcard-body { padding: .8rem .85rem .9rem; }
    .pcard-title { font-size: .82rem; }
    .pcard-price-normal, .pcard-price-promo { font-size: 1rem; }
    .pcard-price { margin-bottom: .75rem; }
    .pcard-btn { font-size: .78rem; padding: .55rem .5rem; border-radius: 10px; }
    .pcard-btn i { display: none; }
}

@media (max-width: 399.98px) {
    .btn-add-extra { display: none; }
}
