/* Pizza Builder — experiência interativa de orçamento.
 * Escopo: prefixo .pzb-* para não vazar nas demais páginas. */

.pzb-hero {
    background: linear-gradient(135deg, var(--cor-primaria) 0%, #1a2960 100%);
    color: #fff;
    padding: 160px 0 70px;
    text-align: center;
}
.pzb-hero .container { max-width: 800px; }
.pzb-eyebrow {
    display: inline-block;
    background: rgba(227, 10, 33, 0.15);
    color: #ffb3bd;
    padding: 6px 16px;
    border-radius: 50px;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .15em;
    margin-bottom: 18px;
}
.pzb-hero h1 {
    font-family: var(--fonte-titulo);
    font-size: clamp(2rem, 4vw, 3rem);
    line-height: 1.15;
    margin-bottom: 14px;
}
.pzb-hero p { font-size: 1.05rem; opacity: .85; max-width: 640px; margin: 0 auto; }

.pzb-shell { padding: 50px 0 80px; }
.pzb-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 32px;
    align-items: start;
}

/* --- Stage --- */
.pzb-stage {
    background: #fff;
    border-radius: 18px;
    padding: 28px;
    box-shadow: 0 6px 30px rgba(10, 20, 53, .07);
    position: relative;
}

.pzb-progress {
    list-style: none;
    display: flex;
    justify-content: space-between;
    margin: 0 0 32px;
    padding: 0;
    position: relative;
    counter-reset: pzb;
}
.pzb-progress::before {
    content: "";
    position: absolute;
    top: 14px;
    left: 5%;
    right: 5%;
    height: 2px;
    background: #e2e8f0;
    z-index: 0;
}
.pzb-progress li {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: .75rem;
    color: #94a3b8;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .05em;
    flex: 1;
}
.pzb-progress li span {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    display: grid;
    place-items: center;
    font-weight: 700;
    transition: all .25s ease;
}
.pzb-progress li.is-active span {
    background: var(--cor-destaque);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(227, 10, 33, .12);
}
.pzb-progress li.is-done span {
    background: #16a34a;
    color: #fff;
}
.pzb-progress li.is-active,
.pzb-progress li.is-done { color: var(--cor-primaria); }
.pzb-progress li.is-skipped { opacity: .3; }

/* --- Step --- */
/* Step 6 stays measurable to IntersectionObserver (plugin sim init);
 * other steps hide via display:none. Step 6 uses absolute positioning while
 * inactive so the simulator wrappers retain geometry for plugin bootstrap. */
.pzb-step { display: none; animation: pzbFade .35s ease; }
.pzb-step.is-active { display: block; }
.pzb-step[data-step="6"]:not(.is-active) {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}
.pzb-step[data-step="6"]:not(.is-active),
.pzb-step[data-step="6"]:not(.is-active) * {
    user-select: none;
}
@keyframes pzbFade {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.pzb-step-head {
    text-align: center;
    margin-bottom: 28px;
}
.pzb-step-head h2 {
    font-family: var(--fonte-titulo);
    color: var(--cor-primaria);
    font-size: 1.7rem;
    margin-bottom: 6px;
}
.pzb-step-head p { color: #64748b; font-size: .95rem; }

/* --- Cards --- */
.pzb-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}
.pzb-cards--compact { grid-template-columns: repeat(3, 1fr); max-width: 720px; margin: 0 auto; }

.pzb-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    cursor: pointer;
    text-align: left;
    transition: all .25s ease;
    font: inherit;
    color: inherit;
    padding: 0;
}
.pzb-card:hover {
    transform: translateY(-4px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 30px rgba(10, 20, 53, .12);
}
.pzb-card.is-selected {
    border-color: var(--cor-destaque);
    box-shadow: 0 0 0 4px rgba(227, 10, 33, .15), 0 12px 30px rgba(10, 20, 53, .12);
}
.pzb-card--premium {
    border-color: #f5b300;
    background: linear-gradient(180deg, #fffaeb 0%, #fff 60%);
}
.pzb-card--premium:hover { border-color: #d99800; }
.pzb-card--premium.is-selected { border-color: var(--cor-destaque); }

.pzb-card-img {
    width: 100%;
    aspect-ratio: 4 / 3;
    background-color: #f1f5f9;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}
.pzb-card-body { padding: 16px 18px 18px; }
.pzb-card-body h3 {
    font-family: var(--fonte-titulo);
    color: var(--cor-primaria);
    font-size: 1.1rem;
    margin-bottom: 6px;
}
.pzb-card-body p { font-size: .85rem; color: #475569; line-height: 1.45; }
.pzb-card-body small {
    display: block;
    margin-top: 10px;
    font-size: .75rem;
    color: #94a3b8;
    font-weight: 600;
}

.pzb-card--small { text-align: center; }
.pzb-card--small .pzb-card-body { padding: 28px 18px; }
.pzb-card--small:has(.pzb-badge) .pzb-card-body { padding-top: 52px; }
.pzb-card--small h3 { font-size: 1.4rem; }

/* --- Badges --- */
.pzb-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    padding: 4px 10px;
    border-radius: 50px;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.pzb-badge--bottom { top: 12px; left: auto; right: 12px; }
.pzb-badge--green { background: #16a34a; color: #fff; }
.pzb-badge--gold  { background: linear-gradient(135deg, #f5b300, #d99800); color: #fff; }
.pzb-badge--red   { background: var(--cor-destaque); color: #fff; }

/* --- Quantity step --- */
.pzb-qty { max-width: 520px; margin: 0 auto; }
.pzb-qty-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 24px;
}
.pzb-qty-btn {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    color: var(--cor-primaria);
    padding: 16px 8px;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
}
.pzb-qty-btn:hover { border-color: #cbd5e1; }
.pzb-qty-btn.is-selected {
    background: var(--cor-destaque);
    color: #fff;
    border-color: var(--cor-destaque);
}
.pzb-qty-btn:disabled {
    opacity: .35;
    cursor: not-allowed;
}
.pzb-qty-custom { display: flex; flex-direction: column; gap: 8px; }
.pzb-qty-custom label { font-weight: 600; color: var(--cor-primaria); font-size: .9rem; }
.pzb-qty-custom input {
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
}
.pzb-qty-custom input:focus { outline: none; border-color: var(--cor-destaque); }
.pzb-qty-hint { color: #94a3b8; font-size: .8rem; min-height: 1.2em; }
.pzb-qty-hint.is-error { color: var(--cor-destaque); font-weight: 600; }

/* --- Final step / simulator --- */
.pzb-sim-wrap {
    margin: 0 -28px 24px;
    padding: 0 28px;
    position: relative;
}
/* Plugin frontend uses IntersectionObserver — wrappers need geometry to init.
 * Stack all 3 sims with position:absolute so they all measure non-zero from
 * the observer's perspective; only the active one is visually present (also
 * position:relative so it contributes to parent height). */
.pzb-sim {
    position: absolute;
    top: 0;
    left: 28px;
    right: 28px;
    visibility: hidden;
    pointer-events: none;
}
.pzb-sim.is-active {
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    visibility: visible;
    pointer-events: auto;
}
.pzb-sim-empty {
    text-align: center;
    padding: 40px 20px;
    background: #fef3c7;
    color: #92400e;
    border-radius: 12px;
    font-size: .95rem;
}
/* Esconde toggle de cor e CTA WhatsApp do simulador-plugin no contexto do builder
 * (a cor já foi decidida na etapa 1; CTA consolidado abaixo). */
.pzb-sim .sim-color-toggle,
.pzb-sim .sim-cta-whatsapp { display: none !important; }

.pzb-final-cta { text-align: center; padding-top: 16px; border-top: 1px solid #f1f5f9; }
.pzb-whatsapp {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: #25d366;
    color: #fff;
    border: 0;
    padding: 18px 36px;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(37, 211, 102, .35);
    transition: all .2s;
}
.pzb-whatsapp:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(37, 211, 102, .45); }
.pzb-whatsapp:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.pzb-final-hint { color: #64748b; font-size: .85rem; margin-top: 12px; }

/* --- Navigation --- */
.pzb-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #f1f5f9;
}
.pzb-nav-btn {
    background: transparent;
    border: 2px solid #e2e8f0;
    color: var(--cor-primaria);
    padding: 12px 24px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
}
.pzb-nav-btn:hover:not(:disabled) { border-color: var(--cor-primaria); background: #f8fafc; }
.pzb-nav-btn:disabled { opacity: .35; cursor: not-allowed; }
.pzb-nav-next:not(:disabled) {
    background: var(--cor-primaria);
    color: #fff;
    border-color: var(--cor-primaria);
}
.pzb-nav-next:not(:disabled):hover { background: #050a26; }

/* --- Summary aside --- */
.pzb-summary {
    background: #fff;
    border-radius: 18px;
    padding: 26px;
    box-shadow: 0 6px 30px rgba(10, 20, 53, .07);
    position: sticky;
    top: 110px;
}
.pzb-summary h3 {
    font-family: var(--fonte-titulo);
    color: var(--cor-primaria);
    font-size: 1.2rem;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
}
.pzb-summary-list { margin-bottom: 20px; }
.pzb-summary-list > div {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: .9rem;
}
.pzb-summary-list dt { color: #64748b; font-weight: 500; }
.pzb-summary-list dd { color: var(--cor-primaria); font-weight: 600; text-align: right; }
.pzb-summary-list dd.is-empty { color: #cbd5e1; font-weight: 400; }

.pzb-price { padding-top: 8px; }
.pzb-price-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: .9rem;
    color: #64748b;
}
.pzb-price-row strong { color: var(--cor-primaria); font-size: 1.05rem; }
.pzb-price-row--total {
    background: linear-gradient(135deg, #fef2f2 0%, #fff5f5 100%);
    margin: 8px -10px 0;
    padding: 14px 10px;
    border-radius: 10px;
    color: var(--cor-primaria);
    font-weight: 600;
}
.pzb-price-row--total strong { font-size: 1.5rem; color: var(--cor-destaque); }
.pzb-price-note { display: block; margin-top: 14px; font-size: .72rem; color: #94a3b8; line-height: 1.4; }

/* --- Responsive --- */
@media (max-width: 960px) {
    .pzb-grid { grid-template-columns: 1fr; }
    .pzb-summary { position: static; }
    .pzb-cards, .pzb-cards--compact { grid-template-columns: 1fr; }
    .pzb-progress li { font-size: 0; }
    .pzb-progress li span { font-size: .85rem; }
}
@media (max-width: 600px) {
    .pzb-hero { padding: 130px 0 50px; }
    .pzb-stage { padding: 20px; }
    .pzb-qty-presets { grid-template-columns: repeat(2, 1fr); }
    .pzb-sim-wrap { margin: 0 -20px 24px; padding: 0 20px; }
}
