/* ==========================================================================
   Gys Sticky Add to Cart — Premium UI
   Palette is unchanged: red #c41e1e / #a81919, white, #111 text,
   green #27ae60 (in stock), red #e74c3c (out of stock).
   ========================================================================== */
:root {
	--gys-red: #c41e1e;
	--gys-red-dark: #a81919;
	--gys-ink: #111;
	--gys-ink-soft: #444;
	--gys-line: #f0f0f0;
	--gys-border: #e0e0e0;
	--gys-in-stock: #27ae60;
	--gys-out-stock: #e74c3c;
	--gys-radius: 16px;
	--gys-safe-bottom: env(safe-area-inset-bottom, 0px);
}

/* ==========================================================================
   Sticky Bar
   ========================================================================== */
.gys-satc-sticky-bar {
	position: fixed;
	bottom: -120px;
	left: 0;
	right: 0;
	width: 100%;
	background: rgba(255, 255, 255, 0.92);
	backdrop-filter: blur(16px) saturate(180%);
	-webkit-backdrop-filter: blur(16px) saturate(180%);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.08);
	z-index: 9998;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	padding: 12px 20px calc(12px + var(--gys-safe-bottom));
	transition: bottom 0.5s cubic-bezier(0.16, 1, 0.3, 1);
	cursor: pointer;
	box-sizing: border-box;
	direction: rtl;
	border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.gys-satc-sticky-bar.visible {
	bottom: 0;
}

.gys-satc-product-info {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0; /* allow title to truncate */
}

.gys-satc-product-image img {
	width: 46px;
	height: 46px;
	object-fit: cover;
	border-radius: 12px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.gys-satc-product-details {
	min-width: 0;
}

.gys-satc-product-title {
	font-size: 13px;
	font-weight: 600;
	margin: 0 0 3px 0;
	line-height: 1.25;
	color: var(--gys-ink-soft);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 160px;
}

.gys-satc-product-price {
	font-size: 16px;
	color: var(--gys-ink);
	font-weight: 800;
	letter-spacing: -0.3px;
}

.gys-satc-action {
	flex-shrink: 0;
}

.gys-satc-action-btn {
	background: linear-gradient(180deg, var(--gys-red) 0%, var(--gys-red-dark) 100%) !important;
	color: #fff !important;
	padding: 12px 22px;
	border-radius: 12px;
	font-size: 15px;
	font-weight: 800;
	border: none;
	pointer-events: none;
	box-shadow: 0 6px 16px rgba(196, 30, 30, 0.32);
	letter-spacing: -0.3px;
	white-space: nowrap;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.gys-satc-sticky-bar:hover .gys-satc-action-btn {
	box-shadow: 0 8px 22px rgba(196, 30, 30, 0.42);
	transform: translateY(-1px);
}

.gys-satc-sticky-bar:active .gys-satc-action-btn {
	transform: translateY(0);
}

/* ==========================================================================
   Popup Overlay
   ========================================================================== */
.gys-satc-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
	z-index: 9999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.4s ease, visibility 0.4s ease;
}

.gys-satc-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   Popup Card (bottom sheet on mobile)
   ========================================================================== */
.gys-satc-popup {
	position: fixed;
	bottom: -100%;
	left: 12px;
	right: 12px;
	width: auto;
	background: #ffffff;
	z-index: 10000;
	border-radius: 28px;
	padding: 0;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
	transition: bottom 0.55s cubic-bezier(0.16, 1, 0.3, 1);
	display: flex;
	flex-direction: column;
	max-height: 90vh;
	direction: rtl;
	overflow: hidden;
}

.gys-satc-popup.active {
	bottom: max(12px, var(--gys-safe-bottom));
}

/* Swipe handle */
.gys-satc-swipe-handle-wrapper {
	width: 100%;
	display: flex;
	justify-content: center;
	padding: 14px 0 2px;
	cursor: grab;
	touch-action: none;
	background: #fff;
	position: relative;
	z-index: 2;
}

.gys-satc-swipe-handle {
	width: 40px;
	height: 5px;
	background: #e2e2e2;
	border-radius: 99px;
	transition: background 0.2s ease;
}

.gys-satc-swipe-handle-wrapper:active .gys-satc-swipe-handle {
	background: #cfcfcf;
}

/* Close button */
.gys-satc-close-btn {
	position: absolute;
	top: 14px;
	right: 14px;
	background: #f4f4f4;
	border: none;
	color: var(--gys-ink-soft) !important;
	cursor: pointer;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.2s ease, transform 0.2s ease;
	z-index: 3;
}

.gys-satc-close-btn svg {
	width: 18px;
	height: 18px;
	stroke: var(--gys-ink-soft);
}

.gys-satc-close-btn:hover {
	background: #ebebeb;
	transform: rotate(90deg);
}

/* Content area */
.gys-satc-popup-content {
	padding: 8px 26px calc(26px + var(--gys-safe-bottom));
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	display: flex;
	flex-direction: column;
	background: #fff;
}

/* Title */
.gys-satc-popup-title {
	font-size: 20px;
	font-weight: 800;
	text-align: center;
	margin: 0 0 14px;
	color: var(--gys-ink);
	letter-spacing: -0.4px;
	line-height: 1.3;
	padding: 0 36px; /* clear the close button */
}

/* Product image */
.gys-satc-popup-image {
	width: 100%;
	max-width: 220px;
	margin: 0 auto 6px;
}

.gys-satc-popup-image img {
	width: 100%;
	height: auto;
	object-fit: contain;
	display: block;
	mix-blend-mode: multiply; /* drops white product backgrounds */
}

/* Diamond divider */
.gys-satc-divider {
	width: 100%;
	height: 1px;
	background: var(--gys-line);
	position: relative;
	margin: 16px 0;
}

.gys-satc-divider::after,
#gys-satc-form-container .single_variation_wrap::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 6px;
	height: 6px;
	background: #d4d4d4;
	border: 2px solid #fff;
}

/* Simple product info */
.gys-satc-popup-simple-info {
	text-align: center;
	margin-bottom: 16px;
}

.gys-satc-popup-price,
.gys-satc-popup-simple-info .price {
	font-size: 23px;
	font-weight: 800;
	color: var(--gys-ink);
	margin-bottom: 5px;
	letter-spacing: -0.5px;
}

.gys-satc-popup-status,
.gys-satc-popup-simple-info .stock {
	font-size: 13px;
	font-weight: 600;
	color: var(--gys-in-stock);
}

.gys-satc-popup-simple-info .out-of-stock {
	color: var(--gys-out-stock);
}

/* ==========================================================================
   Add-to-cart Form
   ========================================================================== */
#gys-satc-form-container {
	width: 100%;
}

#gys-satc-form-container form.cart {
	display: flex !important;
	flex-direction: column;
	align-items: center;
	margin: 0;
}

/* Variations — fully neutralized so only our styling shows */
#gys-satc-form-container table.variations {
	background: transparent !important;
	border: none !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin-bottom: 20px !important;
	width: 100% !important;
	border-collapse: separate !important;
}

#gys-satc-form-container table.variations tbody,
#gys-satc-form-container table.variations tr,
#gys-satc-form-container table.variations td,
#gys-satc-form-container table.variations th {
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	background: transparent !important;
	border: none !important;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
}

#gys-satc-form-container table.variations tr {
	gap: 12px;
	margin-bottom: 16px !important;
}

#gys-satc-form-container table.variations td.label {
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}

#gys-satc-form-container table.variations td.label label {
	font-weight: 800 !important;
	font-size: 16px !important;
	color: var(--gys-ink) !important;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
}

#gys-satc-form-container table.variations td.value {
	width: 100%;
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
}

#gys-satc-form-container table.variations td.value > div:not(.vi-wpvs-option):not(.swatch) {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Select dropdowns */
#gys-satc-form-container select {
	width: 100%;
	max-width: 300px;
	padding: 13px 18px;
	border: 1px solid var(--gys-border);
	border-radius: 14px;
	background-color: #fafafa;
	font-size: 15px;
	font-weight: 600;
	color: var(--gys-ink);
	appearance: none;
	-webkit-appearance: none;
	background-image: url('data:image/svg+xml;utf8,<svg fill="%23333" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
	background-repeat: no-repeat;
	background-position: left 14px center;
	background-size: 20px;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.03);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	cursor: pointer;
}

#gys-satc-form-container select:focus {
	border-color: var(--gys-red);
	background-color: #fff;
	box-shadow: 0 0 0 3px rgba(196, 30, 30, 0.12);
	outline: none;
}

/* Variation price & availability */
#gys-satc-form-container .woocommerce-variation {
	margin-bottom: 16px;
	text-align: center;
	width: 100%;
}

#gys-satc-form-container .woocommerce-variation-price {
	font-size: 24px;
	font-weight: 900;
	color: var(--gys-ink);
	margin-bottom: 5px;
	display: block;
	letter-spacing: -0.5px;
}

#gys-satc-form-container .woocommerce-variation-availability {
	font-size: 14px;
	font-weight: 700;
	color: var(--gys-in-stock);
	display: block;
}

#gys-satc-form-container .woocommerce-variation-availability .out-of-stock {
	color: var(--gys-out-stock);
}

/* Add-to-cart wrapper + its diamond divider */
#gys-satc-form-container .single_variation_wrap {
	display: flex;
	flex-direction: column;
	width: 100%;
	position: relative;
	padding-top: 30px;
}

#gys-satc-form-container .single_variation_wrap::before {
	width: 100%;
	height: 1px;
	background: var(--gys-line);
	top: 15px;
	left: 0;
	transform: translateY(-50%);
	position: absolute;
	content: '';
}

#gys-satc-form-container .single_variation_wrap::after {
	content: '';
	position: absolute;
	top: 15px;
	left: 50%;
	transform: translate(-50%, -50%) rotate(45deg);
	width: 6px;
	height: 6px;
	background: #d4d4d4;
	border: 2px solid #fff;
}

#gys-satc-form-container .woocommerce-variation-add-to-cart {
	display: flex;
	flex-direction: column;
	gap: 15px;
	align-items: center;
	justify-content: center;
	width: 100%;
}

#gys-satc-form-container .quantity {
	display: none !important;
}

/* Primary add-to-cart button */
#gys-satc-form-container button[type="submit"].single_add_to_cart_button,
#gys-satc-form-container button.single_add_to_cart_button {
	background: linear-gradient(180deg, var(--gys-red) 0%, var(--gys-red-dark) 100%) !important;
	color: #ffffff !important;
	border: none;
	padding: 17px 30px;
	border-radius: 16px;
	font-size: 18px;
	font-weight: 800;
	box-shadow: 0 8px 20px rgba(196, 30, 30, 0.28);
	transition: transform 0.15s ease, box-shadow 0.2s ease, filter 0.2s ease;
	width: 100%;
	max-width: 400px;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	letter-spacing: -0.3px;
	cursor: pointer;
}

#gys-satc-form-container button.single_add_to_cart_button::before {
	content: '';
	display: inline-block;
	width: 22px;
	height: 22px;
	background-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 24 24" fill="none" stroke="%23ffffff" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" xmlns="http://www.w3.org/2000/svg"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg>');
	background-size: contain;
	background-repeat: no-repeat;
}

#gys-satc-form-container button.single_add_to_cart_button:hover {
	transform: translateY(-2px);
	box-shadow: 0 12px 26px rgba(196, 30, 30, 0.38);
	filter: brightness(1.03);
}

#gys-satc-form-container button.single_add_to_cart_button:active {
	transform: translateY(0);
	box-shadow: 0 4px 12px rgba(196, 30, 30, 0.22);
}

#gys-satc-form-container button.single_add_to_cart_button.disabled {
	opacity: 0.45;
	pointer-events: none;
	box-shadow: none;
	filter: grayscale(0.2);
}

/* Body scroll lock */
body.gys-satc-locked {
	overflow: hidden;
}

/* ==========================================================================
   Desktop — centered modal dialog
   ========================================================================== */
@media (min-width: 768px) {
	.gys-satc-popup {
		width: 460px;
		left: 50%;
		right: auto;
		bottom: auto;
		top: 50%;
		transform: translate(-50%, -50%) scale(0.94);
		opacity: 0;
		visibility: hidden;
		max-height: 86vh;
		transition: opacity 0.35s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
	}

	.gys-satc-popup.active {
		bottom: auto;
		opacity: 1;
		visibility: visible;
		transform: translate(-50%, -50%) scale(1);
	}

	/* No drag-to-dismiss on desktop */
	.gys-satc-swipe-handle-wrapper {
		display: none;
	}

	.gys-satc-popup-content {
		padding-top: 28px;
	}
}
