/* Lista de Desejos - estilos front-end (mobile-first) */

.ld-wrap {
	--ld-primary: #d6336c;
	--ld-primary-dark: #a61e4d;
	--ld-bg: #fdf2f6;
	--ld-text: #2d2a2e;
	--ld-muted: #8a8a8a;
	--ld-border: #f0d9e4;
	--ld-radius: 14px;

	max-width: 640px;
	margin: 0 auto;
	padding: 16px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--ld-text);
	box-sizing: border-box;
}
.ld-wrap * { box-sizing: border-box; }

.ld-muted { color: var(--ld-muted); font-size: 0.85rem; }

/* ---------- Botões ---------- */
.ld-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 10px 16px;
	border-radius: 999px;
	border: 1px solid var(--ld-primary);
	background: var(--ld-primary);
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: transform .1s ease, background .15s ease;
}
.ld-btn:hover { background: var(--ld-primary-dark); border-color: var(--ld-primary-dark); }
.ld-btn:active { transform: scale(0.97); }
.ld-btn-outline { background: transparent; color: var(--ld-primary); }
.ld-btn-outline:hover { background: var(--ld-bg); }
.ld-btn-sm { padding: 6px 12px; font-size: 0.85rem; }
.ld-btn-full { width: 100%; }
.ld-btn-primary { }

/* ---------- Formulários ---------- */
.ld-card {
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius);
	padding: 20px;
	box-shadow: 0 2px 10px rgba(0,0,0,.04);
}
.ld-form h2 { margin-top: 0; font-size: 1.3rem; }
.ld-field { margin-bottom: 14px; display: flex; flex-direction: column; gap: 4px; }
.ld-field label { font-size: 0.85rem; font-weight: 600; }
.ld-field input, .ld-select {
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 10px;
	font-size: 1rem;
	width: 100%;
}
.ld-field input:focus, .ld-select:focus { outline: none; border-color: var(--ld-primary); }
.ld-form-msg { min-height: 20px; font-size: 0.9rem; margin-bottom: 10px; }
.ld-form-msg.is-erro { color: #c0392b; }
.ld-form-msg.is-sucesso { color: #2f9e44; }
.ld-form-footer { text-align: center; font-size: 0.9rem; margin-top: 12px; }
.ld-auth-wrap { padding-top: 30px; }

.ld-link-com-botao { display: flex; gap: 8px; }
.ld-link-com-botao input { flex: 1; }
.ld-link-com-botao .ld-btn { flex-shrink: 0; white-space: nowrap; }

.ld-campo-moeda { display: flex; align-items: center; border: 1px solid #ddd; border-radius: 10px; overflow: hidden; }
.ld-campo-moeda-prefixo { padding: 10px 0 10px 12px; color: var(--ld-muted); font-weight: 600; }
.ld-campo-moeda input { border: none; border-radius: 0; padding-left: 6px; }
.ld-campo-moeda input:focus { outline: none; }
.ld-campo-moeda:focus-within { border-color: var(--ld-primary); }

.ld-upload-imagem { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.ld-desejo-preview {
	width: 100px;
	height: 100px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	border: 1px solid var(--ld-border);
	background: #f5f5f5;
}

/* ---------- Painel ---------- */
.ld-painel-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.ld-painel-header h2 { margin: 0 0 4px; font-size: 1.25rem; }
.ld-painel-header-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.ld-tabs {
	display: flex;
	gap: 6px;
	margin: 18px 0 14px;
	border-bottom: 1px solid var(--ld-border);
	overflow-x: auto;
}
.ld-tab {
	background: none;
	border: none;
	padding: 10px 6px;
	font-weight: 600;
	color: var(--ld-muted);
	cursor: pointer;
	border-bottom: 3px solid transparent;
	white-space: nowrap;
}
.ld-tab.is-active { color: var(--ld-primary); border-color: var(--ld-primary); }

/* ---------- Listagem vertical (mobile-first) ---------- */
.ld-lista-desejos {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.ld-card-desejo {
	display: flex;
	gap: 12px;
	background: #fff;
	border: 1px solid var(--ld-border);
	border-radius: var(--ld-radius);
	padding: 12px;
	align-items: stretch;
}
.ld-card-desejo.ld-card-oculto { display: none; }
.ld-card-opaco { opacity: 0.45; }
.ld-card-img {
	width: 84px;
	height: 84px;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	flex-shrink: 0;
	background: #f5f5f5;
}
.ld-card-body { flex: 1; min-width: 0; }
.ld-card-titulo { margin: 2px 0 4px; font-size: 1.02rem; line-height: 1.25; }
.ld-card-valor { margin: 0; font-weight: 700; color: var(--ld-primary-dark); }
.ld-card-tamanho { margin: 2px 0 6px; font-size: 0.85rem; color: var(--ld-muted); }
.ld-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }

.ld-badge {
	display: inline-block;
	font-size: 0.7rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .02em;
	padding: 2px 8px;
	border-radius: 999px;
	margin-bottom: 6px;
	background: #eee;
	color: #555;
}
.ld-badge-rascunho { background: #fff3bf; color: #966b02; }
.ld-badge-publicado { background: #d3f9d8; color: #2b8a3e; }
.ld-badge-reservado { background: #ffe3e3; color: #c92a2a; }
.ld-badge-recebido { background: #e5dbff; color: #5f3dc4; }

.ld-vazio { text-align: center; color: var(--ld-muted); padding: 40px 10px; }

.ld-alerta {
	padding: 12px 16px;
	border-radius: 10px;
	margin-bottom: 16px;
	font-size: 0.9rem;
	font-weight: 600;
	text-align: center;
}
.ld-alerta-erro { background: #ffe3e3; color: #c92a2a; }

.ld-confirmacao-reserva { padding-top: 40px; }
.ld-confirmacao-card { text-align: center; }
.ld-confirmacao-card h2 { margin-top: 0; }

/* ---------- Lista pública ---------- */
.ld-lista-publica-topo { text-align: center; margin-bottom: 18px; }
.ld-logo-site { max-height: 60px; margin-bottom: 10px; }
.ld-titulo-lista { font-size: 1.2rem; margin: 0 0 12px; }
.ld-filtro-wrap { display: flex; justify-content: flex-end; }
.ld-filtro-wrap .ld-select { width: auto; }

/* ---------- Modais ---------- */
.ld-modal[hidden] { display: none; }
.ld-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: flex-end;
	justify-content: center;
}
.ld-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.5);
}
.ld-modal-conteudo {
	position: relative;
	background: #fff;
	width: 100%;
	max-width: 480px;
	max-height: 90vh;
	min-height: 0; /* essencial dentro de um flex container para o overflow-y funcionar corretamente */
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	border-radius: 20px 20px 0 0;
	padding: 24px 20px;
	animation: ld-slide-up .2s ease-out;
}
@media (min-width: 640px) {
	.ld-modal { align-items: center; }
	.ld-modal-conteudo { border-radius: 16px; }
}
@keyframes ld-slide-up {
	from { transform: translateY(30px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}
.ld-modal-fechar {
	position: absolute;
	top: 12px;
	right: 14px;
	background: none;
	border: none;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
	color: var(--ld-muted);
}
.ld-modal-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.ld-modal-actions .ld-btn { flex: 1; }

/* Compartilhar */
.ld-share-link { display: flex; gap: 8px; margin: 14px 0; }
.ld-share-link input { flex: 1; padding: 10px 12px; border: 1px solid #ddd; border-radius: 10px; }
.ld-share-redes { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ld-share-rede {
	flex: 1;
	min-width: 100px;
	text-align: center;
	padding: 10px;
	border-radius: 10px;
	background: var(--ld-bg);
	color: var(--ld-primary-dark);
	text-decoration: none;
	font-weight: 600;
	font-size: 0.85rem;
}
.ld-share-qrcode { display: flex; justify-content: center; padding: 10px 0; }

.ld-modal-sucesso { text-align: center; }
