/* ==========================================================================
   WooCommerce Returns — My Account styles
   ========================================================================== */

/* Wrapper */
.wc-returns-wrap {
	margin: 0;
}

.wc-returns-intro {
	margin-bottom: 1.5em;
	color: #6b7280;
	font-size: 0.95em;
}

/* Single order card */
.wc-returns-order {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	margin-bottom: 1.75em;
	overflow: hidden;
}

/* Order header bar */
.wc-returns-order-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.5em;
	padding: 0.85em 1.1em;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
}

.wc-returns-order-meta {
	display: flex;
	gap: 1.25em;
	flex-wrap: wrap;
	font-size: 0.9em;
}

.wc-returns-order-number {
	font-weight: 600;
}

.wc-returns-order-date,
.wc-returns-order-total {
	color: #4b5563;
}

/* Deadline badge */
.wc-returns-deadline {
	font-size: 0.82em;
	color: #6b7280;
}

.wc-returns-deadline--urgent {
	display: inline-block;
	padding: 2px 8px;
	background: #fef3c7;
	color: #92400e;
	border-radius: 20px;
	font-weight: 600;
}

/* Items table */
.wc-returns-items {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.wc-returns-items thead th {
	padding: 0.65em 1em;
	text-align: left;
	font-size: 0.82em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	border-bottom: 1px solid #e5e7eb;
	background: #fff;
}

.wc-returns-items tbody td {
	padding: 0.75em 1em;
	vertical-align: middle;
	border-bottom: 1px solid #f3f4f6;
}

.wc-returns-items tbody tr:last-child td {
	border-bottom: none;
}

.wc-returns-items tbody tr:hover {
	background: #fafafa;
}

/* Checkbox column */
.wc-returns-check {
	width: 2.5em;
	text-align: center !important;
}

.wc-returns-check input[type="checkbox"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
	accent-color: #7f54b3;
}

/* Product cell */
.wc-returns-product {
	display: flex;
	align-items: center;
	gap: 0.65em;
}

.wc-returns-thumb {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 4px;
	border: 1px solid #e5e7eb;
	flex-shrink: 0;
}

.wc-returns-product-name {
	font-weight: 500;
}

.wc-returns-qty,
.wc-returns-price {
	white-space: nowrap;
}

/* Highlighted row when checked */
.wc-returns-items tbody tr.is-selected {
	background: #f5f0fa;
}

/* Reason textarea */
.wc-returns-reason-wrap {
	padding: 0.85em 1.1em;
	border-top: 1px solid #f3f4f6;
}

.wc-returns-reason-wrap label {
	display: block;
	margin-bottom: 0.4em;
	font-size: 0.88em;
	color: #374151;
	font-weight: 500;
}

.wc-returns-reason-wrap textarea {
	width: 100%;
	box-sizing: border-box;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	padding: 0.5em 0.75em;
	font-size: 0.9em;
	line-height: 1.5;
	resize: vertical;
	transition: border-color 0.15s;
}

.wc-returns-reason-wrap textarea:focus {
	outline: none;
	border-color: #7f54b3;
	box-shadow: 0 0 0 2px rgba(127, 84, 179, 0.15);
}

/* Action row */
.wc-returns-order-actions {
	padding: 0.85em 1.1em;
	border-top: 1px solid #e5e7eb;
	background: #f9fafb;
	text-align: right;
}

.wc-returns-submit-btn {
	cursor: pointer;
}

.wc-returns-submit-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* Success / error message */
#wc-returns-message {
	margin-top: 1em;
}

#wc-returns-message.is-error {
	border-left-color: #dc2626;
	background: #fef2f2;
}

/* Spinner (uses WC dashicons) */
.wc-returns-spinner {
	display: inline-block;
	vertical-align: middle;
	margin-right: 0.4em;
	width: 16px;
	height: 16px;
	border: 2px solid #ccc;
	border-top-color: #7f54b3;
	border-radius: 50%;
	animation: wc-returns-spin 0.6s linear infinite;
}

@keyframes wc-returns-spin {
	to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 600px) {
	.wc-returns-order-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.wc-returns-items thead th:nth-child(3),
	.wc-returns-items tbody td:nth-child(3) {
		display: none;
	}
}

/* ==========================================================================
   My Account nav icon for the "Resi" menu item
   ==========================================================================
   Themes like Storefront apply a WooCommerce icon font to ALL nav items via
   ::before, but don't define a glyph for custom endpoints → black square.
   We override the font and character with a Dashicons undo/return arrow.
   The !important is intentional: it must win over the theme's font-family
   and content rules for the default (unknown) endpoint icon.
   ========================================================================== */

.woocommerce-MyAccount-navigation-link--resi > a::before {
    font-family: 'Dashicons' !important;
    content: '\f171' !important; /* dashicons-undo — curved return/undo arrow */
    speak: never;
    font-style: normal !important;
    font-weight: 400 !important;
    font-variant: normal;
    text-transform: none;
    line-height: 1;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    /* Reset any background badge applied by the theme (e.g. Storefront) */
    background: transparent !important;
    background-color: transparent !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: inherit !important;
}
