/**
 * Off-Canvas Panel — Shared component CSS for all ct-panel drawers.
 *
 * Loaded globally (panels can open from any page).
 * Provides consistent styling across all off-canvas panels:
 * - Mini Cart (#woo-cart-panel)
 * - Wishlist (#woo-wishlist-panel)
 * - Product Information (#product-info-panel)
 *
 * Individual panel CSS files only override what's UNIQUE to that panel.
 * This file is the single source of truth for shared panel styling.
 *
 * @package Blocksy_Child
 * @date 2026-03-19
 */

/* ==========================================================================
   Panel Layout — all off-canvas drawers
   ========================================================================== */

#woo-cart-panel .ct-panel-inner,
#woo-wishlist-panel .ct-panel-inner,
#product-info-panel .ct-panel-inner {
	display: flex;
	flex-direction: column;
	height: 100%;
}

/* ==========================================================================
   Panel Header — consistent padding, border, close button alignment
   ========================================================================== */

#woo-cart-panel .ct-panel-actions,
#woo-wishlist-panel .ct-panel-actions {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 24px;
	border-bottom: 1px solid var(--theme-border-color, #e0e0e0);
	flex-shrink: 0;
}

/* Product info panel: close-only header (no heading text) */
#product-info-panel .ct-panel-actions {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	padding: 10px 16px;
	flex-shrink: 0;
}

/* ==========================================================================
   Panel Heading — consistent font styling across all panels
   WHY: Blocksy renders cart heading as <span>, wishlist as <h2>.
   Both should match visually — h2 font variables with fallbacks.
   ========================================================================== */

#woo-cart-panel .ct-panel-heading,
#woo-wishlist-panel .ct-panel-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-family: var(--theme-heading-2-font-family, var(--theme-headings-font-family, inherit));
	font-size: var(--theme-heading-2-font-size, 24px);
	font-weight: var(--theme-heading-2-font-weight, var(--theme-headings-font-weight, 700));
	line-height: var(--theme-heading-2-line-height, var(--theme-headings-line-height, 1.3));
	color: var(--theme-heading-2-color, var(--theme-headings-color, var(--theme-palette-color-4, #333)));
	text-transform: none;
	letter-spacing: normal;
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Panel Content — consistent inner padding
   ========================================================================== */

#woo-cart-panel .ct-panel-content-inner,
#woo-wishlist-panel .ct-panel-content-inner {
	padding: 0 24px;
	width: 100%;
	box-sizing: border-box;
}

#product-info-panel .ct-panel-content-inner {
	flex: 1;
	padding: 0 24px 24px;
}

#product-info-panel .ct-panel-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	overflow-y: auto;
	overflow-x: hidden;
	-webkit-overflow-scrolling: touch;
}

/* ==========================================================================
   Panel Icons — each panel gets its own icon
   ========================================================================== */

/* Cart icon — SVG via CSS mask (Feather Icons shopping-cart) */
#woo-cart-panel .ct-panel-heading::before {
	content: '';
	display: inline-block;
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	background: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='21' r='1'/%3E%3Ccircle cx='20' cy='21' r='1'/%3E%3Cpath d='M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6'/%3E%3C/svg%3E");
	mask-size: contain;
	mask-repeat: no-repeat;
}

/* Wishlist heart icon — rendered via PHP (inline SVG in heading).
   Size set here for consistency with cart icon. */
.ct-wishlist-panel-icon {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

/* ==========================================================================
   Responsive — mobile panel adjustments
   ========================================================================== */

@media (max-width: 767px) {
	#woo-cart-panel .ct-panel-actions,
	#woo-wishlist-panel .ct-panel-actions {
		padding: 16px;
	}

	#woo-cart-panel .ct-panel-content-inner,
	#woo-wishlist-panel .ct-panel-content-inner {
		padding: 0 16px;
	}

	#product-info-panel .ct-panel-actions {
		padding: 8px 12px;
	}

	#product-info-panel .ct-panel-content-inner {
		padding: 0 16px 16px;
	}
}

/* ==========================================================================
   Mini Cart — Checkout button full width + bottom padding.
   WHY: Consistency with all other buttons on the site (ATC, submit, etc.)
   Blocksy's default checkout button is not full width in the cart panel.
   @date 2026-03-19
   ========================================================================== */



/* Add padding above the first item in mini cart */
#woo-cart-panel .ct-panel-content {
	padding-top: 8px;
}

/* Mini cart buttons — full width, stacked */
#woo-cart-panel .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0 24px 24px;
}

#woo-cart-panel .woocommerce-mini-cart__buttons .button {
	width: 100%;
	box-sizing: border-box;
	text-align: center;
}

/* ==========================================================================


/* Wishlist empty state (logged in + guest) */

/* ==========================================================================
   Empty State Buttons — full width across all panels.
   WHY: Consistency with checkout button and all other full-width buttons.
   @date 2026-03-19
   ========================================================================== */

.return-to-shop .button,
.return-to-shop a {
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	display: block;
}

/* ==========================================================================
   Mini Cart Empty State — Recently Viewed + Favourites grids.
   WHY: When cart is empty, show useful product suggestions instead of
   just a blank panel. Matches suggested products styling.
   @date 2026-03-19
   ========================================================================== */

.bc-empty-cart-state {
	padding: 0;
}

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

.bc-empty-cart-section-title {
	font-family: var(--theme-body-font-family, inherit);
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--theme-palette-color-4, #888);
	margin: 0 0 12px 0;
}

.bc-mini-product-grid {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.bc-mini-product-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 0;
	text-decoration: none;
	border-bottom: 1px solid var(--theme-border-color, #e0e0e0);
	transition: opacity 0.2s;
}

.bc-mini-product-item:last-child {
	border-bottom: none;
}

.bc-mini-product-item:hover {
	opacity: 0.75;
}

.bc-mini-product-image {
	width: 50px;
	min-width: 50px;
	border-radius: var(--theme-border-radius, 3px);
	overflow: hidden;
}

.bc-mini-product-image img {
	width: 100%;
	height: auto;
	display: block;
}

.bc-mini-product-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bc-mini-product-title {
	font-size: 13px;
	font-weight: 500;
	color: var(--theme-palette-color-3, #746A5F);
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bc-mini-product-price {
	font-size: 12px;
	font-weight: 500;
	color: var(--theme-palette-color-2, #393939);
}

.bc-mini-product-price .woocommerce-price-suffix {
	display: none;
}
