/**
 * Gift box flavor picker styles.
 *
 * @package JSD_Variation_Image_Swatches
 */

.jsd-gift-box-picker,
.jsd-gift-box-picker * {
	box-sizing: border-box;
}

.jsd-gift-box-picker {
	margin: 0 0 1.5em;
	width: 100%;
}

.jsd-gift-box-picker__header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 0.75em;
}

.jsd-gift-box-picker__title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
}

.jsd-gift-box-picker__counter {
	color: #555;
	font-size: 14px;
	line-height: 1.4;
	white-space: nowrap;
}

.jsd-gift-box-picker.is-complete .jsd-gift-box-picker__counter {
	color: #1f5f3b;
	font-weight: 600;
}

.jsd-gift-box-picker__grid {
	display: flex;
	flex-wrap: nowrap;
	gap: 0.75em;
	overflow-x: auto;
	overflow-y: hidden;
	-webkit-overflow-scrolling: touch;
	padding: 0.5em 0.25em;
	scrollbar-width: thin;
}

.jsd-gift-box-card {
	display: flex;
	flex: 0 0 106px;
	flex-direction: column;
	align-items: stretch;
	width: 106px;
	min-width: 106px;
	max-width: 106px;
	border: 2px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: inherit;
	font-family: inherit;
	padding: 10px;
	text-align: center;
	text-decoration: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jsd-gift-box-card.is-selected {
	border-color: currentColor;
	box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
}

.jsd-gift-box-card__select {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	border: 0 !important;
	background: transparent !important;
	color: inherit !important;
	cursor: pointer;
	font-family: inherit !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-align: center;
	text-decoration: none !important;
}

.jsd-gift-box-card__select:disabled {
	cursor: not-allowed;
	opacity: 0.45;
}

.jsd-gift-box-card__image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 82px;
	height: 82px;
	min-width: 82px;
	min-height: 82px;
	max-width: 82px;
	max-height: 82px;
	margin: 0 auto 6px;
	overflow: hidden;
	border-radius: 4px;
	background: #f5f5f5;
}

.jsd-gift-box-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.jsd-gift-box-card__image--empty::before {
	content: "";
	display: block;
	width: 34px;
	height: 34px;
	border: 1px dashed #aaa;
	border-radius: 4px;
}

.jsd-gift-box-card__name {
	height: 2.8em;
	margin-bottom: 8px;
	overflow: hidden;
	color: #333;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.jsd-gift-box-card__fixed-quantity {
	margin-top: auto;
	color: #555;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
}

.jsd-gift-box-card__controls {
	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) 28px;
	align-items: center;
	gap: 4px;
	margin-top: 8px;
}

.jsd-gift-box-card__button {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px !important;
	height: 28px !important;
	min-width: 28px !important;
	min-height: 28px !important;
	max-width: 28px !important;
	max-height: 28px !important;
	border: 1px solid #bbb !important;
	border-radius: 50% !important;
	background: #fff !important;
	color: #222 !important;
	cursor: pointer;
	font-family: inherit !important;
	font-size: 16px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-decoration: none !important;
	vertical-align: middle;
}

.jsd-gift-box-card__button:disabled {
	cursor: not-allowed;
	opacity: 0.35;
}

.jsd-gift-box-card__quantity {
	min-width: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-align: center;
}

@media (max-width: 600px) {
	.jsd-gift-box-picker__header {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.25em;
	}

	.jsd-gift-box-card {
		flex-basis: 98px;
		width: 98px;
		min-width: 98px;
		max-width: 98px;
		padding: 8px;
	}

	.jsd-gift-box-card__image {
		width: 76px;
		height: 76px;
		min-width: 76px;
		min-height: 76px;
		max-width: 76px;
		max-height: 76px;
	}
}
