/* SafePath Header – side cart + mobile bottom bar. ID-scoped so WoodMart styles can't leak in. */

/* ---------- resets inside the cart ---------- */
#sph-cart-drawer button {
	background: none !important; border: 0 !important; padding: 0 !important; margin: 0 !important; min-height: 0 !important;
	box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1 !important;
	font: inherit; color: inherit; cursor: pointer; width: auto; height: auto;
}
#sph-cart-drawer ul, #sph-cart-drawer li, #sph-cart-drawer dl, #sph-cart-drawer dt, #sph-cart-drawer dd, #sph-cart-drawer p { margin: 0 !important; padding: 0; list-style: none !important; }
#sph-cart-drawer li::before, #sph-cart-drawer li::after { content: none !important; }
#sph-cart-drawer a { text-decoration: none !important; }
#sph-cart-drawer .woocommerce-Price-amount, #sph-cart-drawer .amount { color: inherit !important; font-weight: inherit; }
#sph-cart-drawer :is(h2, button, dl, dt, dd, p, a, span) { font-family: inherit !important; }
#sph-cart-drawer img { border: 0 !important; box-shadow: none !important; }
#sph-cart-drawer .sph-ico, #sph-bottombar .sph-ico { width: 1em; height: 1em; display: block; flex-shrink: 0; }

/* ---------- head ---------- */
#sph-cart-drawer .sph-panel-title { display: flex; align-items: center; gap: 8px; }
#sph-cart-drawer .sph-cart-hcount {
	min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; background: var(--sph-soft); color: var(--sph-dark);
	font-size: 13px; font-weight: 800; line-height: 26px; text-align: center;
}
#sph-cart-drawer .sph-cart-hcount[data-count="0"] { display: none; }

/* ---------- layout ---------- */
#sph-cart-drawer .sph-cart-wrap { flex: 1; min-height: 0; display: flex; flex-direction: column; transition: opacity .2s ease; }
#sph-cart-drawer .sph-cart-wrap.is-busy { pointer-events: none; }

/* ---------- free shipping ---------- */
#sph-cart-drawer .sph-fs { flex-shrink: 0; padding: 14px 20px 16px; background: color-mix(in srgb, var(--sph-fs) 6%, #fff); border-bottom: 1px solid var(--sph-line); }
#sph-cart-drawer .sph-fs.is-done { background: color-mix(in srgb, var(--sph-fs-done) 8%, #fff); }
#sph-cart-drawer .sph-fs-text { display: flex; align-items: center; gap: 10px; font-size: 14px; line-height: 1.6; color: var(--sph-dark); margin-bottom: 10px !important; }
#sph-cart-drawer .sph-fs-text b { font-weight: 800; color: var(--sph-fs); }
#sph-cart-drawer .sph-fs-ico { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; flex-shrink: 0; background: var(--sph-fs); color: #fff; }
#sph-cart-drawer .sph-fs.is-done .sph-fs-ico { background: var(--sph-fs-done); }
#sph-cart-drawer .sph-fs.is-done .sph-fs-text { font-weight: 700; color: var(--sph-fs-done); }
#sph-cart-drawer .sph-fs-track { height: 8px; border-radius: 4px; background: color-mix(in srgb, var(--sph-fs) 14%, #fff); overflow: hidden; }
#sph-cart-drawer .sph-fs.is-done .sph-fs-track { background: color-mix(in srgb, var(--sph-fs-done) 16%, #fff); }
#sph-cart-drawer .sph-fs-track span {
	display: block; height: 100%; border-radius: 4px; background: var(--sph-fs); transition: width .5s cubic-bezier(.2, .8, .2, 1);
	background-image: linear-gradient(45deg, rgba(255,255,255,.22) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.22) 50%, rgba(255,255,255,.22) 75%, transparent 75%);
	background-size: 16px 16px;
}
#sph-cart-drawer .sph-fs.is-done .sph-fs-track span { background-color: var(--sph-fs-done); }

/* ---------- items ---------- */
#sph-cart-drawer .sph-cart-items { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 4px 20px !important; }
#sph-cart-drawer .sph-ci { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; padding: 16px 0 !important; border-bottom: 1px solid var(--sph-line); transition: opacity .2s ease; }
#sph-cart-drawer .sph-ci:last-child { border-bottom: 0; }
#sph-cart-drawer .sph-ci.is-busy { opacity: .45; }
#sph-cart-drawer .sph-ci-img { width: 84px; height: 84px; border-radius: 14px; background: var(--sph-soft); overflow: hidden; display: grid; place-items: center; }
#sph-cart-drawer .sph-ci-img img { width: 100% !important; height: 100% !important; object-fit: contain; mix-blend-mode: multiply; border-radius: 0; margin: 0; float: none; }
#sph-cart-drawer .sph-ci-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
#sph-cart-drawer .sph-ci-top { display: flex; align-items: flex-start; gap: 8px; }
#sph-cart-drawer .sph-ci-name {
	flex: 1; min-width: 0; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--sph-dark) !important;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
#sph-cart-drawer a.sph-ci-name:hover { color: var(--sph-primary) !important; }
#sph-cart-drawer .sph-ci-remove { width: 32px !important; height: 32px !important; border-radius: 10px !important; display: grid !important; place-items: center; font-size: 17px; color: #9AA1AD !important; flex-shrink: 0; transition: background .2s, color .2s; }
#sph-cart-drawer .sph-ci-remove:hover { background: #FFF0EE !important; color: var(--sph-badge) !important; }
#sph-cart-drawer .variation { display: flex; flex-wrap: wrap; gap: 2px 6px; font-size: 12.5px; color: var(--sph-muted); }
#sph-cart-drawer .variation dt { font-weight: 600; }
#sph-cart-drawer .variation dd p { display: inline; }
#sph-cart-drawer .sph-ci-unit { font-size: 13px; color: var(--sph-muted); }
#sph-cart-drawer .sph-ci-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 6px; }
#sph-cart-drawer .sph-ci-qty { font-size: 13.5px; color: var(--sph-muted); }
#sph-cart-drawer .sph-ci-total { font-size: 16px; font-weight: 800; color: var(--sph-dark); white-space: nowrap; }
#sph-cart-drawer .sph-ci-total del { font-size: 12.5px; color: var(--sph-muted); font-weight: 600; }

#sph-cart-drawer .sph-qty { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--sph-border); border-radius: 12px; background: #fff; }
#sph-cart-drawer .sph-qty button { width: 38px !important; height: 36px !important; display: grid !important; place-items: center; font-size: 16px; color: var(--sph-dark) !important; border-radius: 11px !important; transition: background .2s, color .2s; }
#sph-cart-drawer .sph-qty button:hover:not([disabled]) { background: var(--sph-soft) !important; color: var(--sph-primary) !important; }
#sph-cart-drawer .sph-qty button[disabled] { opacity: .35; cursor: not-allowed; }
#sph-cart-drawer .sph-qty-n { min-width: 26px; text-align: center; font-size: 15px; font-weight: 800; color: var(--sph-dark); }

/* ---------- footer: summary + buttons ---------- */
#sph-cart-drawer .sph-cart-foot {
	flex-shrink: 0; padding: 16px 20px calc(16px + env(safe-area-inset-bottom)); background: #fff;
	border-top: 1px solid var(--sph-border); box-shadow: 0 -10px 30px rgba(16, 24, 40, .06);
}
#sph-cart-drawer .sph-sum { display: grid; gap: 9px; margin-bottom: 14px !important; }
#sph-cart-drawer .sph-sum > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; font-size: 14.5px; }
#sph-cart-drawer .sph-sum dt { color: var(--sph-muted); font-weight: 500; }
#sph-cart-drawer .sph-sum dd { color: var(--sph-dark); font-weight: 700; text-align: left; white-space: nowrap; }
#sph-cart-drawer .sph-sum dd small { font-size: 12.5px; font-weight: 500; color: var(--sph-muted); white-space: normal; }
#sph-cart-drawer .sph-sum .is-free dd { color: #019761; }
#sph-cart-drawer .sph-sum .is-disc dd { color: var(--sph-badge); }
#sph-cart-drawer .sph-sum .is-total { margin-top: 4px; padding-top: 12px; border-top: 1px dashed var(--sph-border); }
#sph-cart-drawer .sph-sum .is-total dt { font-size: 16px; font-weight: 800; color: var(--sph-dark); }
#sph-cart-drawer .sph-sum .is-total dd { font-size: 20px; font-weight: 800; color: var(--sph-primary); }
#sph-cart-drawer .sph-cart-note { font-size: 12.5px; color: var(--sph-muted); text-align: center; margin: -4px 0 12px !important; }

#sph-cart-drawer .sph-cart-btns { display: grid; gap: 10px; }
#sph-cart-drawer .sph-cart-btns--row { grid-template-columns: 1.6fr 1fr; }
#sph-cart-drawer .sph-cb {
	display: flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 16px; border-radius: 14px;
	font-size: 15.5px; font-weight: 800; white-space: nowrap; transition: filter .2s, background .2s, color .2s, border-color .2s;
}
#sph-cart-drawer .sph-cb .sph-ico { font-size: 18px; }
#sph-cart-drawer .sph-cb-primary { background: var(--sph-primary); color: #fff !important; }
#sph-cart-drawer .sph-cb-primary:hover { filter: brightness(1.08); }
#sph-cart-drawer .sph-cb-outline { border: 1.5px solid var(--sph-border); color: var(--sph-dark) !important; background: #fff; }
#sph-cart-drawer .sph-cb-outline:hover { border-color: var(--sph-dark); }
#sph-cart-drawer .sph-cart-continue { display: block !important; margin: 12px auto 0 !important; font-size: 14px; font-weight: 600; color: var(--sph-muted) !important; text-decoration: underline !important; text-underline-offset: 4px; }
#sph-cart-drawer .sph-cart-continue:hover { color: var(--sph-dark) !important; }

/* ---------- empty ---------- */
#sph-cart-drawer .sph-cart-wrap.is-empty { justify-content: center; }
#sph-cart-drawer .sph-cart-empty { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 40px 24px; text-align: center; color: var(--sph-muted); font-size: 16px; }
#sph-cart-drawer .sph-cart-empty-ico { width: 112px; height: 112px; border-radius: 50%; background: var(--sph-soft); display: grid; place-items: center; font-size: 52px; color: #B9BFC9; margin-bottom: 4px; }
#sph-cart-drawer .sph-cart-empty .sph-cb { min-width: 200px; margin-top: 6px; }

/* ====================================================================
   Mobile bottom bar
   ==================================================================== */
#sph-bottombar { display: none; }
#sph-bottombar :is(a, span) { font-family: inherit !important; }
#sph-bottombar ul { display: grid; grid-template-columns: repeat(var(--bb-n, 5), minmax(0, 1fr)); height: 64px; margin: 0 !important; padding: 0 !important; list-style: none !important; }
#sph-bottombar li { margin: 0 !important; padding: 0 !important; list-style: none !important; position: relative; }
#sph-bottombar li::before, #sph-bottombar li::after { content: none !important; }
#sph-bottombar a {
	position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; height: 100%;
	color: var(--bb-c) !important; text-decoration: none !important; font-size: 11.5px; font-weight: 600; line-height: 1.2;
	-webkit-tap-highlight-color: transparent;
}
#sph-bottombar .sph-bb-ico { position: relative; display: grid; place-items: center; font-size: 24px; transition: transform .2s ease; }
#sph-bottombar a:active .sph-bb-ico { transform: scale(.9); }
#sph-bottombar .sph-bb-label { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#sph-bottombar .is-active a { color: var(--bb-a) !important; font-weight: 800; }
#sph-bottombar.sph-bb--flat .is-active:not(.is-center) a::before { content: ""; position: absolute; top: 0; left: 50%; width: 26px; height: 3px; margin-left: -13px; border-radius: 0 0 3px 3px; background: var(--bb-a); }
#sph-bottombar .sph-cart-count {
	position: absolute; top: -7px; left: -11px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
	border: 2px solid var(--bb-bg); background: var(--bb-badge); color: #fff; font-size: 10.5px; font-weight: 800; line-height: 15px; text-align: center;
}
#sph-bottombar .sph-cart-count[data-count="0"] { display: none; }

/* raised centre button */
#sph-bottombar .is-center .sph-bb-ico {
	width: 56px; height: 56px; margin-top: -30px; border-radius: 50%; background: var(--bb-cb); color: #fff;
	border: 4px solid var(--bb-bg); box-shadow: 0 10px 22px color-mix(in srgb, var(--bb-cb) 38%, transparent); font-size: 24px;
}
#sph-bottombar .is-center .sph-cart-count { top: -4px; left: -4px; }
#sph-bottombar .is-center a { gap: 2px; }

/* no labels */
#sph-bottombar.sph-bb--nolabels ul { height: 58px; }
#sph-bottombar.sph-bb--nolabels .sph-bb-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
#sph-bottombar.sph-bb--nolabels .sph-bb-ico { font-size: 26px; }

@media (max-width: 1024px) {
	#sph-bottombar.sph-bb--until-1024 { display: block; }
	body.sph-bb-on.sph-bb-1024 { padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 768px) {
	#sph-bottombar.sph-bb--until-768 { display: block; }
	body.sph-bb-on.sph-bb-768 { padding-bottom: calc(64px + env(safe-area-inset-bottom)) !important; }
}
#sph-bottombar {
	position: fixed; left: 0; right: 0; bottom: 0; z-index: 9990; direction: rtl;
	background: var(--bb-bg); border-top: 1px solid #E7E9EE; padding-bottom: env(safe-area-inset-bottom);
	box-shadow: 0 -6px 24px rgba(16, 24, 40, .07);
}
#sph-bottombar.sph-bb--floating {
	left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); padding-bottom: 0;
	border: 1px solid #E7E9EE; border-radius: 22px; box-shadow: 0 14px 34px rgba(16, 24, 40, .16);
}
#sph-bottombar.sph-bb--floating .is-active:not(.is-center) .sph-bb-ico::after { content: ""; position: absolute; bottom: -8px; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--bb-a); }
#sph-bottombar.sph-bb--floating .is-active .sph-bb-label { display: none; }
#sph-bottombar.sph-bb--floating.sph-bb--has-center .is-center .sph-bb-label { display: block; }
@media (max-width: 1024px) {
	body.sph-bb-on.sph-bb-1024:has(#sph-bottombar.sph-bb--floating) { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
}
@media (max-width: 768px) {
	body.sph-bb-on.sph-bb-768:has(#sph-bottombar.sph-bb--floating) { padding-bottom: calc(86px + env(safe-area-inset-bottom)) !important; }
}
body.sph-lock #sph-bottombar { z-index: 9980; }

/* pending row while adding */
#sph-cart-drawer .sph-ci.is-pending { animation: sph-pend-in .25s ease; }
#sph-cart-drawer .sph-ci.is-pending .sph-ci-img img { opacity: .75; }
#sph-cart-drawer .sph-pending-note { display: inline-flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 13.5px; font-weight: 600; color: var(--sph-primary); }
#sph-cart-drawer .sph-spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--sph-primary) 25%, transparent); border-top-color: var(--sph-primary); animation: sph-spin .7s linear infinite; }
@keyframes sph-spin { to { transform: rotate(360deg); } }
@keyframes sph-pend-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { #sph-cart-drawer .sph-spin { animation-duration: 2s; } #sph-cart-drawer .sph-ci.is-pending { animation: none; } }

/* ====================================================================
   Account panel (logged-in customers)
   ==================================================================== */
#sph-account {
	--sph-border: #E7E9EE; --sph-line: #F0F2F5; --sph-muted: #6B7280; --sph-soft: #F3F5F8;
	position: fixed; top: 0; bottom: 0; left: 0; z-index: 99995; width: min(380px, 90vw);
	background: #fff; display: flex; flex-direction: column; visibility: hidden; transform: translateX(-100%);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s;
	font-family: var(--sph-font, inherit); color: var(--sph-dark); direction: rtl; text-align: right; line-height: 1.5; box-sizing: border-box;
}
#sph-account *, #sph-account *::before, #sph-account *::after { box-sizing: border-box; }
#sph-account.is-open { transform: none; visibility: visible; }
.admin-bar #sph-account { top: var(--wp-admin--admin-bar--height, 0px); }
#sph-account :is(h2, a, span, strong, small, button) { font-family: inherit !important; }
#sph-account ul, #sph-account li { margin: 0 !important; padding: 0 !important; list-style: none !important; }
#sph-account li::before, #sph-account li::after { content: none !important; }
#sph-account a { text-decoration: none !important; }
#sph-account .sph-ico { width: 1em; height: 1em; display: block; flex-shrink: 0; }
#sph-account .sph-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 76px; padding: 0 20px; border-bottom: 1px solid var(--sph-border); flex-shrink: 0; }
#sph-account .sph-panel-title { margin: 0; font-size: 20px; font-weight: 800; color: var(--sph-dark); }
#sph-account .sph-close {
	display: inline-flex !important; align-items: center; justify-content: center; width: 44px !important; height: 44px !important; padding: 0 !important; margin: 0 !important;
	border: 0 !important; border-radius: 12px !important; background: var(--sph-soft) !important; color: var(--sph-dark) !important; font-size: 20px; min-height: 0 !important; box-shadow: none !important; cursor: pointer;
}
#sph-account .sph-close:hover { background: #E5E8ED !important; }
#sph-account .sph-acc-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px; }
#sph-account .sph-acc-user {
	display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; margin-bottom: 14px;
	background: linear-gradient(135deg, color-mix(in srgb, var(--sph-primary) 9%, #fff), #fff); border: 1px solid color-mix(in srgb, var(--sph-primary) 14%, #fff);
}
#sph-account .sph-acc-avatar {
	width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
	background: var(--sph-primary); color: #fff; font-size: 22px; font-weight: 800; line-height: 1;
}
#sph-account .sph-acc-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
#sph-account .sph-acc-who strong { font-size: 17px; font-weight: 800; color: var(--sph-dark); }
#sph-account .sph-acc-who small { font-size: 13px; color: var(--sph-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
#sph-account .sph-acc-menu { display: grid; gap: 4px; }
#sph-account .sph-acc-menu a {
	display: flex; align-items: center; gap: 12px; height: 54px; padding: 0 12px; border-radius: 14px;
	color: var(--sph-dark) !important; font-size: 15.5px; font-weight: 700; transition: background .2s, color .2s;
}
#sph-account .sph-acc-ico { width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0; display: grid; place-items: center; background: var(--sph-soft); color: var(--sph-dark); font-size: 19px; transition: background .2s, color .2s; }
#sph-account .sph-acc-lbl { flex: 1; min-width: 0; }
#sph-account .sph-acc-badge { min-width: 24px; height: 24px; padding: 0 7px; border-radius: 12px; background: color-mix(in srgb, var(--sph-primary) 12%, #fff); color: var(--sph-primary); font-size: 12.5px; font-weight: 800; line-height: 24px; text-align: center; }
#sph-account .sph-acc-go { color: #B6BECB; font-size: 16px; transition: transform .2s, color .2s; }
#sph-account .sph-acc-menu a:hover, #sph-account .sph-acc-menu a.is-active { background: var(--sph-soft); color: var(--sph-primary) !important; }
#sph-account .sph-acc-menu a:hover .sph-acc-ico, #sph-account .sph-acc-menu a.is-active .sph-acc-ico { background: var(--sph-primary); color: #fff; }
#sph-account .sph-acc-menu a:hover .sph-acc-go { color: var(--sph-primary); transform: translateX(-3px); }
#sph-account .sph-acc-foot { flex-shrink: 0; padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sph-border); }
#sph-account .sph-acc-logout {
	display: flex; align-items: center; justify-content: center; gap: 10px; height: 50px; border-radius: 14px;
	border: 1.5px solid #F6D3CE; background: #FFF6F5; color: #D23B26 !important; font-size: 15px; font-weight: 800; transition: background .2s, border-color .2s;
}
#sph-account .sph-acc-logout .sph-acc-ico { width: auto; height: auto; background: none; color: inherit; font-size: 19px; }
#sph-account .sph-acc-logout:hover { background: #FFECE9; border-color: #F0B5AC; }
@media (prefers-reduced-motion: reduce) { #sph-account { transition: none; } }
