/* Divus Gift Progress Bar – frontend */

.divus-gpb-wrap {
	display: block;
}

.divus-gpb-bar {
	--gpb-accent: #a2d9d8;
	--gpb-track: #e7e7e7;
	--gpb-text: #2a2a2a;
	box-sizing: border-box;
	padding: 16px 14px 30px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--gpb-text);
}

.divus-gpb-bar * {
	box-sizing: border-box;
}

.divus-gpb-msg {
	text-align: center;
	margin: 0 0 18px;
	font-size: 13px;
}

.divus-gpb-msg strong {
	color: var(--gpb-accent);
	font-weight: 700;
	white-space: nowrap;
}

.divus-gpb-msg .amount {
	white-space: nowrap;
}

/* ---- Track ---- */

.divus-gpb-track-wrap {
	position: relative;
	height: 8px;
	margin: 0 18px;
}

.divus-gpb-track {
	position: absolute;
	inset: 0;
	background: var(--gpb-track);
	border-radius: 999px;
	overflow: hidden;
}

.divus-gpb-fill {
	height: 100%;
	width: 0;
	border-radius: 999px;
	background: var(--gpb-accent);
	transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---- Nodes ---- */

.divus-gpb-node {
	position: absolute;
	top: 50%;
	width: 34px;
	height: 34px;
	margin-left: -17px;
	transform: translateY(-50%);
	border-radius: 50%;
	background: #fff;
	border: 3px solid var(--gpb-track);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: border-color 0.3s ease, transform 0.15s ease, box-shadow 0.2s ease;
	z-index: 2;
}

.divus-gpb-node.is-reached {
	border-color: var(--gpb-accent);
	background: var(--gpb-accent);
}

.divus-gpb-icon {
	font-size: 15px;
	line-height: 1;
	filter: grayscale(1) opacity(0.55);
	transition: filter 0.3s ease;
}

.divus-gpb-node.is-reached .divus-gpb-icon {
	filter: grayscale(0) opacity(1) brightness(0) invert(1);
}

.divus-gpb-node.is-gift[data-tier] {
	cursor: pointer;
}

.divus-gpb-node.is-gift[data-tier].is-reached:hover {
	transform: translateY(-50%) scale(1.12);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--gpb-accent) 22%, transparent);
}

.divus-gpb-node.is-gift:focus-visible {
	outline: 2px solid var(--gpb-accent);
	outline-offset: 3px;
}

.divus-gpb-node-amount {
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
	color: #777;
}

.divus-gpb-node.is-reached .divus-gpb-node-amount {
	color: var(--gpb-accent);
}

.divus-gpb-node.is-gift.is-reached:not(.has-gift) .divus-gpb-node-amount::after {
	content: " •";
	color: var(--gpb-accent);
	animation: divus-gpb-pulse 1.4s ease-in-out infinite;
}

.divus-gpb-node-check {
	position: absolute;
	top: -6px;
	right: -6px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	color: var(--gpb-accent);
	font-size: 11px;
	font-weight: 700;
	line-height: 16px;
	text-align: center;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

@keyframes divus-gpb-pulse {
	0%, 100% { opacity: 0.3; }
	50% { opacity: 1; }
}

/* ---- Cart item styling ---- */

.divus-gpb-cart-badge {
	display: inline-block;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #66b856;
	background: hsl(110 41% 95% / 1);
	padding: 2px 7px;
	border-radius: 4px;
	vertical-align: middle;
	margin-left: 4px;
}

.divus-gpb-free,
.divus-gpb-free * {
	font-weight: 700;
	color: var(--gpb-accent, #a2d9d8) !important;
	text-decoration: none !important;
}

.divus-gpb-qty-locked {
	display: inline-block;
	min-width: 38px;
	text-align: center;
	opacity: 0.7;
}

/* Подаръкът е винаги 1 брой – крием стъпката за количество в количка и mini-cart */
.divus-gpb-gift-item .quantity,
.woocommerce-mini-cart-item.divus-gpb-gift-item .quantity,
.woocommerce-mini-cart-item:has( .divus-gpb-cart-badge ) .quantity,
.widget_shopping_cart_content li:has( .divus-gpb-cart-badge ) .quantity,
.cart_item:has( .divus-gpb-cart-badge ) .quantity {
	display: none !important;
}

/* ---- Modal ---- */

body.divus-gpb-modal-open {
	overflow: hidden;
}

.divus-gpb-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.divus-gpb-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 26, 14, 0.55);
	backdrop-filter: blur(2px);
	animation: divus-gpb-fade 0.2s ease;
}

.divus-gpb-modal__box {
	position: relative;
	background: #fff;
	border-radius: 16px;
	width: 100%;
	max-width: 760px;
	max-height: 88vh;
	overflow: auto;
	padding: 30px 28px 26px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	animation: divus-gpb-pop 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.divus-gpb-modal .divus-gpb-modal__close {
	position: absolute !important;
	top: 14px !important;
	right: 16px !important;
	left: auto !important;
	width: 36px !important;
	height: 36px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: none !important;
	border-radius: 50% !important;
	background: #f1f1f1 !important;
	color: #555 !important;
	font-size: 22px !important;
	line-height: 36px !important;
	text-align: center !important;
	cursor: pointer !important;
	box-shadow: none !important;
	z-index: 3 !important;
	transition: background 0.2s ease;
}

.divus-gpb-modal .divus-gpb-modal__close:hover {
	background: #e2e2e2 !important;
}

.divus-gpb-modal__head {
	font-size: 20px;
	font-weight: 800;
	text-align: center;
	margin: 0 0 4px;
	color: #1f1f1f;
}

.divus-gpb-modal__sub {
	text-align: center;
	font-size: 13px;
	color: #777;
	margin: 0 0 20px;
}

.divus-gpb-modal__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 16px;
}

.divus-gpb-card {
	border: 2px solid #ededed;
	border-radius: 12px;
	padding: 12px;
	text-align: center;
	display: flex;
	flex-direction: column;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.divus-gpb-card:hover {
	border-color: var(--gpb-accent, #a2d9d8);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.08);
}

.divus-gpb-card.is-chosen {
	border-color: var(--gpb-accent, #a2d9d8);
	background: color-mix(in srgb, var(--gpb-accent, #a2d9d8) 6%, #fff);
}

.divus-gpb-card__img {
	aspect-ratio: 1 / 1;
	margin-bottom: 10px;
	border-radius: 8px;
	overflow: hidden;
	background: #f7f7f7;
}

.divus-gpb-card__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.divus-gpb-card__name {
	font-size: 13px;
	font-weight: 600;
	color: #2a2a2a;
	margin-bottom: 12px;
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 36px;
}

.divus-gpb-var {
	width: 100%;
	margin-bottom: 10px;
	padding: 8px 10px;
	border: 1px solid #d6d6d6;
	border-radius: 8px;
	font-size: 13px;
	background: #fff;
	cursor: pointer;
}

.divus-gpb-var:focus {
	outline: none;
	border-color: var(--gpb-accent, #a2d9d8);
}

.divus-gpb-card__price {
	margin-bottom: 12px;
	font-size: 13px;
	line-height: 1.3;
}

.divus-gpb-card__price del,
.divus-gpb-card__price del * {
	color: #9a9a9a !important;
	text-decoration: line-through;
	margin-right: 5px;
	font-weight: 400;
}

.divus-gpb-card__price ins,
.divus-gpb-card__price ins * {
	color: var(--gpb-accent, #a2d9d8) !important;
	font-weight: 700;
	text-decoration: none;
}

/* Задраскана оригинална цена в количка / mini-cart */
.divus-gpb-orig,
.divus-gpb-orig * {
	color: #9a9a9a !important;
	text-decoration: line-through;
	margin-right: 4px;
	font-weight: 400;
}

.divus-gpb-card__btn {
	border: none;
	background: var(--gpb-accent, #a2d9d8);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	padding: 9px 12px;
	border-radius: 8px;
	cursor: pointer;
	transition: filter 0.2s ease, opacity 0.2s ease;
}

.divus-gpb-card__btn:hover {
	filter: brightness(1.07);
}

.divus-gpb-card.is-chosen .divus-gpb-card__btn {
	background: color-mix(in srgb, var(--gpb-accent, #a2d9d8) 70%, #000);
}

/* ---- Theme overrides (бият Woodmart/WooCommerce стилове) ---- */

.divus-gpb-modal .divus-gpb-card__btn {
	background: var(--gpb-accent, #a2d9d8) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: none !important;
}

.divus-gpb-modal .divus-gpb-card__btn:hover {
	filter: brightness(1.07);
}

.divus-gpb-modal .divus-gpb-card.is-chosen .divus-gpb-card__btn {
	background: color-mix(in srgb, var(--gpb-accent, #a2d9d8) 70%, #000) !important;
}

.divus-gpb-modal .divus-gpb-var {
	max-width: 100%;
	text-overflow: ellipsis;
}

/* Цени/суми/валути в прогрес бара – черни */
.divus-gpb-bar .divus-gpb-amount,
.divus-gpb-bar .divus-gpb-amount *,
.divus-gpb-bar .divus-gpb-node-amount,
.divus-gpb-bar .divus-gpb-node-amount *,
.divus-gpb-bar .woocommerce-Price-amount,
.divus-gpb-bar .woocommerce-Price-currencySymbol {
	color: #000 !important;
}

@keyframes divus-gpb-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes divus-gpb-pop {
	from { opacity: 0; transform: translateY(14px) scale(0.97); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
	.divus-gpb-bar { padding: 14px 8px 28px; }
	.divus-gpb-track-wrap { margin: 0 14px; }
	.divus-gpb-node { width: 30px; height: 30px; margin-left: -15px; }
	.divus-gpb-modal__grid { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
	.divus-gpb-fill,
	.divus-gpb-node,
	.divus-gpb-modal__overlay,
	.divus-gpb-modal__box {
		transition: none;
		animation: none;
	}
}

/* ---- Текстов ред за floating bar ([divus_gift_bar_text]) ---- */

.divus-gpb-text-wrap {
	width: 100%;
}

.divus-gpb-text {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 4px 8px;
	font-size: 15px;
	line-height: 1.35;
	text-align: center;
	color: inherit;
}

.divus-gpb-text strong {
	font-weight: 700;
	white-space: nowrap;
}

/* Цените наследяват цвета на бара (за да личат на тъмен фон) */
.divus-gpb-text .woocommerce-Price-amount,
.divus-gpb-text .woocommerce-Price-currencySymbol {
	color: inherit !important;
}

/* ---- Оферта с отстъпка в mini-cart ---- */

.divus-gpb-offer-wrap:empty {
	display: none;
}

.divus-gpb-offer {
	margin: 60px 10px 4px;
	padding: 12px;
	background: #ebd05f;
	border-radius: 12px;
}

.divus-gpb-offer__title {
	text-align: center;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #2a2a2a;
	margin-bottom: 10px;
}

.divus-gpb-offer__card {
	position: relative;
	display: flex;
	gap: 12px;
	align-items: center;
	background: #fff;
	border-radius: 10px;
	padding: 10px;
}

.divus-gpb-offer__img {
	flex: 0 0 72px;
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	background: #f7f7f7;
}

.divus-gpb-offer__img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.divus-gpb-offer__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.divus-gpb-offer__save {
	align-self: flex-start;
	font-size: 10px;
	font-weight: 500;
	color: #000000;
	background: var(--gpb-accent, #a2d9d8);
	padding: 2px 8px;
	border-radius: 999px;
}

.divus-gpb-offer__save .woocommerce-Price-amount,
.divus-gpb-offer__save .woocommerce-Price-currencySymbol {
	color: #000000 !important;
}

.divus-gpb-offer__name {
	font-size: 13px;
	font-weight: 600;
	color: #2a2a2a;
	line-height: 1.3;
}

.divus-gpb-offer__price {
	font-size: 13px;
}

.divus-gpb-offer__price ins,
.divus-gpb-offer__price ins * {
	text-decoration: none;
	font-weight: 700;
	color: #2a2a2a !important;
	margin-right: 6px;
}

.divus-gpb-offer__price del,
.divus-gpb-offer__price del * {
	color: #9a9a9a !important;
	text-decoration: line-through;
	font-weight: 400;
}

.divus-gpb-offer__btn {
	margin-top: 6px;
	width: fit-content;
	border-radius: 100px !important;
	background: var(--gpb-accent, #a2d9d8);
	font-size: 13px !important;
	font-weight: 600 !important;
}

.divus-gpb-offer__btn:hover {
	filter: brightness(1.06);
}

/* Намалена цена на реда (количка/mini-cart) */
.divus-gpb-offer-price,
.divus-gpb-offer-price * {
	font-weight: 700;
	color: var(--gpb-accent, #a2d9d8) !important;
}

.divus-gpb-offer + .divus-gpb-offer {
	margin-top: 14px;
}

/* ---- Responsive: таблет и мобилно (по-малки текстове/отстояния) ---- */
@media (max-width: 768px) {
	/* Попъп за избор на подарък */
	.divus-gpb-modal { padding: 12px; }
	.divus-gpb-modal__box { padding: 20px 14px 14px; border-radius: 14px; }
	.divus-gpb-modal__head { font-size: 16px; line-height: 1.25; }
	.divus-gpb-modal__sub { font-size: 12px; margin-bottom: 14px; }
	.divus-gpb-modal__grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
	.divus-gpb-card { padding: 8px; border-radius: 10px; }
	.divus-gpb-card__img { margin-bottom: 8px; }
	.divus-gpb-card__name { font-size: 12px; min-height: 0; margin-bottom: 8px; }
	.divus-gpb-var { padding: 6px 8px; font-size: 12px; margin-bottom: 8px; }
	.divus-gpb-card__price { font-size: 12px; margin-bottom: 8px; }
	.divus-gpb-card__btn { padding: 8px; font-size: 12px; }
	.divus-gpb-modal .divus-gpb-modal__close {
		width: 30px !important;
		height: 30px !important;
		font-size: 18px !important;
		line-height: 30px !important;
		top: 10px !important;
		right: 10px !important;
	}

	/* Прогрес бар (mini-cart кастъмизации) */
	.divus-gpb-bar { padding: 12px 6px 26px; font-size: 12px; }
	.divus-gpb-msg { font-size: 12px; margin-bottom: 14px; }
	.divus-gpb-track-wrap { margin: 0 14px; }
	.divus-gpb-node { width: 28px; height: 28px; margin-left: -14px; }
	.divus-gpb-icon { font-size: 13px; }
	.divus-gpb-node-amount { font-size: 10px; }

	/* Оферта с отстъпка */
	.divus-gpb-offer { margin: 40px 0 4px; padding: 10px; }
	.divus-gpb-offer__title { font-size: 11px; margin-bottom: 8px; }
	.divus-gpb-offer__card { gap: 10px; padding: 8px; }
	.divus-gpb-offer__img { flex: 0 0 56px; width: 56px; height: 56px; }
	.divus-gpb-offer__save { font-size: 10px; }
	.divus-gpb-offer__name { font-size: 12px; }
	.divus-gpb-offer__price { font-size: 12px; }
	.divus-gpb-offer__btn { margin-top: 4px; }

	/* Значка "Подарък" в количката */
	.divus-gpb-cart-badge { font-size: 9px; padding: 1px 6px; }
}

@media (max-width: 480px) {
	.divus-gpb-modal__box { padding: 18px 12px 12px; }
	.divus-gpb-modal__head { font-size: 15px; }
	.divus-gpb-modal__grid { gap: 8px; }
	.divus-gpb-offer { margin-top: 32px; }
}
