/* DW Orçamento via WhatsApp — frontend */
:root {
	--dwo-btn: #25D366;
	--dwo-btn-text: #fff;
	--dwo-border: rgba(0, 0, 0, .12);
	--dwo-muted: rgba(0, 0, 0, .6);
	--dwo-radius: 8px;
}

/* Esconde o botão de compra (e o preço da variação) quando o produto é só orçamento */
.dwo-hide-cart form.cart .single_add_to_cart_button,
.dwo-hide-cart .elementor-add-to-cart .single_add_to_cart_button,
.dwo-hide-cart .wc-block-components-product-button__button {
	display: none !important;
}

/* Botão */
.dwo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: var(--dwo-btn) !important;
	color: var(--dwo-btn-text) !important;
	border: 0;
	border-radius: var(--dwo-radius);
	padding: 12px 20px;
	font-weight: 600;
	font-size: 1em;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none !important;
	transition: filter .15s, transform .15s;
}
.dwo-btn:hover { filter: brightness(.94); }
.dwo-btn:active { transform: translateY(1px); }
.dwo-btn:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.dwo-btn[disabled], .dwo-btn.is-loading { opacity: .65; cursor: progress; }
.dwo-ico { flex: 0 0 auto; }

.dwo-single-wrap { margin: 12px 0; width: 100%; }
.dwo-ctx-single { width: 100%; max-width: 420px; }
.dwo-ctx-loop { margin-top: 6px; font-size: .9em; padding: 9px 14px; }
.dwo-ctx-loop .dwo-ico { width: 16px; height: 16px; }
.dwo-fallback-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.dwo-price-text { font-weight: 600; }

/* Toast */
.dwo-toast {
	position: fixed;
	left: 50%;
	bottom: 24px;
	z-index: 99999;
	transform: translate(-50%, 20px);
	opacity: 0;
	pointer-events: none;
	display: flex;
	gap: 14px;
	align-items: center;
	max-width: calc(100vw - 32px);
	background: #1f2937;
	color: #fff;
	padding: 12px 18px;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
	font-size: 15px;
	transition: opacity .2s, transform .2s;
}
.dwo-toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.dwo-toast.is-error { background: #b91c1c; }
.dwo-toast a { color: #86efac; font-weight: 700; white-space: nowrap; text-decoration: underline; }

/* Contador flutuante */
.dwo-floating {
	position: fixed;
	left: 18px;
	bottom: 18px;
	z-index: 9998;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--dwo-btn);
	color: var(--dwo-btn-text) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
}
.dwo-floating[hidden] { display: none; }
.dwo-floating .dwo-count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: #ef4444;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}
.dwo-counter { display: inline-flex; gap: 6px; align-items: center; text-decoration: none; }
.dwo-counter .dwo-count { font-weight: 700; }

/* Página da lista */
.dwo-quote { max-width: 860px; margin: 0 auto; }
.dwo-loading, .dwo-empty, .dwo-success { text-align: center; padding: 32px 16px; }
.dwo-empty p { font-size: 1.1em; margin-bottom: 16px; }

.dwo-items { border: 1px solid var(--dwo-border); border-radius: 12px; overflow: hidden; margin-bottom: 28px; }
.dwo-item {
	display: grid;
	grid-template-columns: 72px 1fr auto 32px;
	gap: 14px;
	align-items: start;
	padding: 14px;
	border-bottom: 1px solid var(--dwo-border);
	transition: opacity .2s;
}
.dwo-item:last-child { border-bottom: 0; }
.dwo-item.is-removing { opacity: .4; pointer-events: none; }
.dwo-item-img img { width: 72px; height: 72px; object-fit: cover; border-radius: 6px; display: block; }
.dwo-item-name { font-weight: 600; line-height: 1.3; }
.dwo-item-name a { text-decoration: none; }
.dwo-item-sku { font-size: .85em; color: var(--dwo-muted); margin-top: 2px; }
.dwo-item-attrs { list-style: none; margin: 6px 0 0; padding: 0; font-size: .9em; }
.dwo-item-attrs li { margin: 0; }
.dwo-item-attrs li.is-undefined { color: #b45309; }
.dwo-note {
	width: 100%;
	margin-top: 8px;
	font-size: .9em;
	padding: 6px 8px;
	border: 1px solid var(--dwo-border);
	border-radius: 6px;
	resize: vertical;
	min-height: 34px;
	box-sizing: border-box;
}
.dwo-item-qty { display: flex; align-items: center; border: 1px solid var(--dwo-border); border-radius: 8px; overflow: hidden; }
.dwo-qty-btn {
	background: transparent !important;
	color: inherit !important;
	border: 0 !important;
	width: 34px;
	height: 38px;
	padding: 0 !important;
	font-size: 18px;
	cursor: pointer;
}
.dwo-qty {
	width: 52px !important;
	height: 38px;
	text-align: center;
	border: 0 !important;
	padding: 0 !important;
	-moz-appearance: textfield;
	appearance: textfield;
	background: transparent;
}
.dwo-qty::-webkit-inner-spin-button, .dwo-qty::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.dwo-remove {
	background: transparent !important;
	color: var(--dwo-muted) !important;
	border: 0 !important;
	font-size: 26px;
	line-height: 1;
	width: 32px;
	height: 32px;
	padding: 0 !important;
	cursor: pointer;
}
.dwo-remove:hover { color: #b91c1c !important; }

.dwo-form h3 { margin: 0 0 12px; }
.dwo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.dwo-field { margin: 0 0 14px; }
.dwo-field.dwo-full { grid-column: 1 / -1; }
.dwo-field label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .95em; }
.dwo-field label span { color: #b91c1c; }
.dwo-field input, .dwo-field textarea { width: 100%; box-sizing: border-box; }
.dwo-field .is-invalid { border-color: #b91c1c !important; box-shadow: 0 0 0 1px #b91c1c; }
.dwo-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.dwo-form-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; }
.dwo-form-error[hidden] { display: none; }
.dwo-send { width: 100%; padding: 15px 20px; font-size: 1.05em; }
.dwo-success h3 { margin-bottom: 8px; }
.dwo-success .dwo-btn { margin: 12px 0; }
.dwo-admin-warning { background: #fff7ed; border: 1px solid #fdba74; padding: 10px 14px; border-radius: 8px; }

@media (max-width: 600px) {
	.dwo-item { grid-template-columns: 56px 1fr 28px; gap: 10px; }
	.dwo-item-img img { width: 56px; height: 56px; }
	.dwo-item-qty { grid-column: 2; grid-row: 2; justify-self: start; }
	.dwo-remove { grid-column: 3; grid-row: 1; }
	.dwo-grid { grid-template-columns: 1fr; }
	.dwo-ctx-single { max-width: none; }
}
