/*
 * Direct Checkout Optimizer — Sticky Button Styles
 * Theme-safe: all selectors scoped to .dco-sticky-bar.
 */

/* =====================================================================
   Sticky bar — base
   ===================================================================== */

.dco-sticky-bar {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 99990;
	padding: 10px 16px;
	box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.18);
	transition: transform 0.3s ease, opacity 0.3s ease;
	will-change: transform;
}

.dco-sticky-bar--bottom {
	bottom: 0;
	border-radius: 0;
}

/* Hidden state — JS removes this class after scroll threshold. */
.dco-sticky-bar--hidden {
	transform: translateY(110%);
	opacity: 0;
	pointer-events: none;
}

/* Mobile-only: hidden on desktop via CSS (JS also guards). */
@media (min-width: 783px) {
	.dco-sticky-bar--mobile-only {
		display: none !important;
	}
}

/* =====================================================================
   Inner layout
   ===================================================================== */

.dco-sticky-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	max-width: 960px;
	margin: 0 auto;
}

/* =====================================================================
   Product summary
   ===================================================================== */

.dco-sticky-bar__product {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
}

.dco-sticky-bar__thumb {
	width: 44px;
	height: 44px;
	flex-shrink: 0;
	overflow: hidden;
	border-radius: 4px;
}

.dco-sticky-bar__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.dco-sticky-bar__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.dco-sticky-bar__name {
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.dco-sticky-bar__price {
	font-size: 13px;
	opacity: 0.9;
}

.dco-sticky-bar__price .woocommerce-Price-amount {
	color: inherit;
}

/* =====================================================================
   CTA button
   ===================================================================== */

.dco-sticky-bar__btn {
	flex-shrink: 0;
	padding: 10px 24px;
	font-size: 14px;
	font-weight: 700;
	border: none;
	border-radius: 4px;
	cursor: pointer;
	transition: opacity 0.2s, transform 0.1s;
	white-space: nowrap;
}

.dco-sticky-bar__btn:hover  { opacity: 0.88; }
.dco-sticky-bar__btn:active { transform: scale(0.97); }

.dco-sticky-bar__btn.dco-loading {
	opacity: 0.65;
	cursor: not-allowed;
}

/* =====================================================================
   Close button
   ===================================================================== */

.dco-sticky-bar__close {
	background: none;
	border: none;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 4px;
	opacity: 0.7;
	flex-shrink: 0;
	transition: opacity 0.15s;
}

.dco-sticky-bar__close:hover { opacity: 1; }

/* =====================================================================
   Offset for common cookie/GDPR bars (detected via JS)
   ===================================================================== */

.dco-sticky-bar--offset {
	bottom: var(--dco-cookie-bar-height, 0px);
}

/* =====================================================================
   Responsive — collapse product info on very small screens
   ===================================================================== */

@media (max-width: 400px) {
	.dco-sticky-bar__product {
		display: none;
	}

	.dco-sticky-bar__btn {
		width: 100%;
		text-align: center;
	}

	.dco-sticky-bar__inner {
		justify-content: center;
	}
}
