/* =========================================================
   VF COD Checkout — multi-product cart drawer
   Site-wide floating button + slide-in panel. Reuses the same
   design tokens and field styling as the single-product form
   (assets/css/style.css) via the shared .hanout-cod-wrap class
   on the checkout form inside the drawer.
   ========================================================= */

.hanout-cod-cart-root {
	--hanout-cod-primary: #0f4d3f;
	--hanout-cod-accent: #c9a24b;
	--hanout-cod-ink: #1c2622;
	--hanout-cod-bg: #ffffff;
	font-family: -apple-system, "Segoe UI", "Tahoma", "Cairo", "Noto Kufi Arabic", sans-serif;
	direction: rtl;
}
.hanout-cod-cart-root * ,
.hanout-cod-cart-root *::before,
.hanout-cod-cart-root *::after { box-sizing: border-box; }

/* ---- floating button ---- */
.hanout-cod-cart-fab {
	position: fixed;
	bottom: 22px;
	z-index: 99997;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--hanout-cod-primary);
	color: #fff;
	box-shadow: 0 6px 20px rgba(0,0,0,.22), 0 1px 0 rgba(255,255,255,.15) inset;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s ease, box-shadow .15s ease;
}
.hanout-cod-cart-fab:hover { transform: translateY(-2px); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.hanout-cod-cart-fab:active { transform: translateY(0); }
.hanout-cod-cart-fab-icon { font-size: 24px; line-height: 1; }
.hanout-cod-cart-fab-count {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 22px;
	height: 22px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--hanout-cod-accent);
	color: #241a03;
	font-size: 12px;
	font-weight: 800;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 2px solid #fff;
}

/* The cart root is always direction:rtl, so "end" (as named in the settings)
   is the physical LEFT side and "start" the physical RIGHT side. Physical
   properties are used on purpose: mixing logical inset-inline-* with a
   physical translateX() is exactly what made the drawer slide the wrong way
   and stay parked on-screen on desktop. */
.hanout-cod-cart-pos-end .hanout-cod-cart-fab { left: 22px; right: auto; }
.hanout-cod-cart-pos-start .hanout-cod-cart-fab { right: 22px; left: auto; }

/* ---- overlay ---- */
.hanout-cod-cart-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15,20,18,.45);
	z-index: 99998;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .2s ease, visibility 0s linear .2s;
}
.hanout-cod-cart-root.is-open .hanout-cod-cart-overlay {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transition: opacity .2s ease, visibility 0s;
}

/* ---- drawer ---- */
.hanout-cod-cart-drawer {
	position: fixed;
	top: 0;
	bottom: 0;
	width: min(400px, 100vw);
	max-width: 100vw;
	background: var(--hanout-cod-bg);
	z-index: 99999;
	display: flex;
	flex-direction: column;
	/* Closed state: fully off-screen AND hidden (visibility) so it can never
	   be seen, focused or tabbed into, whatever the screen width. The shadow
	   is only painted while open — otherwise its blur bleeds ~30px back into
	   the viewport edge even when the panel is parked off-screen. */
	visibility: hidden;
	box-shadow: none;
	transition: transform .25s ease, box-shadow .25s ease, visibility 0s linear .25s;
}
.hanout-cod-cart-pos-end .hanout-cod-cart-drawer { left: 0; right: auto; transform: translateX(-105%); }
.hanout-cod-cart-pos-start .hanout-cod-cart-drawer { right: 0; left: auto; transform: translateX(105%); }
.hanout-cod-cart-root.is-open .hanout-cod-cart-drawer {
	transform: translateX(0);
	visibility: visible;
	box-shadow: 0 0 32px rgba(0,0,0,.25);
	transition: transform .25s ease, box-shadow .25s ease, visibility 0s;
}

.hanout-cod-cart-drawer-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid #e3e2dc;
	flex: 0 0 auto;
}
.hanout-cod-cart-drawer-header h2 {
	margin: 0;
	font-size: 17px;
	font-weight: 800;
	color: var(--hanout-cod-ink);
}
.hanout-cod-cart-close {
	border: none;
	background: #f2f1ec;
	color: var(--hanout-cod-ink);
	width: 32px;
	height: 32px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 15px;
	line-height: 1;
}
.hanout-cod-cart-close:hover { background: #e7e6df; }

.hanout-cod-cart-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 14px 18px 22px;
}

/* ---- item rows ---- */
.hanout-cod-cart-items { display: flex; flex-direction: column; gap: 12px; margin-bottom: 6px; }
.hanout-cod-cart-item {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding-bottom: 12px;
	border-bottom: 1px dashed #e3e2dc;
}
.hanout-cod-cart-item:last-child { border-bottom: none; }
.hanout-cod-cart-item-image {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	object-fit: cover;
	background: #f2f1ec;
	flex: 0 0 auto;
}
.hanout-cod-cart-item-image--empty {
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 22px;
}
.hanout-cod-cart-item-info { flex: 1 1 auto; min-width: 0; }
.hanout-cod-cart-item-name {
	font-size: 13.5px;
	font-weight: 700;
	color: var(--hanout-cod-ink);
	display: block;
	margin-bottom: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.hanout-cod-cart-item-variation { font-size: 11.5px; color: #6b7a75; display: block; margin-bottom: 6px; }
.hanout-cod-cart-item-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.hanout-cod-cart-item-qty { display: flex; align-items: center; gap: 6px; }
.hanout-cod-cart-item-qty button {
	width: 24px;
	height: 24px;
	border-radius: 6px;
	border: 1px solid #e3e2dc;
	background: #fbfbf9;
	cursor: pointer;
	font-size: 14px;
	line-height: 1;
	color: var(--hanout-cod-ink);
}
.hanout-cod-cart-item-qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 13px; }
.hanout-cod-cart-item-price { font-weight: 700; font-size: 13.5px; color: var(--hanout-cod-primary); }
.hanout-cod-cart-item-remove {
	border: none;
	background: transparent;
	color: #b3261e;
	cursor: pointer;
	font-size: 13px;
	padding: 2px 4px;
}
.hanout-cod-cart-item-remove:hover { text-decoration: underline; }
.hanout-cod-cart-item.hanout-cod-cart-item--invalid { opacity: .55; }
.hanout-cod-cart-item-invalid-note { font-size: 11px; color: #b3261e; }

.hanout-cod-cart-empty { text-align: center; padding: 40px 10px; color: #6b7a75; font-size: 13.5px; }

/* ---- checkout form (reuses .hanout-cod-wrap field styling) ---- */
.hanout-cod-cart-checkout.hanout-cod-wrap {
	max-width: none;
	width: auto;
	margin: 18px 0 0;
	padding-top: 16px;
	border-top: 1px solid #e3e2dc;
}
/* The main form's submit button is a flex child of its footer row (width:auto);
   in the drawer it is a direct child of the form, so it must fill the width itself. */
.hanout-cod-cart-checkout.hanout-cod-wrap .hanout-cod-cart-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100% !important;
	margin-top: 10px;
}
.hanout-cod-cart-summary { margin-top: 6px; }
.hanout-cod-cart-summary .hanout-cod-summary-row + .hanout-cod-summary-row { border-top: 1px dashed var(--hanout-cod-line, #e3e2dc); }

/* ---- misc ---- */
.hanout-cod-cart-message.is-error { color: #b3261e; font-size: 13px; margin: 8px 0; }
.hanout-cod-cart-message.is-success { color: var(--hanout-cod-primary); font-size: 13px; margin: 8px 0; }

@media (max-width: 480px) {
	.hanout-cod-cart-drawer { width: 100vw; }
	.hanout-cod-cart-fab { bottom: 16px; }
	.hanout-cod-cart-pos-end .hanout-cod-cart-fab { left: 16px; }
	.hanout-cod-cart-pos-start .hanout-cod-cart-fab { right: 16px; }
}


/* ---- badge "bump" when something is added ---- */
.hanout-cod-cart-fab.is-bump { animation: hanout-cod-cart-bump .45s ease; }
@keyframes hanout-cod-cart-bump {
	0% { transform: scale(1); }
	40% { transform: scale(1.18); }
	100% { transform: scale(1); }
}

/* ---- "add to cart" button printed on product cards (shop, home, categories) ---- */
.hanout-cod-loop-wrap { margin-top: 8px; width: 100%; direction: rtl; }
.hanout-cod-loop-wrap .hanout-cod-loop-btn,
a.hanout-cod-loop-btn,
button.hanout-cod-loop-btn {
	display: flex !important;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	box-sizing: border-box;
	height: auto !important;
	min-height: 40px !important;
	max-height: none !important;
	padding: 8px 12px !important;
	margin: 0;
	background: var(--hanout-cod-primary, #0f4d3f) !important;
	color: #fff !important;
	border: 1.5px solid var(--hanout-cod-primary, #0f4d3f) !important;
	border-radius: 10px !important;
	font-family: inherit;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	line-height: 1.3 !important;
	text-decoration: none !important;
	text-align: center;
	cursor: pointer;
	transition: filter .15s ease, transform .1s ease, background .15s ease;
}
.hanout-cod-loop-btn:hover { filter: brightness(1.08); }
.hanout-cod-loop-btn:active { transform: translateY(1px); }
.hanout-cod-loop-btn.is-added { background: #2f9e44 !important; border-color: #2f9e44 !important; }
.hanout-cod-loop-btn.is-loading { opacity: .7; cursor: progress; }
.hanout-cod-loop-wrap .hanout-cod-loop-btn.hanout-cod-loop-btn--options {
	background: transparent !important;
	color: var(--hanout-cod-primary, #0f4d3f) !important;
}
.hanout-cod-loop-wrap .hanout-cod-loop-btn.hanout-cod-loop-btn--options:hover { background: rgba(15, 77, 63, .07) !important; filter: none; }

/* ---- small confirmation toast ---- */
.hanout-cod-cart-toast {
	position: fixed;
	bottom: 90px;
	left: 50%;
	transform: translate(-50%, 20px);
	z-index: 99996;
	max-width: calc(100vw - 32px);
	padding: 10px 18px;
	border-radius: 999px;
	background: #1c2622;
	color: #fff;
	font-family: -apple-system, "Segoe UI", "Tahoma", "Cairo", sans-serif;
	font-size: 13.5px;
	font-weight: 600;
	direction: rtl;
	box-shadow: 0 8px 24px rgba(0,0,0,.25);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}
.hanout-cod-cart-toast.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, 0);
	transition: opacity .2s ease, transform .2s ease, visibility 0s;
}

@media (prefers-reduced-motion: reduce) {
	.hanout-cod-cart-drawer, .hanout-cod-cart-overlay, .hanout-cod-cart-toast { transition: none !important; }
	.hanout-cod-cart-fab.is-bump { animation: none; }
}
