/* M365DALYS Theme Pack 1.1 — professional mobile layer */

.m365-mobile-nav,
.m365-mobile-search-panel {
	display: none;
}

@media (max-width: 780px) {
	html {
		scroll-behavior: smooth;
	}

	body.m365-mobile-ready {
		padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important;
		overflow-x: hidden;
	}

	body.m365-mobile-search-open {
		overflow: hidden !important;
	}

	body.m365-mobile-ready button,
	body.m365-mobile-ready .button,
	body.m365-mobile-ready input[type="submit"],
	body.m365-mobile-ready a.checkout-button {
		min-height: 44px;
	}

	body.m365-mobile-ready input,
	body.m365-mobile-ready select,
	body.m365-mobile-ready textarea {
		font-size: 16px !important;
	}

	/* Bottom mobile navigation */
	.m365-mobile-nav {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 99999;
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		padding: 6px 5px calc(6px + env(safe-area-inset-bottom));
		border-top: 1px solid #dbe3ec;
		background: rgba(255,255,255,.98);
		box-shadow: 0 -7px 22px rgba(15,23,42,.10);
		backdrop-filter: blur(12px);
		-webkit-backdrop-filter: blur(12px);
	}

	.m365-mobile-nav__item {
		position: relative;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 2px;
		min-width: 0;
		min-height: 50px;
		padding: 3px 2px;
		border: 0;
		border-radius: 10px;
		background: transparent;
		color: #64748b;
		font-family: inherit;
		font-size: 9.5px;
		font-weight: 800;
		line-height: 1.05;
		text-align: center;
		text-decoration: none;
		cursor: pointer;
		transition: background .15s ease, color .15s ease, transform .15s ease;
	}

	.m365-mobile-nav__item:hover,
	.m365-mobile-nav__item:focus,
	.m365-mobile-nav__item.is-active {
		background: #f0fdf4;
		color: #15803d;
	}

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

	.m365-mobile-nav__icon {
		display: block;
		height: 21px;
		font-size: 19px;
		line-height: 21px;
	}

	.m365-mobile-cart-count {
		position: absolute;
		top: 0;
		left: 50%;
		min-width: 18px;
		height: 18px;
		margin-left: 7px;
		padding: 0 5px;
		border: 2px solid #fff;
		border-radius: 999px;
		background: #15803d;
		color: #fff;
		font-size: 10px;
		font-weight: 900;
		line-height: 14px;
		box-sizing: border-box;
	}

	/* Full-screen mobile search */
	.m365-mobile-search-panel {
		position: fixed;
		inset: 0;
		z-index: 100000;
		display: block;
		padding: 0;
		background: #f4f6f8;
		opacity: 0;
		visibility: hidden;
		transform: translateY(14px);
		transition: opacity .18s ease, visibility .18s ease, transform .18s ease;
	}

	.m365-mobile-search-panel.is-open {
		opacity: 1;
		visibility: visible;
		transform: translateY(0);
	}

	.m365-mobile-search-panel__inner {
		position: relative;
		width: 100%;
		height: 100%;
		max-width: none;
		padding: calc(18px + env(safe-area-inset-top)) 16px 24px;
		border-radius: 0;
		background: #fff;
		box-shadow: none;
		box-sizing: border-box;
	}

	.m365-mobile-search-panel__inner:before {
		content: "Prekių paieška";
		display: block;
		margin: 8px 48px 22px 0;
		color: #111827;
		font-size: 24px;
		font-weight: 900;
		line-height: 1.15;
	}

	.m365-mobile-search-close {
		position: absolute;
		top: calc(13px + env(safe-area-inset-top));
		right: 14px;
		width: 42px;
		height: 42px;
		min-height: 42px !important;
		padding: 0;
		border: 1px solid #dbe3ec;
		border-radius: 50%;
		background: #fff;
		color: #475569;
		font-size: 29px;
		line-height: 38px;
		box-shadow: 0 5px 13px rgba(15,23,42,.07);
		cursor: pointer;
	}

	.m365-mobile-search-panel form {
		display: grid !important;
		grid-template-columns: minmax(0, 1fr) !important;
		gap: 10px !important;
		margin: 0 !important;
	}

	.m365-mobile-search-panel input[type="search"],
	.m365-mobile-search-panel input[type="text"] {
		width: 100% !important;
		height: 56px !important;
		padding: 0 16px !important;
		border: 1px solid #cfd8e3 !important;
		border-radius: 12px !important;
		background: #fbfcfe !important;
		box-shadow: none !important;
		box-sizing: border-box !important;
	}

	.m365-mobile-search-panel button,
	.m365-mobile-search-panel input[type="submit"] {
		width: 100% !important;
		height: 54px !important;
		padding: 0 18px !important;
		border: 0 !important;
		border-radius: 12px !important;
		background: #15803d !important;
		color: #fff !important;
		font-size: 15px !important;
		font-weight: 900 !important;
	}

	/* Mobile cart cards */
	body.m365-modern-cart .woocommerce {
		padding-left: 12px !important;
		padding-right: 12px !important;
	}

	body.m365-modern-cart .woocommerce:before {
		margin-bottom: 14px !important;
		font-size: 34px !important;
	}

	body.m365-modern-cart .woocommerce-cart-form {
		padding: 14px !important;
		border-radius: 16px !important;
	}

	body.m365-modern-cart .shop_table.cart tr.cart_item {
		display: grid !important;
		grid-template-columns: 34px 82px minmax(0, 1fr) !important;
		gap: 8px 10px !important;
		padding: 14px 0 !important;
		border-bottom: 1px solid #edf2f7 !important;
	}

	body.m365-modern-cart .shop_table.cart tr.cart_item td {
		display: block !important;
		width: auto !important;
		min-width: 0 !important;
		padding: 0 !important;
		border: 0 !important;
		text-align: left !important;
	}

	body.m365-modern-cart .shop_table.cart tr.cart_item td:before {
		display: none !important;
		content: none !important;
	}

	body.m365-modern-cart .shop_table.cart .product-remove {
		grid-column: 1 !important;
		grid-row: 1 !important;
		align-self: start !important;
	}

	body.m365-modern-cart .shop_table.cart .product-thumbnail {
		grid-column: 2 !important;
		grid-row: 1 / span 3 !important;
	}

	body.m365-modern-cart .shop_table.cart .product-thumbnail img {
		width: 78px !important;
		height: 78px !important;
	}

	body.m365-modern-cart .shop_table.cart .product-name {
		grid-column: 3 !important;
		grid-row: 1 !important;
		align-self: start !important;
	}

	body.m365-modern-cart .shop_table.cart .product-name a {
		display: -webkit-box !important;
		-webkit-box-orient: vertical !important;
		-webkit-line-clamp: 3 !important;
		overflow: hidden !important;
		font-size: 15px !important;
		line-height: 1.35 !important;
	}

	body.m365-modern-cart .shop_table.cart .product-price {
		grid-column: 3 !important;
		grid-row: 2 !important;
		font-size: 18px !important;
	}

	body.m365-modern-cart .shop_table.cart .product-quantity {
		grid-column: 3 !important;
		grid-row: 3 !important;
		margin: 2px 0 0 !important;
	}

	body.m365-modern-cart .shop_table.cart .product-subtotal {
		grid-column: 3 !important;
		grid-row: 4 !important;
		margin-top: 5px !important;
		color: #15803d !important;
		font-size: 19px !important;
		font-weight: 950 !important;
	}

	/* Hide duplicate product labels inserted by responsive tables. */
	body.m365-modern-cart .shop_table.cart .product-name:before,
	body.m365-modern-cart .shop_table.cart .product-price:before,
	body.m365-modern-cart .shop_table.cart .product-quantity:before,
	body.m365-modern-cart .shop_table.cart .product-subtotal:before {
		display: none !important;
	}

	/* Thumb-friendly +/- quantity control */
	body.m365-modern-cart .m365-mobile-qty {
		display: inline-grid;
		grid-template-columns: 42px 54px 42px;
		align-items: center;
		gap: 0;
		border: 1px solid #d9e1ea;
		border-radius: 11px;
		overflow: hidden;
		background: #fff;
	}

	body.m365-modern-cart .m365-mobile-qty button {
		width: 42px;
		height: 44px;
		min-height: 44px !important;
		padding: 0;
		border: 0;
		background: #f8fafc;
		color: #111827;
		font-size: 21px;
		font-weight: 900;
		cursor: pointer;
	}

	body.m365-modern-cart .m365-mobile-qty input.qty {
		width: 54px !important;
		height: 44px !important;
		min-height: 44px !important;
		padding: 0 !important;
		border: 0 !important;
		border-left: 1px solid #e2e8f0 !important;
		border-right: 1px solid #e2e8f0 !important;
		border-radius: 0 !important;
		background: #fff !important;
		font-size: 16px !important;
		font-weight: 850 !important;
		-moz-appearance: textfield;
	}

	body.m365-modern-cart .m365-mobile-qty input.qty::-webkit-outer-spin-button,
	body.m365-modern-cart .m365-mobile-qty input.qty::-webkit-inner-spin-button {
		margin: 0;
		-webkit-appearance: none;
	}

	body.m365-modern-cart .shop_table.cart td.actions {
		padding-top: 14px !important;
	}

	body.m365-modern-cart .coupon {
		grid-template-columns: 1fr !important;
	}

	body.m365-modern-cart .coupon input.input-text,
	body.m365-modern-cart .coupon button {
		width: 100% !important;
	}

	body.m365-modern-cart button[name="update_cart"] {
		width: 100% !important;
		margin-top: 8px !important;
	}

	/* General mobile safeguards */
	body.m365-mobile-ready .site-branding img,
	body.m365-mobile-ready .custom-logo {
		max-width: min(58vw, 240px) !important;
		height: auto !important;
	}

	body.m365-modern-cart .woocommerce-cart-form,
	body.m365-modern-cart .cart-collaterals,
	body.m365-lite-checkout form.checkout {
		max-width: 100% !important;
		overflow: visible !important;
	}

	#m365-footer {
		margin-bottom: 8px !important;
		padding-bottom: 28px !important;
	}
}

@media (max-width: 420px) {
	.m365-mobile-nav__item {
		font-size: 9px;
	}

	.m365-mobile-nav__icon {
		font-size: 18px;
	}

	body.m365-modern-cart .shop_table.cart tr.cart_item {
		grid-template-columns: 30px 72px minmax(0, 1fr) !important;
	}

	body.m365-modern-cart .shop_table.cart .product-thumbnail img {
		width: 68px !important;
		height: 68px !important;
	}
}


/* ===== M365 Theme Pack 1.2 mobile overrides ===== */
@media (max-width:780px){

/* Search */
.m365-mobile-search-panel{background:rgba(15,23,42,.96)!important}
.m365-mobile-search-panel__inner{
  padding:calc(20px + env(safe-area-inset-top)) 18px 24px!important;
  background:linear-gradient(180deg,#0f172a,#1e293b)!important
}
.m365-mobile-search-panel__inner:before{
  content:"Paieška"!important;color:#fff!important;font-size:28px!important;
  margin:6px 52px 22px 0!important
}
.m365-mobile-search-close{
  top:calc(16px + env(safe-area-inset-top))!important;right:16px!important;
  width:42px!important;height:42px!important;border-radius:50%!important;
  border:1px solid rgba(255,255,255,.22)!important;
  background:rgba(255,255,255,.08)!important;color:#fff!important
}
.m365-mobile-search-panel form{
  display:grid!important;grid-template-columns:minmax(0,1fr) 54px!important;
  gap:8px!important;margin:0!important
}
.m365-mobile-search-panel input[type=search],
.m365-mobile-search-panel input[type=text]{
  width:100%!important;height:54px!important;padding:0 15px!important;
  border-radius:12px!important;background:#fff!important;color:#111827!important
}
.m365-mobile-search-panel button,
.m365-mobile-search-panel input[type=submit]{
  width:54px!important;height:54px!important;min-height:54px!important;
  padding:0!important;border-radius:12px!important;font-size:0!important
}
.m365-mobile-search-panel button:before,
.m365-mobile-search-panel input[type=submit]:before{
  content:"⌕"!important;font-size:24px!important;line-height:54px!important
}

/* Product page width */
body.m365-modern-product .site-content,
body.m365-modern-product #content,
body.m365-modern-product .woocommerce{
  width:100%!important;max-width:100%!important;
  padding-left:12px!important;padding-right:12px!important;
  box-sizing:border-box!important
}
body.m365-modern-product div.product{
  display:block!important;width:100%!important;margin:0!important;
  padding:14px!important;border-radius:16px!important;box-sizing:border-box!important
}

/* Gallery */
body.m365-modern-product div.product div.images,
body.m365-modern-product div.product .woocommerce-product-gallery{
  width:100%!important;float:none!important;margin:0 0 16px!important
}
body.m365-modern-product div.product .woocommerce-product-gallery__image{
  width:100%!important;min-height:0!important;height:auto!important;
  aspect-ratio:1/1!important;padding:10px!important;box-sizing:border-box!important
}
body.m365-modern-product div.product .woocommerce-product-gallery__image a{
  display:flex!important;align-items:center!important;justify-content:center!important;
  width:100%!important;height:100%!important
}
body.m365-modern-product div.product .woocommerce-product-gallery__image img{
  width:100%!important;max-width:100%!important;height:100%!important;
  object-fit:contain!important
}
body.m365-modern-product .flex-control-thumbs{
  display:flex!important;flex-wrap:nowrap!important;gap:10px!important;
  overflow-x:auto!important;overflow-y:hidden!important;margin:10px 0 0!important
}
body.m365-modern-product .flex-control-thumbs li{
  flex:0 0 72px!important;width:72px!important;height:72px!important;margin:0!important
}
body.m365-modern-product .flex-control-thumbs img{
  width:72px!important;height:72px!important;object-fit:contain!important
}

/* Summary and variations */
body.m365-modern-product div.product div.summary{
  width:100%!important;float:none!important;margin:0!important;padding:0!important
}
body.m365-modern-product div.product .product_title{
  font-size:27px!important;line-height:1.15!important;margin:0 0 10px!important
}
body.m365-modern-product div.product p.price,
body.m365-modern-product div.product span.price{font-size:28px!important}

body.m365-modern-product div.product table.variations,
body.m365-modern-product div.product table.variations tbody,
body.m365-modern-product div.product table.variations tr,
body.m365-modern-product div.product table.variations th,
body.m365-modern-product div.product table.variations td{
  display:block!important;width:100%!important;box-sizing:border-box!important
}
body.m365-modern-product div.product table.variations th,
body.m365-modern-product div.product table.variations td{padding:0!important}
body.m365-modern-product div.product table.variations label{
  display:block!important;margin:0 0 6px!important
}
body.m365-modern-product div.product table.variations select{
  display:block!important;width:100%!important;min-height:48px!important;
  padding:0 42px 0 13px!important;box-sizing:border-box!important
}

/* Cart form */
body.m365-modern-product div.product form.cart{
  display:grid!important;grid-template-columns:1fr!important;
  gap:10px!important;width:100%!important;margin:14px 0 0!important
}
body.m365-modern-product div.product form.cart .quantity,
body.m365-modern-product div.product form.cart .quantity input.qty,
body.m365-modern-product div.product form.cart .single_add_to_cart_button{
  width:100%!important;box-sizing:border-box!important
}
body.m365-modern-product div.product form.cart .quantity input.qty{
  height:48px!important;min-height:48px!important
}
body.m365-modern-product div.product form.cart .single_add_to_cart_button{
  min-height:52px!important
}

/* Trust */
body.m365-modern-product div.product .summary:after{
  content:"🚚 Pristatymas nuo 3 €\A↩ 14 dienų grąžinimas\A🔒 Saugus atsiskaitymas"!important;
  white-space:pre-line!important;line-height:1.7!important
}

/* Tabs and related */
body.m365-modern-product .woocommerce-tabs{width:100%!important;box-sizing:border-box!important}
body.m365-modern-product .woocommerce-tabs .panel{
  width:100%!important;max-width:100%!important;box-sizing:border-box!important
}
body.m365-modern-product .related.products,
body.m365-modern-product .upsells.products{
  width:100%!important;padding:14px!important;box-sizing:border-box!important
}
body.m365-modern-product .related.products ul.products,
body.m365-modern-product .upsells.products ul.products{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  gap:10px!important;width:100%!important
}
body.m365-modern-product .related.products ul.products li.product,
body.m365-modern-product .upsells.products ul.products li.product{
  width:100%!important;min-width:0!important;margin:0!important;
  padding:10px!important;box-sizing:border-box!important
}
body.m365-modern-product .related.products ul.products li.product img,
body.m365-modern-product .upsells.products ul.products li.product img{
  height:125px!important;object-fit:contain!important
}
}
