/**
 * Frontend styles for Battery Applications.
 *
 * @package BAWEL
 */

/* Main wrapper */
.bawel-apps {
	margin: 20px 0;
	width: 100%;
}

.bawel-apps__title {
	margin: 0 0 20px 0;
	font-size: 1.5em;
	font-weight: 600;
}

/* List container */
.bawel-apps__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--bawel-gap, 20px);
	align-items: flex-start;
}

/* Grid layout - Circular icons in a row */
.bawel-apps--grid .bawel-apps__list {
	display: grid;
	grid-template-columns: repeat(var(--bawel-columns, auto-fill), minmax(100px, 1fr));
	justify-content: flex-start;
	align-items: flex-start;
}

/* Row layout - Horizontal scrollable row */
.bawel-apps--row .bawel-apps__list {
	flex-direction: row;
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	justify-content: flex-start;
}

.bawel-apps--row .bawel-apps__item {
	flex: 0 0 auto;
}

/* Carousel layout */
.bawel-apps--carousel {
	overflow: visible; /* Allow hover effects to show */
}

.bawel-apps--carousel .bawel-apps__list {
	display: flex;
	flex-wrap: nowrap;
	overflow-x: auto; /* Horizontal scroll if needed */
	overflow-y: visible; /* Allow vertical overflow for hover */
	position: relative;
	padding: 0;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	gap: var(--bawel-gap, 20px); /* Use gap instead of margin */
}

/* Icon container - Circular yellow background (single layer) */
.bawel-apps__icon {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 80px;
	height: 80px;
	margin: 0;
	background-color: #FFD700;
	border-radius: 50%;
	padding: 12px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	transition: all 0.3s ease;
	text-decoration: none;
	color: inherit;
	cursor: pointer;
	box-sizing: border-box;
	gap: 8px;
}

.bawel-apps__icon:hover {
	background-color: #FFC700;
	transform: translateY(-3px);
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
	text-decoration: none;
	z-index: 10; /* Ensure hovered icon appears above others */
	position: relative;
}

/* Carousel: Only change background color on hover, no transform to prevent clipping */
.bawel-apps--carousel .bawel-apps__icon:hover {
	transform: none; /* No transform in carousel to prevent clipping */
	background-color: #FFC700; /* Only color change */
}

.bawel-apps__icon img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	display: block;
	object-fit: contain;
	filter: brightness(0) saturate(100%);
}

/* Label - Hidden by default, show below icon if needed */
.bawel-apps__label {
	display: block;
	font-size: 0.85em;
	font-weight: 500;
	line-height: 1.2;
	word-wrap: break-word;
	color: #000;
	text-align: center;
	margin-top: 4px;
	max-width: 100px;
}

/* Hover effects */
.bawel-hover-scale .bawel-apps__item:hover {
	transform: scale(1.02) translateY(-2px);
}

.bawel-hover-opacity .bawel-apps__item:hover {
	opacity: 0.9;
	transform: translateY(-2px);
}

.bawel-hover-lift .bawel-apps__item:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
	.bawel-apps__icon {
		width: 70px;
		height: 70px;
		padding: 10px;
	}

	.bawel-apps__title {
		font-size: 1.2em;
		margin-bottom: 15px;
	}

	.bawel-apps__label {
		font-size: 0.8em;
		max-width: 90px;
	}
}

@media (max-width: 480px) {
	.bawel-apps__icon {
		width: 60px;
		height: 60px;
		padding: 8px;
	}

	.bawel-apps__label {
		font-size: 0.75em;
		max-width: 80px;
	}
}

/* Elementor compatibility */
.elementor-widget-bawel_battery_applications .bawel-apps {
	margin: 0;
}

/* Elementor: Allow overflow for carousel - override all parent containers */
.elementor-widget-bawel_battery_applications,
.elementor-widget-bawel_battery_applications .elementor-widget-container,
.elementor-widget-bawel_battery_applications .elementor-widget-container > *,
.elementor-widget-bawel_battery_applications .bawel-apps--carousel,
.elementor-widget-bawel_battery_applications .bawel-apps--carousel .bawel-apps__list {
	overflow: visible !important;
}

/* WooCommerce tab compatibility */
.woocommerce-tabs .bawel-apps {
	margin-top: 0;
}

/* Print styles */
@media print {
	.bawel-apps__item {
		break-inside: avoid;
	}
}
