/* =====================================================================
   PEDEJÁ — PÁGINA DO PRODUTO (modal aberto pelo index, pagina_item_div.php)
   Prefixo pj-. Neutraliza as regras globais do estilo.css antigo
   (label/h1/h2/p com float, button{display:none}).
   Cores por variáveis no .pj-produto:
     --pj-acento      cor de seleção e do botão (cor secundária do cliente)
     --pj-acento-txt  texto legível sobre o acento
   ===================================================================== */

.pj-produto-fundo { min-height: 100vh; min-height: 100dvh; }

/* coluna que ocupa a tela toda: com pouco conteúdo o rodapé continua colado embaixo */
.pj-produto {
	--pj-txt: #1d1d1f;
	--pj-txt-2: #6e6e73;
	--pj-borda: #ececf0;
	--pj-fundo: #f4f4f6;
	--pj-barra-h: 56px;
	position: relative;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
	min-height: 100dvh;
	background: #fff;
	font-family: var(--pj-fonte, 'Plus Jakarta Sans', sans-serif);
	color: var(--pj-txt);
	text-align: left;
}

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

.pj-produto h1,
.pj-produto h2,
.pj-produto h3,
.pj-produto p,
.pj-produto label {
	float: none;
	width: auto;
	margin: 0;
	padding: 0;
	font-family: inherit;
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
	letter-spacing: normal;
}

.pj-produto button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	opacity: 1;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.pj-produto button:disabled { cursor: default; }

#colocar_carrinho_1 { flex: 1; display: flex; flex-direction: column; }

/* ---------- barra do topo: só o X sobre a foto; ao rolar ganha fundo e o nome do produto ---------- */
.pj-produto__barra {
	position: sticky;
	top: 0;
	z-index: 20;
	display: flex;
	align-items: center;
	height: var(--pj-barra-h);
	margin-bottom: calc(-1 * var(--pj-barra-h)); /* não empurra a foto para baixo */
	padding: 0 64px 0 20px;
	pointer-events: none;
	transition: background .2s ease, box-shadow .2s ease;
}

.pj-produto__barra-titulo {
	min-width: 0;
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	opacity: 0;
	transition: opacity .2s ease;
}

.pj-produto--rolado .pj-produto__barra { background: #fff; box-shadow: 0 1px 0 var(--pj-borda); pointer-events: auto; }
.pj-produto--rolado .pj-produto__barra-titulo { opacity: 1; }
.pj-produto--rolado .pj-produto__fechar { box-shadow: none; background: var(--pj-fundo) !important; }

.pj-produto__fechar {
	pointer-events: auto;
	position: absolute;
	top: 9px;
	right: 12px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .95) !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
	color: var(--pj-txt) !important;
}
.pj-produto__fechar svg { width: 18px; height: 18px; }

/* ---------- fotos ---------- */
.pj-galeria {
	position: relative;
	background: var(--pj-fundo);
}

.pj-galeria__trilho {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}
.pj-galeria__trilho::-webkit-scrollbar { display: none; }

.pj-galeria__foto {
	flex: 0 0 100%;
	scroll-snap-align: center;
	height: 72vw;
	max-height: 420px;
}

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

.pj-galeria__pontos {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 12px;
	display: flex;
	justify-content: center;
	gap: 6px;
}

.pj-galeria__ponto {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: rgba(255, 255, 255, .6);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, .08);
	transition: width .2s ease, background .2s ease;
}
.pj-galeria__ponto.pj-ativo { width: 18px; border-radius: 4px; background: #fff; }

/* ---------- nome, descrição, preço ---------- */
.pj-produto__corpo { padding: 20px 20px 6px; }
.pj-produto--sem-foto .pj-produto__corpo { padding-top: 22px; padding-right: 64px; }

.pj-produto__nome {
	font-size: 21px !important;
	font-weight: 700 !important;
	line-height: 1.25;
	word-break: break-word;
}

.pj-produto__desc {
	margin-top: 8px !important;
	font-size: 14px !important;
	line-height: 1.55;
	color: var(--pj-txt-2) !important;
	white-space: pre-line;
	word-break: break-word;
}

.pj-produto__preco {
	margin-top: 12px !important;
	font-size: 17px !important;
	font-weight: 700 !important;
	color: var(--pj-acento) !important;
}
.pj-produto__preco small { font-size: 12px; font-weight: 500; color: var(--pj-txt-2); margin-right: 4px; }

/* ---------- grupos de escolha (tamanho / opcionais) ---------- */
.pj-grupo { margin-top: 18px; }

.pj-grupo__topo {
	position: sticky;
	top: var(--pj-barra-h);
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 20px;
	background: var(--pj-fundo);
	transition: background .25s ease;
}

.pj-grupo__titulo { font-size: 15px !important; font-weight: 700 !important; line-height: 1.3; }
.pj-grupo__regra { margin-top: 2px !important; font-size: 12px !important; color: var(--pj-txt-2) !important; }

.pj-grupo__selo {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 9px;
	border-radius: 6px;
	background: #3a3a3c;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: .3px;
	text-transform: uppercase;
	white-space: nowrap;
}
.pj-grupo__selo--contador { gap: 0; background: #fff; color: var(--pj-txt-2); box-shadow: inset 0 0 0 1px var(--pj-borda); }
.pj-grupo__selo svg { width: 12px; height: 12px; }
.pj-grupo__selo--obrigatorio svg { display: none; }
.pj-grupo--ok .pj-grupo__selo--obrigatorio svg { display: block; }
.pj-grupo--ok .pj-grupo__selo--obrigatorio { background: #e7f6ec; color: #11743a; }

.pj-grupo--erro .pj-grupo__topo { background: #fdecec; }
.pj-grupo--erro .pj-grupo__regra { color: #b42318 !important; font-weight: 700; }
.pj-grupo--erro .pj-grupo__selo--obrigatorio { background: #b42318; animation: pj-tremer .4s ease; }

@keyframes pj-tremer {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}

.pj-grupo__opcoes { padding: 0 20px; }

.pj-opcao {
	display: flex !important;
	align-items: center;
	gap: 14px;
	min-height: 60px;
	padding: 10px 0;
	border-bottom: 1px solid var(--pj-borda);
	cursor: pointer;
	-webkit-user-select: none;
	user-select: none;
}
.pj-opcao:last-child { border-bottom: 0; }

.pj-opcao__txt { flex: 1; min-width: 0; }
.pj-opcao__nome { display: block; font-size: 14px; line-height: 1.35; word-break: break-word; }
.pj-opcao__preco { display: block; margin-top: 2px; font-size: 13px; color: var(--pj-txt-2); }
.pj-opcao__preco--valor { color: var(--pj-txt); font-weight: 700; }

.pj-opcao--off { opacity: .45; cursor: default; }

/* input nativo escondido; a marca visual é o span .pj-opcao__marca */
.pj-opcao input[type="radio"],
.pj-opcao input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

.pj-opcao__marca {
	flex-shrink: 0;
	width: 22px;
	height: 22px;
	border: 2px solid #c7c7cc;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s ease, background .15s ease;
}
.pj-opcao__marca--quadrada { border-radius: 6px; }

.pj-opcao__marca svg { width: 13px; height: 13px; color: var(--pj-acento-txt); opacity: 0; transform: scale(.5); transition: all .15s ease; }

.pj-opcao input:checked + .pj-opcao__marca {
	border-color: var(--pj-acento);
	background: var(--pj-acento);
}
.pj-opcao input:checked + .pj-opcao__marca svg { opacity: 1; transform: scale(1); }
.pj-opcao input:focus-visible + .pj-opcao__marca { box-shadow: 0 0 0 3px rgba(0, 0, 0, .12); }

/* ---------- contador (− 0 +) ---------- */
.pj-qtd {
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	border-radius: 999px;
	background: var(--pj-fundo);
}

.pj-qtd button {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	color: var(--pj-acento);
	font-size: 20px;
	font-weight: 700;
	line-height: 1;
}
.pj-qtd button:disabled { color: #c7c7cc; }
.pj-qtd button svg { width: 16px; height: 16px; }

.pj-qtd__n {
	min-width: 20px;
	text-align: center;
	font-size: 14px;
	font-weight: 700;
}

/* na opção: só o "+" até escolher a primeira unidade */
.pj-opcao--qtd .pj-qtd:not(.pj-qtd--ativo) .pj-qtd__menos,
.pj-opcao--qtd .pj-qtd:not(.pj-qtd--ativo) .pj-qtd__n { display: none; }
.pj-opcao--qtd .pj-qtd:not(.pj-qtd--ativo) { background: transparent; box-shadow: inset 0 0 0 1px var(--pj-borda); }

/* ---------- observação ---------- */
.pj-obs { padding: 22px 20px 28px; }
.pj-obs__rotulo { display: block !important; font-size: 14px !important; font-weight: 700 !important; margin-bottom: 8px !important; }

.pj-obs textarea {
	width: 100%;
	min-height: 76px;
	padding: 12px 14px;
	border: 1px solid #d9d9de;
	border-radius: 12px;
	background: #fff;
	font: 14px/1.4 var(--pj-fonte, 'Plus Jakarta Sans', sans-serif);
	color: var(--pj-txt);
	resize: vertical;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.pj-obs textarea:focus { border-color: var(--pj-acento); box-shadow: 0 0 0 3px rgba(0, 0, 0, .06); }

/* ---------- rodapé fixo: quantidade + adicionar ---------- */
.pj-rodape {
	position: sticky;
	bottom: 0;
	z-index: 15;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: auto;
	padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
	background: rgba(255, 255, 255, .97);
	box-shadow: 0 -6px 18px -10px rgba(0, 0, 0, .2);
}

.pj-rodape .pj-qtd { background: var(--pj-fundo); height: 52px; padding: 0 6px; }
.pj-rodape .pj-qtd button { width: 38px; height: 38px; }
.pj-rodape .pj-qtd__n { min-width: 24px; font-size: 16px; }

.pj-adicionar {
	flex: 1;
	height: 52px;
	padding: 0 18px !important;
	border-radius: 14px;
	background: var(--pj-acento) !important;
	color: var(--pj-acento-txt) !important;
	justify-content: space-between !important;
	gap: 10px;
	font-size: 15px;
	font-weight: 700;
	box-shadow: 0 6px 16px -8px rgba(0, 0, 0, .35);
	transition: transform .12s ease, filter .15s ease;
}
.pj-adicionar:active { transform: scale(.98); }
.pj-adicionar.pj-carregando { filter: saturate(.6) brightness(.95); pointer-events: none; }
.pj-adicionar__total { font-weight: 700; white-space: nowrap; }

.pj-rodape__so-preco { flex: 1; text-align: center; font-size: 18px; font-weight: 700; color: var(--pj-acento); }

/* ---------- aviso (produto indisponível / erro) ---------- */
.pj-aviso {
	margin: 80px 20px 0;
	padding: 28px 20px;
	border-radius: 16px;
	background: var(--pj-fundo);
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pj-txt-2);
}
.pj-aviso strong { display: block; margin-bottom: 6px; font-size: 17px; color: var(--pj-txt); }

.pj-toast {
	position: fixed;
	left: 50%;
	bottom: 96px;
	z-index: 30;
	max-width: calc(100% - 32px);
	padding: 12px 16px;
	border-radius: 12px;
	background: #1d1d1f;
	color: #fff;
	font-size: 13.5px;
	line-height: 1.4;
	box-shadow: 0 8px 24px -8px rgba(0, 0, 0, .4);
	transform: translate(-50%, 20px);
	opacity: 0;
	transition: all .25s ease;
	pointer-events: none;
}
.pj-toast.pj-on { transform: translate(-50%, 0); opacity: 1; }

/* ---------- carrinho flutuante do index: "pulinho" ao adicionar ---------- */
#carrinho_floating.pj-pulo { animation: pj-pulo .5s ease; }
@keyframes pj-pulo {
	0%, 100% { transform: scale(1); }
	40% { transform: scale(1.04); }
}

/* ---------- esqueleto de carregamento (no index) ---------- */
.pj-sk { background: #fff; min-height: 100%; }
.pj-sk__foto { height: 72vw; max-height: 420px; }
.pj-sk__linha { height: 16px; margin: 14px 20px 0; border-radius: 8px; }
.pj-sk__linha--titulo { height: 24px; width: 60%; margin-top: 22px; }
.pj-sk__linha--curta { width: 40%; }
.pj-sk__bloco { background: linear-gradient(90deg, #f0f0f3 20%, #f8f8fa 50%, #f0f0f3 80%); background-size: 200% 100%; animation: pj-sk 1.4s linear infinite; }
@keyframes pj-sk { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ---------- telas grandes: produto vira um card centralizado ---------- */
@media screen and (min-width: 820px) {
	#div_pagina_item { background: rgba(20, 20, 22, .5) !important; }
	.pj-produto-fundo { padding: 4vh 0; }
	.pj-produto,
	.pj-sk {
		max-width: 620px;
		min-height: 0;
		margin: 0 auto;
		border-radius: 22px;
		overflow: hidden;
		box-shadow: 0 20px 60px -20px rgba(0, 0, 0, .5);
	}
	.pj-sk { margin-top: 4vh; min-height: 70vh; }
	.pj-produto { overflow: visible; }
	.pj-galeria { border-radius: 22px 22px 0 0; overflow: hidden; }
	.pj-rodape { border-radius: 0 0 22px 22px; }
	.pj-galeria__foto { height: 380px; }
}

/* promoção e combo */
.pj-riscado { margin-left: 4px; font-size: .78em; font-weight: 500; color: #8e8e93; }
.pj-produto__desconto { display: inline-flex; align-items: center; height: 22px; margin-left: 8px; padding: 0 8px; border-radius: 7px; background: #e5322d; color: #fff; font-size: 12px; font-weight: 800; vertical-align: 3px; }
.pj-combo { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: #f4f4f6; }
.pj-combo__titulo { margin: 0 0 8px !important; font-size: 13px !important; font-weight: 800; color: #1d1d1f !important; float: none !important; }
.pj-combo ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pj-combo li { display: flex; align-items: center; gap: 10px; }
.pj-combo__foto { width: 38px; height: 38px; flex-shrink: 0; border-radius: 10px; background: #e5e5ea center / cover no-repeat; }
.pj-combo__qtd { min-width: 28px; height: 22px; display: inline-flex; align-items: center; justify-content: center; border-radius: 6px; background: #1d1d1f; color: #fff; font-size: 12px; font-weight: 800; }
.pj-combo__nome { font-size: 14px; font-weight: 600; color: #1d1d1f; }
.pj-combo { display: block; width: 100%; box-sizing: border-box; clear: both; } .pj-combo__titulo { font-weight: 800 !important; width: 100%; } .pj-combo li { min-height: 28px; }
