/* ==========================================================================
   Barraq — floating cart bar + side cart
   ========================================================================== */

/* Floating bar (bottom centre) — same glass as the header */
.b-fcart {
	position: fixed; z-index: 95;
	left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px));
	transform: translateX(-50%);
	width: max-content; max-width: calc(100% - 32px);
	background: var(--b-glass-bg);
	-webkit-backdrop-filter: var(--b-glass-blur);
	backdrop-filter: var(--b-glass-blur);
	border: var(--b-glass-border);
	border-radius: 999px;
	box-shadow: var(--b-glass-shadow);
	animation: b-fcart-in .45s var(--b-ease) both;
}
.b-fcart.is-bump { animation: b-fcart-bump .5s var(--b-ease); }
@keyframes b-fcart-in { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes b-fcart-bump { 35% { transform: translate(-50%, -6px) scale(1.03); } 100% { transform: translate(-50%, 0) scale(1); } }

.b-fcart__btn {
	display: flex; align-items: center; gap: 14px; width: 100%;
	padding: 7px 8px 7px 8px; border: 0; background: transparent; cursor: pointer;
	font-family: var(--b-font); color: var(--b-ink); text-align: left;
	-webkit-tap-highlight-color: transparent;
}
.b-fcart__icon {
	position: relative; flex: 0 0 auto; width: 48px; height: 48px; border-radius: 50%;
	display: grid; place-items: center; color: #fff; background: var(--b-grad);
	box-shadow: var(--b-shadow-pop);
}
.b-fcart__count {
	position: absolute; top: -3px; right: -4px; min-width: 21px; height: 21px; padding: 0 5px;
	display: grid; place-items: center; border-radius: 99px; border: 2px solid #fff;
	font-size: 11px; font-weight: 800; line-height: 1; color: #fff; background: var(--b-green);
}
.b-fcart__info { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; padding-right: 6px; }
.b-fcart__label { font-size: 12.5px; font-weight: 600; color: var(--b-text); white-space: nowrap; }
.b-fcart__total { font-size: 17px; font-weight: 800; color: var(--b-ink); white-space: nowrap; }
.b-fcart__total .woocommerce-Price-amount { color: inherit; }
.b-fcart__cta {
	display: inline-flex; align-items: center; gap: 4px; margin-left: auto;
	padding: 13px 18px 13px 20px; border-radius: 99px; white-space: nowrap;
	font-size: 14.5px; font-weight: 700; color: #fff; background: var(--b-grad);
	text-shadow: 0 1px 1px rgba(0, 0, 0, .08);
	transition: box-shadow .25s var(--b-ease), transform .25s var(--b-ease);
}
.b-fcart__btn:hover .b-fcart__cta { box-shadow: var(--b-shadow-pop); transform: translateY(-1px); }
@media (max-width: 480px) {
	.b-fcart { width: calc(100% - 24px); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
	.b-fcart__btn { gap: 10px; }
	.b-fcart__icon { width: 44px; height: 44px; }
	.b-fcart__cta { padding: 12px 14px 12px 16px; font-size: 14px; }
}

/* Keep the WhatsApp button clear of the bar */
body.has-fcart .b-fab-wa,
body:has(.b-fcart:not([hidden])) .b-fab-wa { bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 900px) {
	body.has-fcart .b-fab-wa,
	body:has(.b-fcart:not([hidden])) .b-fab-wa { bottom: 18px; }
}

/* Drawer */
html.b-lock { overflow: hidden; }
.b-drawer { position: fixed; inset: 0; z-index: 1000; }
.b-drawer__overlay {
	position: absolute; inset: 0; background: rgba(31, 31, 31, .38);
	-webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
	opacity: 0; transition: opacity .3s var(--b-ease);
}
.b-drawer__panel {
	position: absolute; top: 0; right: 0; bottom: 0; width: min(430px, 100%);
	display: flex; flex-direction: column;
	background: #fff; box-shadow: -20px 0 60px -20px rgba(31, 31, 31, .35);
	border-radius: 26px 0 0 26px;
	transform: translateX(104%); transition: transform .35s var(--b-ease);
	outline: 0;
}
.b-drawer.is-open .b-drawer__overlay { opacity: 1; }
.b-drawer.is-open .b-drawer__panel { transform: none; }
@media (max-width: 480px) { .b-drawer__panel { border-radius: 0; } }

.b-drawer__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 18px 14px 22px; border-bottom: 1px solid var(--b-line); }
.b-drawer__head h2 { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; }
.b-drawer__head h2 .b-icon { color: var(--b-orange); }
.b-drawer__count { min-width: 26px; height: 26px; padding: 0 8px; display: inline-grid; place-items: center; border-radius: 99px; font-size: 13px; color: #fff; background: var(--b-green); }
.b-drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.b-drawer__inner { display: flex; flex-direction: column; min-height: 100%; }

.b-drawer__free { margin: 14px 18px 4px; padding: 12px 14px; border-radius: 14px; background: var(--b-cream); }
.b-drawer__free p { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 13.5px; font-weight: 600; color: var(--b-ink); }
.b-drawer__free p .b-icon { color: var(--b-orange); flex: 0 0 auto; }
.b-drawer__free-bar { display: block; height: 6px; border-radius: 6px; background: rgba(248, 141, 11, .15); overflow: hidden; }
.b-drawer__free-bar span { display: block; height: 100%; border-radius: 6px; background: var(--b-grad); transition: width .5s var(--b-ease); }
.b-drawer__free.is-unlocked { background: var(--b-success-bg); }
.b-drawer__free.is-unlocked p .b-icon { color: var(--b-green); }
.b-drawer__free.is-unlocked .b-drawer__free-bar span { background: var(--b-grad-green); }

.b-drawer__items { list-style: none; margin: 0; padding: 6px 18px; flex: 1; }
.b-ditem { position: relative; display: grid; grid-template-columns: 76px minmax(0, 1fr) 32px; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--b-line); transition: opacity .2s; }
.b-ditem:last-child { border-bottom: 0; }
.b-ditem.is-busy { opacity: .45; pointer-events: none; }
.b-ditem__media { display: block; border-radius: 14px; background: var(--b-cream); overflow: hidden; align-self: start; }
.b-ditem__media img { width: 76px; height: 76px; object-fit: contain; padding: 6px; }
.b-ditem__name { display: block; font-weight: 700; font-size: 15px; line-height: 1.3; color: var(--b-ink); }
.b-ditem__name:hover { color: var(--b-orange); }
.b-ditem__meta dl { margin: 2px 0 0; font-size: 12.5px; color: var(--b-muted); }
.b-ditem__meta dt, .b-ditem__meta dd, .b-ditem__meta p { display: inline; margin: 0; }
.b-ditem__row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 10px; }
.b-ditem__total { font-size: 15px; color: var(--b-ink); }
.b-ditem__remove { width: 32px; height: 32px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--b-muted); background: transparent; transition: .2s; }
.b-ditem__remove:hover { color: var(--b-danger); background: var(--b-danger-bg); }
/* Quantity stepper (shared with the cart page) */
.b-drawer .b-qty { display: inline-flex; align-items: center; background: #fff; border: 1.5px solid var(--b-line-strong); border-radius: 99px; padding: 2px; }
.b-drawer .b-qty__input { width: 36px; height: 30px; padding: 0; border: 0; background: transparent; text-align: center; font: 700 15px var(--b-font); color: var(--b-ink); -moz-appearance: textfield; appearance: textfield; }
.b-drawer .b-qty__input::-webkit-outer-spin-button, .b-drawer .b-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.b-drawer .b-qty__input:focus { outline: 0; }
.b-drawer .b-qty__btn { width: 30px; height: 30px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center; color: var(--b-ink); background: var(--b-cream); transition: background .2s, color .2s; }
.b-drawer .b-qty__btn:hover { background: var(--b-orange); color: #fff; }
.b-drawer .b-qty-static { font-weight: 700; color: var(--b-ink); }
.b-qty--sm { padding: 2px; }
.b-qty--sm .b-qty__btn { width: 30px; height: 30px; }
.b-qty--sm .b-qty__input { width: 36px; height: 30px; font-size: 15px; }

.b-drawer__foot { position: sticky; bottom: 0; display: grid; gap: 10px; padding: 16px 18px calc(18px + env(safe-area-inset-bottom, 0px)); background: #fff; border-top: 1px solid var(--b-line); box-shadow: 0 -12px 30px -18px rgba(31, 31, 31, .2); }
.b-drawer__sub { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; color: var(--b-ink); }
.b-drawer__sub strong { font-size: 22px; color: var(--b-orange); }
.b-drawer__note { margin: -6px 0 4px; font-size: 12.5px; color: var(--b-muted); }
.b-drawer__empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 40px 24px; text-align: center; }
.b-drawer__empty h3 { margin: 0; }

/* Add-to-cart button feedback on product pages */
.single_add_to_cart_button.is-added { background: var(--b-grad-green) !important; }
.b-atc-error { width: 100%; }
