/**
 * Tazbi Food Core: site chrome.
 * Search box (Product Search widget), mini-cart drawer, floating cart tab and
 * floating WhatsApp button. Header and footer are built from Elementor widgets
 * (their extra styles are in sections.css).
 *
 * Mobile first. Breakpoints match the design: tablet from 768px, desktop from 1024px.
 */

/* Tokens come from the theme. The second value is the fallback used if the theme changes. */
:root {
	--bbc-green: var(--bb-green, #3f7a23);
	--bbc-green-hover: var(--bb-green-hover, #32621c);
	--bbc-gold: var(--bb-gold, #5ea13a);
	--bbc-gold-hover: var(--bb-gold-hover, #4f8e2f);
	--bbc-gold-text: var(--bb-gold-text, #3f7a23);
	--bbc-gold-light: var(--bb-gold-light, #ecf4e7);
	--bbc-cream: var(--bb-cream, #ffffff);
	--bbc-sand: var(--bb-sand, #f2f8ef);
	--bbc-white: var(--bb-white, #fff);
	--bbc-text: var(--bb-text, #000000);
	--bbc-text-muted: var(--bb-text-muted, #4d4d4d);
	--bbc-text-soft: var(--bb-text-soft, #5c5c5c);
	--bbc-border: var(--bb-border, #e5f0e0);
	--bbc-border-strong: var(--bb-border-strong, #dcead4);
	--bbc-red: var(--bb-red, #c8432e);
	--bbc-red-tint: var(--bb-red-tint, #f7e3de);
	--bbc-font-heading: var(--bb-font-heading, "Andika", sans-serif);
	--bbc-container: var(--bb-container, 1280px);
	--bbc-gutter: var(--bb-gutter, clamp(16px, 4vw, 32px));
}

/* ---------- Shared ---------- */

.bb-icon {
	display: block;
	flex: none;
	width: 1em;
	height: 1em;
	fill: currentColor;
}

.bb-wrap {
	width: 100%;
	max-width: var(--bbc-container);
	margin-inline: auto;
	padding-inline: var(--bbc-gutter);
}

html.bb-lock {
	overflow: hidden;
}

.bb-panel {
	position: fixed;
	inset: 0;
	z-index: 150;
}

.bb-panel[hidden] {
	display: none !important;
}

.bb-panel__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	animation: bb-fade-in 0.25s ease;
}

@keyframes bb-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}

@keyframes bb-slide-from-right {
	from { transform: translateX(100%); }
	to { transform: translateX(0); }
}

@keyframes bb-slide-from-left {
	from { transform: translateX(-100%); }
	to { transform: translateX(0); }
}

@keyframes bb-slide-from-top {
	from { transform: translateY(-100%); }
	to { transform: translateY(0); }
}

@keyframes bb-pulse {
	0%, 100% { transform: scale(1); }
	35% { transform: scale(1.12); }
	70% { transform: scale(0.96); }
}

.bb-cart-count {
	font-variant-numeric: tabular-nums;
}

/* The header template sticks to the top; the announcement bar scrolls away first

/* ---------- Search form ---------- */

.bb-searchform {
	display: flex;
	align-items: center;
	height: 46px;
	overflow: hidden;
	border: 1px solid var(--bbc-border-strong);
	border-radius: 999px;
	background: var(--bbc-white);
}

.bb-searchform:focus-within {
	outline: 2px solid var(--bbc-gold);
	outline-offset: 2px;
}

.bb-searchform__cat {
	display: none;
	flex: none;
	width: 150px;
	height: 100%;
	padding: 0 10px 0 18px;
	border: 0;
	border-radius: 0;
	background: var(--bbc-sand);
	color: var(--bbc-green);
	font-size: 13px;
	font-weight: 500;
	text-overflow: ellipsis;
	cursor: pointer;
}

.bb-searchform .bb-searchform__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 16px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--bbc-text);
	font-size: 14px;
	outline: none;
	box-shadow: none;
}

.bb-searchform .bb-searchform__submit {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 38px;
	margin-right: 4px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--bbc-green);
	color: var(--bbc-sand);
	font-size: 22px;
	cursor: pointer;
}

.bb-searchform--square {
	height: 48px;
	border-radius: 12px;
}

.bb-searchform--square .bb-searchform__submit {
	width: 56px;
	height: 100%;
	margin: 0;
	border-radius: 0;
	color: var(--bbc-gold-light);
	font-size: 24px;
}

/* ---------- Floating cart tab ---------- */

.bb-carttab {
	position: fixed;
	top: 50%;
	right: 0;
	z-index: 58;
	display: flex;
	flex-direction: column;
	width: 76px;
	margin-top: -36px;
	overflow: hidden;
	border: 1px solid var(--bbc-border-strong);
	border-right: 0;
	border-radius: 12px 0 0 12px;
	box-shadow: -8px 12px 28px -12px rgba(0, 0, 0, 0.4);
	color: var(--bbc-green);
}

.bb-carttab.is-pulsing {
	animation: bb-pulse 0.45s ease-out;
}

.bb-carttab__top {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	height: 46px;
	background: var(--bbc-green);
	color: var(--bbc-gold-light);
	font-size: 20px;
}

.bb-carttab__top .bb-cart-count,
.bb-carttab__icon--desktop {
	display: none;
}

.bb-carttab .bb-cart-items-label {
	color: var(--bbc-sand);
	font-size: 11px;
	font-weight: 600;
	line-height: 1;
}

.bb-carttab__bottom {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 26px;
	background: var(--bbc-white);
	color: var(--bbc-gold-text);
	font-size: 12px;
	font-weight: 700;
}

/* ---------- Mini-cart drawer ---------- */

.bb-minicart__sheet {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	display: flex;
	flex-direction: column;
	width: min(440px, 94vw);
	background: var(--bbc-white);
	box-shadow: -16px 0 48px rgba(0, 0, 0, 0.3);
	animation: bb-slide-from-right 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.bb-minicart__head {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	height: 64px;
	padding: 0 20px;
	border-bottom: 1px solid var(--bbc-border);
}

.bb-minicart__head h2 {
	margin: 0;
	color: var(--bbc-green);
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.bb-minicart__head-count {
	color: var(--bbc-gold-text);
}

.bb-minicart .bb-minicart__close {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 44px;
	padding: 0 4px;
	border: 0;
	background: transparent;
	color: var(--bbc-text-muted);
	font-size: 14px;
	cursor: pointer;
}

.bb-minicart .bb-minicart__close:hover {
	color: var(--bbc-green);
}

.bb-minicart__close .bb-icon {
	font-size: 20px;
}

.bb-minicart__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	min-height: 0;
	transition: opacity 0.2s ease;
}

.bb-minicart.is-busy .bb-minicart__body {
	opacity: 0.55;
	pointer-events: none;
}

.bb-minicart__lines {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: 10px;
	min-height: 0;
	padding: 16px 16px 8px;
	overflow-y: auto;
	background: var(--bbc-cream);
}

.bb-minicart__empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	margin: auto;
	padding: 40px 0;
	color: var(--bbc-text-muted);
	text-align: center;
}

.bb-minicart__empty .bb-icon {
	color: var(--bbc-gold);
	font-size: 48px;
}

.bb-minicart__empty p {
	margin: 0;
	font-size: 15px;
}

.bb-minicart .bb-minicart__continue {
	height: 44px;
	padding: 0 20px;
	border: 1px solid var(--bbc-green);
	border-radius: 999px;
	background: transparent;
	color: var(--bbc-green);
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.bb-minicart__line {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) 36px;
	align-items: center;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--bbc-border);
	border-radius: 12px;
	background: var(--bbc-white);
}

.bb-minicart__thumb {
	display: block;
	width: 64px;
	height: 64px;
	overflow: hidden;
	border: 1px solid var(--bbc-border);
	border-radius: 10px;
	background: var(--bbc-white);
}

.bb-minicart .bb-minicart__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bb-minicart__info {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

.bb-minicart__name,
.bb-minicart__rec-name {
	overflow: hidden;
	color: var(--bbc-green);
	font-size: 14px;
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.bb-minicart__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 10px;
	color: var(--bbc-text-muted);
	font-size: 13px;
}

.bb-minicart__calc strong {
	color: var(--bbc-green);
	font-weight: 600;
}

.bb-qty {
	display: flex;
	align-items: center;
	height: 30px;
	overflow: hidden;
	border: 1px solid var(--bbc-border-strong);
	border-radius: 999px;
}

.bb-qty .bb-qty__btn {
	width: 30px;
	height: 30px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--bbc-green);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.bb-qty .bb-qty__btn:hover {
	background: var(--bbc-sand);
}

.bb-qty__value {
	min-width: 24px;
	color: var(--bbc-green);
	font-weight: 600;
	text-align: center;
}

.bb-minicart .bb-minicart__remove {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bbc-text-muted);
	font-size: 22px;
	cursor: pointer;
}

.bb-minicart .bb-minicart__remove:hover {
	background: var(--bbc-sand);
	color: var(--bbc-red);
}

.bb-minicart__footer {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: 14px;
	padding: 16px 20px 20px;
	border-top: 1px solid var(--bbc-border);
	background: var(--bbc-white);
}

.bb-minicart__recs {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.bb-minicart--no-recs .bb-minicart__recs {
	display: none;
}

.bb-minicart__recs-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bb-minicart__recs-head h3 {
	margin: 0;
	color: var(--bbc-green);
	font-family: var(--bbc-font-heading);
	font-size: 22px;
	font-weight: 600;
}

.bb-minicart__recs-nav {
	display: flex;
	gap: 6px;
}

.bb-minicart .bb-minicart__recs-nav button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--bbc-gold);
	color: var(--bb-on-gold, #000000); /* White on the green accent is 3.2:1; black is 6.6:1. */
	font-size: 20px;
	cursor: pointer;
}

.bb-minicart__recs-row {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.bb-minicart__recs-row::-webkit-scrollbar {
	display: none;
}

.bb-minicart__rec {
	display: grid;
	flex: 0 0 82%;
	grid-template-columns: 64px minmax(0, 1fr);
	align-items: center;
	gap: 12px;
	padding: 10px;
	border: 1px solid var(--bbc-border);
	border-radius: 12px;
	scroll-snap-align: start;
}

.bb-minicart__rec .bb-minicart__thumb {
	border: 0;
}

.bb-minicart__rec-info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
}

.bb-minicart__rec-name {
	max-width: 100%;
	font-size: 13px;
}

.bb-minicart__rec-price {
	color: var(--bbc-gold-text);
	font-size: 13px;
	font-weight: 600;
}

.bb-minicart__rec-price del {
	margin-right: 4px;
	color: var(--bb-text-strike, #6b6b6b);
	font-weight: 400;
}

.bb-minicart__rec-price ins {
	text-decoration: none;
}

.bb-minicart .bb-minicart__rec-add {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	height: 28px;
	padding: 0 12px;
	border-radius: 999px;
	background: var(--bbc-green);
	color: var(--bbc-sand);
	font-size: 12px;
	font-weight: 500;
}

.bb-minicart__rec-add .bb-icon {
	font-size: 16px;
}

.bb-minicart__rec-add.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* WooCommerce adds a "View cart" link after an AJAX add; the drawer already shows the cart. */
.bb-minicart .added_to_cart {
	display: none;
}

.bb-minicart__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	color: var(--bbc-text-muted);
	font-size: 15px;
}

.bb-minicart__total-value {
	color: var(--bbc-green);
	font-size: 22px;
	font-weight: 600;
}

.bb-minicart .bb-minicart__checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 50px;
	border-radius: 999px;
	background: var(--bbc-gold);
	color: var(--bb-on-gold, #000000);
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	transition: background-color 0.2s ease;
}

.bb-minicart .bb-minicart__checkout:hover {
	background: var(--bbc-gold-hover);
}

@media (max-height: 699px) {
	.bb-minicart__recs {
		display: none;
	}
}

/* Leaves room for the bar so it never covers the end of the page. */

/* ---------- Tablet (768px and up) ---------- */

@media (min-width: 768px) {

	.bb-carttab {
		width: 84px;
		margin-top: -48px;
		overflow: visible;
		background: var(--bbc-white);
		box-shadow: -10px 14px 32px -14px rgba(0, 0, 0, 0.35);
	}

	.bb-carttab__top {
		position: relative;
		height: 60px;
		background: transparent;
		color: var(--bbc-gold-text);
		font-size: 30px;
	}

	.bb-carttab__icon--desktop {
		display: block;
	}

	.bb-carttab__icon--mobile,
	.bb-carttab .bb-cart-items-label {
		display: none;
	}

	.bb-carttab__top .bb-cart-count {
		position: absolute;
		top: 8px;
		right: 16px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 20px;
		height: 20px;
		padding: 0 5px;
		border-radius: 999px;
		background: var(--bbc-red);
		color: #fff;
		font-size: 11px;
		font-weight: 600;
		line-height: 1;
	}

	.bb-carttab__bottom {
		height: 34px;
		border-radius: 0 0 0 11px;
		background: var(--bbc-green);
		color: var(--bbc-gold-light);
		font-size: 14px;
		font-weight: 600;
	}
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
	.bb-panel__backdrop,
	.bb-minicart__sheet,
	.bb-carttab.is-pulsing {
		animation: none;
	}
}

/* ---------- Floating WhatsApp button ---------- */

.bb-wa {
	--bbc-wa: var(--bb-whatsapp, #1f8f4e);
	position: fixed;
	right: 16px;
	bottom: calc(84px + env(safe-area-inset-bottom)); /* Phones: above the 64px bottom bar. */
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	color: #fff;
}

.bb-wa:hover {
	color: #fff;
}

.bb-wa__ring {
	position: absolute;
	inset: 0;
	border-radius: 50%;
	background: var(--bbc-wa);
	animation: bb-wa-ring 2s ease-out infinite;
}

.bb-wa__ring--late {
	animation-delay: 1s;
}

.bb-wa__button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 58px;
	border-radius: 50%;
	background: var(--bbc-wa);
	box-shadow: 0 12px 28px -8px rgba(0, 0, 0, 0.45);
	font-size: 28px;
	animation: bb-wa-wiggle 4s ease-in-out infinite;
}

.bb-wa__button .bb-wa__logo {
	/* WhatsApp logo: 1.25 × the 28px button text = 35px, about 60% of the circle. */
	width: 1.25em;
	height: 1.25em;
	color: #fff;
	fill: currentColor;
}

.bb-wa__tip {
	display: none;
}

@keyframes bb-wa-ring {
	0% { transform: scale(1); opacity: 0.55; }
	100% { transform: scale(1.9); opacity: 0; }
}

@keyframes bb-wa-wiggle {
	0%, 78%, 100% { transform: rotate(0) scale(1); }
	82% { transform: rotate(-14deg) scale(1.08); }
	86% { transform: rotate(12deg) scale(1.08); }
	90% { transform: rotate(-8deg) scale(1.05); }
	94% { transform: rotate(5deg) scale(1.02); }
}

@keyframes bb-wa-tip {
	0%, 8% { opacity: 0; transform: translateX(8px); }
	14%, 70% { opacity: 1; transform: translateX(0); }
	78%, 100% { opacity: 0; transform: translateX(8px); }
}

/* On phones the button sits above the bottom bar. */

@media (min-width: 768px) {
	.bb-wa {
		right: 24px;
		bottom: 24px;
	}

	.bb-wa__tip {
		position: absolute;
		top: 50%;
		right: 70px;
		display: flex;
		align-items: center;
		height: 36px;
		margin-top: -18px;
		padding: 0 14px;
		border: 1px solid var(--bbc-border);
		border-radius: 999px;
		background: var(--bbc-white);
		box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.35);
		color: var(--bbc-green);
		font-size: 13px;
		font-weight: 500;
		white-space: nowrap;
		opacity: 0;
		animation: bb-wa-tip 9s ease-in-out 2s infinite;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bb-wa__ring {
		display: none;
	}

	.bb-wa__button,
	.bb-wa__tip {
		animation: none;
	}

	.bb-wa__tip {
		opacity: 1;
	}
}
