/* VEDES products — shared card/grid/slider styles (frontend + SU preview) */

.vedes-product-slider,
.vedes-products-shortcode {
	position: relative;
}

.vedes-product-carousel {
	margin: 0;
}

.vedes-product-card-link,
.vedes-product-slide-link,
.vedes-product-grid-link {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	height: 100%;
	box-sizing: border-box;
	padding: 16px;
	color: inherit;
	text-decoration: none;
	text-align: left;
	background: #ffffff;
	border: 1px solid #e6e8ee;
	border-radius: 16px;
	box-shadow: 0 6px 20px rgba(0, 32, 80, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.vedes-product-card-link:hover,
.vedes-product-slide-link:hover,
.vedes-product-grid-link:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(0, 32, 80, 0.1);
	color: inherit;
	text-decoration: none;
}

.vedes-product-card-image,
.vedes-product-slide-image {
	display: block;
	overflow: hidden;
	border-radius: 12px;
	aspect-ratio: 1 / 1;
	background: #f3f4f7;
	flex: 0 0 auto;
}

.vedes-product-card-image img,
.vedes-product-slide-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.vedes-product-card-title,
.vedes-product-slide-title {
	display: block;
	margin-top: 14px;
	margin-bottom: 0;
	flex: 0 0 auto;
	font-size: var(--vedes-product-title-size, 15px);
	font-weight: 700;
	line-height: var(--vedes-product-title-lh, 1.35);
	/* Immer 2 Zeilen reservieren; längerer Text → vertikaler Scroll */
	height: calc(var(--vedes-product-title-size, 15px) * var(--vedes-product-title-lh, 1.35) * 2);
	max-height: calc(var(--vedes-product-title-size, 15px) * var(--vedes-product-title-lh, 1.35) * 2);
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	color: var(--epcl-black, #002050);
	text-align: left;
	scrollbar-width: thin;
}

.vedes-product-card-title::-webkit-scrollbar,
.vedes-product-slide-title::-webkit-scrollbar {
	width: 4px;
}

.vedes-product-card-title::-webkit-scrollbar-thumb,
.vedes-product-slide-title::-webkit-scrollbar-thumb {
	background: rgba(0, 32, 80, 0.25);
	border-radius: 4px;
}

.vedes-title-position-below .vedes-product-card-title,
.vedes-title-position-below .vedes-product-slide-title {
	margin-top: 14px;
	margin-bottom: 0;
}

.vedes-title-position-above .vedes-product-card-title,
.vedes-title-position-above .vedes-product-slide-title {
	margin-top: 0;
	margin-bottom: 12px;
}

.vedes-product-slider[data-show-title="0"] .vedes-product-card-title,
.vedes-product-slider[data-show-title="0"] .vedes-product-slide-title,
.vedes-products-shortcode[data-show-title="0"] .vedes-product-card-title {
	display: none;
}

.vedes-product-card-prices,
.vedes-product-slide-prices {
	display: block;
	margin-top: 10px;
	margin-bottom: 16px;
	flex: 0 0 auto;
	min-height: 1.2em; /* Preiszeile stabil für gleiche Button-Position */
	line-height: 1.3;
	text-decoration: none;
}

.vedes-product-slider[data-show-price="0"] .vedes-product-card-prices,
.vedes-product-slider[data-show-price="0"] .vedes-product-slide-prices,
.vedes-products-shortcode[data-show-price="0"] .vedes-product-card-prices {
	display: none;
}

.vedes-product-card-retail,
.vedes-product-slide-retail {
	display: inline;
	margin-right: 8px;
	font-size: 14px;
	font-weight: 400;
	color: #6c757d;
	text-decoration: line-through !important;
	text-decoration-thickness: 1.5px;
	text-decoration-color: #6c757d;
}

.vedes-product-card-price,
.vedes-product-slide-price {
	display: inline;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--epcl-black, #002050);
	text-decoration: none !important;
}

.vedes-product-card-price.is-sale,
.vedes-product-slide-price.is-sale {
	color: #e10489;
}

/* CTA „Zum Produkt“ */
.vedes-product-card-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin-top: auto;
	flex: 0 0 auto;
	padding: 12px 16px;
	box-sizing: border-box;
	border-radius: 8px;
	background: #2b61c9;
	color: #ffffff !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
}

.vedes-product-card-link:hover .vedes-product-card-cta,
.vedes-product-slide-link:hover .vedes-product-card-cta,
.vedes-product-grid-link:hover .vedes-product-card-cta {
	background: #2456b3;
}

.vedes-product-card-cta-label {
	position: relative;
	z-index: 1;
}

.vedes-product-card-cta-arrow {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	stroke: currentColor;
}

.vedes-product-slider .slick-dots {
	position: static;
	margin-top: 12px;
}

.vedes-product-slider .slick-arrow {
	z-index: 2;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.vedes-product-slider:hover .slick-arrow,
.vedes-product-slider:focus-within .slick-arrow {
	opacity: 1;
	visibility: visible;
}

.vedes-product-slider:hover .slick-arrow.slick-disabled,
.vedes-product-slider:focus-within .slick-arrow.slick-disabled {
	opacity: 0;
	visibility: hidden;
}

/* Prev/Next unter den Dots, horizontal zentriert */
.vedes-product-slider .vedes-product-carousel.bottom-arrows {
	padding-bottom: 48px;
}

.vedes-product-slider .bottom-arrows > .slick-dots {
	margin-top: 12px;
	margin-bottom: 0;
}

.vedes-product-slider .bottom-arrows > .slick-prev,
.vedes-product-slider .bottom-arrows > .slick-next {
	top: auto !important;
	bottom: 0 !important;
	left: 50% !important;
	right: auto !important;
	transform: none !important;
}

.vedes-product-slider .bottom-arrows > .slick-prev {
	margin-left: -41px; /* -(Button 35px + Gap 6px) */
}

.vedes-product-slider .bottom-arrows > .slick-next {
	margin-left: 6px;
}

.vedes-product-slider .bottom-arrows > .slick-prev:hover,
.vedes-product-slider .bottom-arrows > .slick-next:hover {
	transform: none !important;
}

.widget_vedes_product_slider .vedes-product-slider .slick-arrow {
	opacity: 0;
}

.widget_vedes_product_slider .vedes-product-slider:hover .slick-arrow,
.widget_vedes_product_slider .vedes-product-slider:focus-within .slick-arrow {
	opacity: 1;
}

#sidebar .widget_vedes_product_slider .vedes-product-slider,
.vedes-home-layout #sidebar .widget_vedes_product_slider .vedes-product-slider {
	padding: 0 4px;
}

#sidebar .widget_vedes_product_slider .vedes-product-card-image,
#sidebar .widget_vedes_product_slider .vedes-product-slide-image {
	box-shadow: 0 2px 10px rgba(0, 32, 80, 0.08);
	background: #fff;
}

#sidebar .widget_vedes_product_slider .vedes-product-card-price,
#sidebar .widget_vedes_product_slider .vedes-product-slide-price {
	font-size: 16px;
}

#sidebar .widget_vedes_product_slider .slick-dots,
.vedes-home-layout #sidebar .widget_vedes_product_slider .slick-dots {
	margin-top: 14px;
}

/* VEDES: Produkt-Grid im Beitrag (Shortcode) */
.vedes-products-grid {
	display: grid;
	gap: 24px;
	margin: 24px 0;
	align-items: stretch;
}

.vedes-product-grid-item {
	min-width: 0;
	padding: 0;
	display: flex;
	align-items: stretch;
}

.vedes-product-grid-item > a {
	width: 100%;
	height: 100%;
}

.vedes-products-grid.vedes-products-cols-1 {
	grid-template-columns: minmax(0, 1fr);
}

.vedes-products-grid.vedes-products-cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vedes-products-grid.vedes-products-cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vedes-products-grid.vedes-products-cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.single .post-content .vedes-products-shortcode .vedes-product-card-title {
	font-size: var(--vedes-product-title-size, 15px);
	height: calc(var(--vedes-product-title-size, 15px) * var(--vedes-product-title-lh, 1.35) * 2);
	max-height: calc(var(--vedes-product-title-size, 15px) * var(--vedes-product-title-lh, 1.35) * 2);
}

.single .post-content .vedes-products-shortcode .vedes-product-card-price {
	font-size: 22px;
}

.vedes-product-slide.item {
	padding: 4px 8px;
	box-sizing: border-box;
	height: auto;
	display: flex !important;
	align-items: stretch;
}

.vedes-product-slide.item > a {
	width: 100%;
	height: 100%;
}

/* Slider: gleiche Teaser-Höhe in einer Reihe */
.vedes-product-slider .slick-track {
	display: flex !important;
	align-items: stretch;
}

.vedes-product-slider .slick-slide {
	height: auto !important;
	display: flex !important;
}

.vedes-product-slider .slick-slide > div {
	display: flex;
	width: 100%;
	height: 100%;
}

@media (max-width: 991px) {
	.vedes-products-grid.vedes-products-cols-3,
	.vedes-products-grid.vedes-products-cols-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.vedes-products-grid.vedes-products-cols-2,
	.vedes-products-grid.vedes-products-cols-3,
	.vedes-products-grid.vedes-products-cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Shortcodes Ultimate generator preview */
#su-generator-preview .vedes-products-shortcode,
#su-generator-preview .vedes-product-slider {
	max-width: 100%;
	box-sizing: border-box;
}

#su-generator-preview .vedes-products-grid {
	margin: 0;
}

#su-generator-preview .vedes-products-grid.vedes-products-cols-3,
#su-generator-preview .vedes-products-grid.vedes-products-cols-4 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

#su-generator-preview a.vedes-product-card-link,
#su-generator-preview a.vedes-product-slide-link,
#su-generator-preview a.vedes-product-grid-link {
	color: inherit !important;
	text-decoration: none !important;
}

#su-generator-preview .vedes-product-card-title,
#su-generator-preview .vedes-product-slide-title,
#su-generator-preview .vedes-product-card-price,
#su-generator-preview .vedes-product-slide-price {
	color: #002050;
}

#su-generator-preview .vedes-product-card-price.is-sale,
#su-generator-preview .vedes-product-slide-price.is-sale {
	color: #e10489;
}

#su-generator-preview .vedes-product-card-cta {
	color: #ffffff !important;
	text-decoration: none !important;
}

@media (max-width: 575px) {
	#su-generator-preview .vedes-products-grid.vedes-products-cols-2,
	#su-generator-preview .vedes-products-grid.vedes-products-cols-3,
	#su-generator-preview .vedes-products-grid.vedes-products-cols-4 {
		grid-template-columns: minmax(0, 1fr);
	}
}
