.bam-ad-unit {
	position: relative;
	max-width: 100%;
	box-sizing: border-box;
}

.bam-ad-unit img.bam-ad-image {
	display: block;
	max-width: 100%;
	height: auto;
}

.bam-ad-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.bam-ad-cta {
	display: inline-block;
	margin-top: 8px;
	padding: 8px 16px;
	border-radius: 4px;
	background: #1d4ed8;
	color: #fff !important;
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
}

.bam-ad-video,
.bam-ad-video-embed {
	max-width: 100%;
}

.bam-ad-video-embed {
	position: relative;
	padding-bottom: 56.25%;
	height: 0;
	overflow: hidden;
}

.bam-ad-video-iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.bam-ad-html-frame {
	width: 100%;
	border: 0;
}

.bam-native-ad {
	display: flex;
	gap: 12px;
	align-items: flex-start;
}

.bam-native-image {
	max-width: 96px;
	height: auto;
	border-radius: 4px;
	flex-shrink: 0;
}

.bam-native-label {
	display: block;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #8a8a8a;
	margin-bottom: 2px;
}

.bam-native-headline {
	display: block;
	font-size: 15px;
	margin-bottom: 2px;
}

.bam-native-description {
	font-size: 13px;
	color: #555;
	margin: 0;
}

.bam-text-ad {
	padding: 10px 14px;
	border: 1px solid #e5e5e5;
	border-radius: 6px;
}

.bam-text-headline {
	display: block;
	font-size: 15px;
}

.bam-text-subheading {
	display: block;
	font-size: 12px;
	color: #777;
}

.bam-text-description {
	font-size: 13px;
	margin: 4px 0 0;
}

.bam-ticker-wrap {
	overflow: hidden;
	white-space: nowrap;
	position: relative;
	width: 100%;
}

.bam-ticker-track {
	display: inline-block;
	white-space: nowrap;
	padding-left: 100%;
	animation-name: bam-ticker-scroll;
	animation-timing-function: linear;
	animation-iteration-count: infinite;
}

/* v1.0.2: the Direction dropdown saved on the campaign's ticker message
   is the ONLY thing that decides these two rules — nothing here reads or
   infers language/script from the message text.
   With the padding-left:100% technique above, the base @keyframes below
   (translateX(0%) -> translateX(-100%)) moves content from fully
   off-screen RIGHT to fully off-screen LEFT — i.e. "enter right, exit
   left". Playing the same keyframes in reverse moves content from fully
   off-screen LEFT to fully off-screen RIGHT — i.e. "enter left, exit
   right". Both values are set explicitly (rather than relying on one of
   them being an implicit default) so there is exactly one, unambiguous
   rule per direction. */
.bam-ticker-wrap[data-bam-direction="rtl"] .bam-ticker-track {
	animation-direction: normal;
	direction: rtl;
}

.bam-ticker-wrap[data-bam-direction="ltr"] .bam-ticker-track {
	animation-direction: reverse;
	direction: ltr;
}

.bam-ticker-item {
	display: inline-block;
	margin-right: 48px;
	unicode-bidi: plaintext;
}

.bam-ticker-tracker {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}

@keyframes bam-ticker-scroll {
	from {
		transform: translateX(0);
	}
	to {
		transform: translateX(-100%);
	}
}

.bam-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 100000;
}

.bam-popup-box {
	position: relative;
	background: #fff;
	border-radius: 8px;
	max-width: 90vw;
	max-height: 90vh;
	overflow: auto;
	padding: 24px;
}

.bam-popup-close {
	position: absolute;
	top: 8px;
	right: 12px;
	cursor: pointer;
	font-size: 20px;
	background: none;
	border: none;
	line-height: 1;
}

.bam-sticky-top,
.bam-sticky-bottom {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	box-shadow: 0 0 8px rgba(0, 0, 0, 0.15);
}

.bam-sticky-top {
	top: 0;
}

.bam-sticky-bottom {
	bottom: 0;
}

.bam-floating-left,
.bam-floating-right {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	z-index: 9999;
}

.bam-floating-left {
	left: 0;
}

.bam-floating-right {
	right: 0;
}

/* Advertiser portal & advertise form */
.bam-input {
	width: 100%;
	max-width: 480px;
	padding: 8px 10px;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	box-sizing: border-box;
	font-size: 14px;
}

.bam-submit-button {
	background: #1d4ed8;
	color: #fff;
	border: none;
	padding: 10px 20px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.bam-submit-button:hover {
	background: #1e40af;
}

.bam-form-success {
	background: #ecfdf5;
	border: 1px solid #a7f3d0;
	color: #065f46;
	padding: 12px 16px;
	border-radius: 6px;
	margin-bottom: 16px;
}

.bam-advertise-form h3 {
	margin-top: 28px;
	border-bottom: 1px solid #eee;
	padding-bottom: 6px;
}

.bam-dashboard-header {
	margin-bottom: 12px;
}

.bam-dashboard-nav {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid #eee;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.bam-dashboard-tab {
	padding: 10px 16px;
	text-decoration: none;
	color: #555;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
}

.bam-dashboard-tab.is-active {
	color: #1d4ed8;
	border-bottom-color: #1d4ed8;
	font-weight: 600;
}

.bam-stat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 14px;
	margin-bottom: 24px;
}

.bam-stat-card {
	background: #f9fafb;
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 14px 16px;
}

.bam-stat-card--attention {
	border-left: 4px solid #d63638;
}

.bam-stat-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	color: #888;
	margin-bottom: 4px;
}

.bam-stat-value {
	display: block;
	font-size: 20px;
	font-weight: 700;
}

.bam-dashboard-table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 20px;
}

.bam-dashboard-table th,
.bam-dashboard-table td {
	text-align: left;
	padding: 8px 10px;
	border-bottom: 1px solid #eee;
}

.bam-status {
	display: inline-block;
	padding: 2px 10px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	background: #eef2ff;
	color: #3730a3;
}

.bam-status--running,
.bam-status--approved,
.bam-status--completed {
	background: #ecfdf5;
	color: #065f46;
}

.bam-status--pending,
.bam-status--awaiting_reply,
.bam-status--scheduled,
.bam-status--paused {
	background: #fffbeb;
	color: #92400e;
}

.bam-status--rejected,
.bam-status--cancelled,
.bam-status--expired {
	background: #fef2f2;
	color: #991b1b;
}

.bam-comment-thread {
	margin: 16px 0;
}

.bam-comment {
	padding: 10px 14px;
	border-radius: 6px;
	margin-bottom: 10px;
	background: #f9fafb;
}

.bam-comment--admin {
	background: #eff6ff;
}

.bam-comment-date {
	font-size: 11px;
	color: #999;
	margin-left: 8px;
}

.bam-order-card {
	border: 1px solid #eee;
	border-radius: 6px;
	padding: 14px 16px;
	margin-bottom: 14px;
}

/* Carousel ads */
.bam-carousel {
	position: relative;
	overflow: hidden;
}

.bam-carousel-track {
	display: flex;
	transition: transform 0.4s ease;
}

.bam-carousel-slide {
	flex: 0 0 100%;
	max-width: 100%;
}

.bam-carousel-prev,
.bam-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	border: none;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	line-height: 1;
}

.bam-carousel-prev {
	left: 8px;
}

.bam-carousel-next {
	right: 8px;
}

.bam-carousel-dots {
	position: absolute;
	bottom: 8px;
	left: 50%;
	transform: translateX(-50%);
	display: flex;
	gap: 6px;
}

.bam-carousel-dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.6);
	cursor: pointer;
	display: inline-block;
}

.bam-carousel-dot.is-active {
	background: #fff;
}

/* Sponsored listing badges */
.bam-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 3px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	margin-right: 4px;
}

.bam-badge--vip {
	background: #1f2937;
	color: #fbbf24;
}

.bam-badge--urgent {
	background: #dc2626;
	color: #fff;
}

.bam-badge--featured {
	background: #2563eb;
	color: #fff;
}

.bam-badge--sponsored {
	background: #e5e7eb;
	color: #374151;
}
