/**
 * Gia Custom Cart Panel styles — the approved mockup applied to our own markup.
 * The Pixfort shell sizing (.pix-sidebar full-height/width) is handled by
 * cart-sidebar.css; this file styles the .gia-cart panel we inject inside it.
 *
 * White surface, black square checkout button, radius 0, EB Garamond titles +
 * Jost body, quantity stepper, coupon field, subtotal/discount/shipping/total.
 */

.gia-cart {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	font-family: 'Jost', sans-serif;
	background: #fff;
	position: relative;
	z-index: 100000000000; /* above the backdrop (99999999998) */
}

.gia-cart--loading {
	opacity: 0.55;
	pointer-events: none;
	transition: opacity 0.15s ease;
}

/* ---- Items (scrollable) ---- */
.gia-cart__items {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 4px 28px;
	min-height: 0;
}

.gia-cart-item {
	display: flex;
	position: relative;
	gap: 20px;
	padding: 24px 0;
	border-bottom: 1px solid #f0f0f0;
	align-items: stretch;
}

.gia-cart-item__thumb {
	flex: 0 0 104px;
	width: 104px;
	align-self: stretch;
	display: flex;
}

.gia-cart-item__thumb a,
.gia-cart-item__thumb > a {
	display: block;
	width: 100%;
}

.gia-cart-item__thumb img {
	width: 104px !important;
	height: 100% !important;
	min-height: 130px !important;
	object-fit: cover !important;
	object-position: center !important;
	display: block !important;
	border-radius: 0 !important;
	max-width: none !important;
	min-width: 104px !important;
	margin: 0 !important;
}

.gia-cart-item__info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.gia-cart-item__head {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 10px;
}

.gia-cart-item__titles {
	min-width: 0;
}

.gia-cart-item__eyebrow {
	font-family: 'Jost', sans-serif;
	font-size: 10.5px;
	font-weight: 400;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #8c8475;
	margin: 0 0 5px;
}

.gia-cart-item__name {
	font-family: 'EB Garamond', serif;
	font-size: 21px;
	line-height: 1.12;
	color: #23211e;
	margin: 0;
}

/* Option 3: caps label above value, attributes side by side. */
.gia-cart-item__attrs {
	display: flex;
	gap: 34px;
	margin: 13px 0 0;
}
.gia-cart-item__attr { margin: 0; }
.gia-cart-item__attr dt {
	font-family: 'Jost', sans-serif;
	font-size: 9px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #b0a99c;
	margin: 0 0 3px;
}
.gia-cart-item__attr dd {
	font-family: 'EB Garamond', serif;
	font-size: 15px;
	color: #23211e;
	margin: 0;
}

/* Price block: unit price stacked over line total, right-aligned, centered to
   the stepper height. Unit line only renders when qty > 1 (PHP-controlled). */
.gia-cart-item__priceblock {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: center;
	gap: 2px;
}
.gia-cart-item__unit {
	font-family: 'Jost', sans-serif;
	font-size: 10.5px;
	letter-spacing: 0.03em;
	color: #a8a29a;
	white-space: nowrap;
}
.gia-cart-item__price {
	font-family: 'Jost', sans-serif;
	font-size: 15px;
	color: #23211e;
	letter-spacing: 0.02em;
	white-space: nowrap;
	margin: 0;
}

.gia-cart-item__remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #a8a29a;
	font-size: 18px;
	line-height: 1;
	padding: 0;
	flex: 0 0 auto;
}
.gia-cart-item__remove:hover { color: #a03030; }

.gia-cart-item__controls {
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	margin-top: auto;
	padding-top: 16px;
}

.gia-cart-item__qty {
	display: inline-flex;
	align-items: center;
	border: 1px solid #e6e6e6;
}
.gia-cart-item__qty button {
	width: 40px;
	height: 44px;
	background: none;
	border: none;
	cursor: pointer;
	color: #23211e;
	font-size: 16px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
}
.gia-cart-item__qty button:hover { background: #f5f5f5; }
.gia-cart-item__qty-val {
	min-width: 38px;
	text-align: center;
	font-family: 'Jost', sans-serif;
	font-size: 14px;
	color: #23211e;
}

/* ---- Mobile: same Option 3 structure, scaled down ---- */
@media (max-width: 600px) {
	.gia-cart-item { gap: 13px; padding: 18px; }
	.gia-cart-item__thumb { flex: 0 0 82px; width: 82px; }
	.gia-cart-item__thumb img { width: 82px !important; min-width: 82px !important; min-height: 118px !important; }
	.gia-cart-item__name { font-size: 18px; }
	.gia-cart-item__attrs { gap: 20px; }
	.gia-cart-item__attr dd { font-size: 13.5px; }
	.gia-cart-item__price { font-size: 14px; }
}

/* ---- Coupon ---- */
.gia-cart__coupon {
	padding: 18px 28px;
	border-top: 1px solid #e6e6e6;
	flex: 0 0 auto;
}
.gia-cart__coupon-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	background: none;
	border: none;
	cursor: pointer;
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #8c8475;
	padding: 0;
}
.gia-cart__coupon-field {
	display: flex;
	gap: 8px;
	margin-top: 12px;
}
.gia-cart__coupon-field[hidden] { display: none; }
.gia-cart__coupon-input {
	flex: 1;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	color: #23211e;
	background: #fff;
	border: 1px solid #e6e6e6;
	padding: 11px 13px;
	border-radius: 0;
}
.gia-cart__coupon-input:focus { outline: none; border-color: #23211e; }
.gia-cart__coupon-apply {
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	background: none;
	border: 1px solid #23211e;
	color: #23211e;
	padding: 0 18px;
	cursor: pointer;
	transition: background 0.15s ease;
}
.gia-cart__coupon-apply:hover { background: #23211e; color: #fff; }
.gia-cart__coupon-error {
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	color: #a03030;
	margin: 8px 0 0;
}
.gia-cart__applied-coupons {
	list-style: none;
	margin: 10px 0 0;
	padding: 0;
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: #7a6a4f;
}
.gia-cart__applied-coupons button {
	background: none;
	border: none;
	color: #a8a29a;
	cursor: pointer;
	font-size: 14px;
}
.gia-cart__applied-coupons button:hover { color: #a03030; }

/* ---- Totals ---- */
.gia-cart__totals {
	padding: 20px 28px 0;
	border-top: 1px solid #e6e6e6;
	flex: 0 0 auto;
}
.gia-cart-line {
	display: flex;
	justify-content: space-between;
	font-family: 'Jost', sans-serif;
	font-size: 13px;
	color: #4a463f;
	letter-spacing: 0.02em;
	margin-bottom: 11px;
}
.gia-cart-line__label { color: #8c8475; }
.gia-cart-line--total {
	align-items: baseline;
	padding-top: 15px;
	border-top: 1px solid #e6e6e6;
	margin-top: 5px;
	margin-bottom: 0;
}
.gia-cart-line--total .gia-cart-line__label {
	font-family: 'EB Garamond', serif;
	font-size: 20px;
	color: #23211e;
}
.gia-cart-line--total .gia-cart-line__val {
	font-family: 'EB Garamond', serif;
	font-size: 22px;
	color: #23211e;
}
.gia-cart-line__val .woocommerce-Price-amount { color: inherit; font: inherit; }

/* ---- Checkout button ---- */
.gia-cart__checkout {
	display: block;
	margin: 18px 28px 0;
	font-family: 'Jost', sans-serif;
	font-size: 12px;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: #fff !important;
	background: #23211e;
	border: none;
	border-radius: 0;
	padding: 17px;
	text-align: center;
	text-decoration: none;
	transition: opacity 0.15s ease;
}
.gia-cart__checkout:hover { opacity: 0.86; color: #fff !important; background: #23211e; }

.gia-cart__whatsapp {
	display: block;
	margin: 12px 28px 24px;
	font-family: 'Jost', sans-serif;
	font-size: 11px;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: #23211e;
	background: none;
	border: 1px solid #23211e;
	border-radius: 0;
	padding: 14px;
	text-align: center;
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.gia-cart__whatsapp:hover {
	background: #23211e;
	color: #fff;
}

/* ---- Empty ---- */
.gia-cart__empty {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px 28px;
	text-align: center;
}
.gia-cart__empty-msg {
	font-family: 'EB Garamond', serif;
	font-size: 19px;
	color: #9b958a;
	margin: 0;
}
.gia-cart__empty-actions {
	flex: 0 0 auto;
	padding: 0 28px 24px;
}
.gia-cart__empty-actions .gia-cart__checkout {
	margin: 0 0 12px;
}
.gia-cart__empty-actions .gia-cart__whatsapp {
	margin: 0;
}

/* ---- Backdrop: dims the page behind the open cart sidebar ---- */
.gia-cart-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(35, 33, 30, 0.34);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.28s ease, visibility 0.28s ease;
	z-index: 99999999998; /* one below Pixfort's sidebar; sibling + DOM order also enforces this */
}
.gia-cart-backdrop.is-visible {
	opacity: 1;
	visibility: visible;
}

/* ---- Entrance animation (one-time, on cart open) ----
   Panel is server-rendered and always in the DOM. The .gia-cart-revealed class
   (added by JS when the sidebar opens) drives a gentle staggered fade-up. */

/* Items are visible by default (if JS fails, panel still shows). The entrance
   only plays when .gia-cart-revealed is present. */
.gia-cart-revealed .gia-cart-item {
	opacity: 0;
	transform: translateY(10px);
	animation: gia-cart-item-in 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) forwards;
}
.gia-cart-revealed .gia-cart-item:nth-child(1) { animation-delay: 0.05s; }
.gia-cart-revealed .gia-cart-item:nth-child(2) { animation-delay: 0.11s; }
.gia-cart-revealed .gia-cart-item:nth-child(3) { animation-delay: 0.17s; }
.gia-cart-revealed .gia-cart-item:nth-child(4) { animation-delay: 0.23s; }
.gia-cart-revealed .gia-cart-item:nth-child(n+5) { animation-delay: 0.28s; }

@keyframes gia-cart-item-in {
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Totals + checkout fade in slightly after the items settle. */
.gia-cart-revealed .gia-cart__coupon,
.gia-cart-revealed .gia-cart__totals,
.gia-cart-revealed .gia-cart__checkout,
.gia-cart-revealed .gia-cart__whatsapp {
	opacity: 0;
	animation: gia-cart-fade-in 0.4s ease 0.22s forwards;
}
@keyframes gia-cart-fade-in {
	to { opacity: 1; }
}

/* Respect reduced-motion preferences. */
@media (prefers-reduced-motion: reduce) {
	.gia-cart-revealed .gia-cart-item,
	.gia-cart-revealed .gia-cart__coupon,
	.gia-cart-revealed .gia-cart__totals,
	.gia-cart-revealed .gia-cart__checkout,
	.gia-cart-revealed .gia-cart__whatsapp {
		animation: none;
		opacity: 1;
		transform: none;
	}
}

