/**
 * Sticky add-to-cart bar (single product).
 * Figma frame-parent — standalone CSS (no gulp).
 */

.sticky-atc {
	position: fixed;
	left: 0;
	right: 0;
	/* Always pin to viewport bottom (not bottom: 72px) — avoids iOS Safari
	   chrome show/hide gap above the footer mobile menu. */
	bottom: 0;
	z-index: 9997;
	width: 100%;
	box-sizing: border-box;
	padding-bottom: env(safe-area-inset-bottom, 0);
	/* Transparent underlay so mobile menu (higher z-index) sits in the reserved strip */
	background: transparent;
	transform: translateY(100%);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: transform 0.25s ease, opacity 0.2s ease, visibility 0.2s;
}

.sticky-atc.is-visible {
	transform: translateY(0);
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

@media (max-width: 767px) {
	.sticky-atc {
		/*
		 * Reserve space for mobile sticky menu (~72px) via padding, not bottom offset.
		 * bottom stays 0 so ATC + menu move together when iOS URL bar collapses.
		 */
		bottom: 0;
		padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
	}

	body.mobile-nav-open .sticky-atc {
		visibility: hidden;
		pointer-events: none;
	}
}

/*
 * DJ Accessibility sits bottom-left with z-index 99999.
 * Lift it above sticky ATC (and mobile nav on small screens).
 */
body.single-product .djacc.djacc--sticky.djacc--bottom-left,
body.single-product .djacc.djacc--sticky.djacc--bottom-center,
body.single-product .djacc.djacc--sticky.djacc--bottom-right {
	bottom: 100px;
	transition: bottom 0.25s ease;
}

body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-left,
body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-center,
body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-right {
	bottom: 120px;
}

@media (max-width: 767px) {
	body.single-product .djacc.djacc--sticky.djacc--bottom-left,
	body.single-product .djacc.djacc--sticky.djacc--bottom-center,
	body.single-product .djacc.djacc--sticky.djacc--bottom-right {
		/* Above mobile sticky menu */
		bottom: 88px;
	}

	body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-left,
	body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-center,
	body.single-product.sticky-atc-visible .djacc.djacc--sticky.djacc--bottom-right {
		/* Mobile menu (~72px) + sticky ATC (~90px) */
		bottom: 170px;
	}
}

.sticky-atc__inner {
	width: 100%;
	border-radius: 2px 2px 0 0;
	background-color: #f6f6f6;
	border-top: 1px solid #e7e7e7;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 16px;
	gap: 12px;
	text-align: left;
	font-size: 18px;
	color: #1e1e1e;
	font-family: "Satoshi", "Satoshi Variable", sans-serif;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__inner {
		padding: 24px 64px;
		gap: 20px;
	}
}

.sticky-atc__product {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
	/* Take all free space so title can grow */
	flex: 1 1 auto;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__product {
		gap: 16px;
	}
}

.sticky-atc__image {
	height: 48px;
	width: 48px;
	border-radius: 2px;
	object-fit: cover;
	flex-shrink: 0;
	display: block;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__image {
		height: 56px;
		width: 56px;
	}
}

.sticky-atc__title {
	/* No fixed max-width — use remaining bar width */
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
	position: relative;
	line-height: 24px;
	font-size: 14px;
	font-weight: 500;
	font-variation-settings: "wght" 500;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: #1e1e1e;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__title {
		font-size: 18px;
		line-height: 28px;
		-webkit-line-clamp: 3;
	}
}

.sticky-atc__actions {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	flex-shrink: 0;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__actions {
		gap: 32px;
	}
}

/* Price — Figma: red main chip + optional strike + unit (€/m²) only */
.sticky-atc__price-wrap {
	display: none;
	flex-direction: column;
	align-items: flex-start;
}

@media print, screen and (min-width: 40em) {
	.sticky-atc__price-wrap {
		display: flex;
	}
}

.sticky-atc__price-row {
	display: flex;
	align-items: center;
	gap: 8px;
}

.sticky-atc__main-price {
	border-radius: 2px;
	background-color: #c72c2e;
	display: flex;
	align-items: center;
	padding: 0 4px;
	color: #fff;
	font-size: 30px;
	line-height: 38px;
	font-weight: 700;
	font-family: "Satoshi", "Satoshi Variable", sans-serif;
	white-space: nowrap;
}

.sticky-atc__main-price .woocommerce-Price-amount,
.sticky-atc__main-price bdi,
.sticky-atc__main-price .amount {
	color: #fff !important;
	font-size: 30px !important;
	line-height: 38px !important;
	font-weight: 700 !important;
	background: none !important;
	padding: 0 !important;
}

.sticky-atc__main-price .price-for-m2,
.sticky-atc__main-price .ecom-wc-price-decimal {
	display: none !important;
}

.sticky-atc__price-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	font-size: 12px;
	color: #4f4f4f;
	gap: 0;
}

.sticky-atc__regular-price {
	font-size: 12px;
	line-height: 18px;
	font-weight: 500;
	color: #4f4f4f;
	text-decoration: line-through;
}

.sticky-atc__regular-price .woocommerce-Price-amount,
.sticky-atc__regular-price bdi {
	font-size: 12px !important;
	line-height: 18px !important;
	font-weight: 500 !important;
	color: #4f4f4f !important;
	background: none !important;
	padding: 0 !important;
}

.sticky-atc__price-unit {
	position: relative;
	font-size: 12px;
	line-height: 18px;
	font-weight: 500;
	color: #4f4f4f;
	white-space: nowrap;
}

.sticky-atc__qty-row {
	display: flex;
	align-items: center;
	gap: 12px;
	height: 44px;
}

@media print, screen and (min-width: 64em) {
	.sticky-atc__qty-row {
		gap: 16px;
	}
}

/* Shared control height: matches “Ielikt grozā” (Figma 44px) */
.sticky-atc__quantity {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 44px;
}

/* − and + : same box as input (44×44) */
.sticky-atc__qty-btn {
	border: none;
	border-radius: 2px;
	background-color: #3d3d3d;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	box-sizing: border-box;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.15s ease;
}

.sticky-atc__qty-btn:hover,
.sticky-atc__qty-btn:focus-visible {
	background-color: #1e1e1e;
	outline: none;
}

.sticky-atc__qty-btn svg {
	display: block;
	width: 12px;
	height: 12px;
}

/* Input: same size as − / + */
.sticky-atc input.sticky-atc__qty-input[type="number"] {
	width: 44px !important;
	min-width: 44px !important;
	max-width: 44px !important;
	height: 44px !important;
	min-height: 44px !important;
	max-height: 44px !important;
	box-sizing: border-box !important;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
	border-radius: 2px !important;
	background-color: #fff !important;
	border: 1px solid #85888e !important;
	padding: 0 !important;
	margin: 0 !important;
	text-align: center !important;
	font-size: 16px !important;
	line-height: 42px !important; /* 44 − 2px border */
	color: #0d0d0d !important;
	font-family: "Satoshi", "Satoshi Variable", sans-serif !important;
	-moz-appearance: textfield;
	appearance: textfield;
	flex: 0 0 44px;
	align-self: center;
}

.sticky-atc input.sticky-atc__qty-input[type="number"]::-webkit-inner-spin-button,
.sticky-atc input.sticky-atc__qty-input[type="number"]::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to cart: same 44px height as qty controls */
.sticky-atc__submit {
	border: none;
	border-radius: 2px;
	background-color: #c72c2e;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	padding: 0 16px;
	box-sizing: border-box;
	font-size: 14px;
	line-height: 24px;
	font-weight: 500;
	font-variation-settings: "wght" 500;
	font-family: "Satoshi", "Satoshi Variable", sans-serif;
	color: #fff;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.15s ease;
}

@media print, screen and (min-width: 40em) {
	.sticky-atc__submit {
		font-size: 16px;
	}
}

.sticky-atc__submit:hover,
.sticky-atc__submit:focus-visible {
	background-color: #b02527;
	outline: none;
	color: #fff;
}

/* Keep title visible; still allow 2 lines on small screens */
@media (max-width: 479px) {
	.sticky-atc__title {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		font-size: 13px;
		line-height: 18px;
	}
}
