/**
 * Header 5 — Blocksy off-canvas cart (#woo-cart-panel) as the prototype cart drawer
 * (gb-new-elements.css §5 shell, line items, "items included", cross-sell, totals, checkout).
 * Markup: woocommerce/cart/mini-cart.php (child override). Values verbatim from the prototype.
 * Tier A: the drawer can open from any page.
 */

#woo-cart-panel {
	--theme-text-color: var(--gb-on-dark);
	--theme-link-initial-color: #fff;
	--theme-link-hover-color: var(--gb-gold);
	--theme-headings-color: #fff;
	--theme-border-color: rgba(255, 255, 255, 0.1);
}

/* ---------- shell ---------- */
[data-header] #woo-cart-panel .ct-panel-inner {
	width: min(440px, 100%);
	background: var(--gb-dark);
	color: var(--gb-on-dark);
	border-left: 1px solid rgba(255, 255, 255, 0.1);
	box-shadow: var(--gb-shadow-2);
}

#woo-cart-panel .ct-panel-actions {
	padding: 16px var(--gb-gutter);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

#woo-cart-panel .ct-panel-heading {
	font-family: var(--gb-font-display);
	font-size: var(--gb-fs-20);
	font-weight: 600;
	color: #fff;
	letter-spacing: 0.01em;
	text-transform: none;
}

#woo-cart-panel .gb-mc-title { display: inline-flex; align-items: center; gap: 10px; }
#woo-cart-panel .gb-mc-title .gb-icon { color: var(--gb-gold); flex: 0 0 auto; }
#woo-cart-panel .gb-mc-title__count { color: var(--gb-on-dark-muted); font-family: var(--gb-font-body); font-size: var(--gb-fs-16); font-weight: 700; }

#woo-cart-panel .ct-toggle-close {
	--theme-icon-color: var(--gb-on-dark);
	--theme-icon-hover-color: #fff;
	width: 40px;
	height: 40px;
	border-radius: var(--gb-r-sm);
}

#woo-cart-panel .ct-toggle-close:hover { background: rgba(255, 255, 255, 0.1); }

/* Content fills the panel: scrolling body + pinned foot (no horizontal scroll). */
#woo-cart-panel .ct-panel-content,
#woo-cart-panel .ct-panel-content-inner {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	padding: 0;
	overflow: hidden;
}

#woo-cart-panel .widget_shopping_cart_content,
#woo-cart-panel .gb-mc {
	background: transparent; /* .gb-root carries the page ground colour */
	color: var(--gb-on-dark);
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	width: 100%;
}

#woo-cart-panel .gb-drawer__body { flex: 1 1 auto; min-height: 0; overflow-x: hidden; overflow-y: auto; padding: 16px var(--gb-gutter) 8px; }
#woo-cart-panel .gb-drawer__foot { flex: 0 0 auto; padding: 14px var(--gb-gutter) 18px; background: var(--gb-dark-2); border-top: 1px solid rgba(255, 255, 255, 0.12); }

/* ---------- line items ---------- */
#woo-cart-panel .gb-mc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
#woo-cart-panel .gb-mc-item {
	position: static;
	display: grid;
	grid-template-columns: 84px minmax(0, 1fr) auto;
	gap: 12px;
	margin: 0;
	padding: 0 0 14px;
	border: 0;
	border-bottom: 1px solid rgba(255, 255, 255, 0.08);
	transition: opacity .2s;
}
#woo-cart-panel .gb-mc-item:last-child { border-bottom: 0; padding-bottom: 0; }
#woo-cart-panel .gb-mc-item.is-updating { opacity: .55; }
#woo-cart-panel .gb-mc-item__img { display: block; align-self: start; line-height: 0; border-radius: var(--gb-r-md); overflow: hidden; }
#woo-cart-panel .gb-mc-item__img img { width: 100%; height: auto; aspect-ratio: 8 / 7; object-fit: cover; display: block; }
#woo-cart-panel .gb-mc-item__main { min-width: 0; display: grid; gap: 6px; align-content: start; }
#woo-cart-panel .gb-mc-item__name { font-family: var(--gb-font-display); font-size: var(--gb-fs-16); font-weight: 600; color: #fff; text-decoration: none; line-height: 1.25; }
#woo-cart-panel .gb-mc-item__name:hover { color: var(--gb-gold); }
#woo-cart-panel .gb-mc-item__meta { display: flex; flex-wrap: wrap; gap: 6px; font-size: var(--gb-fs-13); color: var(--gb-on-dark-muted); margin: 0; }
#woo-cart-panel .gb-mc-stock { color: #7bc490; font-weight: 600; }
#woo-cart-panel .gb-mc-item__price { grid-column: 3; grid-row: 1; align-self: start; margin: 0; line-height: 1.25; font-weight: 700; font-size: var(--gb-fs-15); color: #fff; white-space: nowrap; }
#woo-cart-panel .gb-mc-item__price .amount { font-weight: 700; color: #fff; }
#woo-cart-panel .gb-mc-item__row { display: flex; align-items: center; gap: 14px; margin-top: 2px; }

/* Extras / gift card chosen on the product page (WooCommerce item data). */
#woo-cart-panel .gb-mc-item__extras { margin: 0; font-size: var(--gb-fs-12); color: var(--gb-on-dark-muted); line-height: 1.4; }
#woo-cart-panel .gb-mc-item__extras dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 6px; margin: 0; }
#woo-cart-panel .gb-mc-item__extras dt { color: var(--gb-on-dark); font-weight: 600; margin: 0; }
#woo-cart-panel .gb-mc-item__extras dd { margin: 0; }
#woo-cart-panel .gb-mc-item__extras dd p { margin: 0; }

/* compact quantity stepper (prototype .gb-qty--mc) */
#woo-cart-panel .gb-qty--mc { display: inline-grid; grid-template-columns: 32px 40px 32px; border: 1.5px solid rgba(255, 255, 255, 0.28); border-radius: var(--gb-r-sm); overflow: hidden; background: transparent; }
#woo-cart-panel .gb-qty--mc button { appearance: none; border: 0; padding: 0; min-height: 32px; background: rgba(255, 255, 255, 0.06); color: var(--gb-on-dark); font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: none; }
#woo-cart-panel .gb-qty--mc button:hover { background: rgba(255, 255, 255, 0.14); color: #fff; }
#woo-cart-panel .gb-qty--mc input { appearance: none; -moz-appearance: textfield; min-height: 32px; height: 32px; width: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; color: #fff; font-size: var(--gb-fs-14); font-weight: 700; text-align: center; box-shadow: none; }
#woo-cart-panel .gb-qty--mc input::-webkit-outer-spin-button,
#woo-cart-panel .gb-qty--mc input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

#woo-cart-panel .gb-mc-wish { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; min-height: 0; padding: 0; flex: 0 0 auto; background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.28); border-radius: var(--gb-r-sm); color: var(--gb-on-dark); cursor: pointer; box-shadow: none; }
#woo-cart-panel .gb-mc-wish:hover,
#woo-cart-panel .gb-mc-wish[aria-pressed="true"] { border-color: var(--gb-gold); color: var(--gb-gold); background: transparent; }
#woo-cart-panel .gb-mc-wish[aria-pressed="true"] .gb-icon { fill: var(--gb-gold); }

/* "Remove" (WooCommerce remove_from_cart_button) as a text link. */
#woo-cart-panel .gb-mc-item .remove.gb-mc-remove {
	position: static;
	display: inline;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	background: none;
	border: 0;
	font-size: var(--gb-fs-13);
	font-weight: 600;
	line-height: inherit;
	color: var(--gb-on-dark-muted);
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
	opacity: 1;
}
#woo-cart-panel .gb-mc-item .remove.gb-mc-remove:hover { color: #fff; background: none; }

/* "N items included" */
#woo-cart-panel .gb-mc-inside { margin-top: 2px; }
#woo-cart-panel .gb-mc-inside summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; font-size: var(--gb-fs-13); color: var(--gb-on-dark-muted); text-decoration: underline; text-underline-offset: 2px; }
#woo-cart-panel .gb-mc-inside summary::-webkit-details-marker { display: none; }
#woo-cart-panel .gb-mc-inside__hide { display: none; }
#woo-cart-panel .gb-mc-inside[open] .gb-mc-inside__show { display: none; }
#woo-cart-panel .gb-mc-inside[open] .gb-mc-inside__hide { display: inline; }
#woo-cart-panel .gb-mc-chev { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translate(-1px, -1px); flex: 0 0 auto; }
#woo-cart-panel details[open] > summary .gb-mc-chev { transform: rotate(-135deg) translate(-2px, -2px); }
#woo-cart-panel .gb-mc-sub { list-style: none; margin: 10px 0 0; padding: 0 0 0 12px; display: grid; gap: 12px; border-left: 1px solid rgba(255, 255, 255, 0.12); }
/* included items (prototype): thumbnail, name, meta, qty, price. Nested in the mini-cart list, so Blocksy's line-item box is reset. */
#woo-cart-panel .gb-mc-sub__item { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 10px; align-items: start; position: static; margin: 0; padding: 0; border: 0; min-height: 0; }
#woo-cart-panel .gb-mc-sub__img { display: block; line-height: 0; border-radius: 4px; overflow: hidden; color: var(--gb-on-dark); }
#woo-cart-panel .gb-mc-ph { width: 56px; height: auto; display: block; }
#woo-cart-panel .gb-mc-sub__body { display: grid; gap: 2px; min-width: 0; }
#woo-cart-panel .gb-mc-sub__name { font-size: var(--gb-fs-14); font-weight: 700; color: #fff; line-height: 1.3; }
#woo-cart-panel .gb-mc-sub__meta,
#woo-cart-panel .gb-mc-sub__qty { font-size: var(--gb-fs-12); color: var(--gb-on-dark-muted); line-height: 1.4; }
#woo-cart-panel .gb-mc-sub__price { font-size: var(--gb-fs-14); font-weight: 700; color: var(--gb-on-dark-muted); line-height: 1.3; }

/* "Goes well with" */
#woo-cart-panel .gb-mc-xsell { margin-top: 18px; padding: 14px; background: var(--gb-dark-2); border-radius: var(--gb-r-md); }
#woo-cart-panel .gb-mc-xsell__title { margin: 0 0 10px; font-size: var(--gb-fs-12); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--gb-on-dark-muted); }
#woo-cart-panel .gb-mc-xsell__row { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
#woo-cart-panel .gb-mc-xsell__img { align-self: start; line-height: 0; }
#woo-cart-panel .gb-mc-xsell__img img { width: 100%; height: auto; aspect-ratio: 8 / 7; object-fit: cover; display: block; border-radius: var(--gb-r-sm); }
#woo-cart-panel .gb-mc-xsell__name { font-size: var(--gb-fs-14); font-weight: 700; color: #fff; text-decoration: none; }
#woo-cart-panel .gb-mc-xsell__name:hover { color: var(--gb-gold); }
#woo-cart-panel .gb-mc-xsell__price { margin: 4px 0 0; font-size: var(--gb-fs-14); color: var(--gb-gold); font-weight: 700; }
#woo-cart-panel .gb-mc-xsell__price del { color: var(--gb-on-dark-muted); margin-left: 6px; font-size: var(--gb-fs-13); font-weight: 400; order: 2; }
#woo-cart-panel .gb-mc-xsell__price ins { text-decoration: none; }
#woo-cart-panel .gb-mc-xsell__add { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 16px; background: transparent; border: 1.5px solid rgba(255, 255, 255, 0.28); border-radius: var(--gb-r-sm); color: var(--gb-on-dark); font-weight: 700; font-size: var(--gb-fs-13); text-decoration: none; cursor: pointer; }
#woo-cart-panel .gb-mc-xsell__add:hover { border-color: var(--gb-gold); color: var(--gb-gold); }
#woo-cart-panel .gb-mc-xsell .added_to_cart { display: none; }

/* ---------- foot ---------- */
#woo-cart-panel .gb-mc-note { margin: 0 0 12px; padding: 10px 12px 10px 14px; border-left: 3px solid var(--gb-gold); border-radius: var(--gb-r-sm); background: rgba(255, 255, 255, 0.04); font-size: var(--gb-fs-13); line-height: 1.45; color: var(--gb-on-dark); }
#woo-cart-panel .gb-mc-totals { margin: 0; padding: 12px 0 14px; border-top: 1px solid rgba(255, 255, 255, 0.10); display: grid; gap: 8px; }
#woo-cart-panel .gb-mc-totals > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
#woo-cart-panel .gb-mc-totals dt { margin: 0; font-size: var(--gb-fs-14); font-weight: 400; color: var(--gb-on-dark-muted); }
#woo-cart-panel .gb-mc-totals dd { margin: 0; font-size: var(--gb-fs-14); font-weight: 700; color: #fff; }
#woo-cart-panel .gb-mc-totals__grand { padding-top: 10px; border-top: 1px solid rgba(255, 255, 255, 0.10); }
#woo-cart-panel .gb-mc-totals__grand dt { font-family: var(--gb-font-display); font-size: var(--gb-fs-18); color: #fff; font-weight: 600; }
#woo-cart-panel .gb-mc-totals__grand dd { font-size: var(--gb-fs-20); color: var(--gb-gold); }

#woo-cart-panel .gb-mc-checkout { margin-top: 2px; min-height: 48px; }
#woo-cart-panel .gb-mc-lock { width: 12px; height: 14px; border: 1.8px solid currentColor; border-radius: 2px; position: relative; display: inline-block; margin-right: 8px; vertical-align: -2px; }
#woo-cart-panel .gb-mc-lock::before { content: ""; position: absolute; left: 50%; top: -6px; transform: translateX(-50%); width: 8px; height: 7px; border: 1.8px solid currentColor; border-bottom: 0; border-radius: 4px 4px 0 0; }
#woo-cart-panel .gb-mc-continue { display: block; text-align: center; margin-top: 12px; font-size: var(--gb-fs-14); font-weight: 700; color: var(--gb-on-dark); text-decoration: underline; text-underline-offset: 3px; }
#woo-cart-panel .gb-mc-continue:hover { color: var(--gb-gold); }

/* ---------- empty ---------- */
#woo-cart-panel .gb-mc-empty { text-align: center; padding-top: 12px; }
#woo-cart-panel .gb-mc-illus { display: block; margin: 8px auto 14px; color: rgba(177, 141, 86, .65); }
#woo-cart-panel .gb-mc-empty__text { margin: 0 0 16px; font-size: var(--gb-fs-15); color: var(--gb-on-dark-muted); }

@media (max-width: 480px) {
	#woo-cart-panel .gb-mc-item { grid-template-columns: 68px minmax(0, 1fr) auto; gap: 10px; }
	#woo-cart-panel .gb-mc-item__row { flex-wrap: wrap; gap: 10px; }
}

/* Prototype drawer values: 73px title bar (40px close button), 12px note on a faint gold ground. */
#woo-cart-panel .ct-panel-actions { min-height: 73px; box-sizing: border-box; align-items: center; }
#woo-cart-panel .gb-mc-note { padding: 10px 12px; background: rgba(177, 141, 86, 0.12); font-size: var(--gb-fs-12); line-height: 1.5; color: var(--gb-on-dark); }
/* Included item with its own photo (item-images.php); the placeholder stays otherwise (QA). */
#woo-cart-panel .gb-mc-sub__img.has-img { width: 56px; height: 49px; background: #fff; }
#woo-cart-panel .gb-mc-sub__img.has-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
