/* B2B Woo - Estilos Gerais e Portal (Light & Dark Mode) */
:root {
	--b2b-primary: #1e3a8a;
	--b2b-primary-hover: #172554;
	--b2b-secondary: #0ea5e9;
	--b2b-bg: #f8fafc;
	--b2b-card: #ffffff;
	--b2b-header-bg: #ffffff;
	--b2b-text: #1e293b;
	--b2b-text-muted: #64748b;
	--b2b-border: #e2e8f0;
	--b2b-table-head: #f1f5f9;
	--b2b-table-hover: #f8fafc;
	--b2b-success: #16a34a;
	--b2b-success-bg: #dcfce7;
	--b2b-warning: #eab308;
	--b2b-danger: #dc2626;
	--b2b-sidebar-bg: #ffffff;
	--b2b-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
}

/* Modo Dark */
[data-theme="dark"] {
	--b2b-primary: #38bdf8;
	--b2b-primary-hover: #0284c7;
	--b2b-secondary: #0ea5e9;
	--b2b-bg: #090d16;
	--b2b-card: #131b2e;
	--b2b-header-bg: #0d1527;
	--b2b-text: #f1f5f9;
	--b2b-text-muted: #94a3b8;
	--b2b-border: #1e293b;
	--b2b-table-head: #172033;
	--b2b-table-hover: #162035;
	--b2b-success: #4ade80;
	--b2b-success-bg: #064e3b;
	--b2b-sidebar-bg: #131b2e;
	--b2b-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

body.b2b-portal-body {
	margin: 0;
	padding: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	background-color: var(--b2b-bg);
	color: var(--b2b-text);
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.25s ease, color 0.25s ease;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Header */
.b2b-portal-header {
	background: var(--b2b-header-bg);
	border-bottom: 1px solid var(--b2b-border);
	padding: 12px 30px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: var(--b2b-shadow);
}
.b2b-portal-brand {
	display: flex;
	align-items: center;
	gap: 14px;
	text-decoration: none;
	color: inherit;
}
.b2b-brand-logo-wrap {
	width: 44px;
	height: 44px;
	background: #000000;
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	flex-shrink: 0;
	box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}
.b2b-brand-logo-img {
	width: 32px;
	height: 32px;
	filter: invert(1);
	object-fit: contain;
}
.b2b-portal-brand h1 {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--b2b-text);
	line-height: 1.2;
}
.b2b-portal-brand span {
	font-size: 0.8rem;
	color: var(--b2b-text-muted);
	font-weight: 500;
}

.b2b-portal-nav {
	display: flex;
	gap: 20px;
	align-items: center;
}
.b2b-portal-nav a {
	text-decoration: none;
	color: var(--b2b-text-muted);
	font-weight: 600;
	font-size: 0.92rem;
	transition: color 0.2s;
	padding: 6px 0;
}
.b2b-portal-nav a:hover,
.b2b-portal-nav a.active {
	color: var(--b2b-primary);
}

.b2b-user-badge {
	background: var(--b2b-border);
	color: var(--b2b-text);
	padding: 6px 12px;
	border-radius: 20px;
	font-size: 0.82rem;
	font-weight: 600;
}

/* Theme Toggle Button */
.b2b-theme-toggle {
	background: var(--b2b-card);
	border: 1px solid var(--b2b-border);
	color: var(--b2b-text);
	padding: 6px 10px;
	border-radius: 8px;
	cursor: pointer;
	font-size: 0.85rem;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: all 0.2s;
}
.b2b-theme-toggle:hover {
	border-color: var(--b2b-primary);
}

/* Container */
.b2b-portal-content {
	max-width: 1380px;
	width: 100%;
	box-sizing: border-box;
	margin: 28px auto;
	padding: 0 20px 40px 20px;
	flex-grow: 1;
}

.b2b-portal-footer {
	margin-top: auto;
	text-align: center;
	padding: 24px;
	color: var(--b2b-text-muted);
	font-size: 0.85rem;
	border-top: 1px solid var(--b2b-border);
	background: var(--b2b-card);
}

/* Layout em Grid: Catálogo + Resumo Lateral */
.b2b-order-layout {
	display: grid;
	grid-template-columns: 1fr 340px;
	gap: 28px;
	align-items: start;
}

/* Cards & Tables */
.b2b-card {
	background: var(--b2b-card);
	border-radius: 10px;
	border: 1px solid var(--b2b-border);
	box-shadow: var(--b2b-shadow);
	overflow: hidden;
}
.b2b-table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
}
.b2b-table th {
	background: var(--b2b-table-head);
	padding: 14px 16px;
	font-weight: 700;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--b2b-text-muted);
	border-bottom: 1px solid var(--b2b-border);
}
.b2b-table td {
	padding: 14px 16px;
	border-bottom: 1px solid var(--b2b-border);
	vertical-align: middle;
	font-size: 0.92rem;
	color: var(--b2b-text);
}
.b2b-table tr:hover {
	background: var(--b2b-table-hover);
}
.b2b-thumb {
	width: 48px;
	height: 64px;
	object-fit: cover;
	border-radius: 4px;
	background: #eee;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Inputs */
.b2b-qty-input {
	width: 74px;
	padding: 8px;
	border: 1px solid var(--b2b-border);
	border-radius: 6px;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 700;
	background: var(--b2b-card);
	color: var(--b2b-text);
	box-sizing: border-box;
}
.b2b-qty-input:focus {
	outline: none;
	border-color: var(--b2b-primary);
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}

/* Preços */
.b2b-regular-price {
	color: var(--b2b-text-muted);
	text-decoration: line-through;
	font-size: 0.85rem;
	margin-right: 5px;
}
.b2b-wholesale-price {
	color: var(--b2b-primary);
	font-weight: 700;
	font-size: 1rem;
	text-decoration: none;
}
.b2b-badge {
	background: var(--b2b-success-bg);
	color: var(--b2b-success);
	font-size: 0.72rem;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 4px;
	margin-left: 6px;
}

/* PAINEL LATERAL FLUTUANTE (SIDEBAR SUMMARY) */
.b2b-sidebar-summary {
	background: var(--b2b-sidebar-bg);
	border: 1px solid var(--b2b-border);
	border-radius: 12px;
	padding: 24px;
	box-shadow: var(--b2b-shadow);
	position: sticky;
	top: 90px;
	display: flex;
	flex-direction: column;
	gap: 18px;
}
.b2b-summary-title {
	font-size: 1.15rem;
	font-weight: 700;
	margin: 0;
	color: var(--b2b-text);
	border-bottom: 1px solid var(--b2b-border);
	padding-bottom: 12px;
}
.b2b-summary-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 0.95rem;
}
.b2b-summary-row .label {
	color: var(--b2b-text-muted);
}
.b2b-summary-row .value {
	font-weight: 700;
	color: var(--b2b-text);
}
.b2b-summary-row.total {
	border-top: 1px solid var(--b2b-border);
	padding-top: 14px;
	font-size: 1.25rem;
}
.b2b-summary-row.total .value {
	color: var(--b2b-primary);
	font-weight: 800;
}
.b2b-min-alert {
	background: rgba(234, 179, 8, 0.12);
	border: 1px solid var(--b2b-warning);
	color: var(--b2b-warning);
	padding: 10px 12px;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.4;
}
.b2b-btn-checkout {
	background: #0284c7;
	color: #ffffff;
	border: none;
	width: 100%;
	padding: 14px 20px;
	font-size: 1rem;
	font-weight: 700;
	border-radius: 8px;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
}
.b2b-btn-checkout:hover:not(:disabled) {
	background: #0369a1;
}
.b2b-btn-checkout:disabled {
	opacity: 0.45;
	cursor: not-allowed;
	background: #64748b;
}

/* Responsividade Mobile */
@media (max-width: 992px) {
	.b2b-order-layout {
		grid-template-columns: 1fr;
	}
	.b2b-sidebar-summary {
		position: sticky;
		bottom: 0;
		top: auto;
		z-index: 90;
		border-radius: 12px 12px 0 0;
		box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
		padding: 16px 20px;
	}
	.b2b-portal-header {
		padding: 12px 16px;
		flex-wrap: wrap;
		gap: 12px;
	}
	.b2b-portal-nav {
		width: 100%;
		overflow-x: auto;
		padding-bottom: 4px;
	}
	.b2b-table th:nth-child(3),
	.b2b-table td:nth-child(3) {
		display: none; /* Esconde SKU em telas pequenas */
	}
}

/* Formulários */
.b2b-registration-container {
	max-width: 760px;
	margin: 30px auto;
	background: var(--b2b-card);
	padding: 35px;
	border-radius: 10px;
	border: 1px solid var(--b2b-border);
	box-shadow: var(--b2b-shadow);
}
.b2b-form-group {
	margin-bottom: 16px;
}
.b2b-form-group label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 0.88rem;
	color: var(--b2b-text);
}
.b2b-form-group input, .b2b-form-group select {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--b2b-border);
	border-radius: 6px;
	font-size: 0.92rem;
	background: var(--b2b-card);
	color: var(--b2b-text);
	box-sizing: border-box;
}
.b2b-form-row {
	display: flex;
	gap: 15px;
}
.b2b-form-row .half { flex: 1; }
.b2b-form-row .third { flex: 1; }

.b2b-fieldset {
	border: 1px solid var(--b2b-border);
	padding: 18px;
	border-radius: 8px;
	margin: 18px 0;
}
.b2b-fieldset legend {
	font-weight: 700;
	padding: 0 8px;
	color: var(--b2b-primary);
	font-size: 0.9rem;
}

/* Fieldset de Perfil Comercial — integrado harmoniosamente */
.b2b-fieldset-comercial {
	border-color: var(--b2b-border);
	background: transparent;
}
.b2b-fieldset-comercial legend {
	color: var(--b2b-primary);
}
.b2b-fieldset-desc {
	margin: 0 0 16px 0;
	font-size: 0.83rem;
	color: var(--b2b-text-muted);
	line-height: 1.5;
}

/* Campo "Outro estabelecimento" — aparece com slideDown */
.b2b-outro-wrap {
	margin-top: 8px;
}
.b2b-outro-wrap input {
	width: 100%;
	padding: 10px 12px;
	border: 1px dashed var(--b2b-secondary);
	border-radius: 6px;
	font-size: 0.92rem;
	background: rgba(14, 165, 233, 0.06);
	color: var(--b2b-text);
	box-sizing: border-box;
}

/* Label checkbox IE isento — sem style inline */
.b2b-ie-isento-label {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 8px;
	font-size: 0.82rem;
	color: var(--b2b-text-muted);
	font-weight: 400;
	cursor: pointer;
}
.b2b-ie-isento-label input[type="checkbox"] {
	width: auto;
	margin: 0;
	accent-color: var(--b2b-primary);
	cursor: pointer;
}

/* Campo readonly/desabilitado após marcar Isento */
.b2b-field-disabled {
	background-color: var(--b2b-table-head) !important;
	color: var(--b2b-text-muted) !important;
	cursor: not-allowed;
}

/* Estado UF — uppercase via CSS em vez de style inline */
.b2b-state-input {
	text-transform: uppercase;
}

/* Checkbox cards de modalidade de compra */
.b2b-checkbox-group {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 6px;
}
@media (max-width: 600px) {
	.b2b-checkbox-group {
		grid-template-columns: 1fr;
	}
}
.b2b-check-option {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 12px 14px;
	border: 1.5px solid var(--b2b-border);
	border-radius: 8px;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
	background: var(--b2b-card);
	font-weight: 400;
}
.b2b-check-option:hover {
	border-color: var(--b2b-secondary);
	background: var(--b2b-table-hover);
}
.b2b-check-option input[type="checkbox"] {
	width: auto;
	margin-top: 2px;
	flex-shrink: 0;
	accent-color: var(--b2b-primary);
	cursor: pointer;
}
.b2b-check-option:has(input:checked) {
	border-color: var(--b2b-primary);
	background: rgba(14, 165, 233, 0.08);
	box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15);
}
.b2b-check-option span {
	display: flex;
	flex-direction: column;
	gap: 2px;
	line-height: 1.3;
}
.b2b-check-option span strong {
	font-size: 0.875rem;
	color: var(--b2b-text);
}
.b2b-check-option span small {
	font-size: 0.75rem;
	color: var(--b2b-text-muted);
}
.b2b-check-box { display: none; }

/* Textarea do formulário */
.b2b-form-group textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--b2b-border);
	border-radius: 6px;
	font-size: 0.92rem;
	background: var(--b2b-card);
	color: var(--b2b-text);
	box-sizing: border-box;
	resize: vertical;
	font-family: inherit;
	line-height: 1.5;
}
.b2b-form-group textarea:focus {
	outline: none;
	border-color: var(--b2b-secondary);
	box-shadow: 0 0 0 3px rgba(14,165,233,0.12);
}


.b2b-button {
	display: inline-block;
	background: var(--b2b-primary);
	color: #fff;
	border: none;
	padding: 10px 20px;
	font-size: 0.92rem;
	font-weight: 600;
	border-radius: 6px;
	cursor: pointer;
	text-decoration: none;
	text-align: center;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.b2b-button:hover {
	background: var(--b2b-primary-hover);
}
.b2b-button.b2b-btn-secondary {
	background: var(--b2b-table-head);
	color: var(--b2b-text);
	border: 1px solid var(--b2b-border);
}
.b2b-button.b2b-btn-secondary:hover {
	background: var(--b2b-border);
	color: var(--b2b-text);
	border-color: var(--b2b-text-muted);
}
.b2b-btn-full {
	width: 100%;
	box-sizing: border-box;
}
.b2b-submit-group {
	margin-top: 25px;
}

/* Linha Lembrar-me / Esqueceu a senha? */
.b2b-login-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-bottom: 4px;
}
.b2b-remember-label {
	display: flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;   /* evita quebra de linha entre checkbox e texto */
	font-weight: 400;
	font-size: 0.85rem;
	color: var(--b2b-text-muted);
	cursor: pointer;
	margin: 0;
}
.b2b-remember-label input[type="checkbox"] {
	width: auto;
	margin: 0;
	accent-color: var(--b2b-primary);
	cursor: pointer;
	flex-shrink: 0;
}
.b2b-forgot-link {
	white-space: nowrap;
	font-size: 0.85rem;
	color: var(--b2b-secondary);
	text-decoration: none;
	flex-shrink: 0;
}
.b2b-forgot-link:hover {
	text-decoration: underline;
}


/* Q-01: Badges de status na listagem de usuários do WP-Admin */
.b2b-status-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}
.b2b-status-aprovado {
	background-color: #dcfce7;
	color: #15803d;
	border: 1px solid #bbf7d0;
}
.b2b-status-pendente {
	background-color: #fef9c3;
	color: #a16207;
	border: 1px solid #fef08a;
}
.b2b-status-bloqueado {
	background-color: #fee2e2;
	color: #b91c1c;
	border: 1px solid #fecaca;
}

/* ══════════════════════════════════════════════════════════════
   PÁGINA INTRODUTÓRIA B2B & PARCERIAS
   ══════════════════════════════════════════════════════════════ */
.b2b-intro-hero {
	text-align: center;
	padding: 50px 20px 35px 20px;
	max-width: 860px;
	margin: 0 auto;
}
.b2b-intro-tag {
	display: inline-block;
	background: rgba(14, 165, 233, 0.12);
	color: var(--b2b-secondary);
	font-size: 0.82rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	padding: 6px 14px;
	border-radius: 20px;
	margin-bottom: 16px;
}
.b2b-intro-title {
	font-size: 2.3rem;
	font-weight: 800;
	color: var(--b2b-text);
	line-height: 1.25;
	margin: 0 0 16px 0;
}
.b2b-intro-subtitle {
	font-size: 1.12rem;
	color: var(--b2b-text-muted);
	line-height: 1.6;
	margin: 0 auto 30px auto;
	max-width: 680px;
}
.b2b-intro-cta-row {
	display: flex;
	justify-content: center;
	gap: 15px;
	flex-wrap: wrap;
}
.b2b-intro-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
	gap: 24px;
	max-width: 1100px;
	margin: 20px auto 40px auto;
	padding: 0 20px;
}
.b2b-intro-card {
	background: var(--b2b-card);
	border: 1px solid var(--b2b-border);
	border-radius: 12px;
	padding: 28px 24px;
	box-shadow: var(--b2b-shadow);
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
	display: flex;
	flex-direction: column;
}
.b2b-intro-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 20px rgba(0,0,0,0.08);
	border-color: var(--b2b-secondary);
}
.b2b-intro-card-icon {
	width: 52px;
	height: 52px;
	border-radius: 10px;
	background: rgba(14, 165, 233, 0.1);
	color: var(--b2b-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.5rem;
	margin-bottom: 20px;
}
.b2b-intro-card h3 {
	font-size: 1.2rem;
	font-weight: 700;
	margin: 0 0 10px 0;
	color: var(--b2b-text);
}
.b2b-intro-card p {
	font-size: 0.92rem;
	color: var(--b2b-text-muted);
	line-height: 1.55;
	margin: 0;
	flex-grow: 1;
}

/* ══════════════════════════════════════════════════════════════
   BOX DE TERMOS & ACEITE COM AUDITORIA LEGAL
   ══════════════════════════════════════════════════════════════ */
.b2b-terms-box {
	background: var(--b2b-table-head);
	border: 1px solid var(--b2b-border);
	border-radius: 8px;
	padding: 16px;
	max-height: 190px;
	overflow-y: auto;
	font-size: 0.85rem;
	color: var(--b2b-text);
	line-height: 1.6;
	margin-bottom: 12px;
	white-space: pre-wrap;
}
.b2b-terms-checkbox-wrap {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	font-size: 0.88rem;
	color: var(--b2b-text);
	line-height: 1.45;
}
.b2b-terms-checkbox-wrap input[type="checkbox"] {
	width: auto;
	margin-top: 3px;
	flex-shrink: 0;
	accent-color: var(--b2b-primary);
	cursor: pointer;
}
.b2b-terms-hash-badge {
	font-family: monospace;
	font-size: 0.78rem;
	background: var(--b2b-table-head);
	color: var(--b2b-primary);
	padding: 2px 6px;
	border-radius: 4px;
	border: 1px solid var(--b2b-border);
	display: inline-block;
}

/* ══════════════════════════════════════════════════════════════
   MODAL DE CONFIRMAÇÃO & DETALHES DE PEDIDO
   ══════════════════════════════════════════════════════════════ */
.b2b-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(4px);
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	animation: b2bFadeIn 0.2s ease-out;
}
.b2b-modal-content {
	background: var(--b2b-card);
	border-radius: 12px;
	border: 1px solid var(--b2b-border);
	box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.25);
	max-width: 650px;
	width: 100%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	color: var(--b2b-text);
}
.b2b-modal-header {
	padding: 18px 24px;
	border-bottom: 1px solid var(--b2b-border);
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.b2b-modal-header h3 {
	margin: 0;
	font-size: 1.25rem;
	color: var(--b2b-text);
}
.b2b-modal-close {
	background: transparent;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	color: var(--b2b-text-muted);
	cursor: pointer;
	padding: 4px 8px;
}
.b2b-modal-close:hover {
	color: var(--b2b-danger);
}
.b2b-modal-body {
	padding: 24px;
	overflow-y: auto;
	flex-grow: 1;
}
.b2b-modal-footer {
	padding: 16px 24px;
	border-top: 1px solid var(--b2b-border);
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	background: var(--b2b-table-head);
}
@keyframes b2bFadeIn {
	from { opacity: 0; transform: scale(0.98); }
	to { opacity: 1; transform: scale(1); }
}

/* Rastreio & Badges */
.b2b-tracking-code {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: #e0f2fe;
	color: #0369a1;
	padding: 4px 10px;
	border-radius: 6px;
	font-size: 0.85rem;
	font-weight: 700;
	text-decoration: none;
	border: 1px solid #bae6fd;
}
.b2b-tracking-code:hover {
	background: #bae6fd;
	color: #0284c7;
}
.b2b-tracking-empty {
	color: var(--b2b-text-muted);
	font-size: 0.85rem;
	font-style: italic;
}


