:root {
	--dsgw-blue: var(--ds-blue-dark, #174a82);
	--dsgw-blue-button: #2b5d8f;
	--dsgw-blue-hover: #174a82;
	--dsgw-gold: var(--color-em-button-background, #fbb102);
	--dsgw-gold-hover: #e59c00;
	--dsgw-ink: #212529;
	--dsgw-muted: #64707c;
	--dsgw-surface: #fff;
	--dsgw-soft: #f4f8fb;
	--dsgw-border: #dbe5ee;
	--dsgw-danger: #c83f3f;
	--dsgw-success: #23835a;
	--dsgw-radius: 14px;
	--dsgw-shadow: 0 10px 28px rgba(20, 56, 91, .1);
}

.dsgw-owner-panel,
.dsgw-owner-panel *,
.dsgw-public-delivery,
.dsgw-public-delivery *,
table.wishlist_table.shop_table,
table.wishlist_table.shop_table * {
	box-sizing: border-box;
}

/* YITH title controls inherit the store's visual language. */
.wishlist-title-container {
	margin-bottom: 28px;
}

.wishlist-title-container .wishlist-title {
	display: flex;
	align-items: center;
	gap: 12px;
}

.wishlist-title-container .wishlist-title h2 {
	margin: 0 !important;
	padding: 0 !important;
	color: var(--dsgw-ink);
}

.wishlist-title-container .hidden-title-form {
	display: none;
	align-items: center;
	gap: 10px;
	margin: 18px 0 26px;
}

.wishlist-title-container .hidden-title-form input[type="text"] {
	min-height: 48px;
	border: 1px solid var(--dsgw-border);
	border-radius: 11px;
	box-shadow: 0 4px 14px rgba(20, 56, 91, .06);
}

.wishlist-title-container a.show-title-form,
.dsgw-owner-panel .button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 7px;
	min-height: 42px;
	padding: 10px 18px !important;
	border: 0 !important;
	border-radius: 999px !important;
	background: linear-gradient(135deg, #3b6693, #005b93) !important;
	box-shadow: 0 9px 21px rgba(15, 69, 116, .2) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 700 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	text-transform: none !important;
	transition: transform .18s ease, box-shadow .18s ease, background-color .18s ease !important;
}

.wishlist-title-container a.show-title-form:hover,
.dsgw-owner-panel .button:hover {
	box-shadow: 0 12px 25px rgba(15, 69, 116, .28) !important;
	color: #fff !important;
	transform: translateY(-1px);
}

.wishlist-title-container a.show-title-form svg {
	width: 17px;
	height: 17px;
}

/* Owner gift-list control card. */
.dsgw-owner-panel {
	position: relative;
	margin: 0 0 30px;
	padding: 24px;
	overflow: hidden;
	border: 1px solid var(--dsgw-border);
	border-radius: 18px;
	background: linear-gradient(145deg, #fff 0%, #f7fafc 100%);
	box-shadow: var(--dsgw-shadow);
	color: var(--dsgw-ink);
}

.dsgw-owner-panel::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	left: 0;
	height: 5px;
	background: linear-gradient(90deg, var(--dsgw-blue), #3b79ad 72%, var(--dsgw-gold));
}

.dsgw-owner-summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

.dsgw-owner-summary strong {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	color: var(--dsgw-blue);
	font-size: 20px;
	line-height: 1.3;
}

.dsgw-owner-summary strong::before {
	content: "";
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--dsgw-success);
	box-shadow: 0 0 0 5px rgba(35, 131, 90, .12);
}

.dsgw-owner-panel--disabled .dsgw-owner-summary strong::before {
	background: #89939c;
	box-shadow: 0 0 0 5px rgba(100, 112, 124, .12);
}

.dsgw-owner-panel p {
	margin: 7px 0 0;
	line-height: 1.55;
}

.dsgw-owner-toggle {
	flex: 0 0 auto;
	white-space: nowrap;
}

.dsgw-owner-panel--enabled .dsgw-owner-toggle {
	background: #eef2f5 !important;
	box-shadow: none !important;
	color: #425466 !important;
}

.dsgw-owner-panel--enabled .dsgw-owner-toggle:hover {
	background: #e2e8ed !important;
	color: #283746 !important;
}

.dsgw-share-link {
	margin-top: 22px;
	padding: 18px;
	border: 1px solid #d8e5f0;
	border-radius: var(--dsgw-radius);
	background: #eef5fb;
}

.dsgw-share-link > label {
	display: block;
	margin-bottom: 8px;
	color: var(--dsgw-blue);
	font-size: 14px;
	font-weight: 700;
}

.dsgw-share-link > div {
	display: flex;
	gap: 10px;
}

.dsgw-share-link input {
	box-sizing: border-box;
	flex: 1 1 auto;
	min-width: 0;
	height: 48px;
	padding: 0 14px;
	border: 1px solid #c8d7e4;
	border-radius: 10px;
	background: #fff;
	box-shadow: inset 0 1px 2px rgba(23, 74, 130, .04);
	color: #33485c;
	font-size: 14px;
}

.dsgw-owner-panel .dsgw-copy-link {
	min-width: 190px;
	background: var(--dsgw-gold) !important;
	box-shadow: 0 8px 18px rgba(247, 148, 0, .22) !important;
	color: #26323c !important;
	white-space: nowrap;
}

.dsgw-owner-panel .dsgw-copy-link:hover {
	background: var(--dsgw-gold-hover) !important;
	color: #1d2730 !important;
}

.dsgw-invite-notice {
	margin: 16px 0 0 !important;
	padding: 12px 14px;
	border-radius: 10px;
	font-size: 14px;
	font-weight: 600;
}

.dsgw-invite-success { background: #e2f4eb; color: #135c3c; }
.dsgw-invite-error { background: #fde9e7; color: #8a1c13; }
.dsgw-invite-warning { background: #fff3cd; color: #6b4f00; }

.dsgw-invites,
.dsgw-delivery {
	margin-top: 14px;
	border: 1px solid var(--dsgw-border);
	border-radius: 12px;
	background: #fff;
}

.dsgw-invites summary,
.dsgw-delivery summary {
	position: relative;
	padding: 15px 48px 15px 17px;
	cursor: pointer;
	list-style: none;
	color: var(--dsgw-blue);
	font-size: 15px;
	font-weight: 700;
}

.dsgw-invites summary::-webkit-details-marker,
.dsgw-delivery summary::-webkit-details-marker {
	display: none;
}

.dsgw-invites summary::after,
.dsgw-delivery summary::after {
	content: "+";
	position: absolute;
	top: 50%;
	right: 17px;
	width: 25px;
	height: 25px;
	border-radius: 50%;
	background: #edf4f9;
	color: var(--dsgw-blue);
	font-size: 20px;
	font-weight: 500;
	line-height: 23px;
	text-align: center;
	transform: translateY(-50%);
}

.dsgw-invites[open] summary::after,
.dsgw-delivery[open] summary::after {
	content: "−";
}

.dsgw-invites[open] summary,
.dsgw-delivery[open] summary {
	border-bottom: 1px solid var(--dsgw-border);
}

.dsgw-invites .dsgw-owner-form,
.dsgw-delivery .dsgw-owner-form {
	display: grid;
	gap: 15px;
	padding: 18px;
}

.dsgw-invites label > span,
.dsgw-delivery label > span {
	display: block;
	margin-bottom: 6px;
	color: #34485b;
	font-size: 14px;
	font-weight: 650;
}

.dsgw-invites input,
.dsgw-invites textarea,
.dsgw-delivery textarea {
	box-sizing: border-box;
	width: 100%;
	max-width: 760px;
	padding: 12px 14px;
	border: 1px solid #cdd9e3;
	border-radius: 10px;
	background: #fff;
	color: var(--dsgw-ink);
	font: inherit;
	line-height: 1.45;
}

.dsgw-invites input { min-height: 48px; }

.dsgw-invites input:focus,
.dsgw-invites textarea:focus,
.dsgw-delivery textarea:focus,
.dsgw-share-link input:focus {
	border-color: #4c82b2;
	box-shadow: 0 0 0 3px rgba(43, 93, 143, .13);
	outline: none;
}

.dsgw-invites .button,
.dsgw-delivery .button {
	justify-self: start;
}

.dsgw-delivery .dsgw-consent {
	display: flex;
	align-items: flex-start;
	gap: 9px;
	max-width: 760px;
	line-height: 1.45;
}

.dsgw-delivery .dsgw-consent input {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	accent-color: var(--dsgw-blue-button);
}

.dsgw-delivery .dsgw-consent span {
	display: inline;
	margin: 0;
}

.dsgw-privacy-warning {
	max-width: 760px;
	padding: 11px 13px;
	border-radius: 9px;
	background: #fff7e3;
	color: #7a5313;
	font-size: 13px;
}

.dsgw-public-delivery {
	margin: 0 0 24px;
	padding: 19px 21px;
	border: 1px solid #ceded5;
	border-left: 5px solid var(--dsgw-success);
	border-radius: var(--dsgw-radius);
	background: #eef7f2;
	box-shadow: 0 7px 20px rgba(35, 131, 90, .08);
	color: #243b32;
}

.dsgw-public-delivery strong {
	font-size: 17px;
}

.dsgw-public-delivery p {
	margin: 8px 0;
	line-height: 1.55;
}

.dsgw-public-delivery small { color: #52685e; }

/* Desktop wishlist table. */
table.wishlist_table.shop_table {
	border: 1px solid var(--dsgw-border) !important;
	border-collapse: separate !important;
	border-spacing: 0 !important;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 8px 24px rgba(20, 56, 91, .07);
}

table.wishlist_table thead th {
	padding: 17px 13px !important;
	border-color: var(--dsgw-border) !important;
	background: #f3f7fa;
	color: #3c5266;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .01em;
}

table.wishlist_table tbody td {
	padding: 18px 13px !important;
	border-color: #e7edf2 !important;
	vertical-align: middle;
}

.wishlist_table tr td.product-thumbnail a {
	max-width: 86px;
}

.wishlist_table .product-thumbnail img {
	border-radius: 8px;
	box-shadow: 0 5px 14px rgba(20, 40, 60, .13);
}

.wishlist_table .product-name a {
	color: #1f3448 !important;
	font-weight: 650;
	line-height: 1.45;
	text-decoration: none;
}

.wishlist_table .product-name a:hover { color: var(--dsgw-blue) !important; }
.wishlist_table .product-price ins { color: var(--dsgw-blue); font-weight: 750; text-decoration: none; }
.wishlist_table .product-price del { color: #89939c; }
.wishlist_table .product-price,
.wishlist_table .product-price .amount,
.wishlist_table.mobile .item-details-table td.value {
	white-space: nowrap;
}
.wishlist_table .wishlist-in-stock { color: var(--dsgw-success) !important; font-weight: 650; }
.wishlist_table .dateadded { margin-bottom: 9px; color: var(--dsgw-muted); font-size: 12px; }

.wishlist_table .product-add-to-cart a.remove_from_wishlist.button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 36px;
	padding: 8px 13px !important;
	border: 1px solid #dde4e9 !important;
	border-radius: 999px !important;
	background: #f2f4f6 !important;
	box-shadow: none !important;
	color: #58636d !important;
	font-size: 12px !important;
	font-weight: 650 !important;
	text-decoration: none !important;
}

.wishlist_table .product-remove .remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #fff0ef;
	color: var(--dsgw-danger) !important;
	font-size: 21px;
	text-decoration: none;
}

/* Gift action feedback. */
.dsgw-gift-button {
	position: relative !important;
	min-width: 178px;
}

.dsgw-gift-button.dsgw-loading {
	pointer-events: none;
	opacity: .76;
	padding-left: 43px !important;
}

.dsgw-gift-button.dsgw-loading::before {
	content: "";
	position: absolute;
	left: 18px;
	top: 50%;
	width: 15px;
	height: 15px;
	margin-top: -8px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: dsgw-spin .7s linear infinite;
}

.dsgw-gift-button.dsgw-added {
	pointer-events: none;
	opacity: .78;
}

.dsgw-remaining {
	display: block;
	margin-top: 7px;
	color: #47647a;
	font-size: 12px;
	font-weight: 650;
}

.dsgw-unavailable { display: none !important; }

.dsgw-empty-state {
	margin: 20px 0;
	padding: 24px;
	border: 1px solid var(--dsgw-border);
	border-radius: var(--dsgw-radius);
	background: var(--dsgw-soft);
	color: var(--dsgw-blue);
	font-weight: 650;
	text-align: center;
}

.dsgw-enhanced > .woocommerce-notices-wrapper { display: none !important; }

.dsgw-toast {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 999999;
	display: flex;
	align-items: center;
	gap: 18px;
	max-width: min(520px, calc(100vw - 32px));
	padding: 16px 18px;
	border-radius: 12px;
	box-shadow: 0 12px 35px rgba(0, 0, 0, .22);
	color: #fff;
	font-size: 15px;
	font-weight: 650;
	opacity: 0;
	transform: translateY(18px);
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease;
}

.dsgw-toast-visible { opacity: 1; transform: translateY(0); pointer-events: auto; }
.dsgw-toast-success { background: #176d4b; }
.dsgw-toast-error { background: #b42318; }

.dsgw-toast a {
	flex: 0 0 auto;
	padding: 7px 10px;
	border: 1px solid rgba(255, 255, 255, .65);
	border-radius: 999px;
	color: #fff !important;
	text-decoration: none;
}

.dsgw-locked-quantity {
	display: inline-block;
	min-width: 24px;
	font-weight: 650;
	text-align: center;
}

@keyframes dsgw-spin { to { transform: rotate(360deg); } }

@media (max-width: 767px) {
	.wishlist-title-container {
		margin-bottom: 22px;
	}

	.wishlist-title-container .wishlist-title {
		align-items: stretch;
		flex-direction: column;
	}

	.wishlist-title-container .wishlist-title h2 {
		font-size: 28px;
	}

	.wishlist-title-container a.show-title-form {
		width: 100%;
		min-height: 46px;
	}

	.wishlist-title-container .hidden-title-form {
		width: 100%;
	}

	.wishlist-title-container .hidden-title-form input[type="text"] {
		width: 100%;
	}

	.dsgw-owner-panel {
		width: 100%;
		margin-bottom: 24px;
		padding: 20px 18px;
		border-radius: 15px;
	}

	.dsgw-owner-summary {
		align-items: stretch;
		flex-direction: column;
		gap: 16px;
	}

	.dsgw-owner-summary strong {
		align-items: flex-start;
		font-size: 18px;
	}

	.dsgw-owner-summary strong::before {
		flex: 0 0 auto;
		margin-top: 6px;
	}

	.dsgw-owner-toggle {
		width: 100%;
		min-height: 46px !important;
	}

	.dsgw-share-link {
		margin-top: 18px;
		padding: 14px;
	}

	.dsgw-share-link > div {
		align-items: stretch;
		flex-direction: column;
	}

	.dsgw-share-link input {
		width: 100%;
	}

	.dsgw-owner-panel .dsgw-copy-link {
		width: 100%;
		min-width: 0;
		min-height: 46px;
	}

	.dsgw-invites summary,
	.dsgw-delivery summary {
		padding: 15px 45px 15px 14px;
		line-height: 1.4;
	}

	.dsgw-invites .dsgw-owner-form,
	.dsgw-delivery .dsgw-owner-form {
		padding: 15px;
	}

	.dsgw-invites .button,
	.dsgw-delivery .button {
		width: 100%;
		min-height: 46px;
	}

	.dsgw-public-delivery {
		padding: 17px;
	}

	/* Reliable fallback when YITH does not swap its desktop table template. */
	table.wishlist_table.shop_table,
	table.wishlist_table.shop_table tbody {
		display: block !important;
		width: 100% !important;
		border: 0 !important;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
	}

	table.wishlist_table.shop_table thead {
		display: none !important;
	}

	table.wishlist_table.shop_table tbody {
		display: grid !important;
		gap: 16px;
	}

	table.wishlist_table.shop_table tbody tr {
		position: relative;
		display: grid !important;
		grid-template-columns: 92px minmax(0, 1fr);
		gap: 6px 14px;
		width: 100% !important;
		height: auto !important;
		padding: 17px;
		border: 1px solid var(--dsgw-border);
		border-radius: 15px;
		background: #fff;
		box-shadow: 0 8px 22px rgba(20, 56, 91, .08);
	}

	table.wishlist_table.shop_table tbody td {
		display: block !important;
		width: auto !important;
		height: auto !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: left !important;
		word-break: normal;
		overflow-wrap: anywhere;
	}

	.wishlist_table td.product-remove {
		position: absolute;
		top: 10px;
		right: 10px;
		z-index: 2;
	}

	.wishlist_table td.product-remove > div {
		display: block !important;
	}

	.wishlist_table td.product-thumbnail {
		grid-column: 1;
		grid-row: 1 / span 4;
	}

	.wishlist_table tr td.product-thumbnail a {
		width: 92px;
		max-width: 92px;
	}

	.wishlist_table .product-thumbnail img {
		display: block;
		width: 92px !important;
		height: auto !important;
	}

	.wishlist_table td.product-name {
		grid-column: 2;
		padding-right: 27px !important;
	}

	.wishlist_table .product-name a {
		display: block;
		font-size: 15px;
		line-height: 1.4;
	}

	.wishlist_table td.product-price {
		grid-column: 2;
		font-size: 15px;
	}

	.wishlist_table td.product-stock-status {
		grid-column: 2;
		font-size: 13px;
	}

	.wishlist_table td.product-add-to-cart {
		display: grid !important;
		grid-column: 1 / -1;
		grid-template-columns: 1fr auto;
		align-items: center;
		gap: 9px;
		margin-top: 9px;
		padding-top: 13px !important;
		border-top: 1px solid #e8edf1 !important;
	}

	.wishlist_table .product-add-to-cart .dateadded {
		grid-column: 1 / -1;
		margin: 0;
	}

	.wishlist_table .product-add-to-cart a.dsgw-gift-button {
		grid-column: 1 / -1;
		width: 100%;
		min-height: 47px;
		margin: 0 !important;
	}

	.wishlist_table .product-add-to-cart a.remove_from_wishlist.button {
		grid-column: 1 / -1;
		justify-self: start;
		margin: 0 !important;
	}

	.wishlist_table.mobile li .additional-info-wrapper {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.wishlist_table.mobile li .additional-info-wrapper .additional-info,
	.wishlist_table.mobile li .additional-info-wrapper .move-to-another-wishlist {
		grid-column: 1 / -1;
		width: 100%;
	}

	.wishlist_table.mobile li .additional-info-wrapper .product-add-to-cart {
		grid-column: 1;
		margin: 0 !important;
	}

	.wishlist_table.mobile li .additional-info-wrapper .product-remove {
		grid-column: 2;
		margin: 0;
		text-align: center;
	}

	.wishlist_table.mobile li .additional-info-wrapper .product-add-to-cart a {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		width: 100% !important;
		min-height: 44px;
		margin: 0 !important;
		padding: 9px 12px !important;
		font-size: 13px !important;
		line-height: 1.15 !important;
	}

	.wishlist_table.mobile li .additional-info-wrapper .product-remove a.remove_from_wishlist {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		min-height: 44px;
		padding: 9px 12px;
		border: 1px solid #e8aaaa;
		border-radius: 999px;
		background: #fff0ef;
		box-shadow: 0 5px 13px rgba(200, 63, 63, .1);
		color: var(--dsgw-danger) !important;
		font-size: 13px;
		font-weight: 700;
		line-height: 1;
		text-decoration: none;
	}

	.wishlist_table.mobile li .additional-info-wrapper .product-remove a.remove_from_wishlist::after {
		content: "Видалити";
	}

	.dsgw-gift-button { min-width: 0; }

	.dsgw-toast {
		right: 14px;
		bottom: 92px;
		left: 14px;
		justify-content: space-between;
	}
}

@media (max-width: 420px) {
	table.wishlist_table.shop_table tbody tr {
		grid-template-columns: 78px minmax(0, 1fr);
		gap: 6px 12px;
		padding: 14px;
	}

	.wishlist_table tr td.product-thumbnail a,
	.wishlist_table .product-thumbnail img {
		width: 78px !important;
		max-width: 78px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.dsgw-gift-button,
	.dsgw-toast,
	.dsgw-owner-panel .button,
	.wishlist-title-container a.show-title-form {
		transition: none !important;
	}

	.dsgw-gift-button.dsgw-loading::before { animation-duration: 1.4s; }
}
