/* =========================================================
   SdeBar B2B – Shipping Returns – Frontend Popup
   ========================================================= */

/* Overlay */
.ssr-overlay {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, .55);
	z-index: 99999;
	align-items: center;
	justify-content: center;
	padding: 16px;
	direction: rtl;
}

.ssr-overlay.is-open {
	display: flex;
}

/* Modal box */
.ssr-modal {
	position: relative;
	background: #fff;
	border-radius: 12px;
	padding: 40px 36px 32px;
	width: 100%;
	max-width: 520px;
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

/* Close button */
.ssr-modal__close {
	position: absolute;
	top: 14px;
	left: 14px; /* RTL – physical left = visual right */
	background: transparent;
	border: none;
	font-size: 20px;
	cursor: pointer;
	color: #666;
	line-height: 1;
	padding: 4px 8px;
	border-radius: 4px;
	transition: background .15s;
}
.ssr-modal__close:hover { background: #f0f0f0; }

/* Title */
.ssr-modal__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 8px;
	color: #1a1a1a;
}
.ssr-modal__title--success { color: #1a7f37; }
.ssr-modal__title--error   { color: #c0392b; }

.ssr-modal__subtitle {
	color: #555;
	margin: 0 0 24px;
	font-size: 15px;
}

/* Step visibility */
.ssr-step { display: none; }
.ssr-step--active,
.ssr-step[style="display: block;"] { display: block; }

/* Fields */
.ssr-field {
	margin-bottom: 16px;
}
.ssr-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 6px;
	color: #333;
}
.ssr-input {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 6px;
	font-size: 15px;
	box-sizing: border-box;
	transition: border-color .2s;
	direction: rtl;
}
.ssr-input:focus {
	border-color: #2271b1;
	outline: none;
	box-shadow: 0 0 0 3px rgba(34, 113, 177, .18);
}

/* Two-column grid */
.ssr-field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}
@media (max-width: 460px) {
	.ssr-field-grid { grid-template-columns: 1fr; }
}

/* Buttons */
.ssr-btn {
	display: inline-block;
	padding: 11px 24px;
	border-radius: 6px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	border: none;
	transition: background .15s, opacity .15s;
}
.ssr-btn--primary {
	background: #2271b1;
	color: #fff;
	width: 100%;
}
.ssr-btn--primary:hover  { background: #135e96; }
.ssr-btn--secondary {
	background: transparent;
	color: #2271b1;
	border: 2px solid #2271b1;
	width: 100%;
	margin-top: 8px;
}
.ssr-btn--secondary:hover { background: #f0f6ff; }
.ssr-btn:disabled { opacity: .55; cursor: not-allowed; }

/* Address actions row */
.ssr-address-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	margin-top: 20px;
}
.ssr-address-actions .ssr-btn {
	width: auto;
	margin: 0;
}
@media (max-width: 420px) {
	.ssr-address-actions { grid-template-columns: 1fr; }
}

/* Order summary */
.ssr-order-summary {
	background: #f7f7f7;
	border-radius: 8px;
	padding: 16px 18px;
	margin-bottom: 20px;
}
.ssr-summary-row {
	display: flex;
	gap: 8px;
	padding: 5px 0;
	font-size: 14px;
	border-bottom: 1px solid #e8e8e8;
}
.ssr-summary-row:last-child { border-bottom: none; }
.ssr-summary-label {
	font-weight: 600;
	color: #555;
	min-width: 110px;
	flex-shrink: 0;
}
.ssr-summary-value { color: #222; }

.ssr-confirm-prompt {
	font-size: 15px;
	color: #333;
	margin: 0 0 6px;
}

/* Custom address section */
.ssr-custom-address {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e0e0e0;
}
.ssr-form-section-title {
	font-size: 16px;
	font-weight: 700;
	margin: 0 0 16px;
	color: #333;
}

/* Errors */
.ssr-error {
	background: #fff5f5;
	border: 1px solid #f5c6cb;
	border-radius: 6px;
	color: #721c24;
	padding: 10px 14px;
	font-size: 14px;
	margin-bottom: 14px;
}

/* Result screen */
.ssr-result-icon {
	width: 64px;
	height: 64px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
	margin: 0 auto 16px;
}
.ssr-result-icon--success { background: #d4edda; color: #155724; }
.ssr-result-icon--error   { background: #f8d7da; color: #721c24; }

.ssr-result-message {
	font-size: 15px;
	color: #333;
	line-height: 1.6;
	text-align: center;
	margin-bottom: 12px;
}
.ssr-tracking-id {
	font-size: 13px;
	color: #555;
	text-align: center;
}
.ssr-support-msg {
	font-size: 14px;
	color: #856404;
	background: #fff3cd;
	border-radius: 6px;
	padding: 10px 14px;
	text-align: center;
}
#ssr-step-3 { text-align: center; }
#ssr-step-3 .ssr-btn { margin-top: 20px; width: auto; min-width: 140px; }

/* Spinner */
.ssr-spinner {
	position: absolute;
	inset: 0;
	background: rgba(255,255,255,.75);
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 12px;
	z-index: 10;
}
.ssr-spinner__ring {
	width: 44px;
	height: 44px;
	border: 4px solid #e0e0e0;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: ssr-spin .75s linear infinite;
}
@keyframes ssr-spin {
	to { transform: rotate(360deg); }
}

/* Trigger button (shortcode output) */
button.ssr-open-modal {
	cursor: pointer;
}
