/* Grafiart WooCommerce Carousel Styling */

.grafiart-carousel-wrapper {
	position: relative;
	width: 100%;
	margin: 1.5rem 0;
}

.grafiart-carousel-placeholder {
	padding: 2rem;
	background: #f8f9fa;
	border: 2px dashed #ccc;
	border-radius: 8px;
	text-align: center;
	color: #666;
	font-size: 0.95rem;
}

.grafiart-products-carousel,
.grafiart-categories-carousel {
	padding-bottom: 2.5rem !important; /* Space for pagination bullets */
}

/* Block Editor specific fixes */
.grafiart-wc-carousel-editor-block .grafiart-card-link {
	pointer-events: none;
	cursor: default;
}

/* Fallback grid preview for editor if Swiper JavaScript does not initialize inside iframe canvas */
.grafiart-wc-carousel-editor-block .swiper:not(.swiper-initialized) {
	overflow: hidden;
}

.grafiart-wc-carousel-editor-block .swiper:not(.swiper-initialized) .swiper-wrapper {
	display: grid;
	grid-template-columns: repeat(var(--slides-per-view, 4), minmax(0, 1fr));
	gap: var(--space-between, 20px);
	max-height: calc(100vh - 200px);
	overflow: hidden;
}

.grafiart-wc-carousel-editor-block .swiper:not(.swiper-initialized) .swiper-slide {
	width: auto !important;
	margin-right: 0 !important;
}

/* Hide all slides beyond the first row in editor fallback view */
.grafiart-wc-carousel-editor-block .swiper:not(.swiper-initialized) .swiper-slide:nth-child(n + 1) {
	display: flex;
}

/* Hide items past slidesPerView Desktop count in editor preview */
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 1"] .swiper-slide:nth-child(n + 2),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 2"] .swiper-slide:nth-child(n + 3),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 3"] .swiper-slide:nth-child(n + 4),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 4"] .swiper-slide:nth-child(n + 5),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 5"] .swiper-slide:nth-child(n + 6),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 6"] .swiper-slide:nth-child(n + 7),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 7"] .swiper-slide:nth-child(n + 8),
.grafiart-wc-carousel-editor-block .swiper[style*="--slides-per-view: 8"] .swiper-slide:nth-child(n + 9) {
	display: none !important;
}

/* Card Styles */
.grafiart-product-slide,
.grafiart-category-slide {
	height: auto;
	display: flex;
	flex-direction: column;
}

.grafiart-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
	border-radius: 8px;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #eaeaea;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.grafiart-card-link:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.grafiart-card-image-wrap {
	width: 100%;
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background-color: #f5f5f5;
	display: flex;
	align-items: center;
	justify-content: center;
}

.grafiart-slide-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.grafiart-card-link:hover .grafiart-slide-image {
	transform: scale(1.04);
}

.grafiart-card-title {
	margin: 0;
	padding: 1rem;
	font-size: 1rem;
	font-weight: 600;
	text-align: center;
	line-height: 1.35;
	color: #222222;
}

/* Swiper navigation buttons customization */
.grafiart-carousel-wrapper .swiper-button-next,
.grafiart-carousel-wrapper .swiper-button-prev {
	color: #111111;
	background: rgba(255, 255, 255, 0.9);
	width: 36px;
	height: 36px;
	border-radius: 50%;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
	transition: background 0.2s ease, transform 0.2s ease;
}

.grafiart-carousel-wrapper .swiper-button-next:after,
.grafiart-carousel-wrapper .swiper-button-prev:after {
	font-size: 16px;
	font-weight: bold;
}

.grafiart-carousel-wrapper .swiper-button-next:hover,
.grafiart-carousel-wrapper .swiper-button-prev:hover {
	background: #ffffff;
	transform: scale(1.1);
}

/* Swiper pagination dots customization */
.grafiart-carousel-wrapper .swiper-pagination-bullet {
	background: #888888;
	opacity: 0.5;
}

.grafiart-carousel-wrapper .swiper-pagination-bullet-active {
	background: #111111;
	opacity: 1;
}
