/* ==========================================================================
   Custom Checkout Builder – Frontend Styles
   ========================================================================== */

/* Wrapper ----------------------------------------------------------------- */
.ccb-checkout-form-wrap {
	position: relative;
	margin-bottom: 30px;
}

/* Progress bar (multi-step) ----------------------------------------------- */
.ccb-progress-bar {
	display: flex;
	align-items: center;
	margin-bottom: 30px;
	gap: 0;
	border-bottom: 2px solid #e0e0e0;
	padding-bottom: 16px;
}

.ccb-progress-step {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	position: relative;
	cursor: default;
	opacity: .45;
	transition: opacity .25s;
}

.ccb-progress-step.active,
.ccb-progress-step.done { opacity: 1; }

.ccb-step-number {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: #e0e0e0;
	color: #555;
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 13px;
	transition: background .25s, color .25s;
	flex-shrink: 0;
}

.ccb-progress-step.active .ccb-step-number {
	background: #2271b1;
	color: #fff;
}

.ccb-progress-step.done .ccb-step-number {
	background: #197b1b;
	color: #fff;
}

.ccb-step-label {
	font-size: 13px;
	color: #555;
	font-weight: 500;
}

/* Form fields ------------------------------------------------------------- */
.ccb-flex-form {
	display: flex !important;
	flex-wrap: wrap !important;
	gap: 0 20px !important;
	width: 100% !important;
}

.ccb-field-wrap {
	margin-bottom: 20px !important;
	width: 100% !important;
	box-sizing: border-box !important;
	float: none !important; /* لضمان عدم وجود تداخل مع القوالب القديمة */
}

.ccb-field-wrap.ccb-col-50 {
	width: calc(50% - 10px) !important;
	flex: 0 0 calc(50% - 10px) !important;
}

.ccb-field-wrap.ccb-col-33 {
	width: calc(33.33% - 13.34px) !important;
	flex: 0 0 calc(33.33% - 13.34px) !important;
}

/* في حال كان هناك حاويات إضافية من القالب */
.ccb-step-content {
    width: 100% !important;
}

@media (max-width: 768px) {
	.ccb-field-wrap.ccb-col-50,
	.ccb-field-wrap.ccb-col-33 {
		width: 100%;
	}
}

.ccb-field-wrap label {
	display: block;
	margin-bottom: 6px;
	font-weight: 600;
	font-size: 14px;
	color: #3c434a;
}

.ccb-field-wrap .required {
	color: #d63638;
	margin-left: 2px;
}

.ccb-input {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 4px;
	font-size: 15px;
	color: #1d2327;
	transition: border-color .15s, box-shadow .15s;
	background: #fff;
	box-sizing: border-box;
}

.ccb-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 2px rgba(34, 113, 177, .2);
}

.ccb-input.ccb-error {
	border-color: #d63638;
	box-shadow: 0 0 0 2px rgba(214, 54, 56, .15);
}

.ccb-textarea {
	resize: vertical;
	min-height: 100px;
}

.ccb-select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

/* Radio & Checkbox -------------------------------------------------------- */
.ccb-radio-group,
.ccb-checkbox-group {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.ccb-radio-label,
.ccb-checkbox-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-weight: 400 !important;
	cursor: pointer;
}

.ccb-radio,
.ccb-checkbox {
	width: 18px;
	height: 18px;
	accent-color: #2271b1;
	cursor: pointer;
	flex-shrink: 0;
}

/* File upload ------------------------------------------------------------- */
.ccb-file {
	padding: 8px;
	cursor: pointer;
}

/* Error messages ---------------------------------------------------------- */
.ccb-field-error {
	color: #d63638;
	font-size: 13px;
	margin-top: 4px;
	display: block;
}

.ccb-form-errors {
	background: #fef7f7;
	border-left: 4px solid #d63638;
	padding: 14px 18px;
	border-radius: 0 4px 4px 0;
	margin-bottom: 20px;
	color: #d63638;
	font-size: 14px;
}

/* Actions ----------------------------------------------------------------- */
.ccb-form-actions {
	display: flex;
	gap: 12px;
	align-items: center;
	margin-top: 28px;
	flex-wrap: wrap;
}

.ccb-btn-submit,
.ccb-btn-next,
.ccb-btn-prev {
	padding: 13px 28px !important;
	font-size: 16px !important;
	font-weight: 600 !important;
	border-radius: 4px !important;
	cursor: pointer;
	transition: opacity .15s, transform .1s;
}

.ccb-btn-submit:active,
.ccb-btn-next:active { transform: translateY(1px); }

.ccb-btn-prev {
	background: transparent !important;
	border: 1px solid #c3c4c7 !important;
	color: #3c434a !important;
}

/* Loader ------------------------------------------------------------------ */
.ccb-loader {
	position: absolute;
	inset: 0;
	background: rgba(255, 255, 255, .85);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	border-radius: 4px;
}

.ccb-spinner {
	width: 42px;
	height: 42px;
	border: 4px solid #e0e0e0;
	border-top-color: #2271b1;
	border-radius: 50%;
	animation: ccb-spin .75s linear infinite;
}

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

/* Success message --------------------------------------------------------- */
.ccb-success {
	background: #d1fae5;
	border-left: 4px solid #059669;
	padding: 16px 20px;
	border-radius: 0 4px 4px 0;
	color: #065f46;
	font-size: 15px;
	font-weight: 500;
}

/* Conditional (hidden fields) --------------------------------------------- */
.ccb-field-wrap[data-conditional].ccb-hidden {
	display: none !important;
}

/* Admin order custom fields ----------------------------------------------- */
.ccb-admin-order-fields {
	margin-top: 20px;
}

.ccb-admin-order-fields table {
	width: 100%;
	border-collapse: collapse;
}

.ccb-admin-order-fields th,
.ccb-admin-order-fields td {
	padding: 7px 10px;
	border: 1px solid #e5e5e5;
	text-align: left;
	font-size: 13px;
}

.ccb-admin-order-fields th { background: #f6f7f7; font-weight: 600; width: 35%; }

/* Customer order details -------------------------------------------------- */
.ccb-order-details { margin-top: 30px; }

/* Responsive -------------------------------------------------------------- */
@media (max-width: 600px) {
	.ccb-form-actions { flex-direction: column; align-items: stretch; }
	.ccb-btn-submit,
	.ccb-btn-next,
	.ccb-btn-prev { width: 100%; text-align: center; }
}
