/**
 * Sidekick frontend styles.
 * Kept intentionally minimal & override-friendly — easy to restyle from
 * a theme's own stylesheet or from Elementor's Custom CSS panel.
 */

.skw-recommendations {
	margin: 32px 0;
	clear: both;
}

.skw-recommendations__title {
	margin: 0 0 16px;
	font-size: 1.15em;
	font-weight: 700;
}

.skw-recommendations__list {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.skw-product-card {
	display: flex;
	flex-direction: column;
	width: 180px;
	max-width: 100%;
	text-align: center;
	box-sizing: border-box;
}

.skw-product-card__image {
	display: block;
	margin-bottom: 8px;
}

.skw-product-card__image img {
	width: 100%;
	height: auto;
	display: block;
}

.skw-product-card__title {
	display: block;
	font-size: 0.95em;
	font-weight: 600;
	text-decoration: none;
	margin-bottom: 4px;
	color: inherit;
}

.skw-product-card__price {
	font-size: 0.9em;
	margin-bottom: 10px;
	opacity: 0.85;
}

.skw-add-to-cart {
	display: inline-block;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	margin-top: auto;
}

.skw-add-to-cart--disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

/* Small viewports: keep cards usable instead of overflowing. */
@media (max-width: 480px) {
	.skw-product-card {
		width: calc(50% - 8px);
	}
}

/* "ادامه به سبد خرید / تسویه‌حساب" button on the Sidekick interstitial page.
 * Fully self-contained on purpose — it must never depend on the theme's
 * own .button styling (which varies wildly and, on some themes, renders
 * as an unstyled underlined link). Colors come from تنظیمات سایدکیک via
 * the --skw-continue-bg / --skw-continue-color custom properties set
 * inline on the element itself. */
.skw-continue-button {
	display: inline-block;
	margin-top: 20px;
	padding: 14px 32px;
	background-color: var(--skw-continue-bg, #2271b1);
	color: var(--skw-continue-color, #ffffff);
	border-radius: 6px;
	font-size: 1em;
	font-weight: 700;
	text-decoration: none !important;
	text-align: center;
	border: none;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.05s ease;
}

.skw-continue-button:hover,
.skw-continue-button:focus {
	filter: brightness(0.92);
	color: var(--skw-continue-color, #ffffff);
}

.skw-continue-button:active {
	transform: translateY(1px);
}

/* Loop-grid layout: let the theme's own .products/.product styling take
 * over completely — we only add spacing around the whole block. */
.skw-recommendations--loop .products {
	margin-top: 0;
}

/* Elementor Loop Grid layout: simple responsive grid wrapper around
 * each rendered Loop Item template. */
.skw-recommendations__list--elementor-loop {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	align-items: stretch;
}

.skw-elementor-loop-item,
.skw-elementor-loop-item > .elementor {
	min-width: 0;
	height: 100%;
}

.skw-popup[hidden] {
	display: none !important;
}

.skw-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: grid;
	place-items: center;
	padding: 20px;
}

.skw-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.58);
}

.skw-popup__dialog {
	position: relative;
	z-index: 1;
	width: min(1100px, 100%);
	max-height: calc(100vh - 40px);
	overflow: auto;
	padding: 28px;
	border-radius: 12px;
	background: #fff;
	color: #222;
	box-shadow: 0 20px 70px rgba(0, 0, 0, 0.3);
	outline: none;
}

.skw-popup__close {
	position: absolute;
	top: 10px;
	inset-inline-end: 12px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.skw-popup__title {
	margin: 0 0 18px;
	padding-inline-end: 40px;
	font-size: 1.5rem;
}

.skw-popup .skw-recommendations {
	margin: 0;
}

.skw-popup .skw-recommendations__title {
	display: none;
}

.skw-popup-open {
	overflow: hidden;
}

@media (max-width: 600px) {
	.skw-popup {
		padding: 10px;
	}

	.skw-popup__dialog {
		max-height: calc(100vh - 20px);
		padding: 22px 14px;
	}

	.skw-recommendations__list--elementor-loop {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}
