/**
 * Checkout styles for Wideview Availability Shipping Manager
 *
 * @package Wideview_Shipping_Manager
 */

/* Unavailable method notice - ALWAYS visible and clear */
.hsm-unavailable-notice {
	margin-top: 8px;
	padding: 8px 12px;
	background-color: #fff3cd !important;
	border-left: 3px solid #ffc107;
	border-radius: 3px;
	font-size: 13px;
	opacity: 1 !important;
	visibility: visible !important;
	display: block !important;
	position: relative !important;
	z-index: 999 !important;
	/* Force new stacking context to break opacity inheritance */
	isolation: isolate !important;
	transform: translateZ(0) !important;
	-webkit-transform: translateZ(0) !important;
}

/* Message inside notice - should be bold and clear, not faded */
.hsm-unavailable-notice .hsm-unavailable-message {
	color: #856404 !important;
	font-size: 13px;
	font-weight: 700 !important;
	line-height: 1.6 !important;
	opacity: 1 !important;
	visibility: visible !important;
	display: block !important;
	position: relative !important;
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
	text-rendering: optimizeLegibility !important;
}

.hsm-unavailable-notice small {
	font-size: 12px;
	line-height: 1.5;
	opacity: 1 !important;
	visibility: visible !important;
	color: #856404 !important;
}

/* Schedule info inside notice - should be clear but slightly different style */
.hsm-unavailable-notice .hsm-schedule-info {
	display: block !important;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(133, 100, 4, 0.2);
	color: #856404 !important;
	font-size: 12px;
	font-weight: 600 !important;
	line-height: 1.6 !important;
	opacity: 1 !important;
	visibility: visible !important;
	position: relative !important;
	-webkit-font-smoothing: antialiased !important;
	-moz-osx-font-smoothing: grayscale !important;
	text-rendering: optimizeLegibility !important;
}

/* Disabled method styling */
.hsm-disabled-method {
	opacity: 0.6;
	text-decoration: line-through;
}

/* Shipping method wrapper when disabled */
.woocommerce-shipping-methods .hsm-disabled-method-wrapper {
	opacity: 0.5;
	pointer-events: none;
}

/* Unavailable shipping method styling - use rgba for fading instead of opacity */
.woocommerce-shipping-methods li.hsm-unavailable-method,
.woocommerce-shipping-method.hsm-unavailable-method {
	position: relative;
	/* Don't use opacity on parent - it affects children */
	/* Use rgba for background instead of opacity to allow children to be fully visible */
	background-color: rgba(255, 255, 255, 0.6);
}

/* Fade the text of the method itself, but not the notice */
.woocommerce-shipping-methods li.hsm-unavailable-method > *:not(.hsm-unavailable-notice),
.woocommerce-shipping-method.hsm-unavailable-method > *:not(.hsm-unavailable-notice) {
	opacity: 0.6;
}

/* Override any opacity set on parent when notice exists */
.woocommerce-shipping-methods li.hsm-unavailable-method:has(.hsm-unavailable-notice),
.woocommerce-shipping-method.hsm-unavailable-method:has(.hsm-unavailable-notice) {
	opacity: 1 !important;
}

/* Fallback for browsers that don't support :has() */
.woocommerce-shipping-methods li.hsm-unavailable-method .hsm-unavailable-notice,
.woocommerce-shipping-method.hsm-unavailable-method .hsm-unavailable-notice {
	/* Force parent to not have opacity by creating new stacking context */
	position: relative !important;
	z-index: 999 !important;
}

/* But the notice should always be clear - position it outside the opacity context */
.woocommerce-shipping-methods li.hsm-unavailable-method .hsm-unavailable-notice,
.woocommerce-shipping-method.hsm-unavailable-method .hsm-unavailable-notice,
.hsm-disabled-method-wrapper .hsm-unavailable-notice,
.hsm-unavailable-method .hsm-unavailable-notice {
	opacity: 1 !important;
	visibility: visible !important;
	display: block !important;
	background-color: #fff3cd !important;
	position: relative !important;
	z-index: 10 !important;
	/* Reset any inherited opacity */
	transform: translateZ(0) !important;
	will-change: auto !important;
}

/* Ensure all text inside notice is always visible and bold */
.woocommerce-shipping-methods li.hsm-unavailable-method .hsm-unavailable-notice *,
.woocommerce-shipping-method.hsm-unavailable-method .hsm-unavailable-notice *,
.hsm-disabled-method-wrapper .hsm-unavailable-notice *,
.hsm-unavailable-method .hsm-unavailable-notice * {
	opacity: 1 !important;
	visibility: visible !important;
	color: #856404 !important;
	font-weight: 600 !important;
}

/* Specifically target the message and schedule info */
.woocommerce-shipping-methods li.hsm-unavailable-method .hsm-unavailable-notice .hsm-unavailable-message,
.woocommerce-shipping-method.hsm-unavailable-method .hsm-unavailable-notice .hsm-unavailable-message,
.woocommerce-shipping-methods li.hsm-unavailable-method .hsm-unavailable-notice .hsm-schedule-info,
.woocommerce-shipping-method.hsm-unavailable-method .hsm-unavailable-notice .hsm-schedule-info {
	opacity: 1 !important;
	color: #856404 !important;
	font-weight: 600 !important;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.woocommerce-shipping-methods li.hsm-unavailable-method input[type="radio"],
.woocommerce-shipping-method.hsm-unavailable-method input[type="radio"] {
	opacity: 0.7;
	cursor: pointer !important;
	/* Allow selection - validation will block order */
}

.woocommerce-shipping-methods li.hsm-unavailable-method label,
.woocommerce-shipping-method.hsm-unavailable-method label {
	cursor: pointer !important;
	opacity: 0.7;
}

.woocommerce-shipping-methods li.hsm-unavailable-method:hover,
.woocommerce-shipping-method.hsm-unavailable-method:hover {
	background-color: #fafafa !important;
	border-color: #e2e2e2 !important;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
	.hsm-unavailable-notice {
		margin-top: 5px;
		padding: 6px 10px;
		font-size: 12px;
	}
}

