.webtim-gift,
.webtim-gift-modal,
.webtim-gift-cart-item {
	--webtim-gift-accent: var(--e-global-color-primary, #5f8f2a);
}

/* Notice above the cart table */
.webtim-gift {
	margin: 0 0 24px;
	width: 100%;
}

.webtim-gift__notice {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 16px;
	padding: 16px 20px;
	border: 1px solid var(--webtim-gift-accent);
	border-radius: 8px;
	background: #f7faf3;
	background: color-mix(in srgb, var(--webtim-gift-accent) 8%, #fff);
}

.webtim-gift__icon {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	color: var(--webtim-gift-accent);
}

.webtim-gift__icon svg {
	display: block;
	width: 100%;
	height: 100%;
}

.webtim-gift__text {
	flex: 1 1 220px;
	display: flex;
	flex-direction: column;
	gap: 4px;
	line-height: 1.4;
}

.webtim-gift__open {
	flex: 0 0 auto;
}

/* Modal */
.webtim-gift-modal[hidden] {
	display: none !important;
}

.webtim-gift-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

.webtim-gift-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.webtim-gift-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 760px;
	max-height: calc(100vh - 32px);
	background: #fff;
	color: #222;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
}

.webtim-gift-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 16px 20px;
	border-bottom: 1px solid #e5e5e5;
}

.webtim-gift-modal__title {
	margin: 0;
	font-size: 20px;
	line-height: 1.3;
}

.webtim-gift-modal__close {
	padding: 4px 8px;
	border: 0;
	background: none;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.webtim-gift-modal__error {
	margin: 12px 20px 0;
	padding: 10px 12px;
	border-radius: 4px;
	background: #fdecea;
	color: #a12622;
}

.webtim-gift-modal__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 16px;
	margin: 0;
	padding: 20px;
	list-style: none;
	overflow-y: auto;
}

.webtim-gift-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px;
	border: 1px solid #e5e5e5;
	border-radius: 8px;
	text-align: center;
}

.webtim-gift-option.is-selected {
	border-color: var(--webtim-gift-accent);
	box-shadow: 0 0 0 1px var(--webtim-gift-accent);
}

.webtim-gift-option__image img {
	display: block;
	width: 100%;
	max-width: 180px;
	height: auto;
	margin: 0 auto;
}

.webtim-gift-option__name {
	flex: 1;
	font-weight: 600;
}

.webtim-gift-option__selected {
	padding: 8px 0;
	color: var(--webtim-gift-accent);
	font-weight: 600;
}

.webtim-gift-option__choose {
	width: 100%;
}

body.webtim-gift-modal-open {
	overflow: hidden;
}

/* Gift line in the cart: "Gift: for orders over X" as label + value rows, no indent */
.webtim-gift-cart-item dl.variation {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 2px 6px;
	margin: 6px 0 0;
	padding: 0;
	border: 0;
}

.webtim-gift-cart-item dl.variation dt,
.webtim-gift-cart-item dl.variation dd {
	float: none;
	margin: 0;
	padding: 0;
}

.webtim-gift-cart-item dl.variation dt {
	color: var(--webtim-gift-accent);
	font-weight: 600;
}

.webtim-gift-cart-item dl.variation dd p {
	margin: 0;
}

/* Gift line in the cart: fixed quantity 1, no +/- buttons (webtim theme).
   The buttons keep their space, so the 1 lines up with the other quantities. */
.webtim-gift-cart-item .qty-change {
	visibility: hidden !important;
	pointer-events: none !important;
}

.webtim-gift-cart-item .product-quantity {
	align-items: center;
	background: transparent;
	border-color: transparent;
}

.webtim-gift-qty {
	display: inline-block;
	min-width: 40px;
	line-height: 36px;
	text-align: center;
}

@media (max-width: 480px) {
	.webtim-gift-modal__list {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
		padding: 12px;
	}
}
