/**
 * La-Kass Variation Swatches, Countdown, Bought Together Styles
 *
 * @package La-Kass
 * @since   1.0.0
 */

/* ==========================================================================
   Variation Swatches
   ========================================================================== */

.lk-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 8px 0 12px;
}

/* Base swatch button */
.lk-swatch {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 2px solid transparent;
	background: transparent;
	cursor: pointer;
	transition: border-color 0.2s, opacity 0.2s, box-shadow 0.2s;
	padding: 0;
}

.lk-swatch:hover {
	border-color: #999;
}

.lk-swatch--selected {
	border-color: var(--lk-color-primary, #ff4d00) !important;
	box-shadow: 0 0 0 1px var(--lk-color-primary, #ff4d00);
}

/* Unavailable (out of stock for this combo) */
.lk-swatch--unavailable {
	opacity: 0.3;
	pointer-events: none;
	position: relative;
}

.lk-swatch--unavailable::after {
	content: '';
	position: absolute;
	top: 50%;
	left: -2px;
	right: -2px;
	height: 1px;
	background: #999;
	transform: rotate(-45deg);
}

/* ---------- Color Swatches ---------- */

.lk-swatches--color .lk-swatch {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	padding: 2px;
}

.lk-swatch__color {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

/* White/light color needs visible border */
.lk-swatch__color[style*="ffffff"],
.lk-swatch__color[style*="FFFFFF"],
.lk-swatch__color[style*="fff"],
.lk-swatch__color[style*="FFF"] {
	border-color: #ddd;
}

/* ---------- Image Swatches ---------- */

.lk-swatches--image .lk-swatch {
	width: 44px;
	height: 44px;
	border-radius: 6px;
	overflow: hidden;
	padding: 2px;
}

.lk-swatch__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

/* ---------- Label / Text Swatches ---------- */

.lk-swatches--label .lk-swatch {
	min-width: 36px;
	height: 36px;
	border-radius: 6px;
	border: 1px solid #ddd;
	padding: 0 12px;
	background: #fff;
}

.lk-swatches--label .lk-swatch:hover {
	border-color: #999;
	background: #f8f8f8;
}

.lk-swatches--label .lk-swatch--selected {
	border-color: var(--lk-color-primary, #ff4d00);
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
}

.lk-swatches--label .lk-swatch--selected .lk-swatch__label {
	color: #fff;
}

.lk-swatch__label {
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #333;
	white-space: nowrap;
}

/* ==========================================================================
   Countdown Timer
   ========================================================================== */

.lk-countdown {
	display: flex;
	align-items: center;
	gap: 8px;
}

/* Card countdown (compact) */
.lk-countdown--card {
	position: absolute;
	bottom: 8px;
	left: 8px;
	right: 8px;
	background: rgba(0, 0, 0, 0.8);
	color: #fff;
	padding: 6px 10px;
	border-radius: 6px;
	z-index: 3;
	justify-content: center;
}

.lk-countdown--card .lk-countdown__timer {
	gap: 4px;
}

.lk-countdown--card .lk-countdown__block {
	min-width: auto;
	padding: 0;
}

.lk-countdown--card .lk-countdown__value {
	font-size: 13px;
}

.lk-countdown--card .lk-countdown__unit {
	display: none;
}

.lk-countdown--card .lk-countdown__sep {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.5);
}

/* Single product countdown (full) */
.lk-countdown--single {
	flex-direction: column;
	align-items: flex-start;
	background: linear-gradient(135deg, #fff5f0, #fff);
	border: 1px solid #ffe0d0;
	border-radius: 10px;
	padding: 16px 20px;
	margin: 12px 0;
}

.lk-countdown__label {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #e53935;
	margin-bottom: 10px;
}

.lk-countdown__timer {
	display: flex;
	align-items: center;
	gap: 6px;
}

.lk-countdown__block {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 48px;
	padding: 6px 8px;
	background: #fff;
	border-radius: 6px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.lk-countdown__value {
	font-size: 20px;
	font-weight: 700;
	color: #111;
	line-height: 1.2;
	font-variant-numeric: tabular-nums;
}

.lk-countdown__unit {
	font-size: 10px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
	margin-top: 2px;
}

.lk-countdown__sep {
	font-size: 18px;
	font-weight: 700;
	color: #ccc;
	margin: 0 -2px;
	align-self: flex-start;
	padding-top: 6px;
}

/* ==========================================================================
   Frequently Bought Together
   ========================================================================== */

.lk-bought-together {
	margin: 40px 0;
	padding: 30px;
	background: #fafafa;
	border: 1px solid #eee;
	border-radius: 12px;
}

.lk-bought-together__title {
	margin: 0 0 24px;
	font-size: 18px;
	font-weight: 700;
	color: #111;
}

.lk-bought-together__products {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.lk-bought-together__product {
	flex: 1;
	min-width: 140px;
	max-width: 200px;
	text-align: center;
}

.lk-bought-together__image {
	position: relative;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	margin-bottom: 10px;
	border: 1px solid #eee;
}

.lk-bought-together__image img {
	width: 100%;
	height: auto;
	display: block;
}

/* Checkbox overlay */
.lk-bought-together__check {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	cursor: pointer;
}

.lk-bought-together__checkbox {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
}

.lk-bought-together__checkmark {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	background: #fff;
	border: 2px solid #ddd;
	border-radius: 4px;
	transition: background 0.2s, border-color 0.2s;
}

.lk-bought-together__checkmark svg {
	color: #fff;
	opacity: 0;
	transition: opacity 0.2s;
}

.lk-bought-together__checkbox:checked + .lk-bought-together__checkmark {
	background: var(--lk-color-primary, #ff4d00);
	border-color: var(--lk-color-primary, #ff4d00);
}

.lk-bought-together__checkbox:checked + .lk-bought-together__checkmark svg {
	opacity: 1;
}

.lk-bought-together__checkbox:disabled + .lk-bought-together__checkmark {
	opacity: 0.6;
	cursor: default;
}

/* Plus sign between products */
.lk-bought-together__plus {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	flex-shrink: 0;
	color: #bbb;
}

.lk-bought-together__name {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
}

.lk-bought-together__name a {
	color: #333;
	text-decoration: none;
}

.lk-bought-together__name a:hover {
	color: var(--lk-color-primary, #ff4d00);
}

.lk-bought-together__price {
	font-size: 14px;
	font-weight: 600;
	color: #111;
}

.lk-bought-together__price del {
	color: #999;
	font-weight: 400;
	font-size: 12px;
}

.lk-bought-together__price ins {
	text-decoration: none;
	color: var(--lk-color-primary, #ff4d00);
}

/* Footer */
.lk-bought-together__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #eee;
}

.lk-bought-together__total {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.lk-bought-together__total-label {
	font-size: 13px;
	font-weight: 500;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.lk-bought-together__total-value {
	font-size: 22px;
	font-weight: 700;
	color: #111;
}

.lk-bought-together__add-all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 28px;
	background: var(--lk-color-primary, #ff4d00);
	color: #fff;
	border: none;
	border-radius: 8px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, transform 0.1s;
	white-space: nowrap;
}

.lk-bought-together__add-all:hover {
	background: #e64400;
}

.lk-bought-together__add-all:active {
	transform: scale(0.98);
}

.lk-bought-together__add-all.loading {
	opacity: 0.7;
	pointer-events: none;
}

.lk-bought-together__add-all.added {
	background: #2e7d32;
}

/* Notice for variable products */
.lk-bought-together__notice {
	margin-top: 10px;
	padding: 10px 14px;
	background: #fff3e0;
	border: 1px solid #ffe0b2;
	border-radius: 6px;
	font-size: 13px;
	color: #e65100;
	line-height: 1.5;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 768px) {
	.lk-bought-together {
		padding: 20px;
	}

	.lk-bought-together__products {
		flex-direction: column;
		align-items: stretch;
	}

	.lk-bought-together__product {
		max-width: 100%;
		display: flex;
		align-items: center;
		gap: 14px;
		text-align: left;
	}

	.lk-bought-together__image {
		width: 80px;
		flex-shrink: 0;
		margin-bottom: 0;
	}

	.lk-bought-together__plus {
		transform: rotate(90deg);
		align-self: center;
	}

	.lk-bought-together__footer {
		flex-direction: column;
		align-items: stretch;
		gap: 14px;
	}

	.lk-bought-together__add-all {
		justify-content: center;
	}

	/* Countdown single - smaller blocks */
	.lk-countdown--single {
		padding: 12px 16px;
	}

	.lk-countdown__block {
		min-width: 40px;
		padding: 4px 6px;
	}

	.lk-countdown__value {
		font-size: 16px;
	}

	/* Swatches - slightly smaller on mobile */
	.lk-swatches--color .lk-swatch {
		width: 28px;
		height: 28px;
	}

	.lk-swatches--image .lk-swatch {
		width: 38px;
		height: 38px;
	}

	.lk-swatches--label .lk-swatch {
		height: 32px;
		padding: 0 10px;
	}
}

@media (max-width: 480px) {
	.lk-bought-together__total-value {
		font-size: 18px;
	}
}
