/**
 * GFCH side cart drawer + floating launcher.
 */

html.gfch-side-cart-open,
html.gfch-side-cart-open body {
	overflow: hidden;
}

.gfch-side-cart[hidden] {
	display: none !important;
}

.gfch-side-cart {
	position: fixed;
	inset: 0;
	z-index: 100050;
}

.gfch-side-cart__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 42, 0.45);
	backdrop-filter: blur(2px);
	opacity: 0;
	transition: opacity 0.22s ease;
}

.gfch-side-cart.is-open .gfch-side-cart__backdrop {
	opacity: 1;
}

.gfch-side-cart__panel {
	position: absolute;
	top: 0;
	right: 0;
	width: min(400px, 100%);
	height: 100%;
	background: #fff;
	box-shadow: -12px 0 40px rgba(15, 23, 42, 0.18);
	display: flex;
	flex-direction: column;
	transform: translateX(105%);
	transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}

.gfch-side-cart.is-open .gfch-side-cart__panel {
	transform: translateX(0);
}

.gfch-side-cart__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.1rem 1.15rem;
	border-bottom: 1px solid #e8edf2;
	flex-shrink: 0;
}

.gfch-side-cart__title {
	margin: 0;
	font-size: 1.15rem;
	font-weight: 800;
	color: #0f172a;
}

.gfch-side-cart__close {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	border: 0;
	background: transparent;
	color: #0f172a;
	font: inherit;
	font-size: 0.88rem;
	font-weight: 800;
	cursor: pointer;
	padding: 0.25rem;
}

.gfch-side-cart__close:hover {
	color: #005028;
}

.gfch-side-cart__body {
	flex: 1 1 auto;
	overflow: auto;
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.gfch-side-cart__items {
	list-style: none;
	margin: 0;
	padding: 0.5rem 0;
	flex: 1 1 auto;
}

.gfch-side-cart__item {
	display: grid;
	grid-template-columns: 72px 1fr;
	gap: 0.85rem;
	padding: 1rem 1.15rem;
	border-bottom: 1px solid #eef2f6;
}

.gfch-side-cart__item-media {
	width: 72px;
	height: 72px;
	border-radius: 10px;
	overflow: hidden;
	background: #f1f5f1;
	flex-shrink: 0;
}

.gfch-side-cart__item-media a {
	display: block;
	width: 100%;
	height: 100%;
	line-height: 0;
}

.gfch-side-cart__item-media img,
.gfch-side-cart__thumb {
	width: 72px !important;
	height: 72px !important;
	max-width: none !important;
	object-fit: cover;
	border-radius: 10px;
	display: block;
	background: #f1f5f1;
}

.gfch-side-cart__item-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
}

.gfch-side-cart__item-name {
	font-weight: 700;
	color: #0f172a;
	text-decoration: none;
	line-height: 1.3;
	font-size: 0.95rem;
}

.gfch-side-cart__item-name:hover {
	color: #005028;
}

.gfch-side-cart__remove {
	flex-shrink: 0;
	width: 1.5rem;
	height: 1.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 999px;
	background: #f1f5f9;
	color: #64748b;
	cursor: pointer;
}

.gfch-side-cart__remove:hover {
	background: #ff6962;
	color: #fff;
}

.gfch-side-cart__item-sku {
	margin: 0.25rem 0 0.55rem;
	font-size: 0.75rem;
	font-weight: 800;
	color: #0f172a;
}

.gfch-side-cart__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #dbe3ea;
	border-radius: 8px;
	overflow: hidden;
	margin-bottom: 0.45rem;
}

.gfch-side-cart__qty-btn {
	width: 2rem;
	height: 2rem;
	border: 0;
	background: #f8fafc;
	color: #334155;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
}

.gfch-side-cart__qty-btn:hover {
	background: #f7941d;
	color: #fff;
}

.gfch-side-cart__qty-input {
	width: 2.4rem;
	height: 2rem;
	border: 0;
	border-left: 1px solid #dbe3ea;
	border-right: 1px solid #dbe3ea;
	text-align: center;
	font: inherit;
	font-weight: 700;
	font-size: 0.9rem;
	color: #0f172a;
	appearance: textfield;
	-moz-appearance: textfield;
}

.gfch-side-cart__qty-input::-webkit-outer-spin-button,
.gfch-side-cart__qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.gfch-side-cart__item-price {
	margin: 0;
	font-size: 0.9rem;
	font-weight: 700;
	color: #005028;
}

.gfch-side-cart__item-price .amount,
.gfch-side-cart__item-price .woocommerce-Price-amount {
	color: #005028;
}

.gfch-side-cart__footer {
	margin-top: auto;
	padding: 1rem 1.15rem 1.25rem;
	border-top: 1px solid #e8edf2;
	background: #fff;
	flex-shrink: 0;
}

.gfch-side-cart__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.85rem;
	font-size: 1rem;
	font-weight: 700;
	color: #0f172a;
}

.gfch-side-cart__subtotal strong,
.gfch-side-cart__subtotal .amount {
	color: #005028;
}

.gfch-side-cart__shipping {
	margin-bottom: 1rem;
}

.gfch-side-cart__shipping p {
	margin: 0 0 0.45rem;
	font-size: 0.82rem;
	font-weight: 800;
	color: #0f172a;
	line-height: 1.4;
}

.gfch-side-cart__shipping-bar {
	height: 8px;
	border-radius: 999px;
	background: #e8edf2;
	overflow: hidden;
}

.gfch-side-cart__shipping-bar span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: repeating-linear-gradient(
		-45deg,
		#005028,
		#005028 6px,
		#0a7a32 6px,
		#0a7a32 12px
	);
	transition: width 0.25s ease;
}

.gfch-side-cart__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	box-sizing: border-box;
	border-radius: 10px;
	padding: 0.85rem 1rem;
	font-weight: 700;
	font-size: 0.95rem;
	text-decoration: none !important;
	margin-bottom: 0.55rem;
}

.gfch-side-cart__btn:last-child {
	margin-bottom: 0;
}

.gfch-side-cart__btn--ghost {
	background: #eef7f1;
	color: #005028 !important;
}

.gfch-side-cart__btn--ghost:hover {
	background: #f7941d;
	color: #fff !important;
}

.gfch-side-cart__btn--primary {
	background: #005028;
	color: #fff !important;
}

.gfch-side-cart__btn--primary:hover {
	background: #f7941d;
}

.gfch-side-cart__empty {
	padding: 2.5rem 1.25rem;
	text-align: center;
}

.gfch-side-cart__empty p {
	margin: 0 0 1rem;
	color: #64748b;
	font-weight: 600;
}

/* Floating cart + wishlist rail — middle right */
.gfch-float-rail[hidden] {
	display: none !important;
}

.gfch-float-rail {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 100040;
	transform: translate3d(0, -50%, 0);
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.55rem;
	padding: 0.5rem 0 0.5rem 0.45rem;
	margin: 0;
	background: #005028;
	border-radius: 14px 0 0 14px;
	box-shadow: -4px 6px 20px rgba(0, 80, 40, 0.28);
	overflow: visible;
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition:
		transform 0.28s ease,
		padding 0.22s ease,
		box-shadow 0.22s ease,
		opacity 0.22s ease,
		visibility 0.22s ease;
}

.gfch-float-rail.is-visible {
	display: flex;
}

/* Open: grow left, icons stay centered so they move with the rail — no right gap. */
.gfch-float-rail:hover,
.gfch-float-rail:focus-within {
	padding-left: 1.4rem;
	padding-right: 0;
	box-shadow: -10px 8px 28px rgba(0, 80, 40, 0.36);
}

/* Close: slide off when side cart drawer is open. */
html.gfch-side-cart-open .gfch-float-rail.is-visible {
	display: flex !important;
	transform: translate3d(110%, -50%, 0);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	box-shadow: none;
}

.gfch-side-cart-fab[hidden],
.gfch-wishlist-fab[hidden] {
	display: none !important;
}

.gfch-side-cart-fab,
.gfch-wishlist-fab {
	position: relative;
	top: auto;
	right: auto;
	z-index: 1;
	transform: none;
	display: none;
	align-items: center;
	justify-content: center;
	width: 2.85rem;
	height: 2.85rem;
	margin: 0;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: #fff;
	box-shadow: none;
	cursor: pointer;
	padding: 0;
	text-decoration: none;
	overflow: hidden;
}

.gfch-side-cart-fab.is-visible,
.gfch-wishlist-fab.is-visible {
	display: inline-flex;
}

.gfch-side-cart-fab:hover,
.gfch-wishlist-fab:hover,
.gfch-side-cart-fab:focus-visible,
.gfch-wishlist-fab:focus-visible {
	background: #f7941d;
	color: #fff;
}

.gfch-side-cart-fab__count,
.gfch-wishlist-fab__count {
	/* Count shown on flip back-face only. */
	position: static;
	opacity: 1;
	transform: none;
	background: transparent;
	box-shadow: none;
	font-size: 1rem;
	font-weight: 800;
	line-height: 1;
	color: inherit;
}

@media (max-width: 480px) {
	.gfch-side-cart__panel {
		width: 100%;
	}

	.gfch-float-rail {
		gap: 0.45rem;
		padding: 0.5rem 0 0.5rem 0.35rem;
	}

	.gfch-float-rail:hover,
	.gfch-float-rail:focus-within {
		padding-left: 1.1rem;
		padding-right: 0;
	}

	.gfch-side-cart-fab,
	.gfch-wishlist-fab {
		width: 2.6rem;
		height: 2.6rem;
	}
}
