/* ==========================================================================
   Cart sidebar, floating cart tab, product-page actions, Quick order
   Markup: inc/cart-drawer.php   Behaviour: assets/js/cart-drawer.js
   ========================================================================== */

[hidden] { display: none !important; }
html.gps-cd-lock { overflow: hidden; }

/* ---------- Sidebar ---------- */
.gps-cd {
	position: fixed;
	inset: 0;
	z-index: 10000;
	visibility: hidden;
	pointer-events: none;
	transition: visibility 0s linear .35s;
}
.gps-cd.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }

.gps-cd__overlay {
	position: absolute;
	inset: 0;
	background: rgba(22, 19, 32, .55);
	opacity: 0;
	transition: opacity .3s ease;
}
.gps-cd.is-open .gps-cd__overlay { opacity: 1; }

.gps-cd__panel {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(420px, 100vw);
	background: #fff;
	box-shadow: -18px 0 48px -20px rgba(22, 19, 32, .45);
	transform: translateX(100%);
	transition: transform .35s cubic-bezier(.2, .7, .2, 1);
	outline: none;
}
.gps-cd.is-open .gps-cd__panel { transform: translateX(0); }

.gps-cd__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 18px 20px;
	border-bottom: 1px solid var(--line);
}
.gps-cd__head h2 {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin: 0;
	font-family: var(--font-display);
	font-size: 1.2rem;
}
.gps-cd__count { font-size: .85rem; font-weight: 600; color: var(--grey); }
.gps-cd__close {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	color: var(--ink);
	background: var(--surface);
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background .2s ease, color .2s ease;
}
.gps-cd__close:hover { background: var(--ink); color: #fff; }

.gps-cd__inner {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	transition: opacity .2s ease;
}
.gps-cd__inner.is-busy { opacity: .55; pointer-events: none; }

/* ---------- Lines ---------- */
.gps-cd__list {
	flex: 1 1 auto;
	margin: 0;
	padding: 6px 20px;
	overflow-y: auto;
	list-style: none;
}
.gps-cd__item {
	position: relative;
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 14px;
	padding: 16px 0;
	border-bottom: 1px solid var(--line);
	transition: opacity .2s ease, transform .2s ease;
}
.gps-cd__item:last-child { border-bottom: 0; }
.gps-cd__item.is-removing { opacity: .3; transform: translateX(12px); }

.gps-cd__thumb {
	display: block;
	width: 72px;
	height: 72px;
	overflow: hidden;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 12px;
}
.gps-cd__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }

.gps-cd__info { min-width: 0; }
.gps-cd__name {
	display: block;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: .95rem;
	line-height: 1.3;
	color: var(--ink);
	text-decoration: none;
}
a.gps-cd__name:hover { color: var(--violet); }
.gps-cd__info dl.variation { margin: 4px 0 0; font-size: .78rem; color: var(--grey); }
.gps-cd__info dl.variation dt, .gps-cd__info dl.variation dd { display: inline; margin: 0; }
.gps-cd__info dl.variation dd p { display: inline; margin: 0; }
.gps-cd__price { margin-top: 4px; font-size: .85rem; color: var(--grey); }
.gps-cd__row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.gps-cd__line { font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.gps-cd__solo { font-size: .85rem; color: var(--grey); }

.gps-cd__qty {
	display: inline-flex;
	align-items: center;
	background: #fff;
	border: 1.5px solid var(--line);
	border-radius: 999px;
	overflow: hidden;
}
.gps-cd__qty button {
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1;
	color: var(--ink);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.gps-cd__qty button:hover { background: var(--surface); }
.gps-cd__qty input {
	width: 38px;
	height: 32px;
	padding: 0;
	font-weight: 700;
	text-align: center;
	background: transparent;
	border: 0;
	-moz-appearance: textfield;
}
.gps-cd__qty input::-webkit-outer-spin-button,
.gps-cd__qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.gps-cd__remove {
	align-self: start;
	display: grid;
	place-items: center;
	width: 30px;
	height: 30px;
	padding: 0;
	color: var(--grey);
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
}
.gps-cd__remove:hover { color: #fff; background: var(--coral); }

/* ---------- Footer ---------- */
.gps-cd__foot { padding: 16px 20px 20px; background: var(--surface); border-top: 1px solid var(--line); }
.gps-cd__subtotal { display: flex; align-items: baseline; justify-content: space-between; font-size: 1rem; }
.gps-cd__subtotal strong { font-family: var(--font-display); font-size: 1.25rem; }
.gps-cd__note { margin: 4px 0 14px; font-size: .78rem; color: var(--grey); }
.gps-cd__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.gps-cd__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 0 18px;
	font-family: var(--font-display);
	font-weight: 700;
	font-size: .95rem;
	text-decoration: none;
	border: 2px solid var(--ink);
	border-radius: 999px;
	transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.gps-cd__btn--ghost { color: var(--ink); background: transparent; }
.gps-cd__btn--ghost:hover { color: var(--cream); background: var(--ink); }
.gps-cd__btn--primary { color: #fff; background: var(--violet); border-color: var(--violet); }
.gps-cd__btn--primary:hover { color: var(--ink); background: var(--coral); border-color: var(--coral); transform: translateY(-2px); }

.gps-cd__empty {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 24px;
	text-align: center;
	color: var(--grey);
}
.gps-cd__empty p { margin: 0 0 12px; font-weight: 600; }

/* ---------- Floating cart tab ---------- */
.gps-cartfloat {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 9990;
	display: flex;
	flex-direction: column;
	width: 96px;
	padding: 0;
	overflow: hidden;
	font-family: var(--font-display);
	text-align: center;
	background: #fff;
	border: 0;
	border-radius: 16px 0 0 16px;
	box-shadow: 0 12px 30px -10px rgba(22, 19, 32, .45);
	transform: translateY(-50%);
	cursor: pointer;
	transition: box-shadow .2s ease;
}
.gps-cartfloat:hover { box-shadow: 0 16px 36px -10px rgba(124, 58, 237, .55); }
.gps-cartfloat:focus-visible { outline: 3px solid var(--violet-light); outline-offset: 2px; }
.gps-cartfloat__top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 12px 8px 10px;
	color: #fff;
	background: linear-gradient(160deg, var(--violet), var(--ink));
}
.gps-cartfloat__count { font-size: .78rem; font-weight: 800; }
.gps-cartfloat__total { padding: 9px 6px; font-size: .88rem; font-weight: 800; color: var(--ink); }
.gps-cartfloat.is-in { animation: gps-cf-in .45s cubic-bezier(.2, .7, .2, 1); }
.gps-cartfloat.is-bump .gps-cartfloat__top { animation: gps-cf-bump .45s ease; }
@keyframes gps-cf-in { from { transform: translate(100%, -50%); } to { transform: translate(0, -50%); } }
@keyframes gps-cf-bump { 40% { transform: scale(1.12); } }

@media (max-width: 600px) {
	.gps-cartfloat { width: 78px; top: auto; bottom: 96px; transform: none; }
	.gps-cartfloat.is-in { animation: none; }
}

/* ---------- Single product: qty stepper + Add to Cart / Buy Now ---------- */
.woocommerce div.product form.cart .quantity.gps-qty,
.woocommerce div.product form.cart .woocommerce-variation-add-to-cart .quantity.gps-qty {
	display: inline-flex;
	align-items: center;
	margin: 0;
	background: #fff;
	border: 2px solid var(--ink);
	border-radius: 999px;
	overflow: hidden;
}
.woocommerce .gps-qty .qty {
	width: 52px;
	min-height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	-moz-appearance: textfield;
}
.woocommerce .gps-qty .qty::-webkit-outer-spin-button,
.woocommerce .gps-qty .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gps-qty__btn {
	width: 42px;
	align-self: stretch;
	padding: 0;
	font-size: 1.2rem;
	line-height: 1;
	color: var(--ink);
	background: transparent;
	border: 0;
	cursor: pointer;
}
.gps-qty__btn:hover { background: var(--surface); }

.woocommerce div.product form.cart .single_add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex: 1 1 150px;
	min-height: 48px;
	font-weight: 700;
	color: #fff;
	background: var(--ink);
	border: 2px solid var(--ink);
	border-radius: 999px;
}
.woocommerce div.product form.cart .single_add_to_cart_button:hover { color: var(--ink); background: var(--coral); border-color: var(--coral); }
.woocommerce div.product form.cart .single_add_to_cart_button.loading { opacity: .6; pointer-events: none; }
.woocommerce div.product form.cart .single_add_to_cart_button.added { color: var(--ink); background: var(--mint); border-color: var(--ink); }
.woocommerce div.product form.cart .single_add_to_cart_button.added::after { content: "✓"; }
.woocommerce div.product form.cart .single_add_to_cart_button.disabled,
.woocommerce div.product form.cart .single_add_to_cart_button:disabled { opacity: .45; cursor: not-allowed; }

.woocommerce div.product form.cart .gps-buy-now { color: var(--ink); background: var(--coral); border-color: var(--coral); }
.woocommerce div.product form.cart .gps-buy-now:hover { color: #fff; background: var(--violet); border-color: var(--violet); }
.woocommerce div.product form.cart .gps-buy-now svg { flex-shrink: 0; }

/* WooCommerce's "View cart" link would appear beside the button — the sidebar replaces it. */
.woocommerce div.product form.cart .added_to_cart { display: none; }

/* ---------- Quick order ---------- */
.gps-qo {
	position: relative;
	margin: 6px 0 24px;
	padding: 22px 12px 12px;
	border: 2px solid var(--line);
	border-radius: 16px;
}
.gps-qo__legend {
	position: absolute;
	top: -12px;
	left: 50%;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0 10px;
	font-family: var(--font-display);
	font-size: .85rem;
	font-weight: 700;
	color: var(--ink);
	background: var(--cream);
	transform: translateX(-50%);
}
.gps-qo__legend svg { width: 14px; height: 14px; color: var(--coral); }
.gps-qo__btns { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.gps-qo__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 0 14px;
	font-family: var(--font-display);
	font-weight: 700;
	color: #fff;
	text-decoration: none;
	border-radius: 12px;
	transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}
.gps-qo__btn:hover { color: #fff; transform: translateY(-2px); filter: brightness(1.06); box-shadow: 0 10px 18px -10px rgba(22, 19, 32, .6); }
.gps-qo__btn--wa { background: #16a34a; }
.gps-qo__btn--ms { background: #1877f2; }

/* ---------- Toast ---------- */
.gps-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 10010;
	max-width: min(92vw, 420px);
	padding: 12px 18px;
	font-size: .9rem;
	font-weight: 600;
	color: #fff;
	background: var(--ink);
	border-radius: 12px;
	box-shadow: 0 14px 30px -12px rgba(22, 19, 32, .6);
	opacity: 0;
	transform: translate(-50%, 16px);
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.gps-toast {
	display: flex;
	align-items: center;
	gap: 14px;
}
.gps-toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.gps-toast__act {
	padding: 0;
	font: inherit;
	font-weight: 800;
	color: var(--gold);
	background: none;
	border: 0;
	cursor: pointer;
	text-decoration: underline;
	white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
	.gps-cd, .gps-cd__overlay, .gps-cd__panel, .gps-cartfloat, .gps-toast { transition: none; animation: none; }
	.gps-cartfloat.is-in, .gps-cartfloat.is-bump .gps-cartfloat__top { animation: none; }
}

/* ---------- Quick order on cart / checkout ---------- */
.gps-qo--plain { margin: 16px 0 0; padding: 14px; background: #fff; }
.gps-qo--plain .gps-qo__legend { position: static; padding: 0 0 10px; background: none; transform: none; }
.gps-qo--plain .gps-qo__btns { grid-template-columns: 1fr; }

