/**
 * GeoShield Lite — Frontend Styles
 * Restriction banners and disabled button states.
 *
 * @package GeoShield_Lite
 */

/* ─── Restriction Banner ─── */
.geoshield-restriction-banner {
	display: inline-flex;
	width: auto;
	max-width: 100%;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 20px;
	border-radius: 10px;
	margin: 16px 0 20px;
	font-family: inherit;
	font-size: 15px;
	line-height: 1.5;
	animation: gsBannerSlide 0.45s ease-out both;
	overflow-wrap: break-word;
	word-break: break-word;
	box-sizing: border-box;
}

/* Banner Theme: disable_purchase (Critical Red/Error) */
.gs-action-disable_purchase.geoshield-restriction-banner {
	background: #fef2f2;
	border: 1px solid #fee2e2;
	border-left: 5px solid #ef4444;
	box-shadow: 0 4px 12px rgba(239, 68, 68, 0.08), 0 1px 4px rgba(239, 68, 68, 0.04);
}

.gs-action-disable_purchase .gs-banner-icon {
	color: #ef4444;
}

.gs-action-disable_purchase .gs-banner-text {
	color: #b91c1c;
}

.gs-action-disable_purchase .gs-banner-text strong {
	color: #991b1b;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

/* Banner Theme: hide (Red/Error — fallback if page is still accessible) */
.gs-action-hide.geoshield-restriction-banner {
	background: #fff5f5;
	border: 1px solid #fee2e2;
	border-left: 4px solid #ef4444;
	box-shadow: 0 2px 10px rgba(239, 68, 68, 0.05);
}

.gs-action-hide .gs-banner-icon {
	color: #ef4444;
}

.gs-action-hide .gs-banner-text {
	color: #b91c1c;
}

.gs-banner-icon {
	flex-shrink: 0;
	color: #ef4444;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	margin-top: 2px;
}

.gs-banner-icon svg {
	width: 20px;
	height: 20px;
	display: block;
}

.gs-banner-text {
	flex: 1;
	min-width: 0;
	color: #b91c1c;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.55;
	letter-spacing: -0.01em;
}

.gs-banner-text p {
	margin: 0 !important;
	padding: 0 !important;
}

.gs-banner-text strong {
	color: #7f1d1d;
	font-weight: 700;
}

@keyframes gsBannerSlide {
	from {
		opacity: 0;
		transform: translateY(-6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* ─── Disabled Button ─── */
.geoshield-btn-disabled {
	opacity: 0.42 !important;
	cursor: not-allowed !important;
	pointer-events: none !important;
	user-select: none !important;
	-webkit-user-select: none !important;
	position: relative;
	transition: none !important;
	transform: none !important;
}

.geoshield-btn-disabled::after {
	content: '';
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	cursor: not-allowed;
	pointer-events: all;
}

.geoshield-disabled-cart-wrap {
	margin: 16px 0 20px;
	width: auto;
}

.geoshield-disabled-cart-wrap .geoshield-btn-disabled {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	padding: 14px 28px;
	font-size: 16px;
	font-weight: 600;
	border-radius: 6px;
	text-align: center;
	background-color: #94a3b8 !important;
	border-color: #94a3b8 !important;
	color: #ffffff !important;
	box-shadow: none !important;
	opacity: 0.65 !important;
}

/* ─── UI Enforcement — Catalog/Loop ─── */
.geoshield-restricted-product .cart,
.geoshield-restricted-product .quantity,
.geoshield-restricted-product .wc-variation-selection-needed {
	display: none !important;
}

.geoshield-restricted-product.gs-action-disable_purchase .geoshield-disabled-cart-wrap {
	display: block !important;
}

/* ─── UI Enforcement — Single Product Bulletproof ─── */
.single-product .geoshield-restricted-product form.cart,
.single-product .geoshield-restricted-product .woocommerce-variation-add-to-cart {
	display: none !important;
	visibility: hidden !important;
	height: 0 !important;
	overflow: hidden !important;
}

.single-product .geoshield-restricted-product.gs-action-disable_purchase .geoshield-disabled-cart-wrap {
	display: block !important;
	visibility: visible !important;
	height: auto !important;
	overflow: visible !important;
}

/* ─── Accessibility & Responsiveness ─── */
@media (prefers-reduced-motion: reduce) {
	.geoshield-restriction-banner {
		animation: none !important;
	}
}

@media screen and (max-width: 768px) {
	.geoshield-restriction-banner {
		border-radius: 8px;
		padding: 13px 16px;
	}
	.gs-banner-text {
		font-size: 14.5px;
	}
}

@media screen and (max-width: 600px) {
	.geoshield-restriction-banner {
		padding: 12px 14px;
		gap: 10px;
		border-radius: 6px;
		margin: 12px 0 16px;
	}
	.gs-banner-text {
		font-size: 14px;
	}
	.geoshield-disabled-cart-wrap .geoshield-btn-disabled {
		padding: 12px 20px;
		font-size: 15px;
	}
}

@media screen and (max-width: 480px) {
	.geoshield-restriction-banner {
		padding: 10px 12px;
		gap: 8px;
		margin: 10px 0 14px;
	}
	.gs-banner-icon svg {
		width: 18px;
		height: 18px;
	}
	.gs-banner-text {
		font-size: 13.5px;
	}
	.geoshield-disabled-cart-wrap .geoshield-btn-disabled {
		padding: 12px 16px;
		font-size: 14px;
	}
}

@media screen and (max-width: 360px) {
	.geoshield-restriction-banner {
		padding: 8px 10px;
		gap: 6px;
		font-size: 13px;
	}
	.gs-banner-text {
		font-size: 13px;
	}
	.gs-banner-icon svg {
		width: 16px;
		height: 16px;
	}
}
