/**
 * Warranty Workflow — frontend customer UI + admin dashboard.
 */

/* ---------- Customer: warranty section on order page ---------- */

.zorem-warranty-section {
	margin-top: 24px;
	padding: 16px;
	border: 1px solid #e0e3e6;
	border-radius: 6px;
	background: #fafbfc;
}

.zorem-warranty-section h2 {
	margin: 0 0 12px;
	font-size: 16px;
}

.zorem-warranty-claims-list {
	margin-bottom: 12px;
}

.zorem-warranty-claim-row {
	padding: 10px 12px;
	margin-bottom: 8px;
	border-left: 3px solid #c3c4c7;
	background: #fff;
	font-size: 14px;
}

.zorem-warranty-claim-row.status-submitted   { border-left-color: #2271b1; }
.zorem-warranty-claim-row.status-under-review { border-left-color: #dba617; }
.zorem-warranty-claim-row.status-approved    { border-left-color: #2e7d32; }
.zorem-warranty-claim-row.status-rejected    { border-left-color: #b32d2e; }
.zorem-warranty-claim-row.status-resolved    { border-left-color: #4a4a4a; }

.zorem-warranty-claim-meta { margin-bottom: 4px; }
.zorem-warranty-claim-date { color: #646970; }

/* Customer-facing pill (on the order page) — colored fill. */
.zorem-warranty-section .zorem-warranty-status-pill {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 10px;
	font-size: 12px;
	font-weight: 600;
	color: #fff;
	background: #50575e;
}
.zorem-warranty-section .zorem-warranty-status-pill.status-submitted    { background: #2271b1; }
.zorem-warranty-section .zorem-warranty-status-pill.status-under-review { background: #dba617; }
.zorem-warranty-section .zorem-warranty-status-pill.status-approved     { background: #2e7d32; }
.zorem-warranty-section .zorem-warranty-status-pill.status-rejected     { background: #b32d2e; }
.zorem-warranty-section .zorem-warranty-status-pill.status-resolved     { background: #4a4a4a; }

/* Admin dashboard pill — matches Returns Dashboard style (light pill, colored dot, dark text). */
.fullfilments_table .zorem-warranty-status-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 11px;
	border-radius: 4px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	font-weight: 700;
	line-height: 1.4;
	background: #f3f4f6;
	color: #374151;
}
.fullfilments_table .zorem-warranty-status-pill::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	flex: 0 0 8px;
	background: #9ca3af;
}
.fullfilments_table .zorem-warranty-status-pill.status-submitted::before    { background: #2271b1; }
.fullfilments_table .zorem-warranty-status-pill.status-under-review::before { background: #dba617; }
.fullfilments_table .zorem-warranty-status-pill.status-approved::before     { background: #2e7d32; }
.fullfilments_table .zorem-warranty-status-pill.status-rejected::before     { background: #b32d2e; }
.fullfilments_table .zorem-warranty-status-pill.status-resolved::before     { background: #4a4a4a; }

.zorem-warranty-action { margin-top: 10px; }

.zorem-warranty-button {
	display: inline-block;
	padding: 8px 16px;
}

/* ---------- Customer claim form ---------- */

.zorem-warranty-form-container {
	max-width: 640px;
	margin: 20px 0;
}

.zorem-warranty-form-intro {
	color: #646970;
	margin-bottom: 16px;
}

.zorem-warranty-field {
	margin-bottom: 14px;
}

.zorem-warranty-field label { display: block; margin-bottom: 4px; }
.zorem-warranty-field select,
.zorem-warranty-field textarea,
.zorem-warranty-field input[type="file"] {
	width: 100%;
	box-sizing: border-box;
	padding: 8px 10px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 14px;
}

.zorem-warranty-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.zorem-warranty-submit-btn {
	padding: 8px 18px;
}

.zorem-warranty-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid #c3c4c7;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: zorem-warranty-spin 0.7s linear infinite;
}
@keyframes zorem-warranty-spin { to { transform: rotate( 360deg ); } }

.zorem-warranty-result {
	margin-top: 10px;
	padding: 10px;
	border-radius: 4px;
}
.zorem-warranty-result.is-success { background: #d4edda; color: #155724; }
.zorem-warranty-result.is-error   { background: #f8d7da; color: #721c24; }

/* ---------- Tab visibility (matches the existing returns/exchanges CSS-radio pattern) ----------
 * Show the warranty section only when its tab radio is the checked sibling.
 */
#warranty_orders:checked ~ #warranty_orders_content {
	display: block !important;
}

/* ---------- Admin dashboard ---------- */

.zorem-warranty-dashboard {
	padding: 12px 16px;
	background: #fff;
}

.zorem-warranty-toolbar {
	padding: 10px 0;
}

.zorem-warranty-filter {
	display: inline-flex;
	gap: 8px;
	align-items: center;
}

.zorem-warranty-table {
	margin-top: 8px;
}

.zorem-warranty-detail {
	padding: 14px;
	background: #f6f7f7;
	border-left: 3px solid #2271b1;
}

.zorem-warranty-detail h4 {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.zorem-warranty-detail-cols {
	display: flex;
	gap: 20px;
	flex-wrap: wrap;
}

.zorem-warranty-detail-col {
	flex: 1;
	min-width: 280px;
}

.zorem-warranty-detail-col label {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	font-weight: 600;
}

.zorem-warranty-detail-col select,
.zorem-warranty-detail-col textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 6px 8px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	margin-top: 2px;
}

.zorem-warranty-attachments {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 4px;
}
.zorem-warranty-attachments img {
	max-width: 90px;
	max-height: 90px;
	border-radius: 4px;
	border: 1px solid #c3c4c7;
}

.zorem-warranty-save-status {
	margin-left: 8px;
	font-size: 13px;
}
