/*
 * Cicka Design – slide-in cart sidebar (Astra's #astra-mobile-cart-drawer).
 *
 * Markup: woocommerce/cart/mini-cart.php. Only the sidebar is styled; the
 * header cart icon and how the sidebar opens and closes stay Astra's.
 * Payment buttons that plugins add after the Checkout button only get
 * spacing; nothing here sets overflow or transform on their containers.
 */

#astra-mobile-cart-drawer {
	--cmc-ink: #3A2B2B;
	--cmc-ink-2: #5A4846;
	--cmc-muted: #7A6A68;
	--cmc-accent: #A55F59;
	--cmc-accent-hover: #8F4E49;
	--cmc-line: #EBD3CF;
	--cmc-line-soft: #F1E3E0;
	--cmc-bg: #FFFCFA;
	--cmc-sand: #EFEAE3;
	--cmc-green: #4F7A5A;
	--cmc-green-bg: #EEF4EF;
	--cmc-font: 'Solway', serif;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--cmc-bg);
	color: var(--cmc-ink);
	font-family: var(--cmc-font);
	box-shadow: -18px 0 50px rgba(30, 20, 20, .18);
}
.astra-mobile-cart-overlay { background: rgba(40, 28, 28, .42); }

/* ---------- Header: title, count chip, close button ---------- */
#astra-mobile-cart-drawer .astra-cart-drawer-header {
	position: static;
	display: flex;
	flex: none;
	align-items: center;
	gap: 12px;
	padding: 22px 24px 18px;
	border-bottom: 1px solid var(--cmc-line-soft);
	background: transparent;
	text-align: left;
}
#astra-mobile-cart-drawer .astra-cart-drawer-title {
	order: 1;
	padding: 0;
	color: var(--cmc-ink);
	font: 500 22px/1.2 var(--cmc-font);
	text-transform: none;
	letter-spacing: 0;
}
#astra-mobile-cart-drawer .cmc-head-count {
	order: 2;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--cmc-sand);
	color: var(--cmc-ink-2);
	font: 500 12px/1.5 var(--cmc-font);
	white-space: nowrap;
}
#astra-mobile-cart-drawer .cmc-head-count:empty { display: none; }
#astra-mobile-cart-drawer .astra-cart-drawer-close {
	position: static;
	order: 3;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: 0 0 0 auto;
	padding: 0;
	border: 1px solid var(--cmc-line);
	border-radius: 50%;
	background: #fff;
	color: var(--cmc-ink);
	transform: none;
	cursor: pointer;
}
#astra-mobile-cart-drawer .astra-cart-drawer-close:hover,
#astra-mobile-cart-drawer .astra-cart-drawer-close:focus-visible { border-color: var(--cmc-accent); color: var(--cmc-accent); }
#astra-mobile-cart-drawer .astra-cart-drawer-close svg { width: 18px; height: 18px; fill: currentColor; }

/* ---------- Body: list scrolls, footer stays at the bottom ---------- */
#astra-mobile-cart-drawer .astra-cart-drawer-content {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	padding: 0;
	overflow: hidden;
}
#astra-mobile-cart-drawer .astra-cart-drawer-content .widget_shopping_cart,
#astra-mobile-cart-drawer .widget_shopping_cart_content {
	display: flex !important;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	height: auto;
	margin: 0;
	padding: 0;
}

#astra-mobile-cart-drawer .cmc-note {
	display: flex;
	flex: none;
	align-items: center;
	gap: 10px;
	margin: 16px 24px 4px;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--cmc-green-bg);
	color: var(--cmc-green);
	font-size: 13px;
	line-height: 1.4;
}
#astra-mobile-cart-drawer .cmc-note svg { flex: none; }

#astra-mobile-cart-drawer .woocommerce-mini-cart.cmc-list {
	flex: 1;
	min-height: 0;
	margin: 0;
	padding: 4px 24px 8px;
	overflow-y: auto;
	overscroll-behavior: contain;
	list-style: none;
	border: 0;
}

/* ---------- Rows ---------- */
#astra-mobile-cart-drawer .woocommerce-mini-cart-item.cmc-item {
	display: grid;
	grid-template-columns: 76px minmax(0, 1fr) auto;
	gap: 14px;
	align-items: start;
	margin: 0;
	padding: 16px 0;
	border-bottom: 1px solid var(--cmc-line-soft);
	background: none;
}
/* WooCommerce's clearfix pseudo-elements would take grid cells. */
#astra-mobile-cart-drawer .woocommerce-mini-cart-item.cmc-item::before,
#astra-mobile-cart-drawer .woocommerce-mini-cart-item.cmc-item::after { content: none; display: none; }
#astra-mobile-cart-drawer .cmc-item:last-child { border-bottom: 0; }
#astra-mobile-cart-drawer .cmc-item__img {
	display: block;
	width: 76px;
	height: 76px;
	overflow: hidden;
	border-radius: 14px;
	background: #F8E6E3;
}
#astra-mobile-cart-drawer .woocommerce-mini-cart-item .cmc-item__img img {
	position: static;
	top: auto;
	left: auto;
	display: block;
	float: none;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	transform: none;
	object-fit: cover;
	border-radius: 0;
	box-shadow: none;
}
#astra-mobile-cart-drawer .cmc-item__body { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; }
#astra-mobile-cart-drawer .cmc-item__name {
	display: block;
	margin: 0 0 6px;
	padding: 0;
	color: var(--cmc-ink);
	font: 500 15px/1.35 var(--cmc-font);
	text-decoration: none;
}
#astra-mobile-cart-drawer a.cmc-item__name:hover,
#astra-mobile-cart-drawer a.cmc-item__name:focus-visible { color: var(--cmc-accent); }
#astra-mobile-cart-drawer .cmc-item__body dl.variation { margin: 0 0 6px; color: var(--cmc-muted); font-size: 12px; }
#astra-mobile-cart-drawer .cmc-item__tag {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--cmc-muted);
	font-size: 12px;
	line-height: 1.4;
}
#astra-mobile-cart-drawer .cmc-item__tag svg { flex: none; }
#astra-mobile-cart-drawer .cmc-item__vat {
	display: block;
	margin-top: 6px;
	color: var(--cmc-muted);
	font-size: 10px;
	line-height: 1.35;
	opacity: .85;
}

#astra-mobile-cart-drawer .cmc-item__side {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	justify-content: space-between;
	gap: 10px;
	align-self: stretch;
}
#astra-mobile-cart-drawer .cmc-item .quantity {
	display: block;
	margin: 0;
	color: var(--cmc-ink);
	font: 500 15px/1.35 var(--cmc-font);
	white-space: nowrap;
}
#astra-mobile-cart-drawer .cmc-item .quantity .amount { color: inherit; font-weight: inherit; }
#astra-mobile-cart-drawer .woocommerce-mini-cart-item a.remove.cmc-item__remove {
	position: static;
	display: inline;
	width: auto;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: var(--cmc-muted) !important;
	font: 12px/1.4 var(--cmc-font);
	text-decoration: underline;
	text-underline-offset: 3px;
	opacity: 1;
	transform: none;
}
/* Astra draws a circle around its ✕ icon; the text link needs none. */
#astra-mobile-cart-drawer .woocommerce-mini-cart-item a.remove.cmc-item__remove::before,
#astra-mobile-cart-drawer .woocommerce-mini-cart-item a.remove.cmc-item__remove::after { content: none; display: none; }
#astra-mobile-cart-drawer .woocommerce-mini-cart-item a.remove.cmc-item__remove:hover,
#astra-mobile-cart-drawer .woocommerce-mini-cart-item a.remove.cmc-item__remove:focus-visible {
	background: none;
	color: var(--cmc-accent) !important;
}

/* ---------- Footer ---------- */
#astra-mobile-cart-drawer .cmc-foot {
	flex: none;
	padding: 18px 24px 22px;
	border-top: 1px solid var(--cmc-line);
	background: #fff;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 0;
	border: 0;
	text-align: left;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__total strong {
	color: var(--cmc-ink-2);
	font: 400 15px var(--cmc-font);
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__total .amount {
	color: var(--cmc-ink);
	font: 500 24px/1.2 var(--cmc-font);
}
#astra-mobile-cart-drawer .cmc-foot .wc-gzd-total-mini-cart {
	margin: 4px 0 0;
	padding: 0;
	border: 0;
	color: var(--cmc-muted);
	font-size: 12px;
	text-align: left;
}
#astra-mobile-cart-drawer .cmc-vat,
#astra-mobile-cart-drawer .cmc-vat p {
	margin: 4px 0 0;
	color: var(--cmc-muted);
	font-size: 11.5px;
	line-height: 1.4;
}

#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0 0;
	padding: 0;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 0 20px;
	border: 1px solid var(--cmc-line);
	border-radius: 999px;
	background: transparent;
	color: var(--cmc-ink);
	font: 500 14px/1.2 var(--cmc-font);
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button:hover,
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button:focus-visible {
	border-color: var(--cmc-accent);
	background: transparent;
	color: var(--cmc-accent);
}
/* Checkout first, as the main button. */
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button.checkout {
	order: -1;
	min-height: 52px;
	border-color: var(--cmc-accent);
	background: var(--cmc-accent);
	color: #fff;
	font-size: 15px;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button.checkout::before {
	content: "";
	width: 17px;
	height: 17px;
	background: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 018 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 018 0v3'/%3E%3C/svg%3E") center / contain no-repeat;
}
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button.checkout:hover,
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons a.button.checkout:focus-visible {
	border-color: var(--cmc-accent-hover);
	background: var(--cmc-accent-hover);
	color: #fff;
}
/* Room for payment buttons other plugins add below. */
#astra-mobile-cart-drawer .cmc-foot .woocommerce-mini-cart__buttons ~ *:not(.cmc-trust) { margin-top: 10px; }

#astra-mobile-cart-drawer .cmc-trust {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 4px 18px;
	margin: 14px 0 0;
	color: var(--cmc-muted);
	font-size: 12px;
}
#astra-mobile-cart-drawer .cmc-trust span::before { content: "\2713\00a0"; }

/* Empty cart (shown for a moment after removing the last item). */
#astra-mobile-cart-drawer .woocommerce-mini-cart__empty-message {
	margin: 40px 24px;
	color: var(--cmc-ink-2);
	font-size: 15px;
	text-align: center;
}

/* ---------- Phones ---------- */
@media (max-width: 544px) {
	#astra-mobile-cart-drawer .astra-cart-drawer-header { padding: 18px 16px 14px; }
	#astra-mobile-cart-drawer .astra-cart-drawer-title { font-size: 20px; }
	#astra-mobile-cart-drawer .cmc-note { margin: 12px 16px 2px; }
	#astra-mobile-cart-drawer .woocommerce-mini-cart.cmc-list { padding: 0 16px 6px; }
	#astra-mobile-cart-drawer .woocommerce-mini-cart-item.cmc-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 12px; }
	#astra-mobile-cart-drawer .cmc-item__img { width: 64px; height: 64px; border-radius: 12px; }
	#astra-mobile-cart-drawer .cmc-foot { padding: 14px 16px calc(16px + env(safe-area-inset-bottom, 0px)); }
	#astra-mobile-cart-drawer .cmc-trust { display: none; }
}

@media (prefers-reduced-motion: reduce) {
	#astra-mobile-cart-drawer { transition: none; }
}
