/* Components: announcement bar, nav, pills, drawer, tab bar, WhatsApp. */

/* --- announcement bar ----------------------------------------------- */
.rb-ann {
	background: var(--rb-blue-dark);
	color: var(--rb-white);
	font-size: .84rem;
	font-weight: 700;
	padding-block: 9px;
	overflow: hidden;
	white-space: nowrap;
}

.rb-ann__track {
	display: inline-flex;
	gap: 44px;
	padding-left: 44px;
	animation: rb-tick 34s linear infinite;
	will-change: transform;
}

.rb-ann__item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.rb-ann__item::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--rb-sun);
	flex: none;
}

@keyframes rb-tick {
	to { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
	.rb-ann__track { animation: none; }
}

/* On wide screens there is room to simply centre the messages. */
@media (min-width: 1081px) {
	.rb-ann { text-align: center; }
	.rb-ann__track { animation: none; padding-left: 0; }
	.rb-ann__item[aria-hidden="true"] { display: none; }
}

/* --- primary nav ----------------------------------------------------- */
.rb-nav__list {
	display: flex;
	gap: 2px;
	font-weight: 700;
	font-size: .9375rem;
}

.rb-nav__item { position: relative; }

.rb-nav__list a {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	padding: 0 13px;
	border-radius: 999px;
	color: var(--rb-ink);
	white-space: nowrap;
}

.rb-nav__list a:hover,
.rb-nav__item.current-menu-item > a,
.rb-nav__item.current-menu-ancestor > a {
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	color: var(--rb-blue-dark);
}

/* Second level */
.rb-nav .sub-menu {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	min-width: 210px;
	background: var(--rb-white);
	border: 1px solid var(--rb-line);
	border-radius: var(--rb-r-tile);
	box-shadow: var(--rb-sh-2);
	padding: 8px;
	display: grid;
	gap: 2px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity .16s, transform .16s, visibility .16s;
	z-index: 5;
}

.rb-nav__item:hover > .sub-menu,
.rb-nav__item:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}

/* --- search ---------------------------------------------------------- */
.rb-search {
	display: flex;
	align-items: center;
	gap: 10px;
	flex: 1;
	max-width: 330px;
	height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	color: var(--rb-ink-soft);
}

.rb-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: none;
	font-size: .9rem;
	outline: none;
	color: var(--rb-ink);
}

.rb-search__input::placeholder { color: var(--rb-ink-soft); }

/* --- pills and icon buttons ------------------------------------------ */
.rb-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	font-weight: 700;
	font-size: .875rem;
	white-space: nowrap;
	color: var(--rb-ink);
}

.rb-pill--ghost { background: var(--rb-white); box-shadow: var(--rb-sh-1); }
.rb-pill--ghost:hover { box-shadow: var(--rb-sh-2); color: var(--rb-ink); }
.rb-pill--dark { background: var(--rb-ink); color: var(--rb-white); }
.rb-pill--dark:hover { background: #0E1820; color: var(--rb-white); }

.rb-cart__count {
	background: var(--rb-orange);
	color: var(--rb-white);
	border-radius: 999px;
	min-width: 22px;
	height: 22px;
	display: grid;
	place-items: center;
	font-size: .75rem;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.rb-iconbtn {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	flex: none;
	cursor: pointer;
}

.rb-iconbtn:hover { box-shadow: var(--rb-sh-2); }

.rb-burger { display: none; }

/* --- mobile drawer ---------------------------------------------------- */
.rb-drawer {
	position: fixed;
	inset: 0;
	z-index: 90;
}

.rb-drawer__scrim {
	position: absolute;
	inset: 0;
	background: rgba(14, 24, 32, .5);
	animation: rb-fade .18s ease-out;
}

.rb-drawer__panel {
	position: absolute;
	inset-block: 0;
	inset-inline-start: 0;
	width: min(92vw, 380px);
	background: var(--rb-cream);
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: calc(16px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-left, 0px)) calc(16px + env(safe-area-inset-bottom, 0px));
	overflow-y: auto;
	overscroll-behavior: contain;
	box-shadow: var(--rb-sh-2);
	animation: rb-slide .22s cubic-bezier(.2, .8, .3, 1);
}

@keyframes rb-fade { from { opacity: 0; } }
@keyframes rb-slide { from { transform: translateX(-100%); } }

.rb-drawer__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rb-drawer__title {
	font-family: var(--rb-display);
	font-size: 1.15rem;
	font-weight: 600;
}

.rb-drawer__search {
	display: flex;
	align-items: center;
	gap: 10px;
	height: 48px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	color: var(--rb-ink-soft);
}

.rb-drawer__list { display: grid; gap: 4px; }

.rb-drawer__list a {
	display: flex;
	align-items: center;
	min-height: 50px;
	padding: 0 16px;
	border-radius: 14px;
	font-weight: 800;
	font-size: 1rem;
	color: var(--rb-ink);
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
}

.rb-drawer__list a:hover { color: var(--rb-blue-dark); }

.rb-drawer__list .sub-menu {
	display: grid;
	gap: 4px;
	margin: 4px 0 4px 14px;
}

.rb-drawer__list .sub-menu a {
	min-height: 44px;
	font-weight: 700;
	font-size: .9375rem;
	background: transparent;
	box-shadow: none;
	color: var(--rb-ink-soft);
}

.rb-drawer__foot { margin-top: auto; }

/* --- header switch to the mobile layout -------------------------------- */
/* These live here, not in layout.css, because this file loads last. */
@media (max-width: 860px) {
	.rb-search { display: none; }
	.rb-hide-sm { display: none; }
	.rb-burger { display: grid; }
}

/* --- mobile tab bar ---------------------------------------------------- */
.rb-tabbar { display: none; }

@media (max-width: 860px) {
	.rb-tabbar {
		display: flex;
		position: fixed;
		inset-inline: max(10px, env(safe-area-inset-left, 0px)) max(10px, env(safe-area-inset-right, 0px));
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		z-index: 45;
		background: var(--rb-ink);
		border-radius: 999px;
		justify-content: space-around;
		padding: 8px 4px;
		box-shadow: var(--rb-sh-2);
	}

	.rb-tabbar__link {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 3px;
		min-width: 60px;
		min-height: 48px;
		border-radius: 999px;
		color: #B9C3CD;
		font-size: .6875rem;
		font-weight: 800;
		cursor: pointer;
	}

	.rb-tabbar__link[aria-current] { color: var(--rb-sun); }
	.rb-tabbar__link:hover { color: var(--rb-white); }
}

/* --- WhatsApp --------------------------------------------------------- */
.rb-whatsapp {
	position: fixed;
	inset-inline-end: max(16px, env(safe-area-inset-right, 0px));
	bottom: calc(20px + env(safe-area-inset-bottom, 0px));
	z-index: 40;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #25D366;
	color: var(--rb-white);
	display: grid;
	place-items: center;
	box-shadow: var(--rb-sh-2);
}

.rb-whatsapp:hover { background: #1FB457; color: var(--rb-white); }

@media (max-width: 860px) {
	.rb-whatsapp {
		bottom: calc(86px + env(safe-area-inset-bottom, 0px));
		width: 50px;
		height: 50px;
	}
}

/* --- buttons -----------------------------------------------------------
   The theme opts out of WooCommerce's own button CSS (see inc/woocommerce.php),
   so every WooCommerce button is styled here. This file loads on every page,
   which the cart and checkout need: they are pages, not Woo templates, so a
   sheet limited to is_product() would never reach them.

   WooCommerce convention: .button.alt is the primary action, plain .button
   is secondary. */

.rb-btn,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce #respond input#submit,
.woocommerce .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	min-height: 50px;
	padding: 0 24px;
	border-radius: 999px;
	border: 0;
	background: var(--rb-white);
	color: var(--rb-ink);
	box-shadow: var(--rb-sh-1);
	font-weight: 800;
	font-size: .94rem;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: background .16s, box-shadow .16s, color .16s;
}

.rb-btn:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover,
.woocommerce input.button:hover,
.woocommerce #respond input#submit:hover,
.woocommerce .button:hover { box-shadow: var(--rb-sh-2); color: var(--rb-ink); }

/* Primary: add to cart, proceed to checkout, place order. */
.rb-btn--primary,
.woocommerce a.button.alt,
.woocommerce button.button.alt,
.woocommerce input.button.alt,
.woocommerce .button.alt,
.woocommerce .single_add_to_cart_button,
.woocommerce .checkout-button,
.woocommerce #place_order {
	background: var(--rb-orange-dark);
	color: var(--rb-white);
	box-shadow: none;
}

.rb-btn--primary:hover,
.woocommerce a.button.alt:hover,
.woocommerce button.button.alt:hover,
.woocommerce input.button.alt:hover,
.woocommerce .button.alt:hover,
.woocommerce .single_add_to_cart_button:hover,
.woocommerce .checkout-button:hover,
.woocommerce #place_order:hover { background: #A4461F; color: var(--rb-white); box-shadow: none; }

.rb-btn--muted,
.woocommerce .button:disabled,
.woocommerce .button.disabled {
	background: var(--rb-line);
	color: var(--rb-ink-soft);
	box-shadow: none;
	cursor: not-allowed;
}

/* --- toast (cart feedback) --------------------------------------------- */
.rb-toast {
	position: fixed;
	left: 50%;
	bottom: calc(24px + env(safe-area-inset-bottom, 0px));
	z-index: 70;
	transform: translateX(-50%) translateY(16px);
	background: var(--rb-ink);
	color: var(--rb-white);
	border-radius: 999px;
	padding: 12px 22px;
	font-weight: 700;
	font-size: .9rem;
	box-shadow: var(--rb-sh-2);
	opacity: 0;
	pointer-events: none;
	transition: opacity .22s, transform .22s;
	max-width: calc(100vw - 32px);
	text-align: center;
}

.rb-toast.is-on { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 860px) {
	.rb-toast { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
}

/* --- pagination -------------------------------------------------------- */
.rb-pager { margin-top: 30px; }

.rb-pager .nav-links {
	display: flex;
	gap: 7px;
	justify-content: center;
	flex-wrap: wrap;
}

.rb-pager .page-numbers {
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 13px;
	border-radius: 999px;
	background: var(--rb-white);
	box-shadow: var(--rb-sh-1);
	font-weight: 800;
	color: var(--rb-ink);
}

.rb-pager .page-numbers.current {
	background: var(--rb-ink);
	color: var(--rb-white);
}

/* --- body state while the drawer is open -------------------------------- */
body.rb-drawer-open { overflow: hidden; }
