/*
 * MobilePartsWala — shop layout fix overrides.
 * Loaded after style.css to win the cascade against Astra defaults.
 */

/* Make the shop container full width */
.woocommerce-shop .ast-container,
.post-type-archive-product .ast-container,
.tax-product_cat .ast-container,
.tax-product_brand .ast-container {
	max-width: 1200px !important;
}

.woocommerce-shop #primary,
.post-type-archive-product #primary,
.tax-product_cat #primary,
.tax-product_brand #primary {
	width: 100% !important;
	float: none !important;
}

/* Force a clean grid for product cards */
.woocommerce ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
	gap: 18px !important;
	list-style: none !important;
	padding: 0 !important;
	margin: 0 0 30px !important;
}
.woocommerce ul.products::before,
.woocommerce ul.products::after {
	display: none !important;
}

.woocommerce ul.products li.product {
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	clear: none !important;
	background: #fff;
	border: 1px solid #e8f0fe;
	border-radius: 14px;
	box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
	overflow: hidden;
	display: flex !important;
	flex-direction: column;
	transition: transform 0.2s, box-shadow 0.2s;
}
.woocommerce ul.products li.product:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 22px rgba(26, 115, 232, 0.12);
}

.woocommerce ul.products li.product a {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
}

.woocommerce ul.products li.product a img,
.woocommerce ul.products li.product img.attachment-woocommerce_thumbnail {
	width: 100% !important;
	height: 200px !important;
	object-fit: contain !important;
	background: #f8fafc;
	margin: 0 !important;
	padding: 12px !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product h2,
.woocommerce ul.products li.product h3 {
	font-size: 14px !important;
	font-weight: 700;
	color: #0a1628;
	padding: 14px 14px 6px !important;
	margin: 0 !important;
	line-height: 1.35;
	min-height: 2.7em;
}

.woocommerce ul.products li.product .price {
	color: #1a73e8 !important;
	font-size: 18px !important;
	font-weight: 800 !important;
	padding: 0 14px 8px !important;
	margin: 0 !important;
}
.woocommerce ul.products li.product .price del {
	color: #94a3b8 !important;
	font-size: 13px;
	font-weight: 500;
	margin-right: 6px;
}
.woocommerce ul.products li.product .price ins {
	background: none !important;
	text-decoration: none !important;
	color: #1a73e8 !important;
	font-weight: 800;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
	display: block !important;
	margin: 8px 14px 14px !important;
	padding: 10px 12px !important;
	background: linear-gradient(135deg, #1a73e8, #0d47a1) !important;
	color: #fff !important;
	text-align: center !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	border-radius: 10px !important;
	border: 0 !important;
	white-space: normal !important;
	min-height: auto !important;
	line-height: 1.3 !important;
	width: calc(100% - 28px) !important;
	box-sizing: border-box !important;
}
.woocommerce ul.products li.product .button:hover {
	opacity: 0.92;
}

/* MPW Buy Now: 2-button row on product cards */
.woocommerce ul.products li.product .mpw-loop-buttons {
	display: grid !important;
	grid-template-columns: 1fr 1fr !important;
	gap: 8px !important;
	margin: 8px 14px 14px !important;
}
.woocommerce ul.products li.product .mpw-loop-buttons .button,
.woocommerce ul.products li.product .mpw-loop-buttons .add_to_cart_button,
.woocommerce ul.products li.product .mpw-loop-buttons .mpw-buy-now-btn {
	margin: 0 !important;
	width: 100% !important;
	padding: 9px 6px !important;
	font-size: 12px !important;
	border-radius: 10px !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
}
.woocommerce ul.products li.product .mpw-loop-buttons .add_to_cart_button {
	background: #fff !important;
	color: #1a73e8 !important;
	border: 2px solid #1a73e8 !important;
	box-sizing: border-box !important;
}
.woocommerce ul.products li.product .mpw-loop-buttons .add_to_cart_button:hover {
	background: #e3f2fd !important;
}
.woocommerce ul.products li.product .mpw-loop-buttons .mpw-buy-now-btn {
	background: linear-gradient(135deg, #ff5722, #e64a19) !important;
	color: #fff !important;
	font-weight: 800 !important;
	border: 0 !important;
}
.woocommerce ul.products li.product .mpw-loop-buttons .mpw-buy-now-btn:hover {
	opacity: 0.92;
}

/* Single-product Buy Now button */
.woocommerce div.product .mpw-single-buy-now {
	background: linear-gradient(135deg, #ff5722, #e64a19) !important;
	color: #fff !important;
	margin-left: 8px !important;
	font-weight: 800 !important;
	font-size: 16px !important;
	padding: 14px 32px !important;
	border-radius: 12px !important;
}
.woocommerce div.product .mpw-single-buy-now:hover { opacity: 0.92; }

/* TI Wishlist button on cards */
.woocommerce ul.products li.product .tinv-wraper,
.woocommerce ul.products li.product .tinvwl_add_to_wishlist_button,
.woocommerce ul.products li.product .tinvwl-loop-button-wrapper {
	margin: 0 14px 12px !important;
	padding: 0 !important;
}
.woocommerce ul.products li.product .tinvwl_add_to_wishlist_button {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	font-size: 12px !important;
	color: #e91e63 !important;
	background: transparent !important;
	padding: 0 !important;
	border: 0 !important;
	white-space: nowrap !important;
	text-decoration: none !important;
}
.woocommerce ul.products li.product .tinvwl-icon-heart::before {
	font-size: 14px !important;
}
.woocommerce ul.products li.product .tinvwl-txt {
	font-size: 12px !important;
	white-space: nowrap !important;
}

/* Sale flash badge */
.woocommerce ul.products li.product .onsale {
	position: absolute !important;
	top: 8px !important;
	right: 8px !important;
	background: #ff5722 !important;
	color: #fff !important;
	border-radius: 18px !important;
	padding: 3px 10px !important;
	font-size: 11px !important;
	font-weight: 800 !important;
	margin: 0 !important;
	min-height: auto !important;
	min-width: auto !important;
	line-height: 1.4 !important;
}

/* Hide the broken product image fallback if WP returns the placeholder */
.woocommerce ul.products li.product img[src*="woocommerce-placeholder"] {
	opacity: 0.4;
}

/* Make sure relative positioning works for badges */
.woocommerce ul.products li.product { position: relative; }

/* ──── Header search bar (right of cart) ──── */

.navbar-right {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-shrink: 0;
	height: 100%;
}

/* Make sure every direct child of navbar-right is on the SAME centered line */
.navbar-right > * {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	height: 38px !important;
	margin: 0 !important;
	vertical-align: middle !important;
	line-height: 1 !important;
}

/* Force navbar inner row to align everything centered */
#navbar .navbar-inner,
.navbar-inner {
	display: flex !important;
	align-items: center !important;
	min-height: 64px;
}

.mpw-wishlist-btn {
	background: #fce4ec;
	border: none;
	padding: 8px 14px;
	border-radius: 10px;
	font-weight: 700;
	font-size: 14px;
	color: #e91e63 !important;
	text-decoration: none !important;
	white-space: nowrap;
}
.mpw-wishlist-btn:hover { background: #f8bbd0; }

.mpw-header-search {
	display: inline-flex !important;
	align-items: center !important;
	width: 240px;
	flex: 0 0 240px;
	height: 38px !important;
}

.mpw-header-search form,
.mpw-header-search .dgwt-wcas-search-wrapp,
.mpw-header-search .js-dgwt-wcas-search-wrapp {
	display: flex !important;
	align-items: center !important;
	height: 38px !important;
	margin: 0 !important;
}

.mpw-header-search form {
	display: flex;
	align-items: center;
	width: 100%;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 22px;
	overflow: hidden;
	height: 38px;
	transition: border-color 0.2s, background 0.2s;
}
.mpw-header-search form:focus-within {
	border-color: #1a73e8;
	background: #fff;
}
.mpw-header-search input[type="search"],
.mpw-header-search input[type="text"] {
	flex: 1;
	border: 0 !important;
	outline: none !important;
	padding: 0 14px !important;
	font-size: 13px !important;
	background: transparent !important;
	color: #0a1628 !important;
	margin: 0 !important;
	box-shadow: none !important;
	width: 100% !important;
	min-width: 0 !important;
	height: 36px !important;
	line-height: 36px !important;
}
.mpw-header-search input::placeholder { color: #94a3b8; font-weight: 500; }

.mpw-header-search button[type="submit"] {
	background: transparent;
	color: #64748b;
	border: 0;
	width: 36px;
	height: 36px;
	font-size: 14px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.mpw-header-search form:focus-within button[type="submit"] { color: #1a73e8; }

/* FiboSearch styling — slim, native search bar look */
.mpw-header-search .dgwt-wcas-search-wrapp,
.mpw-header-search .js-dgwt-wcas-search-wrapp {
	width: 100% !important;
	min-width: 0 !important;
	max-width: none !important;
	height: 38px !important;
}
.mpw-header-search .dgwt-wcas-search-form { width: 100% !important; height: 38px !important; }
.mpw-header-search .dgwt-wcas-search-input {
	border-radius: 22px !important;
	background: #f8fafc !important;
	border: 1px solid #e2e8f0 !important;
	padding: 0 40px 0 14px !important;
	font-size: 13px !important;
	height: 38px !important;
	line-height: 38px !important;
	width: 100% !important;
	color: #0a1628 !important;
	box-sizing: border-box !important;
	margin: 0 !important;
}
.mpw-header-search .dgwt-wcas-search-input:focus {
	border-color: #1a73e8 !important;
	background: #fff !important;
	box-shadow: none !important;
	outline: none !important;
}
/* The fibosearch built-in submit button — make it tiny + transparent */
.mpw-header-search .dgwt-wcas-search-submit,
.mpw-header-search .dgwt-wcas-sf-wrapp button {
	background: transparent !important;
	border-radius: 0 !important;
	right: 8px !important;
	left: auto !important;
	top: 50% !important;
	transform: translateY(-50%) !important;
	width: 28px !important;
	height: 28px !important;
	color: #64748b !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 0 !important;
}
.mpw-header-search .dgwt-wcas-ico-magnifier-handler,
.mpw-header-search .dgwt-wcas-search-icon {
	color: #64748b !important;
	width: 14px !important;
	height: 14px !important;
}
.mpw-header-search .dgwt-wcas-suggestions-wrapp {
	border-radius: 12px !important;
	margin-top: 6px !important;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16) !important;
	border: 1px solid #e8f0fe !important;
}

@media (max-width: 1024px) {
	.mpw-header-search { width: 200px; flex-basis: 200px; }
	.mpw-wishlist-btn { display: none; }
}
@media (max-width: 768px) {
	.mpw-header-search {
		order: 99;
		flex: 1 1 100%;
		width: 100%;
		margin-top: 8px;
	}
}

/* Responsive: smaller grid on tablet/mobile */
@media (max-width: 1024px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(3, 1fr) !important;
	}
}
@media (max-width: 768px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 12px !important;
	}
	#mpw-header-search { display: none; }
}
