/*
 * WooCommerce Notices Styling
 * Styles notices to match the card-like design with colored left borders
 */

.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	position: relative;
	background-color: var(--nn-color-white, #ffffff);
	border: 1px solid var(--nn-color-gray-lighter, #e2e2e2);
	border-left-width: 4px;
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
	padding: 1rem 1.5rem;
	margin-bottom: 0;
	color: var(--nn-color-gray-dark, #333333);
	font-size: 0.875rem;
	line-height: 1.5;
}
.single-product .woocommerce:has(.woocommerce-message){
    padding-bottom: 1rem;
}
/* Colored left borders */
.woocommerce-error {
	border-left-color: var(--nn-color-error-alt, #990000) !important; /* Red */
}

.woocommerce-info {
	border-left-color: var(--nn-color-info, #3F80C1) !important; /* Blue */
}

.woocommerce-message {
	border-left-color: var(--nn-color-success, #166F21) !important; /* Green */
}

/* Notice content wrapper */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	display: block;
	padding-right: 2.5rem; /* Make room for close button */
}

/* Notice title (if present) */
.woocommerce-error .notice-title,
.woocommerce-info .notice-title,
.woocommerce-message .notice-title {
	font-weight: 600;
	font-size: 0.9375rem;
	margin-bottom: 0.5rem;
	color: var(--nn-color-gray-dark-text, #1a1a1a);
}

/* Notice body text */
.woocommerce-error .notice-body,
.woocommerce-info .notice-body,
.woocommerce-message .notice-body {
	color: var(--nn-color-gray, #434343);
}

/* Close button */
.woocommerce-notice-close {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	width: 24px;
	height: 24px;
	border: none;
	background: rgba(217, 217, 217, 0.29) !important; /* var(--nn-color-gray-bg) with opacity */
	cursor: pointer;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: background-color 0.2s ease;
	z-index: 10;
}

.woocommerce-notice-close:hover {
	background-color: rgba(217, 217, 217, 0.84); /* var(--nn-color-gray-bg) with opacity */
}

.woocommerce-notice-close::before {
	content: '×';
	font-size: 24px;
	line-height: 1;
	color: var(--nn-color-black);
	font-weight: 300;
    font-family: "Epilogue", Sans-serif;
}

.woocommerce-notice-close:hover::before {
	color: var(--nn-color-black);
}

/* Hide notices that are being closed */
.woocommerce-error.closing,
.woocommerce-info.closing,
.woocommerce-message.closing {
	opacity: 0;
	transform: translateX(20px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.woocommerce-error.closed,
.woocommerce-info.closed,
.woocommerce-message.closed {
	display: none;
}

/* Links inside notices */
.woocommerce-error a,
.woocommerce-info a,
.woocommerce-message a {
	color: var(--nn-color-black);
	text-decoration: underline;
}

.woocommerce-error a:hover,
.woocommerce-info a:hover,
.woocommerce-message a:hover {
	color: var(--nn-color-black);
}

/* Buttons inside notices */
.woocommerce-error .button,
.woocommerce-info .button,
.woocommerce-message .button {
	float: none;
	margin-top: 0.75rem;
	margin-left: 0;
	padding: 0.5rem 1rem;
	border: none;
	border-radius: 4px;
	background-color: var(--nn-color-primary);
	color: var(--nn-color-white);
	font-weight: 500;
	text-decoration: none;
	display: inline-block;
	transition: background-color 0.2s ease;
}

.woocommerce-error .button {
	background-color: var(--nn-color-error);
}

.woocommerce-message .button {
	background-color: var(--nn-color-primary);
}

.woocommerce-error .button:hover,
.woocommerce-info:not(.no_subscriptions) .button:hover,
.woocommerce-message:not(.no_subscriptions) .button:hover {
	opacity: 0.9;
	background-color: inherit;
}

.woocommerce-info.no_subscriptions .button,
.woocommerce-message.no_subscriptions .button {
	background-color: #2d5a48;
}

/* Lists inside notices */
.woocommerce-error ul,
.woocommerce-info ul,
.woocommerce-message ul {
	margin: 0.5rem 0 0 0;
	padding-left: 1.25rem;
}

.woocommerce-error ul li,
.woocommerce-info ul li,
.woocommerce-message ul li {
	margin-bottom: 0.25rem;
}

/* Message inner wrapper */
.woocommerce-message .message-inner {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

/* Message content */
.woocommerce-message .message-content {
	color: var(--nn-color-gray, #434343);
	line-height: 1.6;
}

.woocommerce-message .message-content .button {
	margin-top: 0;
	margin-left: 0.5rem;
	text-decoration: none;
}

/* Links in message-content that aren't buttons */
.woocommerce-message .message-content a:not(.button) {
	color: var(--nn-color-info, #3F80C1);
	text-decoration: underline;
}

.woocommerce-message .message-content a:not(.button):hover {
	color: var(--nn-color-black);
}

/* Buttons wrapper */
.woocommerce-message .buttons-wrapper {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0;
}

.woocommerce-message .buttons-wrapper .button {
	margin-top: 0;
	margin-left: 0;
	flex-shrink: 0;
}

.woocommerce-message .buttons-wrapper .button.checkout {
	background-color: var(--nn-color-success, #166F21);
    margin-right: 20px;
}

.woocommerce-message .buttons-wrapper .button.cart {
	background-color: var(--nn-color-white, #ffffff);
	color: var(--nn-color-success, #166F21);
	border: 1px solid var(--nn-color-success, #166F21);
}

.woocommerce-message .buttons-wrapper .button.cart:hover {
	background-color: var(--nn-color-success, #166F21);
	color: var(--nn-color-white, #ffffff);
}

.woocommerce-message .buttons-wrapper .button span {
	display: inline-block;
}

/* Responsive layout for message-inner */
@media (min-width: 768px) {
	.woocommerce-message .message-inner {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
	
	.woocommerce-message .message-content {
		flex: 1;
	}
	
	.woocommerce-message .buttons-wrapper {
		flex-shrink: 0;
		margin-left: 1rem;
	}
}

/* Remove default WooCommerce notice styles that conflict */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	border-left: 10px solid;
	border-right: 1px solid var(--nn-color-gray-lighter, #e0e0e0);
	border-top: 1px solid var(--nn-color-gray-lighter, #e0e0e0);
	border-bottom: 1px solid var(--nn-color-gray-lighter, #e0e0e0);
}

/* Single-line layout for notices with actions */
.woocommerce-error,
.woocommerce-info,
.woocommerce-message {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: nowrap; /* Single line on desktop */
}

/* Hide <br> tags in notices */
.woocommerce-error br,
.woocommerce-info br,
.woocommerce-message br {
	display: none;
}

/* Notice text content wrapper */
.woocommerce-error .woocommerce-notice-text,
.woocommerce-info .woocommerce-notice-text,
.woocommerce-message .woocommerce-notice-text {
	flex: 1;
	min-width: 0; /* Allow text to shrink */
}

/* Notice actions wrapper - right aligned */
.woocommerce-error .woocommerce-notice-actions,
.woocommerce-info .woocommerce-notice-actions,
.woocommerce-message .woocommerce-notice-actions {
	flex-shrink: 0;
	white-space: nowrap;
	margin-left: auto;
	margin-right: 20px;
}

/* Action links styling */
.woocommerce-error .woocommerce-notice-actions a,
.woocommerce-info .woocommerce-notice-actions a,
.woocommerce-message .woocommerce-notice-actions a {
	white-space: nowrap;
	text-decoration: underline;
	margin-left: 1rem;
	margin-right: 1rem;
}

/* Remove left margin from first link */
.woocommerce-error .woocommerce-notice-actions a:first-child,
.woocommerce-info .woocommerce-notice-actions a:first-child,
.woocommerce-message .woocommerce-notice-actions a:first-child {
	margin-left: 0;
}

/* Remove right margin from last link */
.woocommerce-error .woocommerce-notice-actions a:last-child,
.woocommerce-info .woocommerce-notice-actions a:last-child,
.woocommerce-message .woocommerce-notice-actions a:last-child {
	margin-right: 0;
}

/* For notices without the restructured layout, handle links */
.woocommerce-error:not([data-restructured="true"]) a,
.woocommerce-info:not([data-restructured="true"]) a,
.woocommerce-message:not([data-restructured="true"]) a {
	white-space: nowrap;
	margin-left: auto;
}

/* Mobile responsive: wrap actions below text on small screens */
@media (max-width: 767px) {
	.woocommerce-error,
	.woocommerce-info,
	.woocommerce-message {
		flex-wrap: wrap;
	}
	
	.woocommerce-error .woocommerce-notice-actions,
	.woocommerce-info .woocommerce-notice-actions,
	.woocommerce-message .woocommerce-notice-actions {
		margin-left: 0;
		margin-right: 0;
		margin-top: 0.5rem;
		width: 100%;
	}
}
.single-product .woocommerce-message a{
    color: var(--nn-color-black);
}
.single-product .woocommerce-message a:hover,
.single-product .woocommerce-message a:focus{
    color: var(--nn-color-primary);
}
.single-product .woocommerce-message,
.single-product .woocommerce-error,
.single-product .woocommerce-info{
    text-align: left;
}
