/**
 * Mix & Match Helper Frontend Styles
 *
 * @package MixAndMatchHelper
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */

:root {
	/* Brand Colors */
	--mmh-color-success: #236629;
	--mmh-color-success-light: #2d7d35;
	--mmh-color-success-bg: rgba(35, 102, 41, 0.1);
	
	/* Panel Colors */
	--mmh-color-bg: #f0f7f1;
	--mmh-color-text: #1a1a1a;
	--mmh-color-text-muted: #666;
	
	/* Border Radius */
	--mmh-border-radius: 8px;
	--mmh-border-radius-badge: 3px;
	
	/* Spacing */
	--mmh-spacing-sm: 12px;
	--mmh-spacing-md: 16px;
	--mmh-spacing-lg: 24px;
	
	/* Typography */
	--mmh-font-size-cart-badge: 14px;
}

/* ==========================================================================
   Strategic Panel
   ========================================================================== */

.mmh-offer-panel {
	background: var(--mmh-group-color-bg, var(--mmh-color-bg));
	border: 2px solid var(--mmh-group-color, var(--mmh-color-success));
	border-radius: var(--mmh-border-radius);
	margin-bottom: var(--mmh-spacing-lg);
	padding: var(--mmh-spacing-md);
	position: relative;
	transition: all 0.2s ease;
}

.mmh-offer-panel:hover {
	border-color: var(--mmh-group-color-light, var(--mmh-color-success-light));
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mmh-panel-clickable {
	display: block;
	text-decoration: none;
	color: inherit;
}

.mmh-panel-clickable:hover {
	text-decoration: none;
}

.mmh-panel-clickable:focus {
	outline: 2px solid var(--mmh-color-success);
	outline-offset: 2px;
}

.mmh-panel-wrapper {
	display: flex;
	align-items: flex-start;
	gap: var(--mmh-spacing-md);
}

.mmh-panel-icon {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--mmh-group-color, var(--mmh-color-success));
	border-radius: 50%;
	color: white;
}

.mmh-panel-icon svg {
	width: 32px;
	height: 32px;
	color: white;
}

.mmh-panel-content {
	flex: 1;
	min-width: 0;
}

.mmh-panel-title {
	margin: 0 0 8px 0;
	font-size: 18px;
	font-weight: 600;
	color: var(--mmh-group-color, var(--mmh-color-success));
	line-height: 1.3;
}

	
.mmh-panel-text {
	margin: 0 0 var(--mmh-spacing-sm) 0;
	font-size: 15px;
	line-height: 1.5;
	color: var(--mmh-color-text);
}

.mmh-panel-text strong {
	font-weight: 600;
	color: var(--mmh-group-color, var(--mmh-color-success));
}

.mmh-panel-link-text {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 600;
	color: var(--mmh-group-color, var(--mmh-color-success));
	transition: color 0.2s ease;
}

.mmh-panel-clickable:hover .mmh-panel-link-text {
	color: var(--mmh-group-color-light, var(--mmh-color-success-light));
	text-decoration: underline;
}

.mmh-panel-arrow {
	font-size: 16px;
	transition: transform 0.2s ease;
}

.mmh-panel-clickable:hover .mmh-panel-arrow {
	transform: translateX(3px);
}

/* ==========================================================================
   Badges (PDP, CLP, Cart)
   ========================================================================== */

.mmh-badge {
	display: inline-block;
	padding: 4px 10px;
	background: var(--mmh-group-color-bg, var(--mmh-color-bg));
	border: 1px solid var(--mmh-group-color, var(--mmh-color-success));
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.3;
	color: var(--mmh-group-color, var(--mmh-color-success));
	/* margin-top: 8px; */
}

.archive li.product .mmh-badge {
	margin-top: 10px;
}

.mmh-badge small {
	font-size: inherit;
	font-weight: 600;
}

/* PDP Badge Wrapper */
.mmh-pdp-badge-wrapper {
	margin-bottom: 12px;
}

/* ==========================================================================
   Cart & Mini-Cart Badges (Matches MBV Pattern)
   ========================================================================== */

/**
 * Badge styles for cart and mini-cart.
 * Matches MBV styling for consistency.
 */

/* Badge appears first (naturally in DOM order now) */
.mmh-checkout-badge {
	color: var(--mmh-group-color, var(--mmh-color-success));
	font-weight: 600;
	margin-top: 0;
	margin-bottom: 4px;
	line-height: 1.3;
	display: block;
}

/* Title appears after badge */
.mmh-product-title {
	display: block;
	margin-bottom: 4px;
}

.mmh-checkout-badge small {
	display: inline-block;
	color: var(--mmh-group-color, var(--mmh-color-success));
	font-weight: 600;
	font-size: var(--mmh-font-size-cart-badge);
	background-color: var(--mmh-group-color-bg, var(--mmh-color-success-bg));
	padding: 2px 8px;
	border-radius: var(--mmh-border-radius-badge);
}

/* Mix-match specific styling */
.mmh-checkout-badge-mix-match {
	color: var(--mmh-group-color, var(--mmh-color-success));
}

.mmh-checkout-badge-mix-match small {
	color: var(--mmh-group-color, var(--mmh-color-success));
	background-color: var(--mmh-group-color-bg, var(--mmh-color-success-bg));
}

/* ==========================================================================
   Despatch Date Display - Cart & Mini-Cart
   ========================================================================== */

/**
 * Despatch date below product title in cart/mini-cart.
 * Matches MBV plugin styling for consistency.
 */
.mmh-cart-despatch {
	display: block;
	margin-top: 0.5em;
	font-size: 0.9em;
	color: #666;
	font-style: italic;
	clear: both;
}

/* Tighter spacing in mini-cart */
.widget_shopping_cart .mmh-cart-despatch,
.woocommerce-mini-cart .mmh-cart-despatch {
	margin-top: 0.35em;
	font-size: 0.85em;
}

/* Ensure proper display in cart table */
.woocommerce-cart-form .mmh-cart-despatch,
.shop_table .mmh-cart-despatch {
	margin-top: 0.5em;
}

/* Mobile adjustments */
@media (max-width: 768px) {
	.mmh-cart-despatch {
		font-size: 0.85em;
		margin-top: 0.4em;
	}
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */

/* Tablet and below */
@media (max-width: 768px) {
	.mmh-offer-panel {
		padding: var(--mmh-spacing-sm);
	}

	.mmh-panel-wrapper {
		gap: var(--mmh-spacing-sm);
	}

	.mmh-panel-icon {
		width: 40px;
		height: 40px;
	}

	.mmh-panel-icon svg {
		width: 24px;
		height: 24px;
	}

	.mmh-panel-title {
		font-size: 16px;
	}

	.mmh-panel-text {
		font-size: 14px;
	}
}

/* Mobile */
@media (max-width: 480px) {
	.mmh-panel-wrapper {
		flex-direction: row;
		align-items: flex-start;
	}

	.mmh-panel-icon {
		width: 36px;
		height: 36px;
	}

	.mmh-panel-icon svg {
		width: 22px;
		height: 22px;
	}

	.mmh-panel-title {
		font-size: 15px;
	}

	.mmh-panel-text {
		font-size: 13px;
	}

	.mmh-panel-link {
		font-size: 13px;
	}
}

/* ==========================================================================
   Print Styles
   ========================================================================== */

@media print {
	.mmh-offer-panel {
		border: 1px solid #ccc;
		background: white;
	}

	.mmh-panel-link {
		display: none;
	}
}
