/* NPP Favourites (Shortlist) — Phase 1 */

/* Heart button overlaid on each product card */
li.product { position: relative; }

.npp-fav-btn {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 5;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #ede5e4de;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
	cursor: pointer;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.12s ease, background 0.12s ease;
}
.npp-fav-btn:hover { transform: scale(1.08); }
.npp-fav-btn:focus-visible { outline: 2px solid #2f6b3a; outline-offset: 2px; }

/* Product archives (organic landing pages) — the heart is the only route to a
   purchase, so on pointer devices it expands into a labelled pill on hover/focus.
   Anchored right, so it grows leftwards without shifting the card. Touch stays
   icon-only (sticky :hover, and no room on a narrow card); there the archive
   "how to order" strip carries the explanation instead. */
.npp-fav-btn--labelled .npp-fav-btn__label {
	display: none;
	font-family: 'Cabin', sans-serif;
	font-size: 12px;
	line-height: 1;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #4a4a46;
}
.npp-fav-btn--labelled.is-active .npp-fav-btn__label { color: #fff; }

@media (hover: hover) and (min-width: 768px) {
	.npp-fav-btn--labelled:hover,
	.npp-fav-btn--labelled:focus-visible {
		width: auto;
		max-width: calc(100% - 20px);
		padding: 0 14px 0 11px;
		border-radius: 999px;
		gap: 8px;
		transform: none;
	}
	.npp-fav-btn--labelled:hover .npp-fav-btn__label--add,
	.npp-fav-btn--labelled:focus-visible .npp-fav-btn__label--add {
		display: block;
	}
	.npp-fav-btn--labelled.is-active:hover .npp-fav-btn__label--add,
	.npp-fav-btn--labelled.is-active:focus-visible .npp-fav-btn__label--add {
		display: none;
	}
	.npp-fav-btn--labelled.is-active:hover .npp-fav-btn__label--added,
	.npp-fav-btn--labelled.is-active:focus-visible .npp-fav-btn__label--added {
		display: block;
	}
}

/* One SVG heart everywhere (thin 1.5 stroke) — glyph hidden, shape via mask,
   colour driven by `color` through currentColor. */
.npp-fav-btn__icon,
.npp-fav__pill-icon {
	display: inline-block;
	width: 18px;
	height: 18px;
	flex: 0 0 auto;
	font-size: 0;
	line-height: 0;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19.5 12.572 12 20l-7.5-7.428A5 5 0 1 1 12 6.006a5 5 0 1 1 7.5 6.566'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19.5 12.572 12 20l-7.5-7.428A5 5 0 1 1 12 6.006a5 5 0 1 1 7.5 6.566'/%3E%3C/svg%3E") center / contain no-repeat;
}
.npp-fav-btn__icon {
	color: #767676;
}
.npp-fav-btn.is-active {
	background: #f15648;
}
.npp-fav-btn.is-active .npp-fav-btn__icon {
	color: #fff;
}

/* Single plant page — shortlist heart + back-to-eNursery actions */
.npp-single-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	margin: 16px 0;
}
/* Icon-only circle heart, relocated next to the product title by JS */
.npp-fav-btn--single {
	position: static;
	width: 40px;
	height: 40px;
	flex: 0 0 auto;
	border: 1px solid #cfcfcf;
	border-radius: 50%;
	padding: 0;
	background: #fff;
	box-shadow: none;
}
.npp-fav-btn--single .npp-fav-btn__icon { color: #767676; }
.npp-fav-btn--single .npp-fav-btn__label { display: none; }
/* Title row that receives the heart */
h1.product_title.npp-title-has-fav {
	display: flex;
	align-items: center;
	gap: 14px;
}
/* Single product title in caps to match card titles; botanical stays lower case */
.single-product h1.product_title { text-transform: uppercase; }
/* Hover or active: reverse to filled orange with white heart */
.npp-fav-btn--single:hover,
.npp-fav-btn--single.is-active {
	transform: none;
	background: #f15648;
	border-color: #f15648;
}
.npp-fav-btn--single:hover .npp-fav-btn__icon,
.npp-fav-btn--single.is-active .npp-fav-btn__icon { color: #fff; }
.npp-fav-btn__label--added { display: none; }
/* Quiet text link below the box CTA */
.npp-back-enursery {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 0 0 2px;
	border: 0;
	border-bottom: 1px solid currentColor;
	color: #666;
	font-family: 'Cabin', sans-serif;
	font-size: 14px;
	font-weight: 400;
	text-decoration: none;
}
.npp-back-enursery:hover {
	color: #3d3d3a;
	text-decoration: none;
	border-bottom-color: currentColor;
}

/* Floating pill — single bar that may hold two halves (box + shortlist) */
.npp-fav { position: fixed; right: 20px; bottom: 20px; z-index: 9999; }
.npp-fav__bar {
	display: inline-flex;
	border-radius: 999px;
	overflow: hidden;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.25);
}
.npp-fav__pill,
.npp-fav__box-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 18px;
	border: 0;
	font-family: 'Cabin', sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}
.npp-fav__pill {
	background: #f15648;
	color: #fff;
}
.npp-fav__box-pill {
	background: #fff;
	color: #555;
}
.npp-fav__box-pill:hover { background: #f6f2f1; }
.npp-fav__box-icon { font-size: 18px; display: inline-flex; align-items: center; }
.npp-fav__box-icon img { width: 20px; height: 20px; object-fit: contain; display: block; }
.npp-fav__pill-icon { color: #fff; }
.npp-fav__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #fff;
	color: #f15648;
	font-family: 'Cabin', sans-serif;
	font-size: 13px;
	font-weight: 400;
}

/* Drawer */
.npp-fav__drawer {
	position: fixed;
	right: 20px;
	bottom: 78px;
	width: 320px;
	max-width: calc(100vw - 40px);
	max-height: 70vh;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.28);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: translateY(12px);
	pointer-events: none;
	transition: opacity 0.15s ease, transform 0.15s ease;
}
.npp-fav.is-open #npp-fav-drawer,
.npp-fav.is-box-open #npp-fav-box {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}
.npp-fav__drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid #eee;
}
.npp-fav__drawer-title { margin: 0; font-family: 'Lora', serif; font-size: 16px; font-weight: 400; letter-spacing: 0.5px; }
.npp-fav__close {
	border: 0;
	background: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	color: #666;
}
.npp-fav__list {
	list-style: none;
	margin: 0;
	padding: 8px;
	overflow-y: auto;
}
.npp-fav__item {
	position: relative;
	display: flex;
	align-items: center;
	padding: 6px;
	padding-right: 44px;
	min-height: 58px;
	border-radius: 8px;
}
.npp-fav__item:hover { background: #f5f5f5; }
.npp-fav__item-link {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	min-width: 0;
	text-decoration: none;
	color: inherit;
}
.npp-fav__item-thumb {
	width: 46px;
	height: 46px;
	object-fit: cover;
	border-radius: 2px;
	flex: 0 0 auto;
}
.npp-fav__item-meta { display: flex; flex-direction: column; min-width: 0; }
.npp-fav__item-name {
	font-family: 'Lora', serif;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.npp-fav__item-botanical {
	font-family: 'Lora', serif;
	font-size: 13px;
	font-style: italic;
	color: #666;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.npp-fav__item-remove {
	position: absolute;
	top: 6px;
	right: 8px;
	border: 0;
	background: none;
	font-size: 20px;
	line-height: 1;
	color: #999;
	cursor: pointer;
}
.npp-fav__item-remove:hover { color: #c0392b; }

/* "+" add-to-box button — bottom-right, hidden unless a CPB builder is on the page */
.npp-fav__item-add {
	display: none;
	position: absolute;
	bottom: 6px;
	right: 8px;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #f15648;
	color: #fff;
	font-size: 17px;
	line-height: 1;
	cursor: pointer;
}
.npp-fav__item-add:hover { background: #d8412f; }
.npp-fav--builder .npp-fav__item-add {
	display: flex;
	align-items: center;
	justify-content: center;
}

.npp-fav__empty {
	margin: 0;
	padding: 18px 16px;
	font-family: 'Cabin', sans-serif;
	font-size: 14px;
	color: #777;
	text-align: center;
}

/* Drawer footer — the shortlist's only way forward. Shown when there's a CPB
   builder to fill ("Fill box") or, failing that, a box popover to open
   ("Choose a box"). Hidden only when neither exists, so the drawer never ends
   in a dead end. */
.npp-fav__drawer-foot {
	display: none;
	padding: 12px 16px;
	border-top: 1px solid #eee;
}
.npp-fav--builder .npp-fav__drawer-foot,
.npp-fav--has-box-menu .npp-fav__drawer-foot { display: block; }
/* One button, two labels — see the drawer footer in includes/npp-favourites.php */
.npp-fav__fill-label--fill { display: none; }
.npp-fav--builder .npp-fav__fill-label--fill { display: inline; }
.npp-fav--builder .npp-fav__fill-label--choose { display: none; }
.npp-fav__fill {
	width: 100%;
	padding: 12px;
	border: 0;
	border-radius: 4px;
	background: #f15648;
	color: #fff;
	font-family: 'Cabin', sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
}
.npp-fav__fill:hover { background: #d8412f; }
.npp-fav__fill-note {
	display: block;
	margin-top: 8px;
	font-family: 'Cabin', sans-serif;
	font-size: 12px;
	color: #777;
	text-align: center;
}

/* Box menu (left half) — reuses drawer/item styling, styled like the eNursery card */
.npp-fav__box-drawer { width: 360px; }
.npp-fav__box-drawer .npp-fav__list { margin: 0; padding: 8px; list-style: none; }
.npp-fav__box-drawer .npp-fav__item {
	margin: 0;
	padding-right: 10px;
	text-indent: 0;
	list-style: none;
}
.npp-fav__box-drawer .npp-fav__item::before { content: none; }
.npp-fav__box-drawer .npp-fav__item-link { align-items: center; }
.npp-fav__box-drawer .npp-fav__item-thumb {
	width: 46px;
	height: 46px;
	min-width: 46px;
	flex: 0 0 46px;
	object-fit: cover;
	aspect-ratio: 1 / 1;
}
.npp-fav__item-price {
	font-family: 'Cabin', sans-serif;
	font-size: 12px;
	font-weight: 400;
	color: #999;
}
.npp-fav__item-price del { color: #bbb; font-weight: 400; margin-right: 4px; }
.npp-fav__item-price ins { text-decoration: none; }

/* Inline "Start a plant box" pill CTA on single plant pages (opens the popover) */
.npp-box-cta { margin: 18px 0 10px; text-align: left; }
.npp-box-cta__btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 12px 16px;
	border: 0;
	border-radius: 999px;
	background: #adc087;
	color: #fff;
	font-family: 'Cabin', sans-serif;
	font-size: 13px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 0.12s ease;
}
.npp-box-cta__btn:hover { background: #8fa66b; }
.npp-box-cta__icon { width: 16px; height: auto; display: block; }

/* Per-row CREATE button (mirrors the product card) */
.npp-fav__box-create {
	flex: 0 0 auto;
	align-self: center;
	padding: 8px 10px;
	border: 1px solid #cfcfcf;
	border-radius: 3px;
	background: #fff;
	color: #666;
	font-size: 12px;
	font-weight: 400;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	font-family: 'Cabin', sans-serif;
}
.npp-fav__box-create:hover,
.npp-fav__box-item:hover .npp-fav__box-create {
	background: #f15648;
	border-color: #f15648;
	color: #fff;
}

/* ---------------------------------------------------------------------------
   Plant box builder — heart on each picker tile
   The button is printed inside .cpb-caption (the only per-card hook the box
   plugin offers) and pulled back up over the thumbnail from here. It must stay
   outside .cpb-item-image: that element is the plugin's "add this plant to the
   box" click target, and its :before hover overlay sits at z-index 9.
   --------------------------------------------------------------------------- */
#cpb_product_boxes_custom .cpb-items .cpb-inner {
	position: relative;
}
#cpb_product_boxes_custom .cpb-items .cpb-inner .npp-fav-btn--cpb {
	top: 8px;
	right: 8px;
	z-index: 12;
	width: 32px;
	height: 32px;
}
#cpb_product_boxes_custom .cpb-items .cpb-inner .npp-fav-btn--cpb .npp-fav-btn__icon {
	width: 16px;
	height: 16px;
}
/* Two-up tiles on mobile are nearly eNursery-card width, so the heart grows back
   towards the 38px used there — small tiles, but still a fair tap target. */
@media (max-width: 767px) {
	#cpb_product_boxes_custom .cpb-items .cpb-inner .npp-fav-btn--cpb {
		top: 6px;
		right: 6px;
		width: 34px;
		height: 34px;
	}
}

/* ---------------------------------------------------------------------------
   Plant box builder — heart inside the quick-view popup
   The popup (npp-cpb-enhancements) clones the tile's heart and adds the labels,
   so the shortlist is reachable without closing the popup first. Styled as the
   secondary action beside the green "Add to box": white outline pill that
   reverses to orange, same as the plant-page button.
   --------------------------------------------------------------------------- */
.npp-fav-btn--qv {
	position: static;
	flex: 0 0 auto;
	width: auto;
	height: auto;
	min-height: 46px;
	gap: 8px;
	padding: 12px 18px;
	border: 1px solid #cfcfcf;
	border-radius: 999px;
	background: #fff;
	box-shadow: none;
}
.npp-fav-btn--qv .npp-fav-btn__icon { color: #f15648; }
.npp-fav-btn--qv .npp-fav-btn__label {
	display: block;
	font-family: 'Cabin', sans-serif;
	font-size: 13px;
	line-height: 1;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
	color: #666;
}
.npp-fav-btn--qv .npp-fav-btn__label--added { display: none; }
.npp-fav-btn--qv.is-active .npp-fav-btn__label--add { display: none; }
.npp-fav-btn--qv.is-active .npp-fav-btn__label--added { display: block; }
.npp-fav-btn--qv:hover,
.npp-fav-btn--qv.is-active {
	transform: none;
	background: #f15648;
	border-color: #f15648;
}
.npp-fav-btn--qv:hover .npp-fav-btn__icon,
.npp-fav-btn--qv.is-active .npp-fav-btn__icon,
.npp-fav-btn--qv:hover .npp-fav-btn__label,
.npp-fav-btn--qv.is-active .npp-fav-btn__label { color: #fff; }

/* Narrow phones: the green "Add to box" needs the width, so the heart drops
   back to a circle. */
@media (max-width: 479px) {
	.npp-fav-btn--qv {
		width: 46px;
		min-width: 46px;
		padding: 0;
		border-radius: 50%;
	}
	.npp-fav-btn--qv .npp-fav-btn__label,
	.npp-fav-btn--qv.is-active .npp-fav-btn__label--added { display: none; }
}
