/* =====================================================
   ORDER DETAIL PAGE
   ===================================================== */

/* --- Header --- */
.rw-order-detail-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-bottom: 16px;
}

.rw-order-detail-back {
	color: #111739;
	flex-shrink: 0;
	margin-top: 2px;
	transition: color 0.15s ease;
}

.rw-order-detail-back:hover {
	color: #0064c8;
}

.rw-order-detail-title-group {
	flex: 1;
	min-width: 0;
}

.rw-order-detail-title {
	font-size: 18px;
	font-weight: 700;
	color: #111739;
	line-height: 1.36;
	letter-spacing: -0.18px;
	margin: 0;
}

.rw-order-detail-date {
	font-size: 14px;
	font-weight: 400;
	color: #111739;
	line-height: 1.36;
	letter-spacing: -0.14px;
	margin: 4px 0 0;
}

.rw-order-status-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border-radius: 9999px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.32;
	letter-spacing: -0.12px;
	white-space: nowrap;
	flex-shrink: 0;
	background-color: #eaeef3;
	color: #111739;
}

.rw-order-status-badge--processing {
	background-color: #e6f4ea;
	color: #137333;
}

.rw-order-status-badge--completed {
	background-color: #e6f4ea;
	color: #137333;
}

.rw-order-status-badge--on-hold {
	background-color: #eaeef3;
	color: #111739;
}

.rw-order-status-badge--cancelled,
.rw-order-status-badge--failed {
	background-color: #fce8e6;
	color: #c5221f;
}

.rw-order-status-badge--pending {
	background-color: #fef7e0;
	color: #b05a00;
}

.rw-order-status-badge--refunded {
	background-color: #f3e8fd;
	color: #7627bb;
}

/* --- Card Container --- */
.rw-order-detail-card {
	border: 1px solid #e9edf1;
	border-radius: 4px;
	overflow: hidden;
}

/* --- Section --- */
.rw-order-detail-section {
	padding: 16px;
	border-bottom: 1px solid #e9edf1;
}

.rw-order-detail-section--last {
	border-bottom: none;
}

.rw-order-detail-section-title {
	font-size: 16px;
	font-weight: 700;
	color: #111739;
	line-height: 1.32;
	letter-spacing: -0.16px;
	margin: 0 0 16px;
}

/* --- Product Items --- */
.rw-order-detail-products {
	display: flex;
	flex-direction: column;
	gap: 0px;
}

.rw-order-detail-product--hidden {
	display: none;
}

.rw-order-item {
	padding: 14px 0;
	padding-top: 0;
}

.rw-order-item-main {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.rw-order-item-thumb {
	width: 82px;
	height: 59px;
	border-radius: 2px;
	overflow: hidden;
	flex-shrink: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	background: #f8f9fa;
}

.rw-order-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 2px;
}

.rw-order-item-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.rw-order-item-name {
	font-size: 14px;
	font-weight: 400;
	color: #111739;
	line-height: 1.36;
	letter-spacing: -0.14px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.rw-order-item-name a {
	color: #111739;
	text-decoration: none;
}

.rw-order-item-name a:hover {
	color: #0064c8;
}

.rw-order-item-option {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 12px;
	line-height: 1.32;
}

.rw-order-item-option-label {
	color: #354261;
	font-weight: 400;
}

.rw-order-item-option-value {
	color: #111739;
	font-weight: 500;
	letter-spacing: -0.12px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.rw-order-item-price {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
	flex-shrink: 0;
}

.rw-order-item-price-current {
	font-size: 14px;
	font-weight: 700;
	color: #e01d1d;
	line-height: 1.36;
	letter-spacing: -0.14px;
}

.rw-order-item-price-original {
	font-size: 14px;
	font-weight: 500;
	color: #a7a9b6;
	text-decoration: line-through;
	line-height: 1;
}

.rw-order-item-purchase-note {
	margin-top: 8px;
	padding: 8px 12px;
	background: #f8f9fa;
	border-radius: 4px;
	font-size: 13px;
	color: #354261;
}

/* --- Show More Button --- */
.rw-order-detail-show-more {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: #0064c8;
	line-height: 1.36;
	letter-spacing: -0.14px;
	margin-top: 8px;
}

.rw-order-detail-show-more:hover {
	color: #004fa3;
}

.rw-order-detail-show-more-icon {
	transition: transform 0.2s ease;
}

.rw-order-detail-show-more[data-expanded="true"]
	.rw-order-detail-show-more-icon {
	transform: rotate(180deg);
}

/* --- Key-Value Rows (Order Detail specific) --- */
.rw-order-detail-address-rows,
.rw-order-detail-payment-rows {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.rw-order-detail-label {
	font-size: 14px;
	font-weight: 400;
	color: #354261;
	line-height: 1.36;
	letter-spacing: -0.14px;
}

.rw-order-detail-value {
	font-size: 14px;
	font-weight: 500;
	color: #111739;
	line-height: 1.36;
	letter-spacing: -0.14px;
	text-align: right;
}

/* --- Dashed Divider --- */
.rw-order-detail-divider {
	margin: 16px 0;
	border: none;
	border-top: 2px dashed #e1e7ed;
}

/* --- Total Row --- */
.rw-order-detail-total-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

.rw-order-detail-total-label {
	font-size: 18px;
	font-weight: 400;
	color: #354261;
	line-height: 1.36;
	letter-spacing: -0.18px;
}

.rw-order-detail-total-value {
	font-size: 18px;
	font-weight: 700;
	color: #111739;
	line-height: 1.36;
	letter-spacing: -0.18px;
}

/* --- Order Detail Notes --- */
.rw-order-detail-notes {
	margin-bottom: 16px;
}

.rw-order-detail-notes .commentlist {
	list-style: none;
	padding: 0;
	margin: 0;
}

.rw-order-detail-notes .comment-text {
	font-size: 14px;
	color: #354261;
	padding: 8px 0;
}

.rw-order-detail-notes .meta {
	font-size: 12px;
	color: #a7a9b6;
	margin-bottom: 4px;
}

/* --- Hide default WC elements on order detail --- */
.woocommerce-order-details .woocommerce-order-details__title {
	display: none;
}

/* Responsive */
@media (max-width: 640px) {
	.rw-order-item-main {
		flex-wrap: wrap;
	}

	.rw-order-item-price {
		width: 100%;
		flex-direction: row;
		justify-content: flex-start;
		gap: 8px;
		margin-top: 4px;
	}
}

/* --- Actions (Outside Card) --- */
.rw-order-detail-actions {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 24px;
}

/* Secondary Button (Outline) */
.rw-btn-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 19px 24px;
	background: #fff;
	color: #111739;
	border: 1px solid #d1d5db;
	border-radius: 2px;
	font-size: 14px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.15s ease;
}

.rw-btn-secondary:hover {
	border-color: #111739;
	background: #fcfcfd;
	color: #111739;
}
