/**
 * HN Sticky Add to Cart — Production CSS
 * File: assets/css/sticky-add-to-cart.css
 *
 * Optimized for:
 * - WooCommerce simple and variable products
 * - Desktop, tablet and mobile
 * - iOS safe areas
 * - Low CSS overhead and minimal repaints
 * - Keyboard focus and reduced-motion accessibility
 */

/* =========================================================
   1. VARIABLES
   ========================================================= */

:root {
	--hn-sac-bg: #ffffff;
	--hn-sac-text: #171717;
	--hn-sac-muted: #666666;
	--hn-sac-border: #e7e7e7;
	--hn-sac-accent: #111111;
	--hn-sac-accent-hover: #303030;
	--hn-sac-button-text: #ffffff;
	--hn-sac-radius: 7px;
	--hn-sac-z-index: 249;
	--hn-sac-shadow: 0 -4px 22px rgb(0 0 0 / 8%);
	--hn-sac-transition: 180ms ease;
}

/* =========================================================
   2. STICKY BAR
   ========================================================= */

.hn-sticky-add-to-cart {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: var(--hn-sac-z-index);

	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 12px 24px;
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));

	box-sizing: border-box;
	background: var(--hn-sac-bg);
	color: var(--hn-sac-text);
	border-top: 1px solid var(--hn-sac-border);
	box-shadow: var(--hn-sac-shadow);

	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;

	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(10px);

	transition:
		opacity var(--hn-sac-transition),
		transform var(--hn-sac-transition),
		visibility var(--hn-sac-transition);

	-webkit-tap-highlight-color: transparent;
}

/* Hidden by default; JS controls .is-active */

.hn-sticky-add-to-cart.is-active {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0);
}

/* Consistent sizing */

.hn-sticky-add-to-cart *,
.hn-sticky-add-to-cart *::before,
.hn-sticky-add-to-cart *::after {
	box-sizing: border-box;
}

/* =========================================================
   3. INNER LAYOUT
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	width: 100%;
	max-width: 1320px;
	min-width: 0;
	margin: 0 auto;
	padding: 0;
}

/* =========================================================
   4. PRODUCT IMAGE AND TITLE
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
	display: flex;
	align-items: center;
	gap: 12px;

	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.hn-sticky-add-to-cart .hn-sticky-img {
	display: block;
	flex: 0 0 50px;
	width: 50px;
	height: 50px;
	max-width: 50px;
	margin: 0;
	padding: 0;
	object-fit: cover;
	object-position: center;
	border-radius: 5px;
	background: #f6f6f6;
	border: 0;
	box-shadow: none;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
	display: block;
	min-width: 0;
	max-width: 100%;
	margin: 0;

	color: var(--hn-sac-text);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

/* =========================================================
   5. PRICE, QUANTITY AND BUTTON
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 20px;

	flex: 0 0 auto;
	min-width: 0;
	margin: 0;
	padding: 0;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
	display: block;
	flex: 0 1 auto;
	min-width: 0;
	margin: 0;

	color: var(--hn-sac-text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.4;
	white-space: nowrap;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price .amount {
	color: inherit;
	font-size: inherit;
	font-weight: inherit;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price del {
	margin-right: 5px;
	color: var(--hn-sac-muted);
	font-size: 12px;
	font-weight: 400;
	opacity: 0.75;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price ins {
	color: inherit;
	text-decoration: none;
}

.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;

	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
}

/* =========================================================
   6. QUANTITY SELECTOR
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-qty {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;

	flex: 0 0 auto;
	width: auto;
	min-width: 112px;
	height: 42px;
	margin: 0;
	padding: 0;

	border: 1px solid #dcdcdc;
	border-radius: var(--hn-sac-radius);
	background: #ffffff;
	overflow: hidden;
}

.hn-sticky-add-to-cart .hn-sticky-q {
	display: inline-flex;
	align-items: center;
	justify-content: center;

	flex: 0 0 34px;
	width: 34px;
	min-width: 34px;
	height: 40px;
	margin: 0;
	padding: 0;

	border: 0;
	border-radius: 0;
	background: #ffffff;
	color: var(--hn-sac-text);

	font: inherit;
	font-size: 18px;
	font-weight: 500;
	line-height: 1;

	cursor: pointer;
	box-shadow: none;
	transition: background-color 120ms ease;
	appearance: none;
	-webkit-appearance: none;
}

.hn-sticky-add-to-cart .hn-sticky-q:hover {
	background: #f2f2f2;
	color: var(--hn-sac-text);
}

.hn-sticky-add-to-cart .hn-sticky-q:active {
	background: #e9e9e9;
}

.hn-sticky-add-to-cart .hn-sticky-qty-input {
	display: block;
	flex: 1 1 auto;

	width: 42px;
	min-width: 28px;
	max-width: 54px;
	height: 40px;
	margin: 0;
	padding: 0 2px;

	border: 0;
	border-radius: 0;
	outline-offset: -2px;
	background: #ffffff;
	color: var(--hn-sac-text);

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: normal;
	text-align: center;

	box-shadow: none;
	appearance: textfield;
	-webkit-appearance: none;
	-moz-appearance: textfield;
}

.hn-sticky-add-to-cart .hn-sticky-qty-input::-webkit-inner-spin-button,
.hn-sticky-add-to-cart .hn-sticky-qty-input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* =========================================================
   7. ADD TO CART BUTTON
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;

	flex: 0 0 auto;
	min-width: 150px;
	min-height: 44px;
	margin: 0;
	padding: 11px 20px;

	border: 1px solid var(--hn-sac-accent);
	border-radius: var(--hn-sac-radius);

	background: var(--hn-sac-accent);
	color: var(--hn-sac-button-text);

	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;

	cursor: pointer;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;

	transition:
		background-color 150ms ease,
		border-color 150ms ease,
		opacity 150ms ease;
}

.hn-sticky-add-to-cart .hn-sticky-btn:hover:not(:disabled) {
	background: var(--hn-sac-accent-hover);
	border-color: var(--hn-sac-accent-hover);
	color: var(--hn-sac-button-text);
}

.hn-sticky-add-to-cart .hn-sticky-btn:active:not(:disabled) {
	transform: translateY(1px);
}

.hn-sticky-add-to-cart .hn-sticky-btn:disabled,
.hn-sticky-add-to-cart .hn-sticky-btn[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

/* Cart icon from your hn_icon() helper */

.hn-sticky-add-to-cart .hn-sticky-btn svg {
	display: block;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	max-width: 18px;
}

/* =========================================================
   8. KEYBOARD ACCESSIBILITY
   ========================================================= */

.hn-sticky-add-to-cart button:focus-visible,
.hn-sticky-add-to-cart input:focus-visible {
	outline: 2px solid #2878ff;
	outline-offset: 3px;
}

.hn-sticky-add-to-cart button:focus:not(:focus-visible),
.hn-sticky-add-to-cart input:focus:not(:focus-visible) {
	outline: none;
}

/* =========================================================
   9. LARGE TABLETS AND SMALL LAPTOPS
   ========================================================= */

@media (max-width: 1024px) {
	.hn-sticky-add-to-cart {
		padding-right: 18px;
		padding-left: 18px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 16px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
		gap: 12px;
	}

	.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
		gap: 8px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		font-size: 13px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn {
		min-width: 130px;
		padding-right: 14px;
		padding-left: 14px;
	}
}

/* =========================================================
   10. TABLETS AND MOBILE LANDSCAPE
   ========================================================= */

@media (max-width: 767px) {
	.hn-sticky-add-to-cart {
		padding: 10px 12px;
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));

		box-shadow: 0 -3px 16px rgb(0 0 0 / 9%);
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 10px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
		gap: 9px;
		flex: 1 1 38%;
	}

	.hn-sticky-add-to-cart .hn-sticky-img {
		flex-basis: 42px;
		width: 42px;
		height: 42px;
		max-width: 42px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		display: -webkit-box;
		overflow: hidden;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;

		font-size: 12px;
		line-height: 1.35;
		overflow-wrap: anywhere;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
		gap: 8px;
		flex: 0 1 auto;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
		font-size: 13px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price del {
		display: none;
	}

	.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
		gap: 7px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty {
		min-width: 86px;
		height: 38px;
	}

	.hn-sticky-add-to-cart .hn-sticky-q {
		flex-basis: 27px;
		width: 27px;
		min-width: 27px;
		height: 36px;
		font-size: 16px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty-input {
		width: 32px;
		min-width: 24px;
		max-width: 38px;
		height: 36px;
		font-size: 13px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn {
		gap: 5px;
		min-width: 0;
		min-height: 42px;
		padding: 10px 12px;
		font-size: 12px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn svg {
		width: 16px;
		height: 16px;
	}
}

/* =========================================================
   11. SMALL MOBILE DEVICES
   ========================================================= */

@media (max-width: 480px) {
	.hn-sticky-add-to-cart {
		padding-right: 8px;
		padding-left: 8px;
		padding-top: 9px;
		padding-bottom: calc(9px + env(safe-area-inset-bottom, 0px));
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 7px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
		gap: 7px;
		flex-basis: 34%;
	}

	.hn-sticky-add-to-cart .hn-sticky-img {
		flex-basis: 36px;
		width: 36px;
		height: 36px;
		max-width: 36px;
		border-radius: 4px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		font-size: 11px;
		line-height: 1.3;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
		gap: 6px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
		font-size: 12px;
	}

	.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
		gap: 5px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty {
		min-width: 72px;
		height: 36px;
	}

	.hn-sticky-add-to-cart .hn-sticky-q {
		flex-basis: 23px;
		width: 23px;
		min-width: 23px;
		height: 34px;
		font-size: 15px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty-input {
		width: 26px;
		min-width: 20px;
		max-width: 30px;
		height: 34px;
		padding: 0;
		font-size: 12px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn {
		min-height: 40px;
		padding: 9px 9px;
		font-size: 11px;
		gap: 4px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn svg {
		width: 14px;
		height: 14px;
	}
}

/* =========================================================
   12. EXTRA SMALL PHONES
   ========================================================= */

@media (max-width: 360px) {
	.hn-sticky-add-to-cart {
		padding-right: 6px;
		padding-left: 6px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 5px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
		gap: 5px;
		flex-basis: 30%;
	}

	.hn-sticky-add-to-cart .hn-sticky-img {
		flex-basis: 30px;
		width: 30px;
		height: 30px;
		max-width: 30px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		font-size: 10px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
		gap: 4px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
		font-size: 11px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty {
		min-width: 64px;
		height: 34px;
	}

	.hn-sticky-add-to-cart .hn-sticky-q {
		flex-basis: 20px;
		width: 20px;
		min-width: 20px;
		height: 32px;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty-input {
		width: 24px;
		min-width: 18px;
		max-width: 26px;
		height: 32px;
		font-size: 11px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn {
		min-height: 38px;
		padding: 8px 6px;
		font-size: 10px;
		gap: 3px;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn svg {
		display: none;
	}
}

/* =========================================================
   13. VARIABLE PRODUCT PRICE / SALE PRICE
   ========================================================= */

.hn-sticky-add-to-cart .price,
.hn-sticky-add-to-cart .woocommerce-Price-amount {
	color: inherit;
}

.hn-sticky-add-to-cart .price .woocommerce-Price-currencySymbol {
	font-size: inherit;
}

/* Avoid long variation prices pushing the controls off-screen */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
	overflow-wrap: normal;
}

/* =========================================================
   14. REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
	.hn-sticky-add-to-cart,
	.hn-sticky-add-to-cart *,
	.hn-sticky-add-to-cart *::before,
	.hn-sticky-add-to-cart *::after {
		scroll-behavior: auto !important;
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* =========================================================
   15. HIGH CONTRAST MODE
   ========================================================= */

@media (forced-colors: active) {
	.hn-sticky-add-to-cart {
		border-top: 1px solid CanvasText;
	}

	.hn-sticky-add-to-cart .hn-sticky-qty {
		border: 1px solid ButtonText;
	}

	.hn-sticky-add-to-cart .hn-sticky-btn {
		border: 1px solid ButtonText;
	}
}
    
    
    
/* =========================================================
   STICKY BAR — LEFT PRODUCT INFO / RIGHT ACTIONS
   ========================================================= */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
}

/* Left: image + title + price */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 1 1 auto;
	min-width: 0;
}

.hn-sticky-add-to-cart .hn-sticky-product-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 4px;
	flex: 1 1 auto;
	min-width: 0;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
	display: block;
	min-width: 0;
	max-width: 100%;
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	overflow-wrap: anywhere;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
	display: block;
	min-width: 0;
	margin: 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	white-space: normal;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price del {
	margin-right: 5px;
	color: var(--hn-sac-muted);
	font-size: 12px;
	font-weight: 400;
}

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price ins {
	text-decoration: none;
}

/* Right: quantity + Add to Cart */

.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	flex: 0 0 auto;
	min-width: 0;
	margin-left: auto;
}

.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
	flex: 0 0 auto;
	min-width: 0;
}

/* Tablet and mobile */

@media (max-width: 767px) {
	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 10px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
		gap: 8px;
		flex: 1 1 0;
	}

	.hn-sticky-add-to-cart .hn-sticky-product-info {
		gap: 3px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		font-size: 12px;
		line-height: 1.3;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
		font-size: 13px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price del {
		display: none;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-wrap {
		flex: 0 0 auto;
	}

	.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
		gap: 6px;
	}
}

@media (max-width: 480px) {
	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-content {
		gap: 7px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title-wrap {
		gap: 6px;
	}

	.hn-sticky-add-to-cart .hn-sticky-product-info {
		gap: 2px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-title {
		font-size: 11px;
	}

	.hn-sticky-add-to-cart .hn-sticky-add-to-cart-action-price {
		font-size: 12px;
	}

	.hn-sticky-add-to-cart .hn-quantity-add-to-cart {
		gap: 5px;
	}
}