/* Cloudmaple Cart Drawer – front end. Everything is scoped to .cmcd / .cmcd-enabled. */

:root {
	--cmcd-primary: #4E6B44;
	--cmcd-gift: #C2652F;
	--cmcd-surface: #F6F8F4;
	--cmcd-ink: #22302A;
	--cmcd-muted: #5F6B64;
	--cmcd-line: #E3E7E0;
	--cmcd-width: 420px;
	--cmcd-radius: 12px;
}

/* The theme's own mini-cart flyouts / dropdowns are replaced by the drawer. */
.cmcd-enabled #astra-mobile-cart-drawer,
.cmcd-enabled .astra-cart-drawer,
.cmcd-enabled .astra-mobile-cart-overlay,
.cmcd-enabled .ast-site-header-cart .ast-site-header-cart-data,
.cmcd-enabled .ast-site-header-cart .widget_shopping_cart,
.cmcd-enabled .site-header-cart .widget_shopping_cart { display: none !important; }

html.cmcd-lock,
html.cmcd-lock body { overflow: hidden !important; }

.cmcd[hidden] { display: none !important; }
.cmcd { position: fixed; inset: 0; z-index: 999990; }
.cmcd [hidden] { display: none !important; }

.cmcd-overlay {
	position: absolute; inset: 0; background: rgba(20, 28, 24, .45);
	opacity: 0; transition: opacity .25s ease;
}
.cmcd-panel {
	position: absolute; top: 0; right: 0; bottom: 0;
	width: min(var(--cmcd-width), 100vw); height: 100%; height: 100dvh;
	background: #fff; color: var(--cmcd-ink);
	box-shadow: -12px 0 32px rgba(20, 28, 24, .18);
	transform: translateX(100%); transition: transform .28s cubic-bezier(.2, .7, .2, 1);
	display: flex; flex-direction: column; outline: none;
	font-size: 14px; line-height: 1.45; text-align: left;
}
.cmcd.is-open .cmcd-overlay { opacity: 1; }
.cmcd.is-open .cmcd-panel { transform: none; }

/* Theme resets: buttons, links and inputs inside the drawer use our styles. */
.cmcd button { font: inherit; text-transform: none; letter-spacing: 0; box-shadow: none; min-height: 0; line-height: 1.2; }
.cmcd a { text-decoration: none; }
.cmcd h2, .cmcd h3, .cmcd p, .cmcd ul, .cmcd dl, .cmcd dd { margin: 0; padding: 0; }
.cmcd ul { list-style: none; }
.cmcd img { display: block; max-width: 100%; height: auto; }
.cmcd .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); }

.cmcd-body { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cmcd-body.is-busy { cursor: progress; }
.cmcd-body.is-busy .cmcd-scroll,
.cmcd-body.is-busy .cmcd-foot { opacity: .6; transition: opacity .15s; }

/* ------------------------------------------------------------- header */

.cmcd-head { flex: none; height: 64px; display: flex; align-items: center; justify-content: space-between; padding: 0 10px 0 20px; border-bottom: 1px solid #D9DFD5; }
.cmcd-head__title { display: flex; align-items: center; gap: 10px; }
.cmcd-head h2 { font-size: 19px; font-weight: 700; color: var(--cmcd-ink); line-height: 1.2; }
.cmcd-badge { min-width: 24px; height: 24px; padding: 0 7px; box-sizing: border-box; border-radius: 12px; background: #EEF2EB; color: var(--cmcd-primary); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }

.cmcd .cmcd-icon-btn {
	width: 44px; height: 44px; padding: 0; border: 0; border-radius: 22px;
	background: transparent; color: var(--cmcd-ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.cmcd .cmcd-icon-btn:hover { background: var(--cmcd-surface); color: var(--cmcd-ink); }
.cmcd .cmcd-icon-btn--small { width: 36px; height: 36px; margin: -6px -8px 0 0; color: var(--cmcd-muted); }

.cmcd-loading { padding: 40px 0; text-align: center; color: var(--cmcd-muted); }

/* ----------------------------------------------------------- progress */

.cmcd-progress { flex: none; padding: 14px 20px 16px; background: var(--cmcd-surface); border-bottom: 1px solid var(--cmcd-line); display: grid; gap: 12px; }
.cmcd-bar__text { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 6px; font-size: 13px; }
.cmcd-bar__text strong { font-weight: 600; }
.cmcd-bar__text span { color: var(--cmcd-muted); white-space: nowrap; }
.cmcd-bar__track { height: 8px; border-radius: 4px; background: #DCE3D7; overflow: hidden; }
.cmcd-bar__track i { display: block; height: 100%; border-radius: 4px; background: var(--cmcd-primary); transition: width .35s ease; }
.cmcd-bar--gift .cmcd-bar__track { background: #F1DFD3; }
.cmcd-bar--gift .cmcd-bar__track i { background: var(--cmcd-gift); }

/* --------------------------------------------------------------- body */

.cmcd-scroll { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px 20px; display: flex; flex-direction: column; }
.cmcd-scroll > * { flex: none; }
/* With few products the bottom block sits right above the totals instead of under the products. */
.cmcd-bottom { margin-top: auto; padding-top: 8px; }
.cmcd-notice { margin-top: 12px !important; padding: 10px 12px; border-radius: 8px; background: #FCEDEA; color: #8F2D1F; font-size: 13px; }
.cmcd-muted { color: var(--cmcd-muted); font-size: 12.5px; }

.cmcd-item { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--cmcd-line); }
.cmcd-item__thumb { width: 72px; height: 72px; border-radius: 10px; overflow: hidden; background: var(--cmcd-surface); }
.cmcd-item__thumb img { width: 72px; height: 72px; object-fit: cover; }
.cmcd-item__main { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.cmcd-item__top { display: flex; justify-content: space-between; gap: 10px; align-items: flex-start; }
.cmcd-item__info { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cmcd .cmcd-item__name { font-weight: 600; font-size: 14.5px; color: var(--cmcd-ink); line-height: 1.3; }
.cmcd .cmcd-item__name:hover { color: var(--cmcd-primary); }
.cmcd-item__meta { color: var(--cmcd-muted); font-size: 12.5px; }
.cmcd-gift-badge { align-self: flex-start; margin-top: 4px; padding: 2px 8px; border-radius: 6px; background: #FBE9DD; color: #8A3B12; font-size: 11.5px; font-weight: 700; }
.cmcd-item__bottom { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.cmcd-item__price { text-align: right; display: flex; flex-direction: column; }
.cmcd-item__price del { color: var(--cmcd-muted); font-size: 12px; }
.cmcd-item__price strong { font-size: 15px; font-weight: 700; }

.cmcd-qty { display: inline-flex; align-items: center; border: 1px solid #C9D1C4; border-radius: 10px; height: 40px; overflow: hidden; }
.cmcd .cmcd-qty button { width: 40px; height: 38px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--cmcd-ink); font-size: 18px; cursor: pointer; }
.cmcd .cmcd-qty button:hover { background: var(--cmcd-surface); color: var(--cmcd-ink); }
.cmcd .cmcd-qty__input {
	width: 34px; height: 38px; padding: 0; margin: 0; border: 0; background: transparent; text-align: center;
	font-weight: 600; font-size: 15px; color: var(--cmcd-ink); box-shadow: none; -moz-appearance: textfield; appearance: textfield;
}
.cmcd .cmcd-qty__input::-webkit-outer-spin-button,
.cmcd .cmcd-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.cmcd-undo { margin-top: 12px; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 8px 8px 14px; border-radius: 10px; background: var(--cmcd-ink); color: #fff; font-size: 13.5px; }
.cmcd .cmcd-undo button { height: 36px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: #CFE3C4; font-weight: 700; text-decoration: underline; cursor: pointer; }
.cmcd-empty .cmcd-undo { align-self: stretch; margin: 0 0 16px; }

.cmcd-empty { padding: 48px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 12px; color: #78986A; }
.cmcd-empty__title { font-size: 16px; font-weight: 600; color: var(--cmcd-ink); }

/* ---------------------------------------------------------------- gift */

.cmcd-gift { margin-top: 18px; padding: 16px; border: 1.5px dashed #E2A57D; border-radius: var(--cmcd-radius); background: #FFF8F3; }
.cmcd-gift__title { font-size: 15px; font-weight: 700; color: var(--cmcd-ink); }
.cmcd-gift__text { margin: 2px 0 12px !important; color: #6B5446; font-size: 12.5px; }
.cmcd-gift__list { display: grid; gap: 8px; }
.cmcd .cmcd-gift__opt {
	display: grid; grid-template-columns: 22px 44px minmax(0, 1fr) auto; gap: 10px; align-items: center;
	width: 100%; padding: 8px 10px; border: 1.5px solid var(--cmcd-line); border-radius: 10px;
	background: #fff; color: var(--cmcd-ink); text-align: left; cursor: pointer;
}
.cmcd .cmcd-gift__opt:hover { border-color: #E2A57D; background: #fff; color: var(--cmcd-ink); }
.cmcd .cmcd-gift__opt.is-selected { border-color: var(--cmcd-gift); }
.cmcd-gift__radio { width: 20px; height: 20px; box-sizing: border-box; border-radius: 10px; border: 1.5px solid #B8C3B1; display: flex; align-items: center; justify-content: center; }
.is-selected .cmcd-gift__radio { border-color: var(--cmcd-gift); }
.is-selected .cmcd-gift__radio::after { content: ""; width: 10px; height: 10px; border-radius: 5px; background: var(--cmcd-gift); }
.cmcd-gift__img { width: 44px; height: 44px; border-radius: 8px; overflow: hidden; background: var(--cmcd-surface); }
.cmcd-gift__img img { width: 44px; height: 44px; object-fit: cover; }
.cmcd-gift__name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.cmcd-gift__price { text-align: right; white-space: nowrap; display: flex; flex-direction: column; }
.cmcd-gift__price del { color: var(--cmcd-muted); font-size: 12px; }
.cmcd-gift__price strong { color: #8A3B12; }

/* --------------------------------------------------------- cross-sells */

.cmcd-section-title { font-size: 14.5px; font-weight: 700; color: var(--cmcd-ink); margin-bottom: 10px !important; }
.cmcd-cross { margin-top: 18px; }
.cmcd-cross__list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.cmcd-cross__card { flex: none; width: 148px; scroll-snap-align: start; border: 1px solid var(--cmcd-line); border-radius: var(--cmcd-radius); padding: 10px; box-sizing: border-box; display: flex; flex-direction: column; gap: 8px; }
.cmcd-cross__img { display: block; height: 96px; border-radius: 8px; overflow: hidden; background: var(--cmcd-surface); }
.cmcd-cross__img img { width: 100%; height: 96px; object-fit: cover; }
.cmcd .cmcd-cross__name { font-weight: 600; font-size: 13px; line-height: 1.3; min-height: 34px; color: var(--cmcd-ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cmcd-cross__row { display: flex; justify-content: space-between; align-items: center; gap: 6px; margin-top: auto; }
.cmcd-cross__price { font-weight: 700; font-size: 13.5px; }
.cmcd .cmcd-round-btn { width: 40px; height: 40px; flex: none; padding: 0; border: 1px solid var(--cmcd-primary); border-radius: min(var(--cmcd-btn-radius, 999px), 20px); background: #fff; color: var(--cmcd-primary); font-size: 20px; font-weight: 600; cursor: pointer; }
.cmcd .cmcd-round-btn:hover { background: var(--cmcd-primary); color: #fff; }
.cmcd .cmcd-link-small { font-size: 12.5px; font-weight: 600; color: var(--cmcd-primary); text-decoration: underline; }

/* -------------------------------------------------------------- coupon */

.cmcd-coupon { margin-top: 16px; padding: 12px 14px 14px; border: 1px solid var(--cmcd-line); border-radius: var(--cmcd-radius); background: #fff; }
.cmcd-coupon__label { display: block; font-size: 13.5px; font-weight: 600; margin: 0 0 8px; color: var(--cmcd-ink); }
.cmcd-coupon .cmcd-chip { margin-top: 0; margin-bottom: 8px; }
.cmcd .cmcd-link { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0; border: 0; background: transparent; color: var(--cmcd-primary); font-weight: 600; cursor: pointer; }
.cmcd .cmcd-link:hover { background: transparent; color: var(--cmcd-primary); text-decoration: underline; }
.cmcd-link__plus { width: 18px; height: 18px; border: 1.5px solid currentColor; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; line-height: 1; }
.cmcd-coupon__form { display: flex; gap: 8px; }
.cmcd .cmcd-coupon__form input { flex: 1; min-width: 0; height: 44px; box-sizing: border-box; margin: 0; border: 1px solid #C9D1C4; border-radius: 8px; padding: 0 12px; font: inherit; background: #fff; color: var(--cmcd-ink); }
.cmcd .cmcd-coupon__form button { height: 44px; padding: 0 16px; border: 1px solid var(--cmcd-ink); border-radius: 8px; background: #fff; color: var(--cmcd-ink); font-weight: 600; cursor: pointer; }
.cmcd .cmcd-coupon__form button:hover { background: var(--cmcd-surface); color: var(--cmcd-ink); }
.cmcd-coupon__msg { margin-top: 8px !important; font-size: 12.5px; color: var(--cmcd-primary); }
.cmcd-coupon__msg.is-error { color: #A33A2B; }
.cmcd-chip { display: inline-flex; align-items: center; gap: 4px; margin: 10px 6px 0 0; padding: 0 2px 0 10px; height: 30px; border-radius: 15px; background: #EEF2EB; color: var(--cmcd-primary); font-size: 12.5px; font-weight: 700; }
.cmcd .cmcd-chip button { width: 26px; height: 26px; padding: 0; border: 0; border-radius: 13px; background: transparent; color: inherit; font-size: 16px; cursor: pointer; }

/* ---------------------------------------------------------------- foot */

.cmcd-foot { flex: none; border-top: 1px solid #D9DFD5; padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px)); background: #fff; box-shadow: 0 -6px 16px rgba(34, 48, 42, .06); }
.cmcd-totals { display: grid; gap: 4px; font-size: 13.5px; }
.cmcd-totals > div { display: flex; justify-content: space-between; gap: 12px; }
.cmcd-totals dt { color: var(--cmcd-muted); font-weight: 400; }
.cmcd-totals__discount, .cmcd-totals__discount dt { color: var(--cmcd-primary); }
.cmcd-total { display: flex; justify-content: space-between; align-items: baseline; margin-top: 10px; }
.cmcd-total span { font-weight: 700; font-size: 15px; }
.cmcd-total strong { font-weight: 800; font-size: 24px; letter-spacing: -.3px; }
.cmcd-vat { text-align: right; color: var(--cmcd-muted); font-size: 12px; }
.cmcd .cmcd-btn {
	margin-top: 12px; height: 54px; border-radius: var(--cmcd-btn-radius, 999px); background: var(--cmcd-primary); color: #fff;
	display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: 16px;
}
.cmcd .cmcd-btn:hover, .cmcd .cmcd-btn:focus { color: #fff; filter: brightness(.92); }
.cmcd .cmcd-btn--small { height: 44px; padding: 0 22px; font-size: 15px; display: inline-flex; margin-top: 8px; }
.cmcd-trust { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px 16px; margin-top: 10px !important; color: var(--cmcd-muted); font-size: 12px; }

.cmcd button:focus-visible,
.cmcd a:focus-visible,
.cmcd input:focus-visible { outline: 2px solid var(--cmcd-primary); outline-offset: 2px; }

@media (max-width: 600px) {
	.cmcd-panel { width: 100vw; box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
	.cmcd-panel, .cmcd-overlay, .cmcd-bar__track i { transition: none; }
}

/* Gift preview below the threshold: visible, greyed out, nothing to click yet. */
.cmcd-gift--locked { border-style: dashed; border-color: #D9C8BC; background: #FBF8F6; }
.cmcd-gift__text--locked { display: flex; align-items: center; gap: 6px; color: #6B5446; }
.cmcd-gift__text--locked strong, .cmcd-gift__text--locked .amount { color: #8A3B12; font-weight: 700; }
.cmcd-gift__lock { flex: none; color: #8A3B12; }
.cmcd .cmcd-gift__opt.is-locked {
	cursor: default; opacity: .6; filter: grayscale(1);
	border-style: dashed;
}
.cmcd .cmcd-gift__opt.is-locked:hover { border-color: #E3E7E0; background: #fff; }
.cmcd-gift__opt.is-locked .cmcd-gift__radio { border-style: dashed; }

/* Locked: title, gifts, then the "X € more" line under them. */
.cmcd-gift__title--locked { margin-bottom: 10px; }
.cmcd-gift--locked .cmcd-gift__text--locked { margin: 10px 0 0 !important; font-size: 13px; line-height: 1.4; align-items: flex-start; }
.cmcd-gift--locked .cmcd-gift__text--locked .cmcd-gift__lock { margin-top: 2px; }

/* Kadence: its own cart drawer / dropdown never shows while ours is active. */
.cmcd-enabled #cart-drawer.popup-drawer,
.cmcd-enabled .header-cart-wrap .header-cart-dropdown,
.cmcd-enabled .header-mobile-cart-wrap .header-cart-dropdown { display: none !important; }
