/*
 * WooCommerce Required Bundle Products — Frontend CSS v1.0.1
 * هماهنگ با قالب pckosar.com
 * فونت: IRANSans | رنگ اصلی: #DC143C | دکمه: .buybtn
 */

/* ===================== Container ===================== */
.wrb-bundle-selector {
	direction: rtl;
	font-family: IRANSans, Tahoma, Arial, sans-serif;
	margin: 20px 0 16px;
	padding: 18px 16px;
	background: #fff;
	border-radius: 10px;
	border: 1px solid #e7e7e7;
	box-shadow: 0 2px 12px rgba(171,181,192,.13);
}

/* ===================== Header ===================== */
.wrb-bundle-title-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 6px;
	flex-wrap: wrap;
}

.wrb-icon { font-size: 18px; line-height: 1; }

.wrb-bundle-title {
	font-size: 15px !important;
	font-weight: bold !important;
	color: #DC143C !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1.4 !important;
}

.wrb-badge {
	font-size: 10px;
	font-weight: bold;
	padding: 2px 9px;
	border-radius: 20px;
	letter-spacing: .3px;
}

.wrb-badge-required {
	background: #fff0f0;
	color: #DC143C;
	border: 1px solid #f5c6cb;
}

.wrb-badge-optional {
	background: #f0f7ff;
	color: #1a6eb5;
	border: 1px solid #bee3f8;
}

.wrb-bundle-desc {
	font-size: 12px;
	color: #888;
	margin: 0 0 12px !important;
	line-height: 1.7;
}

/* ===================== Error Box ===================== */
.wrb-error-box {
	display: flex;
	align-items: center;
	gap: 7px;
	background: #fff5f5;
	border: 1px solid #f5c6cb;
	border-radius: 8px;
	padding: 9px 14px;
	font-size: 13px;
	color: #c0392b;
	font-weight: bold;
	margin-bottom: 12px;
}

/* ===================== Options List ===================== */
.wrb-options-list {
	list-style: none !important;
	margin: 0 0 14px !important;
	padding: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 7px;
}

/* ===================== Option Item ===================== */
.wrb-option-item {
	border: 2px solid #e9ecef;
	border-radius: 8px;
	background: #fff;
	transition: border-color .18s, box-shadow .18s, background .18s;
	position: relative;
	overflow: hidden;
}

.wrb-option-item:hover:not(.wrb-option-disabled) {
	border-color: #DC143C;
	box-shadow: 0 2px 8px rgba(220,20,60,.10);
}

/* آیتم انتخاب‌شده */
.wrb-option-item:has(.wrb-option-radio:checked) {
	border-color: #DC143C;
	background: #fff8f8;
	box-shadow: 0 0 0 3px rgba(220,20,60,.10);
}

/* fallback برای مرورگرهایی که :has پشتیبانی نمی‌کنند */
.wrb-option-item.wrb-selected {
	border-color: #DC143C;
	background: #fff8f8;
	box-shadow: 0 0 0 3px rgba(220,20,60,.10);
}

.wrb-option-none {
	border-style: dashed;
	border-color: #ced4da;
}

.wrb-option-disabled {
	opacity: .55;
	background: #f8f9fa;
	pointer-events: none;
}

.wrb-option-custom {
	border-color: #e0c97e;
}

.wrb-option-custom:has(.wrb-option-radio:checked),
.wrb-option-custom.wrb-selected {
	border-color: #c9a227;
	background: #fffdf0;
}

/* ===================== Label ===================== */
.wrb-option-label {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	cursor: pointer;
	width: 100%;
	box-sizing: border-box;
	margin: 0 !important;
}

.wrb-label-disabled { cursor: not-allowed !important; }

/* ===================== Custom Radio ===================== */
.wrb-option-radio {
	display: none; /* مخفی — از .wrb-option-check به عنوان UI استفاده می‌کنیم */
}

.wrb-option-check {
	width: 18px;
	height: 18px;
	min-width: 18px;
	border-radius: 50%;
	border: 2px solid #ccc;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color .15s, background .15s;
	flex-shrink: 0;
}

.wrb-option-radio:checked + .wrb-option-check {
	border-color: #DC143C;
	background: #DC143C;
}

.wrb-option-radio:checked + .wrb-option-check::after {
	content: '';
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #fff;
	display: block;
}

/* ===================== Info Block ===================== */
.wrb-option-info {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.wrb-option-name {
	font-size: 13px;
	font-weight: bold;
	color: #1d1d1d;
	line-height: 1.5;
	display: flex;
	align-items: center;
	gap: 5px;
	flex-wrap: wrap;
}

.wrb-custom-tag {
	font-size: 10px;
	background: #fff3cd;
	color: #856404;
	border: 1px solid #e0c97e;
	border-radius: 3px;
	padding: 1px 5px;
	font-weight: bold;
}

.wrb-option-price {
	font-size: 12px;
	color: #DC143C;
	font-weight: bold;
	display: flex;
	align-items: center;
	gap: 3px;
}

.wrb-price-free {
	color: #198754;
	font-weight: bold;
}

/* ===================== Stock Badge ===================== */
.wrb-option-stock {
	display: flex;
	align-items: center;
	gap: 4px;
	font-size: 10px;
	font-weight: bold;
	padding: 3px 9px;
	border-radius: 20px;
	white-space: nowrap;
	flex-shrink: 0;
}

.wrb-stock-in {
	background: #d1fae5;
	color: #065f46;
}

.wrb-stock-out {
	background: #fee2e2;
	color: #991b1b;
}

.wrb-stock-dot {
	width: 5px;
	height: 5px;
	border-radius: 50%;
	background: currentColor;
	display: inline-block;
}

/* ===================== Price Summary ===================== */
.wrb-price-summary {
	background: #fdf5f5;
	border-radius: 8px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin-top: 4px;
	border: 1px solid #f5c6cb;
}

.wrb-price-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
}

.wrb-ps-label {
	color: #555;
}

.wrb-ps-val {
	font-weight: bold;
	color: #333;
	direction: ltr;
	text-align: left;
}

.wrb-price-divider {
	height: 1px;
	background: #e7c7c7;
	margin: 2px 0;
}

.wrb-total-label {
	color: #DC143C;
	font-weight: bold;
}

.wrb-total-val {
	color: #DC143C;
	font-size: 15px;
}

/* ===================== Cart ===================== */
.wrb-bundle-addon-label {
	color: #DC143C;
	font-size: 12px;
	display: block;
	margin-top: 4px;
	font-family: IRANSans, Tahoma, sans-serif;
}

.wrb-no-remove {
	cursor: default;
	color: #aaa;
	font-size: 16px;
}

/* ===================== Admin Order ===================== */
.wrb-order-admin-badge {
	background: #fff8f8;
	border-right: 3px solid #DC143C;
	padding: 6px 10px;
	border-radius: 4px;
	font-size: 12px;
	color: #6b1a1a;
	margin: 8px 0 0 !important;
	font-family: IRANSans, Tahoma, sans-serif;
}

.wrb-custom-badge {
	border-right-color: #c9a227;
	background: #fffdf0;
	color: #6b5a0a;
}

/* ===================== Responsive ===================== */
@media (max-width: 576px) {
	.wrb-bundle-selector { padding: 14px 10px; }
	.wrb-option-label { padding: 10px 10px; gap: 8px; }
	.wrb-option-stock { display: none; }
	.wrb-option-name { font-size: 12px; }
}
