/**
 * File Path: assets/css/mbs-admin-onix.css
 *
 * ONIX Distribution Data Metabox -- Admin styles
 *
 * Redesigned (Session 190) to match the Book Editor visual language:
 * radio card group for territory type, compact field rows for Product
 * Contact, and section headings that mirror .mbs-format-section-heading.
 *
 * @package MyBookShowroom
 * @since   1.3.0
 */

/* ==========================================================================
   Outer wrapper
   ========================================================================== */

.mbs-onix-wrap {
	padding: 4px 0 12px;
}

/* ==========================================================================
   Sections
   ========================================================================== */

.mbs-onix-section {
	margin-bottom: 28px;
}

.mbs-onix-section:last-child {
	margin-bottom: 0;
}

/* ==========================================================================
   Section headings -- match .mbs-format-section-heading
   ========================================================================== */

.mbs-onix-section-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 6px;
	margin: 0 0 14px;
}

/* ==========================================================================
   "ONIX 3.0 / 3.1" inline badge
   ========================================================================== */

.mbs-onix-badge {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #646970;
	background: #f0f0f1;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	padding: 1px 6px;
	line-height: 1.6;
}

/* ==========================================================================
   Section description text
   ========================================================================== */

.mbs-onix-section-desc {
	margin: 0 0 14px !important;
	color: #646970;
	font-size: 13px;
}

/* ==========================================================================
   Territory fieldset -- remove browser chrome
   ========================================================================== */

.mbs-onix-territory-fieldset {
	border: none;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Territory type -- radio card group
   ========================================================================== */

.mbs-onix-radio-group {
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
	margin: 0 0 16px;
	background: #fff;
}

.mbs-onix-radio-group .mbs-onix-radio-option {
	padding: 12px 16px;
	border-bottom: 1px solid #dcdcde;
	cursor: pointer;
	transition: background 0.1s;
}

.mbs-onix-radio-main {
	display: flex !important;
	align-items: flex-start;
	gap: 10px;
	width: 100%;
	cursor: pointer;
}

.mbs-onix-radio-text {
	display: flex !important;
	flex-direction: column;
	gap: 3px;
}

.mbs-onix-radio-group .mbs-onix-radio-option:last-child {
	border-bottom: none;
}

.mbs-onix-radio-group .mbs-onix-radio-option:hover {
	background: #f6f7f7;
}

.mbs-onix-radio-group .mbs-onix-radio-option:has(input[type="radio"]:checked) {
	background: #f0f6fc;
}

.mbs-onix-radio-group .mbs-onix-radio-option input[type="radio"] {
	flex-shrink: 0;
	margin: 3px 0 0;
}


.mbs-onix-radio-desc {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: #646970;
	line-height: 1.4;
	margin: 0;
}

/* ==========================================================================
   Territory grid panel -- shown when type is include or exclude
   ========================================================================== */

.mbs-onix-territory-grid {
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	padding: 14px 16px;
	background: #fafafa;
}

.mbs-territory-hidden {
	display: none !important;
}

.mbs-territory-hint {
	margin: 0 0 14px !important;
	font-style: italic;
	color: #50575e;
	font-size: 13px;
}

/* ==========================================================================
   Regional group cards
   ========================================================================== */

.mbs-territory-group {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 4px;
	padding: 16px 20px 20px;
	margin-bottom: 16px;
}

.mbs-territory-group:last-child {
	margin-bottom: 0;
}

.mbs-territory-group-header {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 14px;
	border-bottom: 1px solid #dcdcde;
	padding-bottom: 10px;
}

.mbs-territory-region-label {
	flex: 1;
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #3c434a;
}

.mbs-territory-sep {
	color: #c3c4c7;
	font-size: 11px;
	margin: 0;
}

.mbs-territory-toggle {
	font-size: 11px;
	color: var(--mbs-status-info);
	text-decoration: none;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	line-height: 1;
}

.mbs-territory-toggle:hover {
	color: var(--mbs-status-info-dark);
	text-decoration: underline;
}

/* ==========================================================================
   Country checkboxes -- 3-column grid per region
   ========================================================================== */

.mbs-territory-checkboxes {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 10px 16px;
}

.mbs-territory-check-label {
	display: flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	cursor: pointer;
	padding: 2px 0;
}

.mbs-territory-check-label input[type="checkbox"] {
	margin: 0;
	flex-shrink: 0;
}

/* ==========================================================================
   Product Contact -- bordered field rows, no form-table
   ========================================================================== */

.mbs-onix-fields {
	border: 1px solid #dcdcde;
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.mbs-onix-field-row {
	display: grid;
	grid-template-columns: 140px 1fr;
	align-items: center;
	gap: 8px 16px;
	padding: 10px 14px;
	border-bottom: 1px solid #f0f0f1;
	min-height: 48px;
}

.mbs-onix-field-row:last-child {
	border-bottom: none;
}

.mbs-onix-field-label {
	font-size: 13px;
	font-weight: 500;
	color: #1d2327;
	line-height: 1.4;
}

.mbs-onix-field-control {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.mbs-onix-field-control .description {
	margin: 0 !important;
	font-size: 12px;
	color: #646970;
}

.mbs-onix-field-control select,
.mbs-onix-field-control input[type="text"],
.mbs-onix-field-control input[type="email"] {
	max-width: 320px;
}

/* ==========================================================================
   Legacy territorial rights notice (may be rendered in some code paths)
   ========================================================================== */

.mbs-onix-legacy-notice {
	background: #f0f6fc;
	border-left: 4px solid #72aee6;
	border-radius: 0 2px 2px 0;
	padding: 10px 14px;
	margin-bottom: 16px;
}

.mbs-onix-legacy-notice strong {
	display: block;
	margin-bottom: 2px;
	color: #1d2327;
	font-size: 13px;
}

.mbs-onix-legacy-value {
	font-style: italic;
	color: #3c434a;
}

.mbs-onix-legacy-notice .description {
	margin: 6px 0 0;
	color: #646970;
}

/* ==========================================================================
   Required-field indicator ("!") -- mandatory ONIX fields only
   ========================================================================== */

.mbs-onix-required {
	color: #d63638;
	font-weight: 700;
	margin-left: 4px;
	cursor: pointer;
	position: relative;
}

.mbs-onix-tip {
	position: absolute;
	z-index: 9999;
	left: 0;
	top: calc(100% + 4px);
	min-width: 180px;
	max-width: 280px;
	background: #1d2327;
	color: #fff;
	font-size: 12px;
	font-weight: 400;
	line-height: 1.5;
	padding: 6px 10px;
	border-radius: 4px;
	white-space: normal;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	pointer-events: none;
}
