/* Stikily Kit Builder — frontend */

/* Elementor'i add-to-cart vorm on flex-rida (kogus + nupp kõrvuti).
   Valija peab võtma täislaiuse ja kogus/nupp minema järgmisele reale. */
form.cart:has(.skb-app) {
	flex-wrap: wrap;
}

form.cart .skb-app {
	flex: 0 0 100%;
	width: 100%;
	max-width: 100%;
}

.skb-app {
	margin: 1.25em 0;
}

/* Teema nupustiilide reset valija nuppudele */
.skb-app button.skb-tile,
.skb-app button.skb-chip,
.skb-app button.skb-more {
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	font-family: inherit;
	line-height: inherit;
	min-height: 0;
}

.skb-slot {
	margin-bottom: 1.75em;
}

.skb-slot-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 0.5em;
}

.skb-slot-title {
	margin: 0;
	font-size: 1.05em;
}

.skb-slot-counter {
	font-size: 0.85em;
	color: #888;
	white-space: nowrap;
}

.skb-slot-counter.skb-done {
	color: #2e7d32;
	font-weight: 600;
}

/* Kategooria-chipid */
.skb-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 0.75em;
}

.skb-chip {
	border: 1px solid #ddd;
	background: #fff;
	border-radius: 999px;
	padding: 4px 14px;
	font-size: 0.85em;
	cursor: pointer;
	line-height: 1.6;
	color: #444;
	transition: all 0.15s;
}

.skb-chip:hover {
	border-color: #002433;
	color: #002433;
}

.skb-chip-active,
.skb-chip-active:hover {
	background: #002433;
	border-color: #002433;
	color: #fff;
}

/* Grid */
.skb-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
	gap: 10px;
}

@media (min-width: 768px) {
	.skb-grid {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}
}

.skb-tile {
	position: relative;
	display: block;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 10px;
	background: none;
	cursor: pointer;
	text-align: center;
	overflow: hidden;
	transition: transform 0.1s;
}

.skb-tile:hover {
	transform: translateY(-2px);
}

.skb-tile img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 8px;
	display: block;
}

.skb-tile-name {
	display: block;
	font-size: 0.75em;
	line-height: 1.3;
	padding: 4px 2px;
	color: #555;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.skb-tile-check {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #002433;
	color: #fff;
	font-size: 13px;
	line-height: 22px;
	display: none;
}

.skb-tile.skb-selected {
	border-color: #002433;
}

.skb-tile.skb-selected .skb-tile-check {
	display: block;
}

.skb-tile.skb-selected .skb-tile-name {
	color: #002433;
	font-weight: 600;
}

/* Lae veel */
.skb-more {
	margin-top: 0.75em;
	background: #fff;
	color: #002433;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 6px 18px;
	cursor: pointer;
	font-size: 0.9em;
}

.skb-more:hover {
	border-color: #002433;
	color: #002433;
}

.skb-loading,
.skb-empty {
	grid-column: 1 / -1;
	padding: 1em 0;
	color: #999;
	font-size: 0.9em;
}

/* Kokkuvõte */
.skb-summary {
	margin-top: 1em;
	padding: 12px 16px;
	background: #fdf2f6;
	border-radius: 10px;
}

.skb-summary-title {
	margin: 0 0 0.4em;
	font-size: 0.95em;
}

.skb-summary-list {
	margin: 0;
	padding-left: 1.2em;
	font-size: 0.88em;
	color: #555;
}

/* Placeholderid */
.skb-ph-row {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.skb-ph {
	width: 104px;
	padding: 0;
	background: #fff;
	border: 2px dashed #c9d4d9;
	border-radius: 10px;
	cursor: pointer;
	text-align: center;
	overflow: hidden;
	transition: border-color 0.15s;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	font-family: inherit;
	min-height: 0;
}

.skb-ph:hover {
	border-color: #002433;
}

.skb-ph-plus {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	font-size: 34px;
	line-height: 2.9;
	color: #9fb1b9;
	background: #f5f8f9;
}

.skb-ph-name {
	display: block;
	font-size: 0.75em;
	line-height: 1.3;
	padding: 5px 2px;
	color: #555;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.skb-ph-filled {
	border-style: solid;
	border-color: #002433;
}

.skb-ph-filled img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	display: block;
}

.skb-ph-edit {
	display: block;
	font-size: 0.68em;
	color: #888;
	padding-bottom: 5px;
	text-decoration: underline;
}

/* Modaal */
.skb-overlay.skb-open {
	display: flex;
}

.skb-no-scroll {
	overflow: hidden;
}

.skb-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 20, 28, 0.55);
	z-index: 2147483000; /* chatbotidest jm vidinatest kõrgemal */
	display: none;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.skb-modal {
	background: #fff;
	border-radius: 14px;
	width: min(680px, 100%);
	max-height: 84vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.skb-modal-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 18px 10px;
	border-bottom: 1px solid #eee;
}

.skb-modal-title {
	margin: 0;
	font-size: 1.1em;
}

.skb-modal-close {
	background: none;
	border: none;
	font-size: 26px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 2px 8px;
	box-shadow: none;
	min-height: 0;
}

.skb-modal-close:hover {
	color: #002433;
}

.skb-modal .skb-chips {
	padding: 10px 18px 0;
	margin-bottom: 0;
}

.skb-modal-body {
	overflow-y: auto;
	padding: 14px 18px 18px;
	-webkit-overflow-scrolling: touch;
}

@media (max-width: 600px) {
	.skb-overlay {
		padding: 0;
		align-items: flex-end;
	}

	.skb-modal {
		width: 100%;
		max-height: 90vh;
		border-radius: 14px 14px 0 0;
	}

	.skb-ph {
		width: 88px;
	}
}

/* Korvi alamread (komplekti komponendid) */
.skb-child-row .product-name,
.skb-child-row td.product-name {
	padding-left: 2em;
	font-size: 0.92em;
}

.skb-child-row .product-thumbnail img {
	max-width: 48px;
}

/* Laost otsas teade */
.skb-oos-notice {
	padding: 12px 16px;
	background: #fff4e5;
	color: #8a5a00;
	border-radius: 8px;
	font-size: 0.95em;
}

/* Viga */
.skb-error {
	margin-top: 0.75em;
	padding: 10px 14px;
	background: #fdecea;
	color: #b71c1c;
	border-radius: 8px;
	font-size: 0.9em;
}
