/**
 * Off-Canvas Wishlist Panel — Content styles only.
 *
 * Panel container styles (width, backdrop, shadow, close button) are
 * generated dynamically in wishlist-offcanvas.php by reading the cart
 * panel settings from Blocksy header builder.
 *
 * @date 2026-03-16
 * @package Blocksy_Child
 */

/* ==========================================================================
   Panel Inner Layout
   ========================================================================== */

/* ==========================================================================
   Panel Header — heart icon + title + count
   ========================================================================== */

/* Heading — uses global h2 styling via CSS variables */

/* Heart icon — inherits heading color */

.ct-wishlist-panel-count {
	font-weight: 400;
	opacity: 0.6;
}

/* ==========================================================================
   Panel Content
   ========================================================================== */
#woo-wishlist-panel .ct-panel-content {
	flex: 1;
	overflow-y: auto;
}


/* ==========================================================================
   Wishlist Items — matches mini cart item layout
   ========================================================================== */
.ct-wishlist-items {
	list-style: none;
	padding: 0;
	margin: 0;
}

.ct-wishlist-item {
	display: flex;
	align-items: flex-start;
	gap: 16px;
	padding: 16px 0;
	border-bottom: 1px solid var(--theme-border-color, #e0e0e0);
	position: relative;
}

.ct-wishlist-item:last-child {
	border-bottom: none;
}

/* Thumbnail */
.ct-wishlist-item .ct-media-container {
	width: 70px;
	min-width: 70px;
	border-radius: var(--theme-border-radius, 3px);
	overflow: hidden;
}

.ct-wishlist-item .ct-media-container img {
	width: 100%;
	height: auto;
	display: block;
}

/* Product info */
.ct-wishlist-item-info {
	flex: 1;
	min-width: 0;
	padding-right: 24px;
}

.ct-wishlist-item-info a {
	display: block;
	font-size: 14px;
	font-weight: 500;
	color: var(--theme-headings-color, var(--theme-text-color, #333));
	text-decoration: none;
	line-height: 1.4;
	margin-bottom: 6px;
}

.ct-wishlist-item-info a:hover {
	color: var(--theme-link-hover-color, var(--theme-palette-color-1, #000));
}

.ct-wishlist-item-info .price {
	font-size: 14px;
	font-weight: 600;
	color: var(--theme-text-color, #333);
}

/* Remove button — trash icon matching mini cart */
.ct-wishlist-remove {
	position: absolute;
	top: 16px;
	right: 0;
	background: none;
	border: none;
	cursor: pointer;
	padding: 4px;
	color: var(--theme-text-color, #999);
	opacity: 0.4;
	transition: opacity 0.2s;
}

.ct-wishlist-remove:hover {
	opacity: 1;
}

.ct-wishlist-remove svg {
	display: block;
	fill: currentColor;
}

/* ==========================================================================
   Empty State — centered
   ========================================================================== */
.ct-wishlist-empty {
	text-align: center;
	padding: 40px 20px 20px;
}

.ct-wishlist-empty-message {
	font-size: 15px;
	font-weight: 500;
	color: var(--theme-text-color, #333);
	margin: 0;
}

/* ==========================================================================
   Error State
   ========================================================================== */
.ct-wishlist-error {
	text-align: center;
	padding: 40px 20px;
	color: var(--theme-text-color, #666);
	font-size: 14px;
	line-height: 1.5;
}

/* ==========================================================================
   Guest Sign-Up Prompt — always visible for guests
   ========================================================================== */
.ct-wishlist-guest-notice {
	margin: 20px 0;
	padding: 20px;
	background: var(--theme-palette-color-6, #f5f5f5);
	border-radius: 8px;
	text-align: center;
}

.ct-wishlist-guest-notice p {
	font-size: 13px;
	color: var(--theme-text-color, #666);
	margin: 0 0 16px 0;
	line-height: 1.5;
}

.ct-wishlist-signup-btn {
	display: block;
	width: 100%;
	padding: 14px 24px;
	background: var(--theme-button-background-initial-color, #333);
	color: var(--theme-button-text-initial-color, #fff);
	border-radius: var(--theme-button-border-radius, 8px);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: background 0.2s;
	box-sizing: border-box;
}

.ct-wishlist-signup-btn:hover {
	background: var(--theme-button-background-hover-color, var(--theme-palette-color-2, #555));
	color: var(--theme-button-text-initial-color, #fff);
}

/* ==========================================================================
   Continue Shopping — logged-in empty state
   ========================================================================== */
.ct-wishlist-continue {
	width: 100%;
	margin: 20px 0;
}

.ct-wishlist-continue-btn {
	display: block;
	width: 100%;
	padding: 14px 24px;
	background: var(--theme-button-background-initial-color, #333);
	color: var(--theme-button-text-initial-color, #fff);
	border-radius: var(--theme-button-border-radius, 8px);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	transition: background 0.2s;
	box-sizing: border-box;
}

.ct-wishlist-continue-btn:hover {
	background: var(--theme-button-background-hover-color, var(--theme-palette-color-2, #555));
	color: var(--theme-button-text-initial-color, #fff);
}

/* ==========================================================================
   Suggested Products — positioned at bottom of panel
   ========================================================================== */
.ct-wishlist-suggested {
	flex-shrink: 0;
	border-top: 1px solid var(--theme-border-color, #e0e0e0);
	padding: 0 24px 24px;
}

.ct-wishlist-suggested:empty {
	display: none;
}

/* Match mini cart suggested products title */
.ct-wishlist-suggested .ct-module-title {
	padding-top: 16px;
	margin-bottom: 12px;
}

/* Make flexy items visible + scrollable (Blocksy flexy JS doesn't init
   inside our panel). Updated 2026-04-26 after Blocksy 2.1.38 update —
   the new flexy.min.css translates items -100% off-screen and uses
   order:1/2 reordering to prepare for JS-driven slide animation. Without
   the JS, items stay off-screen. We override here. */
.ct-wishlist-suggested .flexy {
	overflow: visible;
}

.ct-wishlist-suggested .flexy-view {
	height: auto;
}

.ct-wishlist-suggested .flexy-items {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	gap: 12px;
}

/* Neutralise Blocksy's off-screen translate + order:2 (added in 2.1.38) */
.ct-wishlist-suggested .flexy-items > * {
	transform: none !important;
	order: 0 !important;
	flex: 0 0 calc(50% - 6px) !important;
	max-width: calc(50% - 6px) !important;
	min-height: 0 !important;
}

.ct-wishlist-suggested .flexy-items::-webkit-scrollbar {
	display: none;
}

.ct-wishlist-suggested .flexy-item {
	scroll-snap-align: start;
	flex-shrink: 0;
}

/* Blocksy 2.1.38 squishes items 3+ to height:1px when data-flexy=no.
   Override so all items stay visible. */
.ct-wishlist-suggested .bc-wishlist-suggested-grid[data-flexy*="no"] .flexy-item:nth-child(n + 3) {
	height: auto !important;
}

/* ==========================================================================
   Wishlist Remove Icon — match mini cart's Blocksy remove styling.
   WHY: Consistency between cart and wishlist off-canvas panels.
   Mini cart uses Blocksy's .remove class with clean opacity transition.
   @date 2026-03-19
   ========================================================================== */
.ct-wishlist-remove {
	opacity: 0.35;
}

.ct-wishlist-remove:hover {
	opacity: 0.8;
}

.ct-wishlist-remove svg {
	width: 10px;
	height: 10px;
}

/* ==========================================================================
   Mini Cart Empty State — Recently Viewed + Favourites + Bestsellers.
   Renders via the SAME shared helper as the wishlist drawer (see
   inc/helpers.php → bc_render_blocksy_suggested_carousel). The unique
   class `bc-minicart-suggested-grid` is the cart-fragments-safe rename
   of Blocksy's `.ct-suggested-products--mini-cart`.
   @date 2026-04-26
   ========================================================================== */
.bc-empty-cart-state {
	padding: 0 0 24px;
}

.bc-empty-cart-state .wc-empty-cart-message,
.bc-empty-cart-state .return-to-shop {
	padding: 0 24px;
}

.bc-empty-cart-section {
	padding: 16px 24px 0;
}

.bc-empty-cart-section + .bc-empty-cart-section {
	border-top: 1px solid var(--theme-border-color, #e0e0e0);
	margin-top: 16px;
}

.bc-empty-cart-section-title {
	font-size: 14px;
	font-weight: 600;
	margin: 0 0 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Apply the same flexy-neutralisation rules to the mini-cart grid that
   we apply to the wishlist grid. Both render via the same Blocksy
   template; both have flexy hooks stripped by the helper. */
.bc-empty-cart-section .flexy {
	overflow: visible;
}

.bc-empty-cart-section .flexy-view {
	height: auto;
}

.bc-empty-cart-section .flexy-items {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	gap: 12px;
}

.bc-empty-cart-section .flexy-items > * {
	transform: none !important;
	order: 0 !important;
	flex: 0 0 calc(50% - 6px) !important;
	max-width: calc(50% - 6px) !important;
	min-height: 0 !important;
}

.bc-empty-cart-section .flexy-items::-webkit-scrollbar {
	display: none;
}

.bc-empty-cart-section .flexy-item {
	scroll-snap-align: start;
	flex-shrink: 0;
}

.bc-empty-cart-section .bc-minicart-suggested-grid[data-flexy*="no"] .flexy-item:nth-child(n + 3) {
	height: auto !important;
}

/* Hide carousel arrows in BOTH drawers — we render as static grid. */
.ct-wishlist-suggested .ct-slider-arrows,
.bc-empty-cart-section .ct-slider-arrows {
	display: none !important;
}

/* ==========================================================================
   Simple-grid fallback (LAYER 5 of the helper's defense-in-depth).
   When Blocksy's template fails entirely, the helper renders this
   self-contained markup. Style it to LOOK like the Blocksy template
   so users never notice the fallback kicked in.
   @date 2026-04-26
   ========================================================================== */
.bc-fallback-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

.bc-fallback-item {
	display: flex;
	flex-direction: column;
	gap: 8px;
	color: inherit;
	text-decoration: none;
}

.bc-fallback-item:hover {
	opacity: 0.85;
}

.bc-fallback-image {
	aspect-ratio: 1 / 1;
	overflow: hidden;
	background: var(--theme-palette-color-7, #f5f5f5);
}

.bc-fallback-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.bc-fallback-info {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bc-fallback-title {
	font-size: 13px;
	line-height: 1.3;
	font-weight: 500;
}

.bc-fallback-price {
	font-size: 13px;
	font-weight: 600;
}
