/**
 * Stiva YGO Mobile Bottom Navigation Bar Styles
 *
 * Sticky bottom app bar on mobile viewports (<= 768px).
 * Uses the original crisp vector SVGs from images/icons-stivaoh/ with refined glassmorphism & active indicators.
 */

.stiva-mobile-bottom-bar {
	display: none;
}

@media (max-width: 768px) {
	/* Pad body so content is not obscured by bottom bar */
	body {
		padding-bottom: calc(82px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Hide on checkout page for clean checkout focus */
	body.woocommerce-checkout .stiva-mobile-bottom-bar {
		display: none !important;
	}

	.stiva-mobile-bottom-bar {
		display: flex !important;
		position: fixed !important;
		bottom: 0 !important;
		left: 0 !important;
		right: 0 !important;
		width: 100% !important;
		min-height: 76px !important;
		background: rgba(255, 255, 255, 0.97) !important;
		backdrop-filter: blur(14px) !important;
		-webkit-backdrop-filter: blur(14px) !important;
		border-top: 1px solid rgba(20, 18, 17, 0.08) !important;
		box-shadow: 0 -6px 24px rgba(20, 18, 17, 0.08) !important;
		z-index: 9990 !important;
		align-items: stretch !important;
		justify-content: space-around !important;
		padding: 8px 6px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
		box-sizing: border-box !important;
		overflow: visible !important;
	}

	.stiva-bottom-tab {
		position: relative !important;
		flex: 1 1 0% !important;
		min-width: 0 !important;
		display: flex !important;
		flex-direction: column !important;
		align-items: center !important;
		justify-content: flex-end !important;
		color: #6e737b !important;
		text-decoration: none !important;
		font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif !important;
		padding: 4px 2px 2px !important;
		margin: 0 !important;
		gap: 5px !important;
		transition: color 0.22s ease, transform 0.22s ease !important;
		background: transparent !important;
		border: none !important;
		cursor: pointer !important;
		box-sizing: border-box !important;
		-webkit-tap-highlight-color: transparent !important;
	}

	/* Top active accent line for regular tabs */
	.stiva-bottom-tab:not(.stiva-bottom-tab--center)::after {
		content: '' !important;
		position: absolute !important;
		top: -8px !important;
		left: 22% !important;
		right: 22% !important;
		height: 3px !important;
		border-radius: 0 0 4px 4px !important;
		background: transparent !important;
		transition: background-color 0.22s ease, transform 0.22s ease !important;
		transform: scaleX(0.6) !important;
	}

	.stiva-bottom-tab-icon-wrap {
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		width: 38px !important;
		height: 34px !important;
		border-radius: 10px !important;
		transition: background-color 0.22s ease, transform 0.22s ease !important;
	}

	.stiva-bottom-tab-img {
		width: 32px !important;
		height: 32px !important;
		max-width: 32px !important;
		max-height: 32px !important;
		display: block !important;
		object-fit: contain !important;
		margin: 0 auto !important;
		transition: transform 0.22s cubic-bezier(0.22, 1, 0.36, 1) !important;
	}

	/* ==========================================================================
	   Center "STORE" Docked Medallion / Half-Circle Dome
	   ========================================================================== */
	.stiva-bottom-tab--center {
		z-index: 2 !important;
		justify-content: flex-end !important;
		overflow: visible !important;
	}

	.stiva-bottom-tab-center-dome {
		position: relative !important;
		margin-top: -26px !important;
		width: 60px !important;
		height: 60px !important;
		border-radius: 50% !important;
		background: #ffffff !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		box-shadow: 0 -5px 14px rgba(20, 18, 17, 0.09), 0 4px 12px rgba(220, 18, 18, 0.14) !important;
		border: 2px solid rgba(220, 18, 18, 0.22) !important;
		transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease, border-color 0.25s ease !important;
		box-sizing: border-box !important;
	}

	/* Inner ring effect */
	.stiva-bottom-tab-center-dome::before {
		content: '' !important;
		position: absolute !important;
		inset: 3px !important;
		border-radius: 50% !important;
		background: linear-gradient(180deg, rgba(220, 18, 18, 0.06) 0%, rgba(220, 18, 18, 0.01) 100%) !important;
		border: 1px solid rgba(220, 18, 18, 0.12) !important;
		pointer-events: none !important;
	}

	.stiva-bottom-tab--center .stiva-bottom-tab-icon-wrap {
		width: 44px !important;
		height: 44px !important;
		border-radius: 50% !important;
		background: transparent !important;
		position: relative !important;
		z-index: 1 !important;
	}

	.stiva-bottom-tab--center .stiva-bottom-tab-img {
		width: 35px !important;
		height: 35px !important;
		max-width: 35px !important;
		max-height: 35px !important;
	}

	.stiva-bottom-tab--center .stiva-tab-label {
		color: #1e1e1e !important;
		font-weight: 700 !important;
		margin-top: 1px !important;
	}

	.stiva-bottom-tab--center:hover .stiva-bottom-tab-center-dome,
	.stiva-bottom-tab--center.stiva-is-active .stiva-bottom-tab-center-dome {
		border-color: #dc1212 !important;
		box-shadow: 0 -6px 18px rgba(220, 18, 18, 0.22), 0 6px 16px rgba(220, 18, 18, 0.25) !important;
		transform: translateY(-3px) scale(1.03) !important;
	}

	.stiva-bottom-tab--center:hover .stiva-tab-label,
	.stiva-bottom-tab--center.stiva-is-active .stiva-tab-label {
		color: #dc1212 !important;
	}

	.stiva-bottom-tab .stiva-tab-label {
		display: block !important;
		font-family: 'Bebas Neue', Impact, 'Arial Narrow', sans-serif !important;
		font-size: 13px !important;
		font-weight: 500 !important;
		line-height: 1.1 !important;
		letter-spacing: 0.45px !important;
		text-transform: uppercase !important;
		white-space: nowrap !important;
		max-width: 100% !important;
		overflow: hidden !important;
		text-overflow: ellipsis !important;
		margin: 0 !important;
		transition: color 0.22s ease !important;
	}

	.stiva-bottom-tab:hover,
	.stiva-bottom-tab:focus,
	.stiva-bottom-tab.stiva-is-active {
		color: #dc1212 !important;
	}

	.stiva-bottom-tab:hover::after,
	.stiva-bottom-tab.stiva-is-active::after {
		background: #dc1212 !important;
		transform: scaleX(1) !important;
	}

	.stiva-bottom-tab.stiva-is-active .stiva-bottom-tab-icon-wrap {
		background: rgba(220, 18, 18, 0.07) !important;
	}

	.stiva-bottom-tab:hover .stiva-bottom-tab-img,
	.stiva-bottom-tab.stiva-is-active .stiva-bottom-tab-img {
		transform: translateY(-1.5px) scale(1.06) !important;
	}
}

/* ==========================================================================
   Deck Builder Mobile Bottom-Bar Pop-Up Menu (Spring Animation)
   ========================================================================== */
.stiva-bottom-tab--trigger {
	background: transparent !important;
	border: none !important;
	box-shadow: none !important;
	padding: 0;
	margin: 0;
	font: inherit;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.stiva-deck-popup-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.28);
	z-index: 9988;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.16s ease, visibility 0.16s ease;
}

.stiva-deck-popup-backdrop.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

.stiva-deck-popup {
	position: fixed;
	bottom: calc(74px + env(safe-area-inset-bottom, 0px));
	left: 70%;
	width: 192px;
	background: #ffffff;
	border: 1px solid rgba(15, 23, 42, 0.1);
	border-radius: 12px;
	padding: 4px;
	box-shadow: 0 14px 36px rgba(15, 23, 42, 0.2);
	z-index: 9992;
	display: flex;
	flex-direction: column;
	gap: 2px;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateX(-50%) translateY(10px) scale(0.94);
	transform-origin: bottom center;
	transition: opacity 0.14s ease-in, transform 0.14s ease-in, visibility 0.14s ease-in;
}

.stiva-deck-popup.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateX(-50%) translateY(0) scale(1);
	transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

.stiva-deck-popup::after {
	content: '';
	position: absolute;
	bottom: -6px;
	left: 50%;
	width: 12px;
	height: 12px;
	background: #ffffff;
	border-right: 1px solid rgba(15, 23, 42, 0.1);
	border-bottom: 1px solid rgba(15, 23, 42, 0.1);
	transform: translateX(-50%) rotate(45deg);
}

.stiva-deck-popup-item {
	display: flex;
	flex-direction: column;
	gap: 1px;
	padding: 7px 10px;
	border-radius: 8px;
	text-decoration: none !important;
	color: #0f172a !important;
	transition: background 0.14s ease;
}

.stiva-deck-popup-item:active,
.stiva-deck-popup-item:hover {
	background: #f8fafc;
}

.stiva-deck-popup-item.is-current {
	background: #fef2f2;
}

.stiva-deck-popup-title {
	font-size: 13.5px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.2;
}

.stiva-deck-popup-item.is-current .stiva-deck-popup-title {
	color: #dc1212;
}

.stiva-deck-popup-sub {
	font-size: 11.5px;
	color: #64748b;
	line-height: 1.25;
}

@media (min-width: 1025px) {
	.stiva-deck-popup,
	.stiva-deck-popup-backdrop {
		display: none !important;
	}
}
