/* Image Boxes Widget – کادر تصویرها */

.cc-ib-wrapper {
	position: relative;
	width: 100%;
	box-sizing: border-box;
	direction: rtl;
}

.cc-ib-wrapper *,
.cc-ib-wrapper *::before,
.cc-ib-wrapper *::after {
	box-sizing: border-box;
}

/* Bordered box around cards */
.cc-ib-box {
	--cc-ib-b-c: rgba(80, 110, 200, 0.45);
	--cc-ib-b-w: 1px;
	--cc-ib-gap: 200px;

	position: relative;
	width: 100%;
	border-style: solid;
	border-width: var(--cc-ib-b-w);
	border-color: var(--cc-ib-b-c);
	border-radius: 24px;
	background-color: #0d1220;
	overflow: visible;
}

/*
 * When bottom label is shown: fully remove bottom border,
 * then draw only left + right segments so a real gap remains.
 */
.cc-ib-box.has-gap {
	border-bottom: none !important;
	border-bottom-width: 0 !important;
	border-bottom-color: transparent !important;
}

.cc-ib-box.has-gap::before,
.cc-ib-box.has-gap::after {
	content: '';
	position: absolute;
	bottom: 0;
	height: 0;
	border: none;
	border-bottom-style: solid;
	border-bottom-width: var(--cc-ib-b-w, 1px);
	border-bottom-color: var(--cc-ib-b-c, rgba(80, 110, 200, 0.45));
	pointer-events: none;
	z-index: 1;
}

/* Left segment of bottom border */
.cc-ib-box.has-gap::before {
	left: 0;
	width: calc(50% - (var(--cc-ib-gap, 200px) / 2));
}

/* Right segment of bottom border */
.cc-ib-box.has-gap::after {
	right: 0;
	width: calc(50% - (var(--cc-ib-gap, 200px) / 2));
}

/* Cards grid */
.cc-ib-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	width: 100%;
	position: relative;
}

.cc-ib-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-decoration: none;
	color: inherit;
	transition: opacity 0.25s ease;
}

.cc-ib-card:hover {
	opacity: 0.92;
}

/* Vertical divider – does NOT reach top */
.cc-ib-wrapper.has-dividers .cc-ib-card:not(:last-child)::after {
	content: '';
	position: absolute;
	left: 0;
	top: 30%;
	height: 55%;
	width: 1px;
	background: rgba(100, 120, 180, 0.35);
	pointer-events: none;
	z-index: 1;
}

/* Icon */
.cc-ib-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
}

.cc-ib-icon.has-circle {
	border-style: solid;
	border-radius: 50%;
	border-width: 1.5px;
	border-color: rgba(100, 130, 255, 0.35);
}

.cc-ib-icon i,
.cc-ib-icon svg {
	display: block;
	line-height: 1;
}

/* Title */
.cc-ib-title {
	margin: 0;
	font-weight: 700;
	font-size: 1.05rem;
	line-height: 1.4;
	color: #fff;
}

/* Description */
.cc-ib-desc {
	font-size: 0.85rem;
	line-height: 1.7;
	color: rgba(180, 195, 230, 0.85);
	max-width: 100%;
}

/*
 * Label centered in the border gap (bottom edge).
 */
.cc-ib-buttons-label {
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translate(-50%, 50%);
	z-index: 2;
	padding: 0 12px;
	max-width: var(--cc-ib-gap, 200px);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-size: 0.9rem;
	line-height: 1.4;
	color: rgba(160, 175, 220, 0.75);
	background-color: transparent;
	text-align: center;
	pointer-events: none;
}

/* Action buttons – outside / below the bordered box */
.cc-ib-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: stretch;
	width: 100%;
	margin-top: 28px;
	gap: 12px;
}

.cc-ib-action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-direction: row-reverse;
	gap: 10px;
	text-decoration: none;
	font-size: 0.88rem;
	font-weight: 500;
	line-height: 1.3;
	transition: background-color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
	white-space: nowrap;
	flex: 1 1 auto;
	min-width: 0;
	background-color: rgba(20, 28, 50, 0.9);
	border: 1px solid rgba(80, 100, 160, 0.4);
	border-radius: 14px;
	padding: 12px 18px;
	color: #fff;
}

.cc-ib-action-btn:hover {
	transform: translateY(-1px);
}

.cc-ib-action-btn .cc-ib-btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	flex-shrink: 0;
}

.cc-ib-action-btn .cc-ib-btn-icon i,
.cc-ib-action-btn .cc-ib-btn-icon svg {
	display: block;
	line-height: 1;
}

.cc-ib-action-btn .cc-ib-btn-text {
	flex: 0 1 auto;
	text-align: center;
}

/* Responsive */
@media (max-width: 1024px) {
	.cc-ib-cards {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 767px) {
	/* Keep outer bordered box (label sits on bottom border like desktop) */
	.cc-ib-box {
		--cc-ib-gap: 180px;
		padding: 20px 14px 28px !important;
		border-radius: 20px;
	}

	/* Gap segments stay active on mobile */
	.cc-ib-box.has-gap {
		border-bottom: none !important;
		border-bottom-width: 0 !important;
		border-bottom-color: transparent !important;
	}

	.cc-ib-box.has-gap::before,
	.cc-ib-box.has-gap::after {
		display: block !important;
	}

	.cc-ib-cards {
		grid-template-columns: 1fr !important;
		gap: 14px !important;
	}

	/* Each card = separate inner box */
	.cc-ib-card {
		background-color: rgba(12, 18, 36, 0.95);
		border: 1px solid rgba(80, 110, 200, 0.3);
		border-radius: 16px;
		padding: 24px 16px 20px !important;
		text-align: center;
	}

	.cc-ib-wrapper.has-dividers .cc-ib-card:not(:last-child)::after {
		display: none !important;
	}

	/* Icon circle – dashed style on mobile */
	.cc-ib-icon.has-circle {
		border-style: dashed;
		border-width: 1.5px;
		border-color: rgba(120, 140, 255, 0.45);
	}

	.cc-ib-title {
		font-size: 1.15rem;
	}

	.cc-ib-desc {
		font-size: 0.82rem;
		line-height: 1.75;
		opacity: 0.9;
	}

	/* Label on the outer box bottom border – same as desktop */
	.cc-ib-buttons-label {
		position: absolute;
		bottom: 0;
		left: 50%;
		transform: translate(-50%, 50%);
		z-index: 2;
		display: block;
		width: auto;
		max-width: var(--cc-ib-gap, 180px);
		margin: 0;
		padding: 0 10px;
		font-size: 0.82rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		text-align: center;
		background-color: transparent;
		pointer-events: none;
	}

	.cc-ib-actions {
		flex-direction: column;
		margin-top: 28px;
	}

	.cc-ib-action-btn {
		width: 100%;
		justify-content: center;
	}
}
