/**
 * iScents Sticky Add To Cart — frontend styles
 *
 * Design intent: a quiet, confident, "hotel concierge desk" strip —
 * plenty of white space, a single hairline + soft shadow doing the
 * separation work, warm champagne-gold as the one accent colour, and a
 * near-black button that reads as premium rather than loud.
 *
 * Dynamic values (colours, height, shadow, z-index, per-device element
 * visibility) are injected as CSS custom properties + extra rules by
 * ISCENTS_Sticky_Cart::build_dynamic_css() and printed inline right
 * after this file — see that method for the source of truth.
 */

#isc-sticky-cart {
	--isc-bg: #ffffff;
	--isc-text: #1a1a1a;
	--isc-price: #1a1a1a;
	--isc-accent: #b8965a;
	--isc-btn-bg: #1a1a1a;
	--isc-btn-text: #ffffff;
	--isc-btn-hover: #b8965a;
	--isc-border: #ececec;
	--isc-shadow: -1px 0 6px rgba(0, 0, 0, .2);
	--isc-font: inherit;
	--isc-height: 84px;
	--isc-zindex: 9999;

	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	background: var(--isc-bg);
	box-shadow: var(--isc-shadow);
	border-top: 1px solid var(--isc-border);
	z-index: var(--isc-zindex);
	font-family: var(--isc-font);
	color: var(--isc-text);
	transform: translateY(100%);
	opacity: 0;
	transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
	will-change: transform;
	box-sizing: border-box;
}

#isc-sticky-cart * {
	box-sizing: border-box;
}

#isc-sticky-cart.isc-is-visible {
	transform: translateY(0);
	opacity: 1;
}

#isc-sticky-cart.isc-is-hidden {
	pointer-events: none;
}

.isc-sticky-cart__inner {
	max-width: 1280px;
	margin: 0 auto;
	height: var(--isc-height);
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: 18px;
	padding: 0 28px;
}

/* Every direct element is a flex item that never wraps onto a new line;
   name/price truncate before the row would ever break. */
.isc-el {
	display: flex;
	align-items: center;
	min-width: 0;
}

/* ---------- Image ---------- */
.isc-sticky-cart__image {
	flex: 0 0 auto;
}
.isc-sticky-cart__image img {
	width: 52px;
	height: 52px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--isc-border);
	display: block;
}

/* ---------- Name ---------- */
.isc-sticky-cart__name {
	flex: 1 1 auto;
	min-width: 60px;
	overflow: hidden;
}
.isc-sticky-cart__name-text {
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 0.01em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	display: block;
}

/* ---------- Price ---------- */
.isc-sticky-cart__price {
	flex: 0 0 auto;
	font-size: 16px;
	font-weight: 600;
	color: var(--isc-price);
	white-space: nowrap;
}
.isc-sticky-cart__price .amount {
	color: var(--isc-price);
}
.isc-sticky-cart__price del {
	opacity: 0.45;
	font-weight: 400;
	margin-right: 4px;
}
.isc-sticky-cart__price ins {
	text-decoration: none;
}

/* ---------- Variations ---------- */
.isc-sticky-cart__variations {
	flex: 0 0 auto;
	gap: 8px;
}
.isc-sticky-cart__variations select {
	height: 38px;
	border: 1px solid var(--isc-border);
	border-radius: 20px;
	padding: 0 32px 0 14px;
	font-size: 13px;
	background-color: #fafafa;
	color: var(--isc-text);
	max-width: 140px;
	cursor: pointer;
	appearance: none;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3e%3cpath fill='%231a1a1a' d='M6 8 0 0h12z'/%3e%3c/svg%3e");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 10px 6px;
	transition: border-color 0.2s ease;
}
.isc-sticky-cart__variations select:focus {
	outline: none;
	border-color: var(--isc-accent);
}

/* ---------- Quantity ---------- */
.isc-sticky-cart__quantity {
	flex: 0 0 auto;
	border: 1px solid var(--isc-border);
	border-radius: 24px;
	overflow: hidden;
	height: 38px;
}
.isc-qty-btn {
	width: 34px;
	height: 38px;
	border: none;
	background: transparent;
	color: var(--isc-text);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}
.isc-qty-btn:hover {
	background: var(--isc-accent);
	color: #ffffff;
}
.isc-sticky-cart__qty-input {
	width: 38px;
	height: 38px;
	border: none;
	border-left: 1px solid var(--isc-border);
	border-right: 1px solid var(--isc-border);
	text-align: center;
	font-size: 14px;
	font-weight: 600;
	color: var(--isc-text);
	-moz-appearance: textfield;
	background: transparent;
}
.isc-sticky-cart__qty-input::-webkit-outer-spin-button,
.isc-sticky-cart__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* ---------- Button ---------- */
.isc-sticky-cart__button {
	flex: 0 0 auto;
	margin-left: auto;
}
.isc-sticky-cart__add-btn {
	position: relative;
	height: 46px;
	padding: 0 30px;
	border: none;
	border-radius: 26px;
	background: var(--isc-btn-bg);
	color: var(--isc-btn-text);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.25s ease, transform 0.15s ease, box-shadow 0.25s ease;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}
.isc-sticky-cart__add-btn:hover:not(:disabled) {
	background: var(--isc-btn-hover);
	transform: translateY(-1px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.16);
}
.isc-sticky-cart__add-btn:active:not(:disabled) {
	transform: translateY(0);
}
.isc-sticky-cart__add-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.isc-btn-spinner {
	display: none;
	width: 14px;
	height: 14px;
	margin-left: 8px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	vertical-align: middle;
	animation: isc-spin 0.7s linear infinite;
}
.isc-sticky-cart__add-btn.is-loading .isc-btn-spinner {
	display: inline-block;
}
.isc-sticky-cart__add-btn.is-loading .isc-btn-text {
	opacity: 0.7;
}
.isc-sticky-cart__add-btn.is-added {
	background: #2e7d32;
}

@keyframes isc-spin {
	to {
		transform: rotate(360deg);
	}
}

/* Give the page a little breathing room at the bottom so the sticky bar
   never overlaps footer content once it is visible. */
body.isc-sticky-cart-active {
	scroll-padding-bottom: var(--isc-height, 84px);
}

/* ------------------------------------------------------------------ */
/* Responsive base rules. Fine-grained per-element visibility per      */
/* device is injected dynamically (see build_dynamic_css()) — these    */
/* rules just tighten up spacing/typography so whatever elements are   */
/* left always sit comfortably in a single row.                        */
/* ------------------------------------------------------------------ */

@media (max-width: 1024px) {
	.isc-sticky-cart__inner {
		gap: 12px;
		padding: 0 18px;
	}
	.isc-sticky-cart__name-text {
		font-size: 14px;
	}
	.isc-sticky-cart__add-btn {
		padding: 0 22px;
		height: 42px;
	}
}

@media (max-width: 600px) {
	.isc-sticky-cart__inner {
		gap: 10px;
		padding: 0 14px;
	}
	.isc-sticky-cart__price {
		font-size: 15px;
	}
	.isc-sticky-cart__quantity {
		height: 36px;
	}
	.isc-qty-btn,
	.isc-sticky-cart__qty-input {
		height: 36px;
	}
	.isc-sticky-cart__add-btn {
		padding: 0 18px;
		height: 40px;
		font-size: 13px;
		flex: 1 1 auto;
	}
	.isc-sticky-cart__button {
		flex: 1 1 auto;
		margin-left: 0;
	}
	.isc-sticky-cart__add-btn {
		width: 100%;
	}
}

/* Respect visitors who've asked for reduced motion. */
@media (prefers-reduced-motion: reduce) {
	#isc-sticky-cart,
	.isc-sticky-cart__add-btn,
	.isc-qty-btn {
		transition: none !important;
		animation: none !important;
	}
}
