/* ---------------------------------------------------------------------------
   Raffle Competition — Frontend Styles
   --------------------------------------------------------------------------- */

/* Progress bar */
.ba-raffle-ui {
	margin-bottom: 1.5em;
}

.ba-raffle-progress {
	margin-bottom: 1.25em;
}

.ba-raffle-progress-header {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.85em;
	margin-bottom: 0.4em;
	color: #444;
}

.ba-raffle-progress-pct {
	font-weight: 700;
	color: #2c7be5;
}

.ba-raffle-progress-track {
	background: #e5e5e5;
	border-radius: 999px;
	height: 14px;
	overflow: hidden;
}

.ba-raffle-progress-fill {
	background: linear-gradient( 90deg, #2c7be5, #5ba4f5 );
	height: 100%;
	border-radius: 999px;
	transition: width 0.4s ease;
}

.ba-raffle-progress-total-label {
	font-size: 0.78em;
	color: #888;
	margin: 0.3em 0 0;
	text-align: right;
}

/* Countdown */
.ba-raffle-countdown {
	margin-bottom: 1.25em;
}

.ba-raffle-countdown-label {
	font-size: 0.82em;
	color: #555;
	font-weight: 600;
	margin-bottom: 0.5em;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.ba-raffle-countdown-timer {
	display: flex;
	align-items: flex-end;
	gap: 0.25em;
	margin-bottom: 0.5em;
}

.ba-countdown-unit {
	display: flex;
	flex-direction: column;
	align-items: center;
	background: #f4f6f9;
	border: 1px solid #dde1ea;
	border-radius: 6px;
	padding: 0.3em 0.6em;
	min-width: 3em;
	text-align: center;
}

.ba-countdown-unit span {
	font-size: 1.5em;
	font-weight: 700;
	line-height: 1.1;
	color: #1a1a2e;
}

.ba-countdown-unit small {
	font-size: 0.65em;
	color: #888;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	margin-top: 0.1em;
}

.ba-countdown-sep {
	font-size: 1.4em;
	font-weight: 700;
	color: #bbb;
	padding-bottom: 0.35em;
}

.ba-raffle-draw-date {
	font-size: 0.84em;
	color: #555;
	margin: 0;
}

/* Status badges */
.ba-raffle-status {
	display: inline-block;
	padding: 0.3em 0.8em;
	border-radius: 3px;
	font-weight: 600;
	font-size: 0.9em;
}

.ba-raffle-sold-out,
.ba-raffle-closed {
	background: #f8d7da;
	color: #721c24;
}

/* Add to cart form */
.ba-raffle-add-to-cart {
	margin-top: 1em;
}

.ba-raffle-qty-wrapper {
	margin-bottom: 1em;
}

.ba-raffle-qty-wrapper label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5em;
}

.ba-raffle-qty-controls {
	display: flex;
	align-items: center;
	gap: 0.6em;
}

.ba-raffle-btn-minus,
.ba-raffle-btn-plus {
	width: 36px;
	height: 36px;
	border: 2px solid #2c7be5;
	border-radius: 50%;
	background: #fff;
	color: #2c7be5;
	font-size: 1.3em;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background 0.15s, color 0.15s;
}

.ba-raffle-btn-minus:hover,
.ba-raffle-btn-plus:hover {
	background: #2c7be5;
	color: #fff;
}

.ba-raffle-slider-wrap {
	position: relative;
	flex: 1;
	padding-top: 1.8em;
}

.ba-raffle-qty-bubble {
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX( -50% );
	background: #2c7be5;
	color: #fff;
	font-size: 0.85em;
	font-weight: 700;
	padding: 0.15em 0.6em;
	border-radius: 999px;
	white-space: nowrap;
	pointer-events: none;
	transition: left 0.1s;
}

.ba-raffle-slider {
	width: 100%;
	cursor: pointer;
	accent-color: #2c7be5;
	display: block;
}

.ba-raffle-user-tickets {
	display: inline-block;
	margin-top: 0.5em;
	font-size: 0.84em;
	font-weight: 600;
	color: #155724;
	background: #d4edda;
	border: 1px solid #c3e6cb;
	border-radius: 4px;
	padding: 0.25em 0.7em;
}

/* Price summary */
.ba-raffle-price-summary {
	margin-bottom: 1em;
}

.ba-raffle-price-line {
	display: flex;
	align-items: center;
	gap: 0.75em;
	font-size: 1.05em;
}

.ba-raffle-discount-info {
	background: #d4edda;
	color: #155724;
	padding: 0.15em 0.5em;
	border-radius: 3px;
	font-size: 0.85em;
	font-weight: 600;
}

.ba-raffle-total-price .woocommerce-Price-amount {
	font-size: 1.2em;
	font-weight: 700;
}

/* Discount table */
.ba-raffle-discount-table {
	margin-bottom: 1em;
	font-size: 0.88em;
}

.ba-raffle-discount-table ul {
	margin: 0.3em 0 0 1em;
	padding: 0;
	list-style: disc;
}

.ba-raffle-discount-table li {
	margin-bottom: 0.2em;
}

/* Closed / maxed messages */
.ba-raffle-closed-msg,
.ba-raffle-maxed-msg,
.ba-raffle-no-tickets {
	padding: 0.75em 1em;
	border: 1px solid #f5c6cb;
	border-radius: 4px;
	background: #fff3f4;
	color: #721c24;
	font-weight: 600;
}

.ba-raffle-cart-maxed {
	padding: 0.75em 1em;
	border: 1px solid #bee5eb;
	border-radius: 4px;
	background: #d1ecf1;
	color: #0c5460;
}

.ba-raffle-cart-maxed p {
	margin: 0 0 0.6em;
	font-weight: 600;
}

/* Ticket numbers in order */
.ba-raffle-ticket-numbers {
	margin-top: 0.5em;
	font-size: 0.9em;
}

/* My Account grid */
.ba-raffle-myaccount-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 240px, 1fr ) );
	gap: 1.25em;
	margin-bottom: 1.5em;
}

.ba-myaccount-card {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.ba-myaccount-card:hover {
	box-shadow: 0 4px 14px rgba( 0, 0, 0, 0.1 );
}

.ba-myaccount-card-won {
	border-color: #d4af37;
}

.ba-myaccount-card-awaiting {
	opacity: 0.85;
}

.ba-myaccount-card-image {
	display: block;
	position: relative;
	overflow: hidden;
}

.ba-myaccount-card-image img {
	width: 100%;
	height: 160px;
	object-fit: cover;
	display: block;
}

.ba-myaccount-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1em;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.ba-myaccount-overlay-won {
	background: rgba( 212, 175, 55, 0.8 );
	color: #fff;
}

.ba-myaccount-overlay-awaiting {
	background: rgba( 0, 0, 0, 0.4 );
	color: #fff;
}

.ba-myaccount-card-body {
	padding: 0.9em 1em;
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: 0.5em;
}

.ba-myaccount-card-title {
	font-size: 0.95em;
	font-weight: 700;
	margin: 0;
	line-height: 1.3;
}

.ba-myaccount-card-title a {
	color: inherit;
	text-decoration: none;
}

.ba-myaccount-card-title a:hover {
	text-decoration: underline;
}

.ba-myaccount-tickets {
	font-size: 0.85em;
	margin: 0;
	color: #555;
}

.ba-myaccount-tickets-label {
	display: block;
	font-size: 0.9em;
	color: #333;
	margin-bottom: 0.3em;
}

.ba-raffle-ticket-list-scroll {
	max-height: 80px;
	overflow-y: auto;
	background: #f9f9f9;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	padding: 0.3em 0.5em;
}

.ba-myaccount-winner-info {
	background: #fffbf0;
	border-left: 3px solid #d4af37;
	padding: 0.5em 0.75em;
	border-radius: 2px;
	font-size: 0.88em;
}

.ba-myaccount-winner-ticket {
	font-weight: 700;
	margin: 0 0 0.2em;
	color: #333;
}

.ba-myaccount-winner-name {
	margin: 0;
	color: #555;
}

.ba-myaccount-winner-you {
	margin: 0;
	font-weight: 700;
	color: #b8860b;
}

.ba-myaccount-status {
	font-size: 0.88em;
	font-weight: 600;
	margin: 0;
}

.ba-myaccount-awaiting {
	color: #856404;
}

.ba-myaccount-countdown {
	font-size: 0.88em;
	color: #555;
}

.ba-myaccount-countdown .ba-raffle-countdown-label {
	font-size: 0.8em;
	margin-bottom: 0.4em;
}

.ba-myaccount-countdown .ba-raffle-countdown-timer {
	gap: 0.15em;
}

.ba-myaccount-countdown .ba-countdown-unit {
	min-width: 2.2em;
	padding: 0.2em 0.35em;
}

.ba-myaccount-countdown .ba-countdown-unit span {
	font-size: 1.1em;
}

.ba-myaccount-countdown .ba-countdown-sep {
	font-size: 1em;
	padding-bottom: 0.2em;
}

.ba-myaccount-card-actions {
	margin-top: auto;
	padding-top: 0.6em;
	border-top: 1px solid #f0f0f0;
	display: flex;
	align-items: center;
	gap: 0.75em;
	flex-wrap: wrap;
}

.ba-myaccount-buy-more {
	font-size: 0.85em !important;
	padding: 0.3em 0.75em !important;
}

.ba-myaccount-view-link {
	font-size: 0.82em;
	color: #777;
	text-decoration: none;
}

.ba-myaccount-view-link:hover {
	color: #333;
	text-decoration: underline;
}

@media ( max-width: 600px ) {
	.ba-raffle-myaccount-grid {
		grid-template-columns: 1fr;
	}
}

/* Free postal entry link */
.ba-raffle-postal-entry {
	margin-top: 0.75em;
	font-size: 0.85em;
}

/* My Account draw groups */
.ba-raffle-section-heading {
	margin: 1.5em 0 0.5em;
	font-size: 1.1em;
	font-weight: 700;
	border-bottom: 1px solid #e5e5e5;
	padding-bottom: 0.3em;
}

.ba-raffle-draw-group {
	margin-bottom: 1.5em;
}

.ba-raffle-draw-heading {
	margin: 0 0 0.5em;
	font-size: 1em;
	font-weight: 600;
	color: #333;
}

/* My Account ticket list */
.ba-raffle-ticket-list {
	font-family: monospace;
	font-size: 0.9em;
	word-break: break-word;
}

.ba-raffle-winning-number {
	display: inline-block;
	background: #d4af37;
	color: #fff;
	font-weight: 700;
	border-radius: 3px;
	padding: 0 0.35em;
	line-height: 1.4;
}

/* Competitions archive shortcode */
.ba-raffle-archive {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 1.5em;
	margin: 1.5em 0;
}

.ba-raffle-archive-empty {
	color: #555;
}

.ba-raffle-archive-card {
	border: 1px solid #e5e5e5;
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	background: #fff;
	transition: box-shadow 0.2s ease;
}

.ba-raffle-archive-card:hover {
	box-shadow: 0 4px 16px rgba( 0, 0, 0, 0.1 );
}

.ba-raffle-archive-card.ba-card-closed {
	opacity: 0.8;
}

.ba-raffle-card-image {
	display: block;
	position: relative;
	overflow: hidden;
}

.ba-raffle-card-image img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	display: block;
}

.ba-raffle-card-closed-overlay {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba( 0, 0, 0, 0.45 );
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 1.2em;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}

.ba-raffle-card-body {
	padding: 1em;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.ba-raffle-card-title {
	font-size: 1em;
	font-weight: 700;
	margin: 0 0 0.75em;
	line-height: 1.3;
}

.ba-raffle-card-title a {
	color: inherit;
	text-decoration: none;
}

.ba-raffle-card-title a:hover {
	text-decoration: underline;
}

.ba-raffle-archive-card .ba-raffle-countdown {
	margin-bottom: 0.75em;
}

.ba-raffle-archive-card .ba-raffle-countdown-timer {
	font-size: 1.1em;
}

.ba-raffle-card-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 0.75em;
	border-top: 1px solid #f0f0f0;
	gap: 0.5em;
	flex-wrap: wrap;
}

.ba-raffle-card-price {
	font-weight: 700;
	font-size: 1em;
}

.ba-raffle-card-price small {
	font-weight: 400;
	font-size: 0.8em;
	color: #777;
}

.ba-raffle-enter-btn,
.ba-raffle-view-btn {
	white-space: nowrap;
}

@media ( max-width: 600px ) {
	.ba-raffle-archive {
		grid-template-columns: 1fr;
	}
}

/* Winner overlay on archive cards */
.ba-overlay-won {
	background: rgba( 212, 175, 55, 0.85 );
	color: #fff;
}

/* Winner info block on archive cards */
.ba-raffle-card-winner {
	margin: 0.5em 0 0.75em;
	padding: 0.5em 0.75em;
	background: #fffbf0;
	border-left: 3px solid #d4af37;
	border-radius: 2px;
	font-size: 0.9em;
}

.ba-raffle-card-winner-ticket {
	margin: 0 0 0.2em;
	font-weight: 700;
	color: #333;
}

.ba-raffle-card-winner-name {
	margin: 0;
	color: #555;
}

/* Winner announcement on product page */
.ba-raffle-winner-announcement {
	border: 2px solid #d4af37;
	border-radius: 6px;
	background: #fffbf0;
	padding: 1.25em 1.5em;
	margin: 1em 0;
	text-align: center;
}

.ba-raffle-winner-label {
	font-size: 1.3em;
	font-weight: 700;
	color: #b8860b;
	margin: 0 0 0.4em;
}

.ba-raffle-winner-ticket {
	font-size: 1.5em;
	font-weight: 700;
	color: #333;
	margin: 0 0 0.25em;
}

.ba-raffle-winner-name {
	font-size: 1.1em;
	color: #555;
	margin: 0;
}

/* Awaiting draw message on product page */
.ba-raffle-awaiting-draw {
	border: 2px dashed #ccc;
	border-radius: 6px;
	background: #f9f9f9;
	padding: 1.25em 1.5em;
	margin: 1em 0;
	text-align: center;
}

.ba-raffle-closed-msg {
	font-weight: 700;
	color: #555;
	margin: 0 0 0.4em;
}

.ba-raffle-awaiting-msg {
	color: #777;
	margin: 0;
	font-size: 0.95em;
}

