/**
 * Gift Progress Bar Styles
 * Inspired by OSEA / Charlotte Tilbury tier progress.
 *
 * @package SynergyTherm_Gift_Progress
 * @since 1.0.0
 */

/* ============================================
   Container
   ============================================ */
.stgp-gift-progress {
	--stgp-primary: #c8a86b;
	--stgp-primary-light: #f5efe6;
	--stgp-success: #4caf50;
	--stgp-success-light: #e8f5e9;
	--stgp-track-bg: #e8e0d4;
	--stgp-text: #333333;
	--stgp-text-muted: #777777;
	--stgp-dot-size: 28px;
	--stgp-bar-height: 8px;

	font-family: inherit;
	padding: 20px 0;
	margin-bottom: 20px;
}

.stgp-context-mini-cart .stgp-gift-progress {
	padding: 12px 16px;
	margin-bottom: 0;
}

/* ============================================
   Message
   ============================================ */
.stgp-message {
	margin-bottom: 16px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--stgp-text);
}

.stgp-message-progress,
.stgp-message-success {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.stgp-message-progress .stgp-icon-gift {
	color: var(--stgp-primary);
	flex-shrink: 0;
}

.stgp-message-success {
	color: var(--stgp-success);
	font-weight: 600;
}

.stgp-message-success .stgp-icon-check {
	flex-shrink: 0;
}

.stgp-context-mini-cart .stgp-message {
	margin-bottom: 10px;
	font-size: 13px;
}

/* ============================================
   Progress Bar Track & Fill
   ============================================ */
.stgp-bar-container {
	position: relative;
	padding: 0 12px;
}

.stgp-bar-track {
	width: 100%;
	height: var(--stgp-bar-height);
	background: var(--stgp-track-bg);
	border-radius: calc(var(--stgp-bar-height) / 2);
	overflow: hidden;
	position: relative;
}

.stgp-bar-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--stgp-primary-light), var(--stgp-primary));
	border-radius: calc(var(--stgp-bar-height) / 2);
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
	position: relative;
}

.stgp-bar-fill::after {
	content: ' ';
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	width: 30px;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3));
	border-radius: 0 calc(var(--stgp-bar-height) / 2) calc(var(--stgp-bar-height) / 2) 0;
}

.stgp-bar-complete {
	background: linear-gradient(90deg, var(--stgp-success-light), var(--stgp-success));
}

/* ============================================
   Tier Markers (dots on the bar)
   ============================================ */
.stgp-tier-markers {
	position: absolute;
	top: 0;
	left: 12px;
	right: 12px;
	height: var(--stgp-bar-height);
	pointer-events: none;
}

.stgp-tier-marker {
	position: absolute;
	top: 50%;
	transform: translate(-50%, -50%);
	pointer-events: auto;
	cursor: default;
}

.stgp-tier-dot {
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--stgp-dot-size);
	height: var(--stgp-dot-size);
	border-radius: 50%;
	background: #ffffff;
	border: 2px solid var(--stgp-track-bg);
	transition: all 0.3s ease;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
	overflow: visible;
}

.stgp-tier-dot svg {
	color: var(--stgp-text-muted);
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.stgp-tier-unlocked .stgp-tier-dot {
	background: var(--stgp-success);
	border-color: var(--stgp-success);
}

.stgp-tier-unlocked .stgp-tier-dot svg {
	color: #ffffff;
}

.stgp-tier-next .stgp-tier-dot {
	border-color: var(--stgp-primary);
	animation: stgp-pulse 2s infinite;
}

.stgp-tier-next .stgp-tier-dot svg {
	color: var(--stgp-primary);
}

@keyframes stgp-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 rgba(200, 168, 107, 0.4);
	}
	50% {
		box-shadow: 0 0 0 6px rgba(200, 168, 107, 0);
	}
}

/* ============================================
   Tier Labels (below bar)
   ============================================ */
.stgp-tier-labels {
	position: relative;
	margin-top: 20px;
	padding: 0 12px;
	min-height: 60px;
	display: flex;
	justify-content: space-between;
}

.stgp-tier-label {
	position: relative;
	text-align: center;
	max-width: 100px;
	flex: 0 1 auto;
}

.stgp-tier-label:last-child {
	text-align: right;
}

.stgp-tier-label:first-child {
	text-align: left;
}

.stgp-label-threshold {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--stgp-text-muted);
	margin-bottom: 4px;
}

.stgp-label-unlocked .stgp-label-threshold {
	color: var(--stgp-success);
}

.stgp-label-next .stgp-label-threshold {
	color: var(--stgp-primary);
}

.stgp-label-image {
	display: block;
	margin: 0 auto 4px;
	border-radius: 4px;
	object-fit: cover;
}

.stgp-label-name {
	display: block;
	font-size: 10px;
	color: var(--stgp-text-muted);
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.stgp-label-unlocked .stgp-label-name {
	color: var(--stgp-success);
	text-decoration: line-through;
}

.stgp-label-next .stgp-label-name {
	color: var(--stgp-primary);
	font-weight: 600;
}

/* ============================================
   Mini-cart Compact Mode
   ============================================ */
.stgp-context-mini-cart .stgp-bar-container {
	padding: 0 8px;
}

.stgp-context-mini-cart .stgp-tier-labels {
	display: none;
}

.stgp-context-mini-cart .stgp-gift-progress {
	--stgp-dot-size: 18px;
	--stgp-bar-height: 6px;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
	.stgp-gift-progress {
		--stgp-dot-size: 20px;
		--stgp-bar-height: 6px;
	}

	.stgp-tier-label {
		max-width: 70px;
	}

	.stgp-label-name {
		font-size: 9px;
	}

	.stgp-label-image {
		width: 24px !important;
		height: 24px !important;
	}

	.stgp-message {
		font-size: 13px;
	}
}

/* ============================================
   Print: hide progress bar
   ============================================ */
@media print {
	.stgp-progress-wrapper {
		display: none !important;
	}
}
