/**
 * Irancat Brand Image Grid — front-end styles.
 *
 * Every value that is exposed as an Elementor control is driven through a CSS
 * custom property. Globals are written on `.icbg-grid`, per-item overrides are
 * written on `.icbg-item` (the repeater item wrapper), so an item-level setting
 * always wins over the global one without any specificity tricks.
 */

.icbg-wrapper {
	box-sizing: border-box;
	width: auto;
	overflow: visible;
}

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

/* -------------------------------------------------- Header */

.icbg-header {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	margin-bottom: 20px;
}

.icbg-header-title {
	font-size: 18px;
	font-weight: 700;
	line-height: 1.4;
}

.icbg-view-all {
	display: inline-block;
	text-align: center;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	transition: opacity 0.2s ease-in-out;
}

.icbg-view-all:hover,
.icbg-view-all:focus {
	opacity: 0.85;
}

.icbg-header.has-separator {
	padding-bottom: 12px;
}

.icbg-header.has-separator::after {
	content: "";
	position: absolute;
	bottom: 0;
	inset-inline-start: 0;
	width: 100%;
	height: 1px;
	background-color: #eeeeee;
}

/* -------------------------------------------------- Grid */

.icbg-grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 12px;
	width: 100%;
	align-items: start;
	justify-items: center;
}

.icbg-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	max-width: var(--icbg-item-max-width, 100%);
	text-align: center;
}

.icbg-item-link {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	color: inherit;
	text-decoration: none;
}

/* -------------------------------------------------- Tile (background plate) */

.icbg-tile {
	position: relative;
	width: 100%;
	aspect-ratio: var(--icbg-tile-ratio, 1 / 1);
	background-repeat: no-repeat;
	background-position: center center;
	background-size: var(--icbg-tile-bg-size, contain);
	border-radius: var(--icbg-tile-radius, 0px);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

/* Fallback for browsers without aspect-ratio support. */
@supports not (aspect-ratio: 1 / 1) {
	.icbg-tile::before {
		content: "";
		display: block;
		padding-top: 100%;
	}
}

.icbg-item-link:hover .icbg-tile {
	transform: translateY(var(--icbg-tile-hover-shift, -4px));
}

/* -------------------------------------------------- Brand logo */

.icbg-brand-image {
	position: absolute;
	left: var(--icbg-img-x, 50%);
	top: var(--icbg-img-y, 44%);
	width: var(--icbg-img-size, 76%);
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 0;
	pointer-events: none;
}

.icbg-brand-image img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	object-fit: contain;
	border-radius: var(--icbg-img-radius, 0px);
}

/* -------------------------------------------------- Brand name */

.icbg-brand-names {
	position: absolute;
	left: var(--icbg-name-x, 50%);
	top: var(--icbg-name-y, 86%);
	width: var(--icbg-name-width, 88%);
	transform: translate(-50%, -50%);
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	pointer-events: none;
}

.icbg-brand-name {
	display: block;
	width: 100%;
	line-height: 1.5;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.icbg-brand-name--latin {
	font-size: 13px;
	font-weight: 600;
}

.icbg-brand-name--iransense {
	font-family: "Iransense", "IRANSansFaNum", "IRANSans", Tahoma, sans-serif;
	font-size: 14px;
	font-weight: 700;
	direction: rtl;
}

/* -------------------------------------------------- Caption below the tile */

.icbg-caption {
	width: 100%;
	margin-top: 10px;
	overflow-wrap: break-word;
	word-wrap: break-word;
}

.icbg-caption-desktop {
	display: block;
}

.icbg-caption-mobile {
	display: none;
}

/* -------------------------------------------------- Empty (auto generated) slots */

.icbg-item--empty .icbg-tile {
	opacity: var(--icbg-empty-opacity, 0.55);
}

/* -------------------------------------------------- Responsive */

/* Column counts per breakpoint are emitted by Elementor's own responsive
   control, so only the caption swap and header spacing live here. */

@media (max-width: 767px) {
	.icbg-caption-desktop {
		display: none;
	}

	.icbg-caption-mobile {
		display: block;
	}

	.icbg-header {
		gap: 12px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.icbg-tile,
	.icbg-view-all {
		transition: none;
	}
}
