/**
 * Smart Gifts Rules for WooCommerce - Enhanced Frontend Stylesheet
 * 
 * Design Token System:
 * - Primary Accent: Emerald Reward Green (#059669 / #10b981)
 * - Secondary Accent: Champagne Amber (#f59e0b)
 * - Base Navy: #0f172a / #1e293b
 * - Neutrals & Surfaces: #ffffff, #f8fafc, #f1f5f9, #e2e8f0
 */

:root {
	--fgf-primary: #059669;
	--fgf-primary-hover: #047857;
	--fgf-primary-light: #ecfdf5;
	--fgf-primary-border: #a7f3d0;
	--fgf-primary-gradient: linear-gradient(135deg, #10b981 0%, #059669 100%);
	--fgf-accent: #f59e0b;
	--fgf-accent-light: #fffbeb;
	--fgf-accent-border: #fde68a;
	--fgf-text-dark: #0f172a;
	--fgf-text-body: #334155;
	--fgf-text-muted: #64748b;
	--fgf-bg-card: #ffffff;
	--fgf-bg-subtle: #f8fafc;
	--fgf-bg-secondary: #f1f5f9;
	--fgf-border-color: #e2e8f0;
	--fgf-border-color-hover: #cbd5e1;
	--fgf-radius-sm: 6px;
	--fgf-radius-md: 10px;
	--fgf-radius-lg: 14px;
	--fgf-radius-pill: 9999px;
	--fgf-shadow-subtle: 0 1px 3px 0 rgba(15, 23, 42, 0.06), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
	--fgf-shadow-card: 0 4px 16px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
	--fgf-shadow-hover: 0 14px 28px -4px rgba(15, 23, 42, 0.12), 0 6px 12px -2px rgba(15, 23, 42, 0.06);
	--fgf-transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   Utility & Global Wrapper
   ========================================================================== */

.fgf_hide {
	display: none !important;
}

.fgf_gift_products_wrapper {
	position: relative;
	width: 100%;
	margin: 28px 0;
	clear: both;
	box-sizing: border-box;
	font-family: inherit;
}

.fgf_gift_products_wrapper h3 {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--fgf-text-dark);
	margin-top: 0;
	margin-bottom: 18px;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--fgf-border-color);
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.fgf_gift_products_wrapper h3::before {
	content: "🎁";
	font-size: 1.35rem;
	line-height: 1;
	display: inline-block;
	transform-origin: center;
	transition: var(--fgf-transition);
}

.fgf_gift_products_wrapper:hover h3::before {
	transform: scale(1.15) rotate(8deg);
}

.fgf_gift_products_wrapper span.fgf_disable_links {
	opacity: 0.55;
	cursor: not-allowed;
	pointer-events: none;
}

.fgf_gift_products_wrapper span.fgf_disable_links a,
.fgf_gift_products_wrapper span.fgf_disable_links button {
	pointer-events: none;
	cursor: not-allowed;
	text-decoration: none;
	filter: grayscale(0.6);
}

/* ==========================================================================
   Notice & Banners
   ========================================================================== */

.fgf-gifts-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--fgf-primary-light);
	color: var(--fgf-primary-hover);
	border: 1px solid var(--fgf-primary-border);
	padding: 12px 18px;
	border-radius: var(--fgf-radius-md);
	font-size: 0.9375rem;
	font-weight: 500;
	margin-bottom: 20px;
	line-height: 1.5;
	box-shadow: var(--fgf-shadow-subtle);
}

.fgf-gifts-notice::before {
	content: "✨";
	font-size: 1.1rem;
	flex-shrink: 0;
}

.fgf-notice {
	padding: 14px 18px !important;
	border-radius: var(--fgf-radius-md) !important;
	margin-bottom: 20px !important;
	border: 1px solid transparent !important;
	font-size: 0.9375rem !important;
	line-height: 1.5 !important;
	box-shadow: var(--fgf-shadow-subtle) !important;
}

.fgf-notice::before {
	content: "" !important;
	display: none !important;
}

.fgf-notice-content-wrapper {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
}

.fgf-notice-content-wrapper .fgf-notice-icon {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
}

.fgf-notice-content-wrapper .fgf-notice-icon img {
	width: 22px;
	height: 22px;
	object-fit: contain;
}

.fgf-notice-content-wrapper .fgf-notice-content {
	flex-grow: 1;
	color: var(--fgf-text-dark);
}

.fgf-notice-content-wrapper .fgf-notice-content p {
	margin: 0 !important;
	line-height: 1.5;
}

.fgf-success-info {
	background-color: var(--fgf-accent-light) !important;
	border-color: var(--fgf-accent-border) !important;
	color: #92400e !important;
}

.fgf-success-message {
	background-color: var(--fgf-primary-light) !important;
	border-color: var(--fgf-primary-border) !important;
	color: var(--fgf-primary-hover) !important;
}

/* BOGO Eligible Notice on Product / Loop */
.fgf-bogo-eligible-notices-wrapper {
	margin: 12px 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fgf-bogo-eligible-notice {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
	border: 1px solid var(--fgf-accent-border);
	border-radius: var(--fgf-radius-pill);
	color: #92400e;
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.4;
	box-shadow: var(--fgf-shadow-subtle);
	width: fit-content;
}

.fgf-bogo-eligible-notice::before {
	content: "🏷️";
	font-size: 0.95rem;
}

.fgf-bogo-loop-page-eligible-notices-wrapper {
	margin: 8px 0;
}

.fgf-bogo-loop-page-eligible-notices-wrapper .fgf-bogo-eligible-notice {
	font-size: 0.8125rem;
	padding: 6px 10px;
}

/* ==========================================================================
   Progress Bar / Milestone Rewards Tracker
   ========================================================================== */

.fgf-progress-bar-wrapper {
	background: var(--fgf-bg-subtle);
	border: 1px solid var(--fgf-border-color);
	border-radius: var(--fgf-radius-lg);
	padding: 20px 24px;
	margin: 20px 0;
	display: block;
	width: 100%;
	box-sizing: border-box;
	box-shadow: var(--fgf-shadow-subtle);
}

.fgf-progress-bar-wrapper p.fgf-progress-bar-heading-label {
	font-size: 1.125rem;
	font-weight: 700;
	color: var(--fgf-text-dark);
	margin: 0 0 14px 0;
	display: flex;
	align-items: center;
	gap: 8px;
	letter-spacing: -0.01em;
}

.fgf-progress-bar-wrapper p.fgf-progress-bar-heading-label::before {
	content: "🎯";
	font-size: 1.25rem;
}

.fgf-progress-bar-above-details-wrapper,
.fgf-progress-bar-below-details-wrapper {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
}

.fgf-progress-bar-above-details-wrapper {
	margin-bottom: 8px;
}

.fgf-progress-bar-below-details-wrapper {
	margin-top: 10px;
}

.fgf-progress-bar-start,
.fgf-progress-bar-end {
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--fgf-text-muted);
}

.fgf-progress-bar-below-details-wrapper .fgf-progress-bar-start {
	color: var(--fgf-primary-hover);
	background: var(--fgf-primary-light);
	padding: 4px 10px;
	border-radius: var(--fgf-radius-pill);
	border: 1px solid var(--fgf-primary-border);
}

.fgf-progress-bar-below-details-wrapper .fgf-progress-bar-end {
	color: var(--fgf-text-body);
	background: var(--fgf-bg-secondary);
	padding: 4px 10px;
	border-radius: var(--fgf-radius-pill);
}

.fgf-progress-bar-outer-wrapper {
	height: 14px;
	border-radius: var(--fgf-radius-pill);
	position: relative;
	overflow: hidden;
	width: 100%;
	padding: 0;
	margin: 6px 0;
	background: var(--fgf-border-color);
	box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.fgf-progress-bar-outer-wrapper span {
	display: block;
	height: 100%;
	border-radius: var(--fgf-radius-pill);
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.fgf-progress-bar-outer-wrapper span.fgf-progress-bar-fill {
	background: var(--fgf-primary-gradient);
	box-shadow: 0 0 12px rgba(16, 185, 129, 0.5);
	position: relative;
	overflow: hidden;
	animation: fgfProgressFill 1.2s ease-out;
}

.fgf-progress-bar-outer-wrapper span.fgf-progress-bar-fill::after {
	content: "";
	position: absolute;
	top: 0;
	left: -100%;
	width: 100%;
	height: 100%;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
	animation: fgfShimmer 2.2s infinite;
}

@keyframes fgfProgressFill {
	from {
		width: 0%;
	}
}

@keyframes fgfShimmer {
	0% {
		left: -100%;
	}
	100% {
		left: 100%;
	}
}

/* ==========================================================================
   Product Cards (Grid & Carousel Items)
   ========================================================================== */

.fgf-gift-products-grid-items,
.fgf-owl-carousel-items {
	box-sizing: border-box;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item,
.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item {
	display: flex;
	flex-direction: column;
	background: var(--fgf-bg-card);
	border: 1px solid var(--fgf-border-color);
	border-radius: var(--fgf-radius-lg);
	box-shadow: var(--fgf-shadow-card);
	padding: 16px;
	margin-bottom: 20px;
	text-align: center;
	position: relative;
	transition: var(--fgf-transition);
	box-sizing: border-box;
	overflow: hidden;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item:hover,
.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item:hover {
	transform: translateY(-4px);
	box-shadow: var(--fgf-shadow-hover);
	border-color: var(--fgf-primary-border);
}

/* Free Gift Tag / Badge on Product */
.fgf-gift-products-grid-items .fgf-gift-products-grid-item::before,
.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item::before {
	content: "FREE GIFT";
	position: absolute;
	top: 10px;
	right: 10px;
	background: var(--fgf-primary-gradient);
	color: #ffffff;
	font-size: 0.6875rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	padding: 3px 8px;
	border-radius: var(--fgf-radius-pill);
	box-shadow: 0 2px 6px rgba(5, 150, 105, 0.35);
	z-index: 2;
	transition: var(--fgf-transition);
}

/* Disabled / Claimed Card State */
.fgf-gift-products-grid-item:has(.fgf_disable_links),
.fgf-owl-carousel-item:has(.fgf_disable_links) {
	opacity: 0.72;
	border-color: var(--fgf-border-color);
}

.fgf-gift-products-grid-item:has(.fgf_disable_links):hover,
.fgf-owl-carousel-item:has(.fgf_disable_links):hover {
	transform: none;
	box-shadow: var(--fgf-shadow-card);
	border-color: var(--fgf-border-color);
}

.fgf-gift-products-grid-item:has(.fgf_disable_links)::before,
.fgf-owl-carousel-item:has(.fgf_disable_links)::before {
	content: "MAX REACHED";
	background: linear-gradient(135deg, #64748b 0%, #475569 100%);
	box-shadow: 0 2px 6px rgba(71, 85, 105, 0.3);
}

/* Product Thumbnail */
.fgf-gift-products-grid-items .fgf-gift-products-grid-item .fgf-product-image,
.fgf-owl-carousel-items .owl-item .fgf-product-image {
	display: block;
	position: relative;
	width: 100%;
	padding: 8px;
	background: var(--fgf-bg-subtle);
	border-radius: var(--fgf-radius-md);
	margin-bottom: 12px;
	overflow: hidden;
	box-sizing: border-box;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item .fgf-product-image img,
.fgf-owl-carousel-items .owl-item .fgf-product-image img {
	width: 100% !important;
	height: 140px !important;
	object-fit: contain;
	transition: var(--fgf-transition);
	margin: 0 auto;
	display: block;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item:hover .fgf-product-image img,
.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item:hover .fgf-product-image img {
	transform: scale(1.05);
}

/* Product Title */
.fgf-gift-products-grid-items .fgf-gift-products-grid-item h5,
.fgf-owl-carousel-items .owl-item h5 {
	flex-grow: 1;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--fgf-text-dark);
	margin: 0 0 10px 0;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.6em;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item h5 a,
.fgf-owl-carousel-items .owl-item h5 a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

.fgf-gift-products-grid-items .fgf-gift-products-grid-item h5 a:hover,
.fgf-owl-carousel-items .owl-item h5 a:hover {
	color: var(--fgf-primary);
}

/* Product Price */
.fgf-carousel-gift-product-price {
	text-align: center;
	margin-bottom: 14px;
	font-size: 0.9375rem;
	line-height: 1.3;
}

.fgf-carousel-gift-product-price del {
	color: var(--fgf-text-muted);
	font-size: 0.8125rem;
	margin-right: 6px;
	opacity: 0.8;
}

.fgf-carousel-gift-product-price ins {
	color: var(--fgf-primary);
	font-weight: 700;
	text-decoration: none;
	background: var(--fgf-primary-light);
	padding: 2px 8px;
	border-radius: var(--fgf-radius-pill);
	border: 1px solid var(--fgf-primary-border);
}

.fgf-carousel-gift-product-price span {
	display: inline !important;
}

/* Actions & Controls Container */
.fgf-gift-product-add-to-cart-actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: auto;
	width: 100%;
}

/* Variation Dropdown */
.fgf-product-variations {
	width: 100% !important;
	padding: 8px 12px !important;
	font-size: 0.875rem !important;
	color: var(--fgf-text-body) !important;
	background-color: var(--fgf-bg-subtle) !important;
	border: 1px solid var(--fgf-border-color) !important;
	border-radius: var(--fgf-radius-sm) !important;
	outline: none !important;
	transition: var(--fgf-transition) !important;
	cursor: pointer;
	box-sizing: border-box;
	margin-bottom: 4px;
}

.fgf-product-variations:focus {
	border-color: var(--fgf-primary) !important;
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
}

/* Quantity Input & Stepper */
.fgf-gift-product-qty-container {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	margin: 0 auto 6px auto;
	background: var(--fgf-bg-subtle);
	border: 1px solid var(--fgf-border-color);
	border-radius: var(--fgf-radius-pill);
	padding: 2px 4px;
	box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.04);
}

.fgf-qty-btn {
	width: 28px !important;
	height: 28px !important;
	border-radius: 50% !important;
	background: #ffffff !important;
	border: 1px solid var(--fgf-border-color) !important;
	color: var(--fgf-text-dark) !important;
	font-size: 1rem !important;
	font-weight: 700 !important;
	line-height: 1 !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	transition: var(--fgf-transition) !important;
	padding: 0 !important;
	margin: 0 !important;
	outline: none !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05) !important;
}

.fgf-qty-btn:hover {
	background: var(--fgf-primary-light) !important;
	border-color: var(--fgf-primary-border) !important;
	color: var(--fgf-primary-hover) !important;
}

.fgf-gift-product-qty {
	width: 44px !important;
	padding: 4px 6px !important;
	font-size: 0.875rem !important;
	text-align: center !important;
	font-weight: 700 !important;
	color: var(--fgf-text-dark) !important;
	background: transparent !important;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	-moz-appearance: textfield;
}

.fgf-gift-product-qty::-webkit-inner-spin-button,
.fgf-gift-product-qty::-webkit-outer-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

/* Add to Cart / Claim Button */
.fgf-add-manual-gift-product,
.fgf-add-gift-product,
.fgf_gift_products_wrapper .button.fgf-add-manual-gift-product {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 6px !important;
	background: var(--fgf-primary-gradient) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: var(--fgf-radius-pill) !important;
	padding: 9px 18px !important;
	font-size: 0.875rem !important;
	font-weight: 600 !important;
	text-decoration: none !important;
	cursor: pointer !important;
	transition: var(--fgf-transition) !important;
	box-shadow: 0 2px 6px rgba(5, 150, 105, 0.25) !important;
	line-height: 1.4 !important;
	text-shadow: none !important;
	-webkit-appearance: none !important;
	width: 100% !important;
	box-sizing: border-box !important;
}

.fgf-add-manual-gift-product:hover,
.fgf-add-gift-product:hover,
.fgf_gift_products_wrapper .button.fgf-add-manual-gift-product:hover {
	background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
	color: #ffffff !important;
	box-shadow: 0 4px 12px rgba(5, 150, 105, 0.35) !important;
	transform: translateY(-1px);
}

.fgf-add-manual-gift-product:active,
.fgf-add-gift-product:active,
.fgf_gift_products_wrapper .button.fgf-add-manual-gift-product:active {
	transform: translateY(1px) scale(0.98);
	box-shadow: 0 1px 3px rgba(5, 150, 105, 0.2) !important;
}

/* ==========================================================================
   Grid System
   ========================================================================== */

.fgf-grid-gift-products-wrapper,
.fgf-grid-gift-products-content {
	float: left;
	width: 100%;
	box-sizing: border-box;
}

.fgf-grid-gift-products-items-dc-6 {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	gap: 16px;
}

.fgf-grid-gift-products-items-dc-5 {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	gap: 16px;
}

.fgf-grid-gift-products-items-dc-4 {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.fgf-grid-gift-products-items-dc-3 {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 16px;
}

.fgf-grid-gift-products-items-dc-2 {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
}

.fgf-grid-gift-products-items-dc-1 {
	display: grid;
	grid-template-columns: 1fr;
	max-width: 380px;
	margin: 0 auto;
	gap: 16px;
}

/* ==========================================================================
   Custom Dropdown Layout
   ========================================================================== */

.fgf-dropdown-wrapper {
	position: relative;
	float: left;
	width: 100%;
	max-width: 480px;
	margin: 10px 0;
	box-sizing: border-box;
}

.fgf-dropdown-wrapper .fgf-dropdown-default-option-wrapper {
	border-radius: var(--fgf-radius-md);
	border: 1px solid var(--fgf-border-color);
	position: relative;
	cursor: pointer;
	background: var(--fgf-bg-card);
	box-shadow: var(--fgf-shadow-subtle);
	transition: var(--fgf-transition);
	padding: 4px 12px;
	display: flex;
	align-items: center;
}

.fgf-dropdown-wrapper .fgf-dropdown-default-option-wrapper:hover {
	border-color: var(--fgf-border-color-hover);
	box-shadow: var(--fgf-shadow-card);
}

.fgf-dropdown-option-selected {
	color: var(--fgf-text-dark);
	display: flex;
	align-items: center;
	font-weight: 600;
	font-size: 0.9375rem;
	padding: 8px 0;
	cursor: pointer;
	text-decoration: none;
	flex-grow: 1;
}

.fgf-dropdown-product-image {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-right: 12px;
	flex-shrink: 0;
}

.fgf-dropdown-product-image img {
	width: 36px !important;
	height: 36px !important;
	object-fit: cover;
	border-radius: var(--fgf-radius-sm);
	border: 1px solid var(--fgf-border-color);
}

.fgf-pointer {
	width: 8px;
	height: 8px;
	border-right: 2px solid var(--fgf-text-muted);
	border-bottom: 2px solid var(--fgf-text-muted);
	transform: rotate(45deg);
	position: absolute;
	right: 16px;
	top: calc(50% - 6px);
	transition: transform 0.25s ease;
	pointer-events: none;
}

.fgf-pointer-down {
	border-top: none;
	border-left: none;
}

ul.fgf-dropdown-options-wrapper {
	border: 1px solid var(--fgf-border-color);
	padding: 6px !important;
	width: 100%;
	list-style: none;
	box-shadow: var(--fgf-shadow-hover);
	display: none;
	position: absolute;
	z-index: 2000;
	margin: 6px 0 0 0 !important;
	box-sizing: border-box;
	background: var(--fgf-bg-card);
	border-radius: var(--fgf-radius-md);
	max-height: 280px;
	overflow-y: auto;
	transition: var(--fgf-transition);
}

ul.fgf-dropdown-options-wrapper li {
	margin: 0 !important;
	list-style: none !important;
	border-radius: var(--fgf-radius-sm);
	overflow: hidden;
}

ul.fgf-dropdown-options-wrapper li:hover,
ul.fgf-dropdown-options-wrapper li a:hover {
	background: var(--fgf-bg-subtle);
}

ul li a.fgf-dropdown-option {
	text-decoration: none;
	display: flex;
	align-items: center;
	font-weight: 500;
	font-size: 0.875rem;
	padding: 8px 10px;
	background: transparent;
	box-sizing: border-box;
	cursor: pointer;
	color: var(--fgf-text-dark);
	border-bottom: 1px solid var(--fgf-bg-secondary);
}

ul.fgf-dropdown-options-wrapper li:last-child a.fgf-dropdown-option {
	border-bottom: none;
}

.fgf-dropdown-wrapper label {
	font-size: 0.875rem;
	color: var(--fgf-text-dark);
	cursor: pointer;
	margin: 0;
	line-height: 1.4;
}

/* Native select fallback */
select.fgf-gift-product-selection {
	width: 100%;
	max-width: 480px;
	padding: 10px 14px;
	font-size: 0.9375rem;
	color: var(--fgf-text-dark);
	background: var(--fgf-bg-card);
	border: 1px solid var(--fgf-border-color);
	border-radius: var(--fgf-radius-md);
	outline: none;
	box-shadow: var(--fgf-shadow-subtle);
	margin: 10px 0;
	cursor: pointer;
}

select.fgf-gift-product-selection:focus {
	border-color: var(--fgf-primary);
	box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.fgf-dropdown-wrapper + .fgf-add-gift-product,
select.fgf-gift-product-selection + .fgf-add-gift-product {
	width: auto !important;
	max-width: 220px;
	margin-top: 12px !important;
}

/* ==========================================================================
   Table Layout (Cart & Table View)
   ========================================================================== */

.fgf_gift_products_table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--fgf-bg-card);
	border: 1px solid var(--fgf-border-color);
	border-radius: var(--fgf-radius-lg);
	overflow: hidden;
	box-shadow: var(--fgf-shadow-card);
	margin-bottom: 24px;
}

.fgf_gift_products_table thead th {
	background: var(--fgf-bg-subtle);
	color: var(--fgf-text-dark);
	font-size: 0.875rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 14px 18px;
	border-bottom: 1px solid var(--fgf-border-color);
	text-align: left;
}

.fgf_gift_products_table tbody tr {
	transition: background-color 0.2s ease;
}

.fgf_gift_products_table tbody tr:hover {
	background-color: var(--fgf-bg-subtle);
}

.fgf_gift_products_table tbody td {
	padding: 16px 18px;
	border-bottom: 1px solid var(--fgf-border-color);
	color: var(--fgf-text-body);
	vertical-align: middle;
}

.fgf_gift_products_table tbody tr:last-child td {
	border-bottom: none;
}

.fgf_gift_products_table td img {
	height: 48px;
	width: 48px;
	object-fit: cover;
	border-radius: var(--fgf-radius-sm);
	border: 1px solid var(--fgf-border-color);
}

.fgf_gift_products_table .fgf-gift-product-add-to-cart-actions {
	display: inline-flex;
	flex-direction: row;
	align-items: center;
	gap: 10px;
	width: auto;
}

.fgf_gift_products_table .fgf-add-manual-gift-product {
	width: auto !important;
	white-space: nowrap;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.fgf-gift-products-grid-footer nav,
.fgf_gift_products_table tfoot nav {
	display: flex;
	justify-content: center;
	padding: 18px 0 6px 0;
	margin: 0;
}

.fgf-gift-products-grid-footer nav ul,
.fgf_gift_products_table tfoot nav ul {
	display: flex;
	align-items: center;
	gap: 6px;
	list-style: none;
	margin: 0;
	padding: 0;
	border: none !important;
}

.fgf-gift-products-grid-footer nav ul li,
.fgf_gift_products_table tfoot nav ul li {
	margin: 0;
	padding: 0;
}

.fgf-gift-products-grid-footer nav ul li span,
.fgf_gift_products_table tfoot nav ul li span,
.fgf_pagination {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border-radius: var(--fgf-radius-sm);
	background: var(--fgf-bg-subtle);
	color: var(--fgf-text-dark);
	font-size: 0.875rem;
	font-weight: 600;
	border: 1px solid var(--fgf-border-color);
	cursor: pointer;
	transition: var(--fgf-transition);
	user-select: none;
}

.fgf-gift-products-grid-footer nav ul li span:hover,
.fgf_gift_products_table tfoot nav ul li span:hover,
.fgf_pagination:hover {
	background: var(--fgf-bg-secondary);
	border-color: var(--fgf-border-color-hover);
	color: var(--fgf-primary);
}

.fgf-gift-products-grid-footer nav ul li span.current,
.fgf_gift_products_table tfoot nav ul li span.current,
.fgf_pagination.current {
	background: var(--fgf-primary-gradient);
	color: #ffffff;
	border-color: var(--fgf-primary);
	box-shadow: 0 2px 6px rgba(5, 150, 105, 0.3);
}

/* ==========================================================================
   Popup & Modal Overrides
   ========================================================================== */

#lightcase-overlay {
	background: rgba(15, 23, 42, 0.72) !important;
	backdrop-filter: blur(4px);
}

#lightcase-content {
	border-radius: var(--fgf-radius-lg) !important;
	overflow: hidden;
	box-shadow: var(--fgf-shadow-hover) !important;
	background: #ffffff !important;
}

.fgf-popup-gift-products-wrapper {
	background: var(--fgf-bg-card);
	padding: 24px;
	border-radius: var(--fgf-radius-lg);
	max-height: 80vh;
	overflow-y: auto;
	box-sizing: border-box;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media screen and (max-width: 992px) {
	.fgf-grid-gift-products-items-dc-6,
	.fgf-grid-gift-products-items-dc-5 {
		grid-template-columns: repeat(3, 1fr);
	}
	.fgf-grid-gift-products-items-dc-4 {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media screen and (max-width: 768px) {
	.fgf-grid-gift-products-items-tc-6,
	.fgf-grid-gift-products-items-tc-5,
	.fgf-grid-gift-products-items-tc-4,
	.fgf-grid-gift-products-items-tc-3 {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.fgf-grid-gift-products-items-tc-2,
	.fgf-grid-gift-products-items-tc-1 {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.fgf_gift_products_wrapper h3 {
		font-size: 1.125rem;
	}

	/* Responsive table stacking */
	.fgf-frontend-table {
		border: 1px solid var(--fgf-border-color);
	}

	.fgf-frontend-table thead {
		display: none;
	}

	.fgf-frontend-table tbody tr {
		display: block;
		padding: 12px 14px;
		border-bottom: 1px solid var(--fgf-border-color);
	}

	.fgf-frontend-table tbody tr:last-child {
		border-bottom: none;
	}

	.fgf-frontend-table tr td {
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 8px 0;
		border: none;
		text-align: right !important;
	}

	.fgf-frontend-table tr td::before {
		content: attr(data-title);
		font-weight: 700;
		color: var(--fgf-text-dark);
		text-align: left;
		margin-right: 12px;
	}

	.fgf-frontend-table tfoot tr td {
		display: block;
		text-align: center !important;
	}

	.fgf-frontend-table tfoot tr td::before {
		display: none;
	}

	.fgf-dropdown-wrapper {
		width: 100%;
		max-width: 100%;
	}
}

@media screen and (max-width: 480px) {
	.fgf-grid-gift-products-items-mc-6,
	.fgf-grid-gift-products-items-mc-5,
	.fgf-grid-gift-products-items-mc-4,
	.fgf-grid-gift-products-items-mc-3,
	.fgf-grid-gift-products-items-mc-2,
	.fgf-grid-gift-products-items-mc-1 {
		grid-template-columns: 1fr;
		gap: 12px;
	}

	.fgf-popup-gift-products-wrapper {
		padding: 16px;
	}

	.fgf-progress-bar-wrapper {
		padding: 16px;
	}
}

/* ==========================================================================
   RTL (Right-to-Left) Support
   ========================================================================== */

[dir="rtl"] .fgf_gift_products_wrapper,
body.rtl .fgf_gift_products_wrapper {
	text-align: right;
}

[dir="rtl"] .fgf-gift-products-grid-items .fgf-gift-products-grid-item::before,
[dir="rtl"] .fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item::before,
body.rtl .fgf-gift-products-grid-items .fgf-gift-products-grid-item::before,
body.rtl .fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item::before {
	right: auto;
	left: 10px;
}

[dir="rtl"] .fgf-dropdown-product-image,
body.rtl .fgf-dropdown-product-image {
	margin-right: 0;
	margin-left: 12px;
}

[dir="rtl"] .fgf-pointer,
body.rtl .fgf-pointer {
	right: auto;
	left: 16px;
}

[dir="rtl"] .fgf-dropdown-wrapper,
body.rtl .fgf-dropdown-wrapper {
	float: right;
}

[dir="rtl"] .fgf_gift_products_table thead th,
body.rtl .fgf_gift_products_table thead th {
	text-align: right;
}

[dir="rtl"] .fgf_gift_products_table tbody td,
body.rtl .fgf_gift_products_table tbody td {
	text-align: right;
}

[dir="rtl"] .fgf-frontend-table tr td::before,
body.rtl .fgf-frontend-table tr td::before {
	float: right;
	margin-right: 0;
	margin-left: 12px;
	text-align: right;
}

[dir="rtl"] .fgf-frontend-table tr td,
body.rtl .fgf-frontend-table tr td {
	text-align: left !important;
}

[dir="rtl"] .fgf-carousel-gift-product-price del,
body.rtl .fgf-carousel-gift-product-price del {
	margin-right: 0;
	margin-left: 6px;
}

/* ==========================================================================
   Toast Notification
   ========================================================================== */

.fgf-toast {
	position: fixed;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%) translateY(100px);
	background: var(--fgf-primary-gradient);
	color: #ffffff;
	padding: 12px 22px;
	border-radius: var(--fgf-radius-pill);
	box-shadow: 0 10px 25px -5px rgba(5, 150, 105, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
	font-size: 0.9375rem;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 10px;
	z-index: 999999;
	opacity: 0;
	pointer-events: none;
	transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.fgf-toast.fgf-toast-show {
	transform: translateX(-50%) translateY(0);
	opacity: 1;
	pointer-events: auto;
}

.fgf-toast .fgf-toast-icon {
	font-size: 1.2rem;
	line-height: 1;
}

[dir="rtl"] .fgf-toast,
body.rtl .fgf-toast {
	direction: rtl;
}

/* ==========================================================================
   Loading Overlay & BlockUI Enhancements
   ========================================================================== */

.blockUI.blockOverlay {
	backdrop-filter: blur(2px) !important;
	background: rgba(255, 255, 255, 0.7) !important;
	border-radius: var(--fgf-radius-lg) !important;
	transition: opacity 0.2s ease !important;
}

.fgf_gift_products_wrapper.processing::after,
.fgf-gift-products-content.processing::after {
	content: "";
	position: absolute;
	top: calc(50% - 16px);
	left: calc(50% - 16px);
	width: 32px;
	height: 32px;
	border: 3px solid rgba(5, 150, 105, 0.2);
	border-top-color: var(--fgf-primary);
	border-radius: 50%;
	animation: fgfSpinner 0.8s linear infinite;
	z-index: 10000;
}

@keyframes fgfSpinner {
	to {
		transform: rotate(360deg);
	}
}

/* ==========================================================================
   Force Gifts Popup & Empty State
   ========================================================================== */

.fgf-force-gifts-popup-wrapper {
	position: relative;
}

.fgf-no-gifts-wrapper {
	text-align: center;
	padding: 36px 20px;
	background: var(--fgf-bg-subtle);
	border: 1px dashed var(--fgf-border-color);
	border-radius: var(--fgf-radius-lg);
	color: var(--fgf-text-muted);
	font-size: 0.9375rem;
}

/* ==========================================================================
   Accessibility: Reduced Motion
   ========================================================================== */

@media (prefers-reduced-motion: reduce) {
	.fgf_gift_products_wrapper *,
	.fgf_gift_products_wrapper *::before,
	.fgf_gift_products_wrapper *::after,
	.fgf-owl-carousel-items *,
	.fgf-owl-carousel-items *::before,
	.fgf-owl-carousel-items *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.fgf-progress-bar-outer-wrapper span.fgf-progress-bar-fill::after {
		display: none !important;
	}

	.fgf-gift-products-grid-items .fgf-gift-products-grid-item:hover,
	.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item:hover,
	.fgf-gift-products-grid-items .fgf-gift-products-grid-item:hover .fgf-product-image img,
	.fgf-owl-carousel-items .owl-item .fgf-owl-carousel-item:hover .fgf-product-image img,
	.fgf-add-manual-gift-product:hover,
	.fgf-add-gift-product:hover,
	.fgf_gift_products_wrapper:hover h3::before {
		transform: none !important;
	}
}
