/* ==========================================================
   Banner Showcase (BNSW) — frontend.css  v1.1.0
   All classes use bnsw- prefix — zero collision with any
   other plugin including WC Product Showcase (wcps-).
   ========================================================== */

/* ── CSS variables (per-instance overrides via inline style) */
.bnsw-wrapper {
	--bnsw-height:   400px;
	--bnsw-overlay:  rgba(0,0,0,0.4);
	--bnsw-cols:     3;
	--bnsw-gap:      12px;
	--bnsw-radius:   14px;
	--bnsw-duration: 0.38s;
	--bnsw-primary:  #f58220;
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.bnsw-empty {
	text-align: center;
	padding: 40px;
	color: #888;
	font-style: italic;
}

/* ════════════════════════════════════════════════════════════
   GRID
   ════════════════════════════════════════════════════════════ */

/* Default grid — equal columns, auto height */
.bnsw-layout-grid .bnsw-grid {
	display: grid;
	grid-template-columns: repeat(var(--bnsw-cols, 3), 1fr);
	gap: var(--bnsw-gap);
}

/*
  HOVER-EXPAND GRID
  ─────────────────
  Switch to flexbox so JS can animate widths freely.
  The container is given a fixed height equal to --bnsw-height.
  Items start equal (flex:1). JS adds inline width on
  mouseenter / removes it on mouseleave.
  NO transform, NO scale, NO box-shadow change — clean.
*/
.bnsw-layout-grid.bnsw-has-hover .bnsw-grid {
	display: flex;
	flex-wrap: nowrap;
	gap: var(--bnsw-gap);
	height: var(--bnsw-height);
	overflow: hidden;
	align-items: stretch;
}

.bnsw-layout-grid.bnsw-has-hover .bnsw-grid .bnsw-item {
	flex: 1 1 0;
	min-width: 0;
	height: 100% !important; /* fill the flex row */
	/* width transition driven by JS inline style */
	transition: width var(--bnsw-duration) ease,
	            flex  var(--bnsw-duration) ease;
}

/* Multi-row: JS adds .bnsw-multirow → back to grid, no expand */
.bnsw-layout-grid.bnsw-has-hover .bnsw-grid.bnsw-multirow {
	display: grid !important;
	height: auto !important;
	overflow: visible !important;
	grid-template-columns: repeat(var(--bnsw-cols, 3), 1fr);
}
.bnsw-layout-grid.bnsw-has-hover .bnsw-grid.bnsw-multirow .bnsw-item {
	flex: unset;
	transition: none;
	height: var(--bnsw-height) !important;
}

/* Responsive: disable expand below 768px */
@media (max-width: 768px) {
	.bnsw-layout-grid.bnsw-has-hover .bnsw-grid {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		height: auto !important;
		overflow: visible !important;
	}
	.bnsw-layout-grid.bnsw-has-hover .bnsw-grid .bnsw-item {
		flex: unset;
		height: var(--bnsw-height) !important;
		transition: none;
	}
}
@media (max-width: 480px) {
	.bnsw-layout-grid .bnsw-grid {
		grid-template-columns: 1fr !important;
	}
}

/* ════════════════════════════════════════════════════════════
   SLIDER
   ════════════════════════════════════════════════════════════ */
.bnsw-layout-slider .bnsw-swiper {
	overflow: hidden;   /* clips expanded slides so nothing bleeds outside */
	padding-bottom: 48px;
	position: relative;
}

/* Prevent expanded slides from causing horizontal scroll on the page */
.bnsw-layout-slider {
	overflow: hidden;
}

/* Only set height — let Swiper control width */
.bnsw-layout-slider .swiper-wrapper {
	align-items: stretch;
}
.bnsw-layout-slider .swiper-slide {
	height: var(--bnsw-height) !important;
	box-sizing: border-box;
}

/* Navigation */
.bnsw-prev, .bnsw-next {
	color: #fff !important;
	background: rgba(0,0,0,.50) !important;
	width: 44px !important;
	height: 44px !important;
	border-radius: 50%;
	transition: background .2s;
}
.bnsw-prev:hover, .bnsw-next:hover { background: rgba(0,0,0,.78) !important; }
.bnsw-prev::after, .bnsw-next::after { font-size: 15px !important; font-weight: 900; }

.bnsw-pagination .swiper-pagination-bullet {
	background: rgba(255,255,255,.6);
	opacity: 1;
	transition: background .2s, transform .2s;
}
.bnsw-pagination .swiper-pagination-bullet-active {
	background: var(--bnsw-primary);
	transform: scale(1.3);
}

/* ════════════════════════════════════════════════════════════
   ITEM — shared for grid and slider
   ════════════════════════════════════════════════════════════ */
.bnsw-item {
	position: relative;
	overflow: hidden;
	border-radius: var(--bnsw-radius);
	height: var(--bnsw-height);
	display: block;
	text-decoration: none;
	background: #1a1a2e;
	box-sizing: border-box;
	/* NO transform — prevents any bounce/grow */
}

a.bnsw-item  { cursor: pointer; }
div.bnsw-item { cursor: default; }

/* Background image */
.bnsw-item-bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
	transition: transform var(--bnsw-duration) ease;
}
.bnsw-item-bg--empty {
	background: linear-gradient(135deg, #1a1a2e 0%, #2d3561 100%);
}
/* Subtle BG zoom only — card itself doesn't move */
.bnsw-item:hover .bnsw-item-bg {
	transform: scale(1.05);
}

/* Overlay */
.bnsw-overlay {
	position: absolute;
	inset: 0;
	background: var(--bnsw-overlay);
	opacity: 0;
	transition: opacity var(--bnsw-duration) ease;
	pointer-events: none;
}
.bnsw-item:hover .bnsw-overlay {
	opacity: 1;
}

/* Content — gradient + text, NO movement on hover */
.bnsw-item-content {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	padding: 20px 22px 22px;
	background: linear-gradient(to top, rgba(0,0,0,.80) 0%, transparent 100%);
	pointer-events: none;
	z-index: 1;
}

.bnsw-item-title {
	margin: 0 0 5px;
	font-size: clamp(14px, 1.8vw, 20px);
	font-weight: 700;
	color: #fff;
	line-height: 1.25;
	text-shadow: 0 1px 6px rgba(0,0,0,.5);
}

.bnsw-item-text {
	margin: 0;
	font-size: clamp(12px, 1.2vw, 14px);
	color: rgba(255,255,255,.9);
	line-height: 1.4;
	text-shadow: 0 1px 4px rgba(0,0,0,.4);
}

/* ════════════════════════════════════════════════════════════
   VIEW MORE
   ════════════════════════════════════════════════════════════ */
.bnsw-viewmore-wrap { text-align: center; margin-top: 28px; }
.bnsw-viewmore-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: var(--bnsw-primary);
	color: #fff;
	text-decoration: none;
	font-size: 14px;
	font-weight: 700;
	padding: 11px 30px;
	border-radius: 8px;
	transition: background .25s;
}
.bnsw-viewmore-btn:hover { background: #d97319; color: #fff; }
