/**
 * Kiwwwi Discounts — osnovni videz.
 *
 * Namenoma skromno. Vsak modul dobi svoj razred `.kwd-block--<id>`, zato
 * prilagajaš tam in te datoteke ne spreminjaš.
 */


.kwd-block__title {
	font-size: 1rem;
	font-weight: 600;
	margin: 0 0 12px;
}

.kwd-block__items {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
}

.kwd-card {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 12px;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 4px;
	background: #fff;
}

.kwd-card.is-in-cart {
	border-color: currentColor;
}

.kwd-card__media img {
	display: block;
	width: 100%;
	height: auto;
}

.kwd-card__body {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
}

.kwd-card__name {
	font-size: 0.875rem;
	line-height: 1.35;
}

.kwd-card__price {
	display: flex;
	align-items: baseline;
	gap: 6px;
	flex-wrap: wrap;
}

.kwd-card__price del {
	opacity: 0.55;
	font-size: 0.8125rem;
}

.kwd-card__price ins {
	text-decoration: none;
	font-weight: 600;
}

.kwd-add,
.kwd-card__link {
	display: inline-block;
	text-align: center;
	padding: 8px 12px;
	margin: 0;
	border: 0;
	border-radius: 3px;
	cursor: pointer;
	font-size: 0.8125rem;
	line-height: 1.2;
}

.kwd-add[disabled] {
	cursor: default;
	opacity: 0.6;
}

/* Loading: spinner only — no text, no icons. !important so module skins
   (loaded later, same specificity, e.g. `.kwd-block--x .kwd-add{color:#fff}`)
   cannot bring the label back. */
.kwd-add.is-loading {
	position: relative;
	color: transparent !important;
}

.kwd-add.is-loading svg,
.kwd-add.is-loading i,
.kwd-add.is-loading img {
	visibility: hidden;
}

.kwd-add.is-loading::after {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 14px;
	height: 14px;
	border: 2px solid #fff;
	border-top-color: transparent;
	border-radius: 50%;
	animation: kwd-spin 0.7s linear infinite;
	visibility: visible;
}

.kwd-add[data-kwd-error]::before {
	content: attr(data-kwd-error);
	display: block;
	font-size: 0.75rem;
	margin-bottom: 4px;
}

.kwd-card__added {
	font-size: 0.8125rem;
	opacity: 0.7;
}

.kwd-add:focus-visible,
.kwd-card__link:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@keyframes kwd-spin {
	to {
		transform: rotate(360deg);
	}
}

/* ── slider controls (Swiper), markup from render.php ─────────────────────
   Desktop: arrows over the edges + pagination dots below. Mobile: dots only,
   the finger does the rest. Swiper's watchOverflow adds `swiper-button-lock`
   / `swiper-pagination-lock` when nothing overflows. */
.kwd-slider__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-70%); /* optically centered on the card image, above the dots row */
	z-index: 3;
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #fff;
	color: #3d4852;
	box-shadow: 0 2px 10px rgba(14, 48, 62, 0.18);
	cursor: pointer;
}

.kwd-slider__arrow--prev {
	left: -6px;
}

.kwd-slider__arrow--next {
	right: -6px;
}

.kwd-slider__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

.kwd-slider__arrow.swiper-button-lock {
	display: none;
}

.kwd-slider__pagination {
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 10px;
}

.kwd-slider__pagination.swiper-pagination-lock {
	display: none;
}

.kwd-slider__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0;
	border-radius: 50%;
	background: #c9d3da;
	opacity: 1;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}

.kwd-slider__pagination .swiper-pagination-bullet-active {
	background: #3d4852;
	transform: scale(1.25);
}

/* Single card → no slider at all (set by kwd.js). */
.kwd-slider--static .kwd-slider__arrow,
.kwd-slider--static .kwd-slider__pagination {
	display: none;
}

/* Mobile: pagination only. */
@media (max-width: 849px) {
	.kwd-slider__arrow {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.kwd-add.is-loading::after {
		animation-duration: 2s;
	}
}

/* Variabilni izdelek — izbirnik različic na kartici. */
.kwd-card__attrs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.kwd-card__attr {
	width: 100%;
	max-width: 100%;
	padding: 6px 8px;
	font-size: 0.8125rem;
	line-height: 1.2;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 3px;
	background: #fff;
	margin: 0;
}

.kwd-card.is-variable .kwd-card__price ins {
	transition: opacity 0.12s ease;
}

/* Touch targets — on phones every add button must clear 44px regardless of
   the per-module sizing above it. Measured at 375px the module styles land
   at 28–30px, which is below the tappable floor. */
@media (max-width: 549px) {
	.kwd-add,
	.kwd-card__link {
		min-height: 44px;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	.kwd-card__attr {
		min-height: 40px;
	}
}
