/**
 * WebToffee Consent Withdrawal — Frontend Styles
 *
 * @package Wbte_Eu_Withdrawal_Button
 * @since   1.0.0
 */

/* --------------------------------------------------------
   Form wrapper
   -------------------------------------------------------- */
.wbte-ewb-withdrawal-form {
	max-width: 640px;
	margin: 0 auto;
	padding: 24px 0;
}

.wbte-ewb-form .form-row {
	margin-bottom: 16px;
}

.wbte-ewb-form .form-row label {
	display: block;
	margin-bottom: 4px;
	font-weight: 600;
}

.wbte-ewb-form .form-row .input-text,
.wbte-ewb-form .form-row select,
.wbte-ewb-form .form-row textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
	box-sizing: border-box;
	background-color: #fff;
}

.wbte-ewb-form .form-row .input-text:focus,
.wbte-ewb-form .form-row select:focus,
.wbte-ewb-form .form-row textarea:focus {
	border-color: #3b82f6;
	outline: none;
	box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.wbte-ewb-form .form-row .input-text[readonly] {
	background-color: #f3f4f6;
	color: #6b7280;
	cursor: not-allowed;
}

/* Name row — flexbox layout */
.wbte-ewb-name-row {
	display: flex;
	gap: 16px;
	margin-bottom: 16px;
}

.wbte-ewb-name-row .form-row {
	flex: 1;
	margin-bottom: 0;
}

/* --------------------------------------------------------
   Items list (checkboxes)
   -------------------------------------------------------- */
.wbte-ewb-items-container {
	margin-bottom: 16px;
	padding: 12px;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	background: #fafafa;
}

.wbte-ewb-items-container > label {
	display: block;
	font-weight: 600;
	margin-bottom: 8px;
}

.wbte-ewb-items-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.wbte-ewb-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 4px;
	border-bottom: 1px solid #e5e7eb;
}

.wbte-ewb-item:last-child {
	border-bottom: none;
}

.wbte-ewb-item--disabled {
	opacity: 0.55;
	flex-wrap: wrap;
}

.wbte-ewb-item--disabled .wbte-ewb-item-name {
	text-decoration: line-through;
}

.wbte-ewb-item-reason {
	width: 100%;
	font-size: 12px;
	color: #b91c1c;
	margin-left: 28px;
	margin-top: 2px;
	font-style: italic;
}

.wbte-ewb-item input[type="checkbox"] {
	flex-shrink: 0;
	width: 16px;
	height: 16px;
	margin: 0;
}

.wbte-ewb-item-name {
	flex: 1;
	font-weight: 500;
}

.wbte-ewb-item-qty {
	flex-shrink: 0;
	color: #6b7280;
	font-size: 13px;
}

.wbte-ewb-item-price {
	flex-shrink: 0;
	font-weight: 600;
	font-size: 13px;
}

.wbte-ewb-items-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 0;
	color: #6b7280;
	font-size: 14px;
}

.wbte-ewb-no-items {
	margin: 0;
	padding: 8px 0;
	color: #6b7280;
	font-style: italic;
}

/* --------------------------------------------------------
   Status badges
   -------------------------------------------------------- */
.wbte-ewb-badge {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	text-transform: capitalize;
}

.wbte-ewb-badge--pending {
	background-color: #fff7ed;
	color: #c2410c;
	border: 1px solid #fdba74;
}

.wbte-ewb-badge--approved {
	background-color: #f0fdf4;
	color: #15803d;
	border: 1px solid #86efac;
}

.wbte-ewb-badge--rejected {
	background-color: #fef2f2;
	color: #b91c1c;
	border: 1px solid #fca5a5;
}

/* --------------------------------------------------------
   Messages
   -------------------------------------------------------- */
.wbte-ewb-success-message {
	padding: 12px 16px;
	margin-bottom: 20px;
	border: 1px solid #86efac;
	border-radius: 4px;
	background-color: #f0fdf4;
	color: #166534;
}

.wbte-ewb-success-message p {
	margin: 0;
}

.wbte-ewb-error-message {
	padding: 12px 16px;
	margin-bottom: 20px;
	border: 1px solid #fca5a5;
	border-radius: 4px;
	background-color: #fef2f2;
	color: #991b1b;
}

.wbte-ewb-error-message ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wbte-ewb-error-message li {
	margin-bottom: 4px;
}

.wbte-ewb-error-message li:last-child {
	margin-bottom: 0;
}

.wbte-ewb-info-message {
	padding: 12px 16px;
	margin-bottom: 20px;
	border: 1px solid #93c5fd;
	border-radius: 4px;
	background-color: #eff6ff;
	color: #1e40af;
}

.wbte-ewb-info-message p {
	margin: 0;
}

/* --------------------------------------------------------
   Button
   -------------------------------------------------------- */
.wbte-ewb-btn--withdrawal {
	display: inline-block;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	background-color: #3b82f6;
	color: #fff;
	transition: background-color 0.2s ease;
}

.wbte-ewb-btn--withdrawal:hover,
.wbte-ewb-btn--withdrawal:focus {
	background-color: #2563eb;
	color: #fff;
}

.wbte-ewb-btn--withdrawal:disabled,
.wbte-ewb-btn--withdrawal.disabled {
	opacity: 0.6;
	cursor: not-allowed;
}

/* --------------------------------------------------------
   Spinner
   -------------------------------------------------------- */
.wbte-ewb-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid #d1d5db;
	border-top-color: #3b82f6;
	border-radius: 50%;
	animation: wbte-ewb-spin 0.6s linear infinite;
}

@keyframes wbte-ewb-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --------------------------------------------------------
   Footer link
   -------------------------------------------------------- */
.wbte-ewb-footer-link {
	text-align: center;
	width: 100%;
	padding: 12px 0;
	font-size: 13px;
	clear: both;
}

.wbte-ewb-footer-link a {
	color: #6b7280;
	text-decoration: underline;
}

.wbte-ewb-footer-link a:hover {
	color: #374151;
}

/* --------------------------------------------------------
   Order details status section
   -------------------------------------------------------- */
.wbte-ewb-order-withdrawal-status {
	margin-top: 24px;
	padding: 16px;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	background: #fafafa;
}

.wbte-ewb-order-withdrawal-status h3 {
	margin: 0 0 8px;
	font-size: 16px;
}

.wbte-ewb-order-withdrawal-status p {
	margin: 0 0 4px;
}

.wbte-ewb-withdrawal-date {
	font-size: 13px;
	color: #6b7280;
}

/* --------------------------------------------------------
   Withdrawals table in My Account
   -------------------------------------------------------- */
.wbte-ewb-withdrawals-table {
	width: 100%;
}

/* --------------------------------------------------------
   Responsive — 480px breakpoint
   -------------------------------------------------------- */
@media screen and (max-width: 480px) {
	.wbte-ewb-withdrawal-form {
		padding: 16px 0;
	}

	.wbte-ewb-name-row {
		flex-direction: column;
		gap: 0;
	}

	.wbte-ewb-name-row .form-row {
		margin-bottom: 16px;
	}

	.wbte-ewb-item {
		flex-wrap: wrap;
		gap: 6px;
	}

	.wbte-ewb-item-name {
		width: calc(100% - 28px);
	}

	.wbte-ewb-item-qty,
	.wbte-ewb-item-price {
		margin-left: 28px;
	}

	.wbte-ewb-btn--withdrawal {
		width: 100%;
	}
}
