/* =========================================================
   VINSMARTHOME - MOBILE BOTTOM NAVIGATION
========================================================= */

:root {
	--vsh-mobile-blue: #1955b5;
	--vsh-mobile-blue-dark: #0e438f;
	--vsh-mobile-blue-soft: #eef5ff;
	--vsh-mobile-yellow: #e5b700;
	--vsh-mobile-text: #17263b;
	--vsh-mobile-muted: #555e69;
	--vsh-mobile-border: #e5ebf2;
	--vsh-mobile-nav-height: 66px;
}

.vsh-mobile-ui {
	display: none;
}

@media (max-width: 849px) {

	html.vsh-mobile-sheet-open,
	body.vsh-mobile-sheet-open {
		overflow: hidden;
	}

	body {
		padding-bottom: calc(var(--vsh-mobile-nav-height) + env(safe-area-inset-bottom));
	}

	.vsh-mobile-ui {
		display: block;
	}

	/* Bottom navigation */
	.vsh-mobile-nav {
		position: fixed;
		z-index: 9998;
		left: 0;
		right: 0;
		bottom: 0;
		display: grid;
		grid-template-columns: repeat(6, minmax(0, 1fr));
		min-height: var(--vsh-mobile-nav-height);
		padding: 5px 6px calc(5px + env(safe-area-inset-bottom));
		border-top: 1px solid rgba(217, 225, 235, .95);
		background: rgba(255, 255, 255, .96);
		-webkit-backdrop-filter: blur(16px);
		backdrop-filter: blur(16px);
		box-shadow: 0 -8px 28px rgba(18, 46, 82, .08);
	}

	.vsh-mobile-nav__item {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 4px;
		min-width: 0;
		min-height: 54px;
		margin: 0;
		padding: 4px 2px;
		border: 0;
		border-radius: 11px;
		color: var(--vsh-mobile-muted);
		background: transparent;
		font: inherit;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
		transition: color .18s ease, background-color .18s ease, transform .18s ease;
	}

	.vsh-mobile-nav__item:active {
		transform: scale(.96);
	}

	.vsh-mobile-nav__icon {
		position: relative;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 28px;
		height: 25px;
	}

	.vsh-mobile-nav__icon svg {
		width: 21px;
		height: 21px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.vsh-mobile-nav__label {
		overflow: hidden;
		max-width: 100%;
		font-size: 10px;
		font-weight: 500;
		line-height: 1.1;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.vsh-mobile-nav__item.is-active {
		color: var(--vsh-mobile-blue);
	}

	.vsh-mobile-nav__item.is-active .vsh-mobile-nav__icon,
	.vsh-mobile-nav__item--consult .vsh-mobile-nav__icon {
		border-radius: 8px;
		background: var(--vsh-mobile-blue-soft);
	}

	.vsh-mobile-nav__item.is-active .vsh-mobile-nav__label,
	.vsh-mobile-nav__item--consult .vsh-mobile-nav__label {
		font-weight: 700;
	}

	.vsh-mobile-nav__item--consult {
		color: var(--vsh-mobile-blue);
	}

	.vsh-mobile-cart-count {
		position: absolute;
		top: -4px;
		right: -6px;
		display: flex;
		align-items: center;
		justify-content: center;
		min-width: 17px;
		height: 17px;
		padding: 0 4px;
		border: 0;
		border-radius: 20px;
		color: #fff;
		background: var(--vsh-mobile-blue-dark);
		box-shadow: 0 2px 7px rgba(30, 47, 72, .18);
		font-size: 9px;
		font-weight: 700;
		line-height: 1;
	}

	.vsh-mobile-cart-count.is-empty {
		display: none;
	}

	/* Overlay */
	.vsh-mobile-sheet-overlay {
		position: fixed;
		z-index: 9999;
		inset: 0;
		background: rgba(7, 20, 38, .46);
		opacity: 0;
		visibility: hidden;
		-webkit-backdrop-filter: blur(2px);
		backdrop-filter: blur(2px);
		transition: opacity .22s ease, visibility .22s ease;
	}

	.vsh-mobile-sheet-overlay.is-open {
		opacity: 1;
		visibility: visible;
	}

	/* Bottom sheet */
	.vsh-mobile-sheet {
		position: fixed;
		z-index: 10000;
		left: 0;
		right: 0;
		bottom: 0;
		max-height: min(95vh, 999px);
		padding-bottom: env(safe-area-inset-bottom);
		border-radius: 20px 20px 0 0;
		background: #fff;
		box-shadow: 0 -18px 55px rgba(8, 33, 67, .18);
		opacity: 0;
		visibility: hidden;
		transform: translateY(104%);
		transition: transform .28s cubic-bezier(.22, .75, .28, 1), opacity .2s ease, visibility .28s ease;
	}

	.vsh-mobile-sheet.is-open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.vsh-mobile-sheet__handle {
		width: 38px;
		height: 4px;
		margin: 9px auto 3px;
		border-radius: 20px;
		background: #d7dee7;
	}

	.vsh-mobile-sheet__header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 11px 18px 14px;
		border-bottom: 1px solid var(--vsh-mobile-border);
	}

	.vsh-mobile-sheet__heading {
		display: flex;
		flex-direction: column;
		gap: 3px;
		min-width: 0;
	}

	.vsh-mobile-sheet__heading strong {
		color: var(--vsh-mobile-text);
		font-size: 1em;
		font-weight: 700;
		line-height: 1.3;
	}

	.vsh-mobile-sheet__heading span {
		color: #778596;
		font-size: 11px;
		line-height: 1.4;
	}

	.vsh-mobile-sheet__close {
		flex: 0 0 36px;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		min-height: unset;
    	min-width: unset;
		margin: -15px 0 0 0;
		padding: 0;
		color: #526176;
		background: #fff;
		box-shadow: none;
	}

	.vsh-mobile-sheet__close svg {
		width: 18px;
		height: 18px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
	}

	.vsh-mobile-sheet__body {
		overflow-y: auto;
		max-height: calc(min(90vh, 888px) - 86px);
		padding: 16px 16px 18px;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}

	/* Device grid */
	.vsh-mobile-sheet__grid {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 9px;
	}

	.vsh-mobile-sheet-card {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		gap: 7px;
		min-width: 0;
		min-height: 90px;
		padding: 11px 5px 9px;
		border: 1px solid #e6ecf3;
		border-radius: 12px;
		color: #34475d;
		background: #fff;
		text-align: center;
		text-decoration: none;
		transition: color .18s ease, border-color .18s ease, background-color .18s ease, transform .18s ease;
	}

	.vsh-mobile-sheet-card:active {
		transform: scale(.97);
	}

	.vsh-mobile-sheet-card__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 38px;
		height: 38px;
		border-radius: 10px;
		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);
	}

	.vsh-mobile-sheet-card__icon svg {
		width: 20px;
		height: 20px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.7;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.vsh-mobile-sheet-card__label {
		display: -webkit-box;
		overflow: hidden;
		color: inherit;
		font-size: 11px;
		font-weight: 600;
		line-height: 1.3;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
	}

	/* More */
	.vsh-mobile-sheet__more {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 7px;
		min-height: 40px;
		margin-top: 14px;
		padding: 10px 12px 8px;
		border: 1px solid #d6e2f1;
		border-radius: 10px;
		color: var(--vsh-mobile-blue);
		background: #f8fbff;
		font-size: 12px;
		font-weight: 600;
		text-decoration: none;
	}

	.vsh-mobile-sheet__more svg {
		width: 16px;
		height: 16px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	/* Services */
	.vsh-mobile-sheet__service-list {
		display: flex;
		flex-direction: column;
		border: 1px solid #e5ebf2;
		border-radius: 13px;
		overflow: hidden;
	}

	.vsh-mobile-service-item {
		display: grid;
		grid-template-columns: 38px minmax(0, 1fr) 20px;
		align-items: center;
		gap: 11px;
		min-height: 56px;
		padding: 8px 12px;
		color: #33475d;
		background: #fff;
		text-decoration: none;
	}

	.vsh-mobile-service-item + .vsh-mobile-service-item {
		border-top: 1px solid #edf1f5;
	}

	.vsh-mobile-service-item__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border-radius: 9px;
		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);
	}

	.vsh-mobile-service-item__icon svg,
	.vsh-mobile-service-item__arrow svg {
		width: 18px;
		height: 18px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.7;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.vsh-mobile-service-item__label {
		font-size: 12px;
		font-weight: 600;
		line-height: 1.35;
	}

	.vsh-mobile-service-item__arrow {
		display: flex;
		color: #9aa8b8;
	}

	/* Consult */
	.vsh-mobile-sheet__body .row-small>.col {
		padding: 0 0 10px;
	}
	.vsh-mobile-sheet__body .vsh-contact,
	.vsh-mobile-consult-action {
		position: relative;
		display: grid;
		grid-template-columns: 46px minmax(0, 1fr) 20px;
		align-items: center;
		gap: 12px;
		min-height: 68px;
		padding: 10px 12px;
		border: 1px solid #e4eaf1;
		border-radius: 13px;
		color: #2f4359;
		background: #fff;
		text-decoration: none;
	}

	.vsh-mobile-sheet__body .vsh-contact:after {
		content: '';
		width: 19px;
		height: 19px;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2397a6b7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: center;
		background-size: contain;
	}

	.vsh-mobile-consult-action + .vsh-mobile-consult-action {
		margin-top: 10px;
	}

	.vsh-mobile-consult-action.is-primary {
		border-color: #d6e4f6;
		background: linear-gradient(135deg, #f7fbff 0%, #edf5ff 100%);
	}
	.vsh-mobile-sheet__body .vsh-contact__icon,
	.vsh-mobile-consult-action__icon {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 44px;
		height: 44px;
		flex: 0 0 44px;
		border-radius: 11px;
		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);
		font-size: 17px;
		font-weight: 800;
	}
	.vsh-mobile-sheet__body .vsh-contact__icon .vsh-contact__icon-img,
	.vsh-mobile-consult-action__icon .vsh-contact__icon-img {
		width: 28px;
		height: 28px;
	}

	.vsh-mobile-consult-action__icon svg,
	.vsh-mobile-consult-action > svg {
		width: 19px;
		height: 19px;
		fill: none;
		stroke: currentColor;
		stroke-width: 1.8;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.vsh-mobile-consult-action > svg {
		color: #97a6b7;
	}

	.vsh-mobile-consult-action strong,
	.vsh-mobile-consult-action small {
		display: block;
	}

	.vsh-mobile-consult-action strong {
		color: var(--vsh-mobile-text);
		font-size: 13px;
		font-weight: 700;
		line-height: 1.35;
	}

	.vsh-mobile-consult-action small {
		margin-top: 3px;
		color: #8a92a1;
		font-size: 12px;
		line-height: 1.35;
		font-weight: 400;
	}

	/* Optional: account/cart move to bottom nav */
	#masthead .mobile-nav .account-item,
	#masthead .mobile-nav .cart-item {
		display: none !important;
	}
}

@media (max-width: 390px) {
	.vsh-mobile-sheet__grid {
		gap: 7px;
	}

	.vsh-mobile-sheet-card {
		min-height: 84px;
		padding-left: 3px;
		padding-right: 3px;
	}

	.vsh-mobile-sheet-card__icon {
		width: 34px;
		height: 34px;
	}

	.vsh-mobile-sheet-card__label,
	.vsh-mobile-nav__label {
		font-size: 10px;
	}
}

/* =========================================================
   MENU-DRIVEN BOTTOM SHEETS
   menu-9  = Thiết bị
   menu-10 = Dịch vụ
========================================================= */

@media (max-width: 849px) {

	/* Base reset for WordPress / Flatsome menu output */
	.vsh-mobile-sheet-menu,
	.vsh-mobile-sheet-menu ul {
		margin: 0;
		padding: 0;
		list-style: none;
	}

	.vsh-mobile-sheet-menu > li {
		margin: 0 !important;
		padding: 0 !important;
	}

	.vsh-mobile-sheet-menu > li > a {
		margin: 0;
		text-decoration: none;
		-webkit-tap-highlight-color: transparent;
	}

	/* Flatsome menu icons: image icon + icon font */
	.vsh-mobile-sheet-menu .ux-menu-icon {
		float: none !important;
		margin: 0 !important;
		object-fit: contain;
	}

	.vsh-mobile-sheet-menu > li > a > i[class^="icon-"],
	.vsh-mobile-sheet-menu > li > a > i[class*=" icon-"] {
		margin: 0 !important;
	}


	


	/* =====================================================
	   MENU 8 - GIẢI PHÁP
	===================================================== */

	.vsh-mobile-sheet-menu--solution {
		display: flex;
		flex-direction: column;

		border: 1px solid #e5ebf2;
		border-radius: 13px;

		overflow: hidden;
	}

	.vsh-mobile-sheet-menu--solution > li + li {
		border-top: 1px solid #edf1f5;
	}

	.vsh-mobile-sheet-menu--solution > li > a {
		display: flex;
		align-items: center;
		gap: 8px;

		min-height: 52px;
		padding: 5px 12px !important;

		color: #33475d !important;
		background: #fff;

		font-size: 12px;
		font-weight: 600;
		line-height: 1.35;
		text-align: left;
	}

	.vsh-mobile-sheet-menu--solution > li > a::after {
		content: "›";
		flex: 0 0 auto;

		margin-left: auto;

		color: #9aa8b8;

		font-size: 22px;
		font-weight: 300;
		line-height: 1;
	}

	.vsh-mobile-sheet-menu--solution > li.current-menu-item > a,
	.vsh-mobile-sheet-menu--solution > li.current-menu-parent > a,
	.vsh-mobile-sheet-menu--solution > li.current-menu-ancestor > a {
		color: var(--vsh-mobile-blue) !important;
		background: #f8fbff;
	}

	/* Flatsome image icon */
	.vsh-mobile-sheet-menu--solution > li > a > .ux-menu-icon {
		display: block;
		flex: 0 0 36px;

		width: 36px !important;
		height: 36px !important;
		padding: 7px;

		border-radius: 9px;
		background: var(--vsh-mobile-blue-soft);
	}

	/* Flatsome font icon */
	.vsh-mobile-sheet-menu--solution > li > a > i[class^="icon-"],
	.vsh-mobile-sheet-menu--solution > li > a > i[class*=" icon-"] {
		display: inline-flex;
		flex: 0 0 36px;
		align-items: center;
		justify-content: center;

		width: 36px;
		height: 36px;

		border-radius: 9px;

		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);

		font-size: 18px;
		line-height: 1;
	}


	/* =====================================================
	   MENU 9 - THIẾT BỊ
	===================================================== */

	.vsh-mobile-sheet-menu--devices {
		display: grid;
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: 15px;
	}

	.vsh-mobile-sheet-menu--devices > li {
	}

	.vsh-mobile-sheet-menu--devices > li > a {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: flex-start;
		gap: 8px;

		width: 100%;
		min-height: 92px;
		height: 100%;
		padding: 11px 5px 9px !important;

		border: 1px solid #e6ecf3;
		border-radius: 8px;

		color: #34475d !important;
		background: #fff;

		font-size: 11px;
		font-weight: 600;
		line-height: 1.3;
		text-align: center;

		transition:
			color .18s ease,
			border-color .18s ease,
			background-color .18s ease,
			transform .18s ease;
	}

	.vsh-mobile-sheet-menu--devices > li > a:active {
		transform: scale(.97);
	}

	.vsh-mobile-sheet-menu--devices > li.current-menu-item > a,
	.vsh-mobile-sheet-menu--devices > li.current-menu-parent > a,
	.vsh-mobile-sheet-menu--devices > li.current-menu-ancestor > a {
		color: var(--vsh-mobile-blue) !important;
		border-color: #cfe0f6;
		background: #f8fbff;
	}

	/* Flatsome image icon */
	.vsh-mobile-sheet-menu--devices > li > a > .ux-menu-icon {
		display: block;
		flex: 0 0 38px;

		width: 38px !important;
		height: 38px !important;
		padding: 7px;

		border-radius: 10px;
		background: var(--vsh-mobile-blue-soft);
	}

	/* Flatsome font icon */
	.vsh-mobile-sheet-menu--devices > li > a > i[class^="icon-"],
	.vsh-mobile-sheet-menu--devices > li > a > i[class*=" icon-"] {
		display: inline-flex;
		flex: 0 0 38px;
		align-items: center;
		justify-content: center;

		width: 38px;
		height: 38px;

		border-radius: 10px;

		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);

		font-size: 20px;
		line-height: 1;
	}


	/* =====================================================
	   MENU 10 - DỊCH VỤ
	===================================================== */

	.vsh-mobile-sheet-menu--services {
		display: flex;
		flex-direction: column;

		border: 1px solid #e5ebf2;
		border-radius: 13px;

		overflow: hidden;
	}

	.vsh-mobile-sheet-menu--services > li + li {
		border-top: 1px solid #edf1f5;
	}

	.vsh-mobile-sheet-menu--services > li > a {
		display: flex;
		align-items: center;
		gap: 8px;

		min-height: 52px;
		padding: 5px 12px !important;

		color: #33475d !important;
		background: #fff;

		font-size: 12px;
		font-weight: 600;
		line-height: 1.35;
		text-align: left;
	}

	.vsh-mobile-sheet-menu--services > li > a::after {
		content: "›";
		flex: 0 0 auto;

		margin-left: auto;

		color: #9aa8b8;

		font-size: 22px;
		font-weight: 300;
		line-height: 1;
	}

	.vsh-mobile-sheet-menu--services > li.current-menu-item > a,
	.vsh-mobile-sheet-menu--services > li.current-menu-parent > a,
	.vsh-mobile-sheet-menu--services > li.current-menu-ancestor > a {
		color: var(--vsh-mobile-blue) !important;
		background: #f8fbff;
	}

	/* Flatsome image icon */
	.vsh-mobile-sheet-menu--services > li > a > .ux-menu-icon {
		display: block;
		flex: 0 0 36px;

		width: 36px !important;
		height: 36px !important;
		padding: 7px;

		border-radius: 9px;
		background: var(--vsh-mobile-blue-soft);
	}

	/* Flatsome font icon */
	.vsh-mobile-sheet-menu--services > li > a > i[class^="icon-"],
	.vsh-mobile-sheet-menu--services > li > a > i[class*=" icon-"] {
		display: inline-flex;
		flex: 0 0 36px;
		align-items: center;
		justify-content: center;

		width: 36px;
		height: 36px;

		border-radius: 9px;

		color: var(--vsh-mobile-blue);
		background: var(--vsh-mobile-blue-soft);

		font-size: 18px;
		line-height: 1;
	}


	/* =====================================================
	   ADMIN-ONLY MISSING MENU NOTICE
	===================================================== */

	.vsh-mobile-sheet__menu-notice {
		display: flex;
		flex-direction: column;
		gap: 5px;

		padding: 14px;

		border: 1px dashed #d7e0ea;
		border-radius: 10px;

		color: #607086;
		background: #f8fafc;

		font-size: 11px;
		line-height: 1.5;
	}

	.vsh-mobile-sheet__menu-notice strong {
		color: #17263b;
		font-size: 12px;
	}

	.vsh-mobile-sheet__menu-notice code {
		font-size: 10px;
	}
}

@media (max-width: 390px) {
	.vsh-mobile-sheet-menu--devices {
		gap: 7px;
	}

	.vsh-mobile-sheet-menu--devices > li > a {
		min-height: 86px;
		padding-right: 3px !important;
		padding-left: 3px !important;
		font-size: 9.5px;
	}

	.vsh-mobile-sheet-menu--devices > li > a > .ux-menu-icon,
	.vsh-mobile-sheet-menu--devices > li > a > i[class^="icon-"],
	.vsh-mobile-sheet-menu--devices > li > a > i[class*=" icon-"] {
		flex-basis: 34px;
		width: 34px !important;
		height: 34px !important;
	}
}
