/**
 * Icon & Image Box for Elementor (Pro Edition) - Frontend Styles
 */

.iibe-box {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none;
	color: inherit;
	box-sizing: border-box;
	gap: 20px;
	--iibe-divider-size: 2px;
	--iibe-divider-length: 60%;
}

.iibe-box,
.iibe-box:hover,
.iibe-box:visited {
	text-decoration: none;
}

/* ---------------- Media wrap (icon / image / number) ---------------- */

.iibe-media-wrap {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 60px;
	height: 60px;
	line-height: 1;
	text-decoration: none;
	box-sizing: border-box;
}

.iibe-flip-h- .iibe-media-wrap { transform: scaleX(-1); }
.iibe-flip-v- .iibe-media-wrap { transform: scaleY(-1); }
.iibe-flip-h-.iibe-flip-v- .iibe-media-wrap,
.iibe-flip-v-.iibe-flip-h- .iibe-media-wrap { transform: scale(-1, -1); }

/* Shapes */
.iibe-media-wrap.iibe-shape-circle { border-radius: 50%; overflow: hidden; }
.iibe-media-wrap.iibe-shape-square { border-radius: 0; overflow: hidden; }
.iibe-media-wrap.iibe-shape-rounded { border-radius: 12px; overflow: hidden; }
.iibe-media-wrap.iibe-shape-hexagon {
	clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
}
.iibe-media-wrap.iibe-shape-diamond {
	clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}
.iibe-media-wrap.iibe-shape-star {
	clip-path: polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.iibe-media-wrap.iibe-shape-blob {
	border-radius: 63% 37% 54% 46% / 55% 48% 52% 45%;
	overflow: hidden;
}

/* Quick view presets (applied via prefix_class iibe-view-) */
.iibe-view-stacked .iibe-media-wrap {
	background: rgba(108, 77, 246, 0.1);
}
.iibe-view-framed .iibe-media-wrap {
	border: 2px solid currentColor;
	background: transparent;
}

.iibe-icon,
.iibe-number,
.iibe-image {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	line-height: 1;
}

.iibe-icon svg { width: 1em; height: 1em; fill: currentColor; }

.iibe-number {
	font-weight: 700;
	line-height: 1;
}

.iibe-image { overflow: hidden; }
.iibe-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: all 0.4s ease;
}

/* Image hover effects */
.iibe-hover-effect-zoom img { transform: scale(1); }
.iibe-media-wrap:hover .iibe-hover-effect-zoom img { transform: scale(1.15); }

.iibe-hover-effect-grayscale img { filter: grayscale(100%); }
.iibe-media-wrap:hover .iibe-hover-effect-grayscale img { filter: grayscale(0%); }

.iibe-hover-effect-blur img { filter: blur(3px); }
.iibe-media-wrap:hover .iibe-hover-effect-blur img { filter: blur(0); }

.iibe-hover-effect-sepia img { filter: sepia(100%); }
.iibe-media-wrap:hover .iibe-hover-effect-sepia img { filter: sepia(0%); }

.iibe-hover-effect-brightness img { filter: brightness(1); }
.iibe-media-wrap:hover .iibe-hover-effect-brightness img { filter: brightness(0.7); }

/* Hover-swap icon/image */
.iibe-has-hover-media .iibe-icon-default,
.iibe-has-hover-media .iibe-image-default {
	transition: opacity 0.3s ease, transform 0.3s ease;
	opacity: 1;
}

.iibe-has-hover-media .iibe-icon-hover,
.iibe-has-hover-media .iibe-image-hover {
	position: absolute;
	top: 0;
	left: 0;
	opacity: 0;
	transform: scale(0.8);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.iibe-box:hover .iibe-has-hover-media .iibe-icon-default,
.iibe-box:hover .iibe-has-hover-media .iibe-image-default {
	opacity: 0;
	transform: scale(0.8);
}

.iibe-box:hover .iibe-has-hover-media .iibe-icon-hover,
.iibe-box:hover .iibe-has-hover-media .iibe-image-hover {
	opacity: 1;
	transform: scale(1);
}

/* Tooltip */
.iibe-has-tooltip {
	position: relative;
}

.iibe-has-tooltip::after {
	content: attr(data-iibe-tooltip);
	position: absolute;
	bottom: calc(100% + 10px);
	left: 50%;
	transform: translateX(-50%) translateY(4px);
	background: #1f1f1f;
	color: #fff;
	font-size: 12px;
	line-height: 1.4;
	padding: 6px 10px;
	border-radius: 4px;
	white-space: nowrap;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 10;
}

.iibe-has-tooltip:hover::after {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---------------- Content ---------------- */

.iibe-content {
	min-width: 0;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.iibe-title {
	margin: 0 0 10px;
	line-height: 1.3;
}

.iibe-title a {
	text-decoration: none;
	color: inherit;
	transition: color 0.3s;
}

.iibe-description {
	margin: 0;
	line-height: 1.6;
}

.iibe-description p { margin: 0 0 10px; }
.iibe-description p:last-child { margin-bottom: 0; }

/* ---------------- Button ---------------- */

.iibe-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	text-decoration: none;
	cursor: pointer;
	background: #6C4DF6;
	color: #fff;
	padding: 10px 22px;
	border-radius: 4px;
	line-height: 1.4;
	transition: all 0.3s ease;
}

.iibe-button svg { width: 1em; height: 1em; fill: currentColor; }

.iibe-button-full {
	width: 100%;
	align-self: stretch !important;
}

/* ---------------- Badge / Ribbon ---------------- */

.iibe-badge {
	position: absolute;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	color: #fff;
	background: #F5365C;
	padding: 4px 10px;
	border-radius: 20px;
	white-space: nowrap;
	z-index: 5;
}

.iibe-badge-top-left { top: 0; left: 0; }
.iibe-badge-top-right { top: 0; right: 0; }
.iibe-badge-bottom-left { bottom: 0; left: 0; }
.iibe-badge-bottom-right { bottom: 0; right: 0; }

/* ---------------- Divider ---------------- */

.iibe-divider {
	flex-shrink: 0;
	align-self: center;
	background-color: #dddddd;
	border: 0;
}

.iibe-position-top- .iibe-divider,
.iibe-position-bottom- .iibe-divider {
	width: var(--iibe-divider-length, 60%);
	height: var(--iibe-divider-size, 2px);
}

.iibe-position-left- .iibe-divider,
.iibe-position-right- .iibe-divider {
	width: var(--iibe-divider-size, 2px);
	height: var(--iibe-divider-length, 60%);
	align-self: stretch;
}

/* ---------------- RTL ---------------- */

body.rtl .iibe-reverse-rtl- .iibe-position-left- .iibe-box,
body.rtl .iibe-reverse-rtl- .iibe-position-right- .iibe-box {
	flex-direction: row-reverse;
}

/* ---------------- Responsive ----------------
 * Note: intentionally no forced mobile flex-direction override here.
 * The "Icon / Image Position" control is itself a responsive control
 * (Desktop / Tablet / Mobile), so the user's chosen position for each
 * breakpoint is already respected via the widget's own generated CSS.
 * A hardcoded !important override here would fight that control on any
 * narrow viewport, including the Elementor editor's preview canvas.
 */
