/**
 * Buy Together for WooCommerce - Frontend Styles
 * Modern, clean, conversion-focused design.
 */

:root {
	--bt-primary: #2563eb;
	--bt-primary-hover: #1d4ed8;
	--bt-primary-light: #eff6ff;
	--bt-success: #16a34a;
	--bt-success-hover: #15803d;
	--bt-success-light: #f0fdf4;
	--bt-warning: #f59e0b;
	--bt-warning-light: #fffbeb;
	--bt-danger: #ef4444;
	--bt-danger-light: #fef2f2;
	--bt-bg: #f8fafc;
	--bt-card-bg: #ffffff;
	--bt-text: #1e293b;
	--bt-text-muted: #64748b;
	--bt-border: #e2e8f0;
	--bt-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
	--bt-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
	--bt-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
	--bt-radius: 12px;
	--bt-radius-sm: 8px;
}

/* ==========================================================================
   Single Product Widget Box
   ========================================================================== */
.bt-deal-container {
	margin: 24px 0;
	font-family: inherit;
	color: var(--bt-text);
	position: relative;
}

/* Demo Toolbar (Admin only) */
.bt-demo-toolbar {
	background: #1e293b;
	color: #f8fafc;
	border-radius: var(--bt-radius-sm);
	padding: 10px 14px;
	margin-bottom: 12px;
	font-size: 13px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	box-shadow: var(--bt-shadow-sm);
}

.bt-demo-header {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #fbbf24;
}

.bt-demo-header .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.bt-demo-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.bt-btn-demo {
	background: #3b82f6;
	color: #ffffff !important;
	border: none;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s ease;
}

.bt-btn-demo:hover {
	background: #2563eb;
}

.bt-btn-demo-outline {
	background: transparent;
	color: #fde047 !important;
	border: 1px solid #fde047;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
}

.bt-btn-demo-outline:hover {
	background: rgba(253, 224, 71, 0.15);
}

.bt-btn-demo-ghost {
	background: transparent;
	color: #94a3b8 !important;
	border: 1px solid #475569;
	padding: 4px 10px;
	border-radius: 4px;
	font-size: 12px;
	cursor: pointer;
}

.bt-btn-demo-ghost:hover {
	background: #334155;
	color: #ffffff !important;
}

/* Card General */
.bt-card {
	background: var(--bt-card-bg);
	border: 1.5px solid var(--bt-border);
	border-radius: var(--bt-radius);
	padding: 20px;
	box-shadow: var(--bt-shadow);
	transition: all 0.2s ease;
}

.bt-card-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.bt-deal-heading {
	margin: 4px 0 0 0;
	font-size: 18px;
	font-weight: 700;
	color: var(--bt-text);
	line-height: 1.35;
}

.bt-badge-tag {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--bt-primary);
	background: var(--bt-primary-light);
	padding: 3px 8px;
	border-radius: 4px;
	margin-bottom: 4px;
}

.bt-save-pill {
	display: inline-block;
	background: #fef3c7;
	color: #92400e;
	font-size: 13px;
	font-weight: 700;
	padding: 6px 12px;
	border-radius: 9999px;
	white-space: nowrap;
	border: 1px solid #fde68a;
}

/* Card States */
.bt-card-active {
	border-color: #93c5fd;
	background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

.bt-card-unlocked {
	border-color: #86efac;
	background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
}

.bt-unlocked-badge {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 18px;
	font-weight: 800;
	color: var(--bt-success);
}

.bt-discount-tag {
	background: var(--bt-success);
	color: #ffffff;
	font-weight: 800;
	font-size: 14px;
	padding: 4px 12px;
	border-radius: 9999px;
}

.bt-unlocked-desc {
	font-size: 14px;
	color: #334155;
	margin: 12px 0 16px 0;
	line-height: 1.5;
}

.bt-card-expired {
	background: #f8fafc;
	border-color: var(--bt-border);
}

/* Pricing Row */
.bt-pricing-row {
	display: flex;
	align-items: center;
	gap: 14px;
	background: var(--bt-bg);
	border: 1px solid var(--bt-border);
	border-radius: var(--bt-radius-sm);
	padding: 12px 16px;
	margin-bottom: 16px;
}

.bt-price-box {
	display: flex;
	flex-direction: column;
}

.bt-price-label {
	font-size: 11px;
	color: var(--bt-text-muted);
	text-transform: uppercase;
	font-weight: 600;
	letter-spacing: 0.03em;
}

.bt-price-regular {
	font-size: 15px;
	color: var(--bt-text-muted);
	text-decoration: line-through;
}

.bt-price-arrow {
	font-size: 18px;
	color: var(--bt-text-muted);
}

.bt-deal-highlight .bt-price-label {
	color: var(--bt-primary);
}

.bt-price-deal {
	font-size: 20px;
	font-weight: 800;
	color: var(--bt-primary);
}

/* Progress Bar and Steps */
.bt-progress-wrapper {
	margin-bottom: 16px;
}

.bt-progress-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 13px;
	margin-bottom: 8px;
}

.bt-meta-status strong {
	color: var(--bt-primary);
	font-size: 15px;
}

.bt-meta-remaining {
	color: var(--bt-warning);
	font-weight: 600;
}

.bt-progress-track {
	height: 10px;
	background: #e2e8f0;
	border-radius: 9999px;
	overflow: hidden;
	position: relative;
	margin-bottom: 12px;
}

.bt-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--bt-primary) 0%, #3b82f6 100%);
	border-radius: 9999px;
	transition: width 0.4s ease;
}

.bt-progress-fill.bt-step-3 {
	background: linear-gradient(90deg, #22c55e 0%, var(--bt-success) 100%);
}

.bt-steps-markers {
	display: flex;
	justify-content: space-between;
	position: relative;
}

.bt-step {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	flex: 1;
	text-align: center;
}

.bt-step-dot {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #e2e8f0;
	color: #64748b;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
}

.bt-step-text {
	font-size: 11px;
	color: var(--bt-text-muted);
	font-weight: 500;
}

.bt-step.is-complete .bt-step-dot {
	background: var(--bt-success);
	color: #ffffff;
}

.bt-step.is-complete .bt-step-text {
	color: var(--bt-success);
	font-weight: 700;
}

.bt-step.is-current .bt-step-dot {
	background: var(--bt-primary);
	color: #ffffff;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.bt-step.is-current .bt-step-text {
	color: var(--bt-primary);
	font-weight: 700;
}

/* Countdown Bar */
.bt-countdown-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #c2410c;
	padding: 8px 12px;
	border-radius: var(--bt-radius-sm);
	font-size: 13px;
	margin-bottom: 16px;
}

.bt-countdown-bar .dashicons {
	font-size: 16px;
	width: 16px;
	height: 16px;
}

.bt-countdown-label {
	font-weight: 600;
}

.bt-countdown-digits {
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-weight: 700;
	background: #ffedd5;
	padding: 2px 6px;
	border-radius: 4px;
	letter-spacing: 0.05em;
}

/* How It Works List */
.bt-how-it-works {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 16px;
	padding: 12px 14px;
	background: var(--bt-bg);
	border-radius: var(--bt-radius-sm);
	border: 1px solid var(--bt-border);
}

.bt-how-step {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	color: #334155;
}

.bt-how-num {
	width: 20px;
	height: 20px;
	background: var(--bt-primary-light);
	color: var(--bt-primary);
	font-size: 11px;
	font-weight: 800;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Buttons */
.bt-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 20px;
	font-size: 14px;
	font-weight: 700;
	border-radius: var(--bt-radius-sm);
	cursor: pointer;
	text-decoration: none !important;
	transition: all 0.15s ease;
	border: 1px solid transparent;
	text-align: center;
	line-height: 1.2;
}

.bt-btn-block {
	display: flex;
	width: 100%;
}

.bt-btn-sm {
	padding: 6px 12px;
	font-size: 12px;
}

.bt-btn-primary {
	background: var(--bt-primary);
	color: #ffffff !important;
}

.bt-btn-primary:hover {
	background: var(--bt-primary-hover);
	color: #ffffff !important;
}

.bt-btn-success {
	background: var(--bt-success);
	color: #ffffff !important;
}

.bt-btn-success:hover {
	background: var(--bt-success-hover);
	color: #ffffff !important;
}

.bt-btn-join-action {
	font-size: 16px !important;
	padding: 14px 24px !important;
	font-weight: 800 !important;
	box-shadow: 0 4px 14px 0 rgba(22, 163, 74, 0.4) !important;
	letter-spacing: 0.02em;
}

.bt-btn-outline {
	background: #ffffff;
	color: var(--bt-text) !important;
	border-color: var(--bt-border);
}

.bt-btn-outline:hover {
	background: var(--bt-bg);
	border-color: #cbd5e1;
}

.bt-btn-secondary {
	background: #f1f5f9;
	color: var(--bt-text) !important;
	border-color: #e2e8f0;
}

.bt-btn-secondary:hover {
	background: #e2e8f0;
}

.bt-btn-whatsapp {
	background: #25d366;
	color: #ffffff !important;
}

.bt-btn-whatsapp:hover {
	background: #1eb855;
	color: #ffffff !important;
}

.bt-wa-icon {
	display: inline-block;
	vertical-align: middle;
	flex-shrink: 0;
}

/* Share Box inside group */
.bt-share-box {
	background: var(--bt-bg);
	border: 1px solid var(--bt-border);
	border-radius: var(--bt-radius-sm);
	padding: 14px;
	text-align: center;
	margin-top: 10px;
}

.bt-joined-notice {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #dcfce7;
	color: #166534;
	border: 1px solid #bbf7d0;
	border-radius: var(--bt-radius-sm);
	padding: 10px 14px;
	margin-bottom: 12px;
	font-size: 14px;
}

.bt-joined-notice .dashicons {
	color: #16a34a;
	font-size: 18px;
	width: 18px;
	height: 18px;
}

.bt-invite-link-row {
	display: flex;
	gap: 6px;
	margin-bottom: 10px;
}

.bt-invite-link-row input.bt-invite-input {
	flex: 1;
	background: #ffffff !important;
	border: 1.5px solid #cbd5e1 !important;
	border-radius: var(--bt-radius-sm) !important;
	padding: 8px 12px !important;
	font-size: 13px !important;
	color: #334155 !important;
	outline: none !important;
	height: auto !important;
	line-height: 1.4 !important;
}

.bt-invite-link-row input.bt-invite-input:focus {
	border-color: var(--bt-primary) !important;
	box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15) !important;
}

.bt-invite-link-row .bt-copy-btn {
	flex-shrink: 0;
	padding: 8px 14px !important;
	font-size: 13px !important;
	white-space: nowrap;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}

.bt-invite-link-row .bt-copy-btn.bt-btn-copied {
	background: #16a34a !important;
	border-color: #15803d !important;
	color: #ffffff !important;
}

.bt-share-prompt {
	margin: 0 0 10px 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--bt-text);
}

.bt-share-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
}

.bt-share-buttons .bt-btn {
	flex: 1 1 180px;
}

/* Badges */
.bt-status-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 3px 8px;
	border-radius: 4px;
}

.bt-badge-active {
	background: #dbeafe;
	color: #1e40af;
}

.bt-badge-completed {
	background: #dcfce7;
	color: #166534;
}

.bt-badge-expired {
	background: #f1f5f9;
	color: #64748b;
}

.bt-badge-cancelled {
	background: #fee2e2;
	color: #991b1b;
}

.bt-badge-demo {
	background: #fef08a;
	color: #854d0e;
	margin-left: 4px;
}

/* WooCommerce Price Modifications */
.bt-badge-unlocked {
	display: inline-block;
	background: #dcfce7;
	color: #166534;
	font-size: 12px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 4px;
	margin-left: 6px;
	vertical-align: middle;
	border: 1px solid #bbf7d0;
}

del.bt-del-price {
	opacity: 0.6;
	margin-right: 6px;
}

ins.bt-deal-price {
	color: var(--bt-success);
	font-weight: 800;
	text-decoration: none;
}

/* Toast Notifications */
.bt-toast {
	position: absolute;
	bottom: -48px;
	left: 50%;
	transform: translateX(-50%);
	background: #1e293b;
	color: #ffffff;
	padding: 8px 16px;
	border-radius: 9999px;
	font-size: 13px;
	font-weight: 600;
	box-shadow: var(--bt-shadow-lg);
	z-index: 100;
	white-space: nowrap;
	animation: btFadeIn 0.2s ease;
}

@keyframes btFadeIn {
	from { opacity: 0; transform: translate(-50%, 8px); }
	to { opacity: 1; transform: translate(-50%, 0); }
}

/* ==========================================================================
   Customer Dashboard (My Account)
   ========================================================================== */
.bt-my-account-wrap {
	font-family: inherit;
	color: var(--bt-text);
}

.bt-dashboard-header {
	margin-bottom: 20px;
}

.bt-dashboard-header h2 {
	margin: 0 0 6px 0;
	font-size: 24px;
	font-weight: 800;
}

.bt-dashboard-subtitle {
	color: var(--bt-text-muted);
	font-size: 14px;
	margin: 0;
}

/* Navigation tabs */
.bt-dashboard-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 24px;
	border-bottom: 2px solid var(--bt-border);
	padding-bottom: 12px;
}

.bt-tab-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	color: var(--bt-text-muted) !important;
	border-radius: var(--bt-radius-sm);
	text-decoration: none !important;
	background: transparent;
	transition: all 0.15s ease;
}

.bt-tab-link:hover {
	background: var(--bt-bg);
	color: var(--bt-text) !important;
}

.bt-tab-link.is-active {
	background: var(--bt-primary);
	color: #ffffff !important;
}

.bt-tab-count {
	font-size: 11px;
	background: rgba(0, 0, 0, 0.08);
	padding: 1px 6px;
	border-radius: 9999px;
}

.bt-tab-link.is-active .bt-tab-count {
	background: rgba(255, 255, 255, 0.25);
	color: #ffffff;
}

/* Cards Grid */
.bt-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
	gap: 20px;
}

.bt-dashboard-card {
	background: var(--bt-card-bg);
	border: 1px solid var(--bt-border);
	border-radius: var(--bt-radius);
	padding: 16px;
	box-shadow: var(--bt-shadow-sm);
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.bt-dashboard-card:hover {
	transform: translateY(-2px);
	box-shadow: var(--bt-shadow);
}

.bt-dash-card-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.bt-dash-status-group {
	display: flex;
	align-items: center;
	gap: 6px;
}

.bt-role-pill {
	font-size: 11px;
	background: #f1f5f9;
	color: #475569;
	padding: 2px 6px;
	border-radius: 4px;
	font-weight: 600;
}

.bt-dash-discount-tag {
	font-size: 12px;
	font-weight: 800;
	color: var(--bt-primary);
	background: var(--bt-primary-light);
	padding: 3px 8px;
	border-radius: 9999px;
}

.bt-dash-product-box {
	margin-bottom: 12px;
}

.bt-dash-product-link {
	display: flex;
	gap: 12px;
	text-decoration: none !important;
	color: inherit !important;
}

.bt-dash-thumb {
	width: 60px;
	height: 60px;
	border-radius: var(--bt-radius-sm);
	overflow: hidden;
	background: var(--bt-bg);
	flex-shrink: 0;
	border: 1px solid var(--bt-border);
}

.bt-dash-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bt-dash-meta {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.bt-dash-prod-title {
	margin: 0 0 4px 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--bt-text);
}

.bt-dash-prices {
	font-size: 13px;
}

.bt-dash-reg-price {
	text-decoration: line-through;
	color: var(--bt-text-muted);
}

.bt-dash-deal-price {
	color: var(--bt-success);
	font-weight: 700;
}

.bt-dash-progress-area {
	margin-bottom: 12px;
}

.bt-dash-progress-text {
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	margin-bottom: 6px;
}

.bt-dash-progress-bar {
	height: 6px;
	background: #e2e8f0;
	border-radius: 9999px;
	overflow: hidden;
}

.bt-dash-bar-fill {
	height: 100%;
	background: var(--bt-primary);
	border-radius: 9999px;
}

.bt-dash-timing {
	margin-bottom: 14px;
	font-size: 12px;
}

.bt-alert-discount-live {
	display: flex;
	align-items: center;
	gap: 8px;
	background: var(--bt-success-light);
	border: 1px solid #bbf7d0;
	color: var(--bt-success);
	padding: 8px 10px;
	border-radius: var(--bt-radius-sm);
}

.bt-dash-deadline {
	display: flex;
	align-items: center;
	gap: 4px;
	color: var(--bt-text-muted);
}

.bt-dash-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: auto;
}

.bt-dash-card-actions .bt-btn {
	flex: 1 1 auto;
}

/* Empty State */
.bt-empty-state {
	text-align: center;
	padding: 40px 20px;
	background: var(--bt-bg);
	border: 1.5px dashed var(--bt-border);
	border-radius: var(--bt-radius);
	margin: 20px 0;
}

.bt-empty-icon .dashicons {
	font-size: 48px;
	width: 48px;
	height: 48px;
	color: var(--bt-text-muted);
	margin-bottom: 12px;
}

.bt-empty-state h4 {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 700;
}

.bt-empty-state p {
	color: var(--bt-text-muted);
	font-size: 14px;
	margin: 0 0 16px 0;
}

/* Responsive adjustments */
@media (max-width: 640px) {
	.bt-card-header {
		flex-direction: column;
		align-items: flex-start;
	}

	.bt-pricing-row {
		flex-direction: column;
		align-items: flex-start;
		gap: 6px;
	}

	.bt-price-arrow {
		display: none;
	}

	.bt-share-buttons {
		flex-direction: column;
	}

	.bt-share-buttons .bt-btn {
		width: 100%;
	}
}
