/**
 * App mode — only active when the shop runs inside The Beauty Brands app.
 * The markup is always present; these rules reveal and arrange it.
 *
 * @package tbb-storefront-child
 */

.tbb-appbar,
.tbb-appsearch,
.tbb-push-ask {
	display: none;
}

/* -------------------------------------------------------------------------
 *  Website chrome the app replaces
 * ---------------------------------------------------------------------- */

.tbb-app-mode .tbb-announce,
.tbb-app-mode .storefront-handheld-footer-bar,
.tbb-app-mode .tbb-wa-float,
.tbb-app-mode #wpadminbar,
.tbb-app-mode .site-footer .tbb-footer__col:not(.tbb-footer__about) {
	display: none !important;
}

.tbb-app-mode {
	overscroll-behavior-y: none;
	-webkit-tap-highlight-color: transparent;
}

.tbb-app-mode body {
	padding-bottom: calc(62px + env(safe-area-inset-bottom));
}

/* Keep floating page elements clear of the tab bar. */
.tbb-app-mode .tbb-shop-view,
.tbb-app-mode .woocommerce-message,
.tbb-app-mode .woocommerce-info {
	scroll-margin-bottom: 80px;
}

/* -------------------------------------------------------------------------
 *  Bottom tab bar
 * ---------------------------------------------------------------------- */

.tbb-app-mode .tbb-appbar {
	position: fixed;
	z-index: 9999;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	align-items: stretch;
	padding-bottom: env(safe-area-inset-bottom);
	background: rgba(255, 255, 255, .96);
	backdrop-filter: saturate(160%) blur(12px);
	border-top: 1px solid var(--tbb-line, #e7e0d8);
	box-shadow: 0 -6px 18px rgba(26, 26, 26, .06);
	user-select: none;
}

.tbb-appbar__tab {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	min-height: 62px;
	padding: 8px 2px 6px;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--tbb-muted, #7a7268);
	/* The search tab is a <button>: undo the theme's button styling. */
	font-family: inherit;
	font-size: 10px;
	font-weight: 500;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	cursor: pointer;
	appearance: none;
	transition: color .15s ease, transform .15s ease;
}

.tbb-appbar__tab:hover,
.tbb-appbar__tab:focus,
.tbb-appbar__tab:active,
button.tbb-appbar__tab:hover,
button.tbb-appbar__tab:focus {
	background: none;
	box-shadow: none;
	color: var(--tbb-ink, #1a1a1a);
	text-decoration: none;
}

.tbb-appbar__tab:active {
	transform: scale(.94);
}

.tbb-appbar__tab.is-active {
	color: var(--tbb-ink, #1a1a1a);
}

.tbb-appbar__icon {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
}

.tbb-appbar__icon svg {
	width: 24px;
	height: 24px;
	fill: currentColor;
}

.tbb-appbar__label {
	font-size: 10px;
	font-weight: 500;
	letter-spacing: .04em;
	line-height: 1;
}

.tbb-appbar__badge {
	position: absolute;
	top: -5px;
	left: 13px;
	min-width: 17px;
	height: 17px;
	padding: 0 4px;
	border-radius: 999px;
	background: var(--tbb-ink, #1a1a1a);
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	line-height: 17px;
	text-align: center;
}

.tbb-appbar__badge.is-empty {
	display: none;
}

/* -------------------------------------------------------------------------
 *  Search sheet
 * ---------------------------------------------------------------------- */

.tbb-app-mode .tbb-appsearch {
	position: fixed;
	z-index: 10000;
	inset: 0;
	display: block;
	background: rgba(26, 26, 26, .35);
	opacity: 0;
	transition: opacity .18s ease;
}

.tbb-app-mode .tbb-appsearch[hidden] {
	display: none;
}

.tbb-app-mode .tbb-appsearch.is-open {
	opacity: 1;
}

.tbb-appsearch__sheet {
	padding: calc(14px + env(safe-area-inset-top)) 16px 18px;
	background: var(--tbb-bg, #fff);
	box-shadow: 0 10px 30px rgba(26, 26, 26, .18);
	transform: translateY(-14px);
	transition: transform .18s ease;
}

.tbb-appsearch.is-open .tbb-appsearch__sheet {
	transform: translateY(0);
}

.tbb-appsearch__sheet form {
	display: flex;
	gap: 8px;
}

.tbb-appsearch__sheet input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 13px 16px;
	border: 1px solid var(--tbb-line, #e7e0d8);
	border-radius: 999px;
	background: var(--tbb-soft, #f6f1ec);
	font-size: 16px; /* stops iOS zooming in on focus */
}

.tbb-appsearch__sheet button[type="submit"] {
	padding: 13px 20px;
	border-radius: 999px;
	background: var(--tbb-ink, #1a1a1a);
	color: #fff;
	font-size: 14px;
}

.tbb-appsearch__close {
	display: block;
	width: 100%;
	margin-top: 12px;
	padding: 6px;
	border: 0;
	background: none;
	color: var(--tbb-muted, #7a7268);
	font-size: 14px;
}

/* -------------------------------------------------------------------------
 *  Notification permission card
 * ---------------------------------------------------------------------- */

.tbb-app-mode .tbb-push-ask {
	position: fixed;
	z-index: 9998;
	right: 12px;
	bottom: calc(72px + env(safe-area-inset-bottom));
	left: 12px;
	display: block;
	padding: 16px 18px;
	border: 1px solid var(--tbb-line, #e7e0d8);
	border-radius: 16px;
	background: var(--tbb-bg, #fff);
	box-shadow: 0 12px 30px rgba(26, 26, 26, .16);
	animation: tbb-push-in .25s ease;
}

@keyframes tbb-push-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

.tbb-push-ask__title {
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 600;
}

.tbb-push-ask__text {
	margin: 0 0 14px;
	color: var(--tbb-muted, #7a7268);
	font-size: 13.5px;
	line-height: 1.5;
}

.tbb-push-ask__actions {
	display: flex;
	gap: 10px;
}

.tbb-push-ask__actions button {
	flex: 1 1 0;
	padding: 11px 14px;
	border: 1px solid var(--tbb-line, #e7e0d8);
	border-radius: 999px;
	background: none;
	color: var(--tbb-ink, #1a1a1a);
	font-size: 14px;
}

.tbb-push-ask__actions .tbb-push-ask__yes {
	border-color: var(--tbb-ink, #1a1a1a);
	background: var(--tbb-ink, #1a1a1a);
	color: #fff;
}
