/*
 * Item 7: WPC Smart Wishlist's `[woosw_list]` output (the standalone
 * /wishlist-2/ page and the My Account "Wishlist" tab, both the exact same
 * shortcode) re-skinned to the theme's own card/line look, buttons, empty
 * state and share link - CSS + enqueue condition only (inc/pages/account.php),
 * no plugin files edited and no shortcode output changed.
 *
 * Markup reference (wpc-smart-wishlist.php get_list()/get_items(), layout
 * 'table'): .woosw-list > .woosw-switcher (.woosw-name-wrapper, optional
 * multi-list <select>) + <table class="woosw-items"><tr class="woosw-item">
 * <td class="woosw-item--remove|image|info|actions"> ... + .woosw-actions
 * (.woosw-share, .woosw-copy). The add-to-basket button inside
 * .woosw-item--atc is WooCommerce's own [add_to_cart] shortcode, so it
 * already picks up the theme's global .button/.bb-btn look from main.css.
 *
 * SPECIFICITY NOTE (16 Nov 2026 layout fix): the plugin's own
 * assets/css/frontend.css carries several 3-4-class selectors (e.g.
 * `.woosw-items .woosw-item .woosw-item--remove span:before` at (0,4,1),
 * `.woosw-list table.woosw-items .woosw-item .woosw-item--image` at (0,4,1))
 * that were quietly beating this file's old single-class rules regardless
 * of enqueue order - that's what was leaving the plugin's 14px font-icon
 * "x" and its fixed 100px image column in place instead of this file's
 * intended look, and the plugin's own `.woosw-list .woosw-actions
 * { justify-content: space-between }` splitting the share/copy row apart
 * (the "empty space on the right" Gary saw). Every rule below that competes
 * with one of those is now nested to at least the same depth so it wins on
 * specificity, not load order. `enqueue(... array('bbt-main') ...)` at
 * priority 21 in inc/pages/account.php still makes sure this file prints
 * after the plugin's own stylesheet as a second safety net.
 *
 * Companion JS: assets/js/wishlist-page.js - adds the real a11y + icon-only
 * treatment the markup itself can't give us (no aria-label on the remove
 * control, a bare "Copy"-text button, no CTA on the empty state). CSS alone
 * can't add attributes or rewrite text nodes.
 */

.woosw-list {
	background: var(--bb-surface);
	border: 1px solid var(--bb-border);
	border-radius: var(--bb-r-panel);
	padding: clamp(18px, 2.4vw, 28px);
	margin: 0 0 20px;
	width: 100%;
	box-sizing: border-box;
}
.woosw-list-not-found { text-align: center; }

/*
 * 16 Nov 2026, Gary: "/wishlist-2/ ... very cramped" - the standalone page
 * uses page.php's generic content template, whose .bb-content__body carries
 * a 760px reading-width cap (main.css) meant for long-form text pages, not
 * a tool like this. The My Account tab renders through a different wrapper
 * (.bb-commerce__body, no cap) so it isn't actually affected today, but the
 * override is added defensively there too per his instruction, in case that
 * ever changes.
 */
.bb-content__body:has(.woosw-list),
.bb-commerce__body:has(.woosw-list) {
	max-width: none;
}

/* ---------- Header: list name + multi-list switcher ---------- */
.woosw-list .woosw-switcher { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 18px; }
.woosw-list .woosw-name-wrapper { display: flex; align-items: center; gap: 10px; min-width: 0; }
.woosw-list .woosw-name {
	font-family: var(--bb-font-display);
	font-size: clamp(1.375rem, 1.2rem + .5vw, 1.75rem); /* G1: panel-heading size, not the 34px global h2 */
	font-weight: 800;
	color: var(--bb-ink);
}
.woosw-list .woosw-detail-rename-btn { border: 0; background: transparent; color: var(--bb-muted); cursor: pointer; font-size: .9375rem; }
.woosw-list .woosw-detail-rename-btn:hover { color: var(--bb-ink); }
.woosw-list .woosw-switcher-dropdown,
.woosw-list .woosw-add-collab-btn.button { min-height: 40px; }
.woosw-list .woosw-switcher-dropdown { width: auto; min-width: 180px; }

/* ---------- Collaboration / search-to-add (only shown when those plugin features are on) ---------- */
.woosw-list .woosw-collabable-toggle { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: .875rem; color: var(--bb-muted); }
.woosw-list .woosw-search-product-wrap { margin: 0 0 16px; }
.woosw-list .woosw-search-product-wrap.woosw-hidden { display: none; }
.woosw-list .woosw-search-product-inner { position: relative; }
.woosw-list .woosw-search-product-input { padding-left: 40px; }
.woosw-list .woosw-search-product-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; background-color: var(--bb-muted); -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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat; }

/* ---------- Item rows ---------- */
/* Grid, not flex: a fixed column plan that always adds up to the full row
   width (image | info [1fr] | actions | remove) instead of leaving a gap
   when the info column's own content is narrower than its flex-basis.
   16 Nov 2026, Gary: one clean line, 24px padding, remove on the FAR
   RIGHT (the plugin's own markup puts the remove <td> FIRST in the DOM -
   `order` below re-sequences it visually without touching that markup;
   CSS Grid auto-placement honours `order` for cell assignment, not just
   paint order). */
.woosw-list .woosw-items { display: block; width: 100%; border-collapse: collapse; }
/* The plugin's markup never writes an explicit <tbody> around its <tr>s, so
   the HTML parser inserts one implicitly - and an unstyled <tbody> (still
   `display: table-row-group` by default, even though the <table> itself is
   `display: block` above) becomes the <tr>'s real containing block for its
   own `width: 100%`, sizing it to its row content instead of the full
   table width (the "empty space on the right" Gary saw). `display: contents`
   removes that box entirely so each <tr> lays out as if it were a direct
   block child of `.woosw-items` itself. */
.woosw-list .woosw-items tbody { display: contents; }
.woosw-list .woosw-items .woosw-item {
	display: grid;
	grid-template-columns: 88px minmax(0, 1fr) auto 36px;
	align-items: center;
	column-gap: 16px;
	width: 100%;
	padding: 24px 4px;
	border-top: 1px solid var(--bb-border);
}
.woosw-list .woosw-items > .woosw-item:first-child { border-top: 0; }

.woosw-list .woosw-items .woosw-item .woosw-item--remove,
.woosw-list .woosw-items .woosw-item .woosw-item--image,
.woosw-list .woosw-items .woosw-item .woosw-item--info,
.woosw-list .woosw-items .woosw-item .woosw-item--actions {
	display: flex;
	width: auto;
	flex: none;
	/* No boxed sub-cells: every one of these sits directly on the row, not
	   in its own card. Defensive against any inherited border/background
	   (e.g. the plugin's `[add_to_cart]` shortcode markup, a bare
	   <p class="product woocommerce">). */
	background: none;
	border: 0;
	padding: 0;
	box-shadow: none;
}
.woosw-list .woosw-items .woosw-item .woosw-item--image  { order: 1; }
.woosw-list .woosw-items .woosw-item .woosw-item--info   { order: 2; }
.woosw-list .woosw-items .woosw-item .woosw-item--actions { order: 3; }
.woosw-list .woosw-items .woosw-item .woosw-item--remove { order: 4; }

/* Remove: 36px round icon button (matches the basket's remove treatment -
   ink/muted at rest, red-tinted on hover) instead of the plugin's 14px
   grey font-icon "x". The plugin's span carries no accessible name of its
   own (no button role, no aria-label) - wishlist-page.js adds role="button",
   tabindex, aria-label and Enter/Space support; this file only draws it. */
.woosw-list .woosw-items .woosw-item .woosw-item--remove {
	width: 36px;
	height: 36px;
	align-items: center;
	justify-content: center;
	justify-self: end;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.woosw-list .woosw-items .woosw-item .woosw-item--remove:hover,
.woosw-list .woosw-items .woosw-item .woosw-item--remove:focus-visible {
	background: #fdf2f2;
}
.woosw-list .woosw-items .woosw-item .woosw-item--remove:focus-visible {
	outline: 3px solid var(--bb-ink);
	outline-offset: 2px;
}
.woosw-list .woosw-items .woosw-item .woosw-item--remove span {
	display: block;
	width: 16px;
	height: 16px;
	background-color: var(--bb-muted);
	-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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6L6 18'/%3E%3C/svg%3E") center/contain no-repeat;
	transition: background-color .15s;
}
/* Neutralise the plugin's own icon-font glyph (span:before, content "\e918")
   so it never renders underneath/behind our mask icon. */
.woosw-list .woosw-items .woosw-item .woosw-item--remove span::before,
.woosw-list .woosw-items .woosw-item .woosw-item--remove span.woosw-item--removing::before {
	content: none;
	display: none;
	animation: none;
}
.woosw-list .woosw-items .woosw-item .woosw-item--remove:hover span,
.woosw-list .woosw-items .woosw-item .woosw-item--remove:focus-visible span {
	background-color: #b42318;
}
/* Removing state (plugin toggles this class while the AJAX call is in flight). */
.woosw-list .woosw-items .woosw-item .woosw-item--remove span.woosw-item--removing {
	opacity: .5;
}

/* 88px, object-fit: contain (never cropped) - Gary, 16 Nov 2026. */
.woosw-list .woosw-items .woosw-item .woosw-item--image { width: 88px; height: 88px; border-radius: var(--bb-r-small); overflow: hidden; background: var(--bb-ground); }
.woosw-list .woosw-items .woosw-item .woosw-item--image a,
.woosw-list .woosw-items .woosw-item .woosw-item--image img { display: block; width: 100%; height: 100%; object-fit: contain; }

/* Name + price + date, stacked small and muted (no boxed card around it). */
.woosw-list .woosw-items .woosw-item .woosw-item--info { flex-direction: column; justify-content: center; gap: 4px; min-width: 0; }
.woosw-list .woosw-items .woosw-item .woosw-item--name a { font-size: .9375rem; font-weight: 600; color: var(--bb-ink); text-decoration: none; }
.woosw-list .woosw-items .woosw-item .woosw-item--name a:hover { text-decoration: underline; }
.woosw-list .woosw-items .woosw-item .woosw-item--price { font-size: .9375rem; font-weight: 700; color: var(--bb-ink); }
.woosw-list .woosw-items .woosw-item .woosw-item--price del { font-size: .8125rem; font-weight: 400; color: var(--bb-muted); margin-right: 4px; }
.woosw-list .woosw-items .woosw-item .woosw-item--price-change { font-size: .75rem; font-weight: 600; }
.woosw-list .woosw-items .woosw-item .woosw-item--price-increase { color: var(--bb-urgency); }
.woosw-list .woosw-items .woosw-item .woosw-item--price-decrease { color: var(--bb-success); }
.woosw-list .woosw-items .woosw-item .woosw-item--time { font-size: .8125rem; color: var(--bb-muted); }
.woosw-list .woosw-items .woosw-item .woosw-item--note { font-size: .8125rem; color: var(--bb-muted); }
.woosw-list .woosw-items .woosw-item .woosw-item--note-add input[type="text"] { min-height: 36px; margin-right: 6px; }

/* Stock + "Add to basket" side by side, ON the row line (no card around
   either) - Gary: "stock (muted, green dot) | Add to basket button". */
/* flex-wrap, not nowrap: an out-of-stock wishlist item's .woosw-item--stock
   doesn't just hold the one-line "Sold out" status - bb-back-in-stock's
   `woocommerce_get_stock_html` filter (class-bbbis-frontend.php) appends
   its whole subscribe form to THIS SAME wc_get_stock_html() call here too
   (get_items() in the plugin echoes it straight into this div), so this
   cell needs to be able to hold a multi-line form, not force everything
   onto one row. */
.woosw-list .woosw-items .woosw-item .woosw-item--actions { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; flex: none; max-width: 100%; }
.woosw-list .woosw-items .woosw-item .woosw-item--stock { font-size: .8125rem; color: var(--bb-muted); max-width: 100%; }
.woosw-list .woosw-items .woosw-item .woosw-item--stock p { margin: 0; }
/* Containment for that injected back-in-stock form specifically. */
.woosw-list .woosw-items .woosw-item .woosw-item--stock .bbbis-form-wrap {
	flex-basis: 100%;
	width: 100%;
	max-width: 100%;
	margin: 8px 0 0;
	white-space: normal;
	box-sizing: border-box;
}
.woosw-list .woosw-items .woosw-item .woosw-item--stock .in-stock,
.woosw-list .woosw-items .woosw-item .woosw-item--stock .out-of-stock {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-weight: 600;
	color: var(--bb-muted);
}
.woosw-list .woosw-items .woosw-item .woosw-item--stock .in-stock::before,
.woosw-list .woosw-items .woosw-item .woosw-item--stock .out-of-stock::before {
	content: "";
	width: 7px;
	height: 7px;
	flex: none;
	border-radius: 50%;
	background: var(--bb-success);
}
.woosw-list .woosw-items .woosw-item .woosw-item--stock .out-of-stock::before { background: var(--bb-urgency); }
.woosw-list .woosw-items .woosw-item .woosw-item--atc { width: auto; }
/* The plugin's [add_to_cart] shortcode wraps the button in its own
   <p class="product woocommerce ...">, a WooCommerce convention with its
   own default margin that otherwise reads as yet another boxed sub-cell. */
.woosw-list .woosw-items .woosw-item .woosw-item--atc p.product {
	margin: 0;
	background: none;
	border: 0;
	box-shadow: none;
}
.woosw-list .woosw-items .woosw-item .woosw-item--atc .button,
.woosw-list .woosw-items .woosw-item .woosw-item--atc .add_to_cart_button {
	width: auto;
	min-height: 40px;
	padding: 0 20px;
	font-size: .8125rem;
	white-space: nowrap;
}

/* ---------- Suggested products ---------- */
.woosw-list .woosw-suggested { margin-top: 20px; }
.woosw-list .woosw-suggested-heading { font-size: .9375rem; font-weight: 700; color: var(--bb-ink); padding-top: 16px; border-top: 1px solid var(--bb-border); }
.woosw-list .woosw-suggested-items .woosw-item--add { flex: none; width: 32px; display: flex; align-items: center; justify-content: center; color: var(--bb-muted); }

/* ---------- Empty states ---------- */
.woosw-list .woosw-popup-content-mid-message,
.woosw-list-not-found .woosw-empty {
	padding: 40px 20px;
	text-align: center;
	color: var(--bb-muted);
	font-size: 1rem;
}
/* CTA appended by wishlist-page.js right after the empty message. */
.bb-wishlist-empty-cta {
	display: flex;
	justify-content: center;
	margin: 4px 0 8px;
}
.bb-wishlist-empty-cta .bb-btn { min-height: 44px; padding: 0 24px; }

/* ---------- Share + copy link: one joined control, label above ---------- */
.woosw-list .woosw-actions {
	margin-top: 20px;
	padding-top: 18px;
	border-top: 1px solid var(--bb-border);
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: flex-start;
	gap: 18px 32px;
}
.woosw-list .woosw-share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.woosw-list .woosw-share-label { font-size: .8125rem; font-weight: 600; color: var(--bb-muted); white-space: nowrap; }
.woosw-list .woosw-share a {
	display: inline-grid;
	place-items: center;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	background: var(--bb-ground);
	color: var(--bb-ink);
	text-decoration: none;
	font-size: .75rem;
}
.woosw-list .woosw-share a:hover { background: var(--bb-yellow); }

/*
 * 16 Nov 2026, Gary: "the URL field and the copy icon button must sit side
 * by side in ONE joined control ... with the label 'Share wishlist' above
 * it". The plugin's markup is `.woosw-copy > .woosw-copy-label +
 * .woosw-copy-url + .woosw-copy-btn` - three flex SIBLINGS, not pre-nested
 * into a field+button group. `flex-wrap: wrap` + the label's
 * `flex-basis: 100%` forces it onto its own line above; no `gap` on the
 * flex row plus the field's `border-right: 0` makes the two touch with a
 * single 1px divider (the button's own left border) instead of a visible
 * seam, with matching outer radii only on the two true outer corners.
 */
.woosw-list .woosw-copy {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	max-width: 520px;
}
.woosw-list .woosw-copy-label {
	flex: 1 0 100%;
	margin: 0 0 8px;
	font-size: .8125rem;
	font-weight: 600;
	color: var(--bb-muted);
}
.woosw-list .woosw-copy-url { flex: 1 1 auto; min-width: 0; }
.woosw-list .woosw-copy-url input {
	width: 100%;
	height: 44px;
	min-height: 44px;
	padding: 0 14px;
	font-size: .8125rem;
	color: var(--bb-ink);
	background: var(--bb-ground);
	border: 1px solid var(--bb-border);
	border-right: 0;
	border-radius: var(--bb-r-control) 0 0 var(--bb-r-control);
}
.woosw-list .woosw-copy-url input:focus-visible { position: relative; z-index: 1; border-right: 1px solid var(--bb-border); outline: 3px solid var(--bb-ink); outline-offset: 1px; }

/* Copy button: icon-only, joined flush onto the field's right end, same
   44px height, tooltip via the theme's own [data-bbt-tip] attribute
   (card-interactions.css) - wishlist-page.js sets `data-bbt-tip` and
   empties the button's text node; this file only provides the joined
   look + the two-sheets "copy" glyph, and the success (green check) state
   once .is-copied is toggled. */
.woosw-list .woosw-copy-btn { flex: none; }
.woosw-list .woosw-copy-btn .button {
	display: inline-grid;
	place-items: center;
	width: 48px;
	height: 44px;
	min-height: 44px;
	padding: 0;
	border-radius: 0 var(--bb-r-control) var(--bb-r-control) 0;
	background: var(--bb-ground);
	border: 1px solid var(--bb-border);
	color: var(--bb-ink);
}
.woosw-list .woosw-copy-btn .button:hover { background: var(--bb-yellow); border-color: var(--bb-yellow); }
.woosw-list .woosw-copy-btn .button:focus-visible { position: relative; z-index: 1; outline: 3px solid var(--bb-ink); outline-offset: 1px; }
.woosw-list .woosw-copy-btn .button::before {
	content: "";
	display: block;
	width: 16px;
	height: 16px;
	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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%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='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2'/%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'/%3E%3C/svg%3E") center/contain no-repeat;
}
.woosw-list .woosw-copy-btn .button.is-copied {
	background: var(--bb-success-bg);
	border-color: var(--bb-success);
	color: var(--bb-success);
}
.woosw-list .woosw-copy-btn .button.is-copied::before {
	-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='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%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='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center/contain no-repeat;
}

/*
 * ---------- Narrow (tablet + mobile): stacked card row ----------
 * 16 Nov 2026, Gary: "image left 72px; name/price/stock beside it; button
 * full width below; remove at top right." The stock + "Add to basket"
 * pair only exists as a unit because they share one <td class="woosw-
 * item--actions"> in the plugin's markup; `display: contents` on that
 * wrapper (same technique as the <tbody> fix above) removes ITS box so
 * .woosw-item--stock and .woosw-item--atc become direct grid items here,
 * free to sit in their own named areas instead of being stuck together.
 */
@media (max-width: 760px) {
	.woosw-list .woosw-items .woosw-item {
		grid-template-columns: 72px minmax(0, 1fr) 36px;
		grid-template-areas:
			"image info   remove"
			"image stock  stock"
			"atc   atc    atc";
		row-gap: 8px;
		column-gap: 14px;
		padding: 20px 4px;
	}
	.woosw-list .woosw-items .woosw-item .woosw-item--image { grid-area: image; width: 72px; height: 72px; align-self: start; }
	.woosw-list .woosw-items .woosw-item .woosw-item--info { grid-area: info; }
	.woosw-list .woosw-items .woosw-item .woosw-item--remove { grid-area: remove; justify-self: end; align-self: start; }
	.woosw-list .woosw-items .woosw-item .woosw-item--actions { display: contents; }
	.woosw-list .woosw-items .woosw-item .woosw-item--stock { grid-area: stock; }
	.woosw-list .woosw-items .woosw-item .woosw-item--atc { grid-area: atc; width: 100%; margin-top: 2px; }
	.woosw-list .woosw-items .woosw-item .woosw-item--atc .button,
	.woosw-list .woosw-items .woosw-item .woosw-item--atc .add_to_cart_button { width: 100%; }

	.woosw-list .woosw-switcher { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 400px) {
	.woosw-list .woosw-copy { max-width: none; }
}
