/**
 * iDigital SMS — Product Waitlist Styles
 */

/* ── Button (waitlist + discount) ── */
.ids-waitlist-wrap,
.ids-discount-wrap {
	display: inline-block;
	vertical-align: middle;
	margin-right: 0;
	margin-bottom: 10px;
	position: relative;
}
.ids-waitlist-wrap .ids-waitlist-btn,
.ids-discount-wrap .ids-waitlist-btn {
	margin-right: 0 !important;
}
/* When placed in Rey .rey-cartBtnQty row: alignment is applied via JS; avoid conflicting margin */
.rey-cartBtnQty .ids-waitlist-wrap .ids-waitlist-btn {
	box-sizing: border-box;
}
.ids-waitlist-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 18px;
	border: none;
	border-radius: 0;
	background: #9E3B3B;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: box-shadow .2s, transform .15s;
	line-height: 1;
	white-space: nowrap;
}
.ids-waitlist-btn:hover {
	box-shadow: 0 2px 10px rgba(158, 59, 59, .4);
	transform: translateY(-1px);
}
.ids-waitlist-btn svg {
	flex-shrink: 0;
}
.ids-waitlist-btn--loading {
	pointer-events: none;
	cursor: wait;
}
.ids-wl-btn-loader {
	display: inline-block;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.35);
	border-top-color: #fff;
	border-radius: 50%;
	animation: ids-wl-spin 0.7s linear infinite;
	flex-shrink: 0;
}
.ids-wl-btn-loading-text {
	margin-right: 0;
}
@keyframes ids-wl-spin {
	to { transform: rotate(360deg); }
}

/* ── Toast (below button, absolute so button does not move) ── */
.ids-wl-toast {
	position: absolute;
	top: 100%;
	left: 0;
	right: auto;
	margin-top: 8px;
	padding: 8px 14px;
	border-radius: 6px;
	background: #ecfdf5;
	color: #065f46;
	font-size: 13px;
	border: 1px solid #a7f3d0;
	max-width: 280px;
	white-space: normal;
	z-index: 10;
	opacity: 0;
	transform: translateY(-8px);
	transition: opacity 0.3s ease, transform 0.35s ease;
	pointer-events: none;
}
[dir="rtl"] .ids-wl-toast {
	left: auto;
	right: 0;
}
.ids-wl-toast.ids-wl-toast--show {
	opacity: 1;
	transform: translateY(0);
}

/* ── Overlay ── */
body.ids-wl-overlay-open {
	overflow: hidden;
}
.ids-wl-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(0,0,0,.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

/* ── Popup ── */
.ids-wl-popup {
	background: #fff;
	border-radius: 0;
	width: 100%;
	max-width: 420px;
	min-height: 60vh;
	max-height: 75vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 25px 50px rgba(0,0,0,.2);
	overflow: hidden;
	direction: rtl;
	animation: idsWlFadeIn .25s ease;
}
.ids-wl-popup--simple {
	min-height: 0;
	max-height: none;
}
@keyframes idsWlFadeIn {
	from { opacity: 0; transform: translateY(20px); }
	to   { opacity: 1; transform: translateY(0); }
}
.ids-wl-popup-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px 24px 12px;
	border-bottom: 1px solid #f1f5f9;
	flex-shrink: 0;
}
.ids-wl-popup-header svg {
	color: #dc2626;
	flex-shrink: 0;
}
.ids-wl-popup-title {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	color: #1e293b;
}
.ids-wl-popup-body {
	padding: 16px 24px;
	flex: 1 1 0;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	touch-action: pan-y;
	scrollbar-width: thin;
	scrollbar-color: #000000 transparent;
}
.ids-wl-popup-body::-webkit-scrollbar {
	width: 1px;
}
.ids-wl-popup-body::-webkit-scrollbar-track {
	background: transparent;
}
.ids-wl-popup-body::-webkit-scrollbar-thumb {
	background: #000000;
	border-radius: 0;
}
.ids-wl-popup-desc {
	margin: 0 0 12px;
	font-size: 14px;
	color: #475569;
}

/* ── Variations ── */
.ids-wl-variations {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
}

/* Grouped accordion */
.ids-wl-variations--grouped {
	gap: 0;
	padding-left: 4px;
}
.ids-wl-variation-group {
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	margin-bottom: 8px;
	overflow: hidden;
}
.ids-wl-variation-group:last-child {
	margin-bottom: 0;
}
.ids-wl-variation-group-header {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	padding: 5px 14px;
	padding-top: 5px;
	padding-bottom: 5px;
	border: none;
	background: #f8fafc;
	color: #1e293b;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-align: right;
	direction: rtl;
	transition: background .15s;
}
.ids-wl-variation-group-header:hover {
	background: #f1f5f9;
}
.ids-wl-variation-group-title {
	flex: 1;
	text-align: right;
	padding-right: 10px;
}
.ids-wl-variation-group-count {
	font-size: 12px;
	font-weight: 500;
	color: #64748b;
}
.ids-wl-variation-group-icon {
	flex-shrink: 0;
	transition: transform .2s ease;
}
.ids-wl-variation-group--open .ids-wl-variation-group-icon {
	transform: rotate(180deg);
}
.ids-wl-variation-group-body {
	display: none;
	padding: 8px 12px 12px;
	background: #fff;
	border-top: 1px solid #e2e8f0;
	flex-direction: column;
	gap: 6px;
}
.ids-wl-variation-group--open .ids-wl-variation-group-body {
	display: flex;
}

.ids-wl-variation-group .ids-wl-variation-label {
	margin: 0;
}

.ids-wl-variation-label {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 8px;
	border: 1px solid #e2e8f0;
	cursor: pointer;
	font-size: 14px;
	transition: border-color .15s, background .15s;
}
.ids-wl-variation-label:hover {
	border-color: #f59e0b;
	background: #fffbeb;
}
.ids-wl-variation-label input:checked + span {
	color: #b45309;
	font-weight: 600;
}

/* ── Field ── */
.ids-wl-field {
	margin-bottom: 8px;
}
.ids-wl-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #334155;
}
.ids-wl-input {
	width: 100%;
	padding: 10px 14px;
	border: 1.5px solid #e2e8f0;
	border-radius: 10px;
	font-size: 15px;
	transition: border-color .2s;
	outline: none;
	box-sizing: border-box;
}
.ids-wl-input:focus {
	border-color: #f59e0b;
	box-shadow: 0 0 0 3px rgba(245,158,11,.15);
}

/* ── Notice ── */
.ids-wl-notice {
	display: none;
	padding: 10px 14px;
	border-radius: 8px;
	font-size: 13px;
	margin-top: 8px;
}
.ids-wl-notice-success {
	background: #ecfdf5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}
.ids-wl-notice-error {
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* ── Footer ── */
.ids-wl-popup-form {
	flex-shrink: 0;
	padding: 12px 24px 8px;
	border-top: 1px solid #f1f5f9;
	background: #fff;
}
.ids-wl-popup-footer {
	display: flex;
	gap: 10px;
	padding: 12px 24px 20px;
	border-top: 1px solid #f1f5f9;
	flex-shrink: 0;
}
.ids-wl-btn {
	flex: 1;
	padding: 8px 16px;
	border-radius: 10px;
	border: none;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, box-shadow .15s;
}
/* Scoped to overlay so theme does not override; inline CSS from settings overrides these */
#ids-wl-overlay .ids-wl-btn-submit {
	background: #000000;
	color: #fff;
}
#ids-wl-overlay .ids-wl-btn-submit:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,.25);
}
#ids-wl-overlay a.ids-wl-btn.ids-wl-btn-submit {
	text-decoration: none;
	text-align: center;
	display: inline-block;
}
#ids-wl-overlay .ids-wl-btn-submit:disabled {
	opacity: .6;
	cursor: wait;
}
#ids-wl-overlay .ids-wl-btn-cancel {
	background: #e5e7eb;
	color: #232323;
}
#ids-wl-overlay .ids-wl-btn-cancel:hover {
	background: #d1d5db;
}

/* ── Floating bar (mobile) ── */
.ids-waitlist-float {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 999998;
	padding: 12px 16px;
	background: #fff;
	box-shadow: 0 -2px 12px rgba(0,0,0,.12);
	direction: rtl;
}
.ids-waitlist-float .ids-waitlist-wrap {
	margin: 0;
	max-width: 100%;
}
.ids-waitlist-float .ids-waitlist-btn {
	margin-right: 0 !important;
}
/* تمام عرض */
.ids-waitlist-float--full .ids-waitlist-wrap {
	width: 100%;
}
.ids-waitlist-float--full .ids-waitlist-btn {
	width: 100%;
	justify-content: center;
}
/* سمت راست */
.ids-waitlist-float--right {
	justify-content: flex-end;
}
[dir="rtl"] .ids-waitlist-float--right {
	justify-content: flex-start;
}
/* سمت چپ */
.ids-waitlist-float--left {
	justify-content: flex-start;
}
[dir="rtl"] .ids-waitlist-float--left {
	justify-content: flex-end;
}
@media (max-width: 768px) {
	.ids-waitlist-float:not(.ids-waitlist-float--hidden) {
		display: flex;
		align-items: center;
	}
	.ids-waitlist-wrap.ids-waitlist-wrap--hidden-mobile {
		display: none !important;
	}
}

/* ── Mobile ── */
@media (max-width: 480px) {
	.ids-wl-popup {
		max-width: 100%;
		border-radius: 16px 16px 0 0;
	}
	.ids-wl-overlay {
		align-items: flex-end;
	}
}
