/* =========================================================
   Shopsaas Pro — core.css
   Layout, header/footer, and the three "real extras":
   AJAX search dropdown, Quick View modal, Sticky Add-to-Cart
   ========================================================= */

.wrapper {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ---------- Header ---------- */
.shopsaas-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
	padding: 18px 24px;
	background: #fff;
	border-bottom: 1px solid #e5e7eb;
	position: relative;
	z-index: 50;
}

.shopsaas-header-logo {
	display: flex;
	align-items: center;
	gap: 10px;
}

.shopsaas-site-branding .site-title {
	font-size: 22px;
	margin: 0;
}

.shopsaas-site-branding .site-description {
	font-size: 13px;
	color: #6b7280;
	margin: 0;
}

.shopsaas-header-menu {
	display: flex;
	align-items: center;
	gap: 24px;
	flex: 1;
	justify-content: flex-end;
	flex-wrap: wrap;
}

.shopsaas-menu {
	display: flex;
	gap: 22px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.shopsaas-menu a {
	color: #1d2327;
	font-weight: 500;
}

.shopsaas-menu a:hover {
	color: #1d4ed8;
}

.shopsaas-header-actions {
	display: flex;
	align-items: center;
	gap: 18px;
}

.shopsaas-cart-icon {
	position: relative;
	font-size: 20px;
	color: #1d2327;
}

.shopsaas-cart-count {
	position: absolute;
	top: -8px;
	right: -10px;
	background: #1d4ed8;
	color: #fff;
	font-size: 11px;
	line-height: 1;
	padding: 2px 5px;
	border-radius: 999px;
	min-width: 16px;
	text-align: center;
}

/* ---------- AJAX Search ---------- */
.shopsaas-search {
	position: relative;
	width: 100%;
	max-width: 280px;
}

.shopsaas-search input[type="search"] {
	width: 100%;
	padding: 9px 14px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
}

.shopsaas-search input[type="search"]:focus {
	outline: none;
	border-color: #1d4ed8;
}

.shopsaas-search-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	max-height: 420px;
	overflow-y: auto;
	z-index: 60;
	display: none;
}

.shopsaas-search-results.is-active {
	display: block;
}

.shopsaas-search-result-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 12px;
	border-bottom: 1px solid #f1f1f1;
	text-decoration: none;
	color: #1d2327;
}

.shopsaas-search-result-item:last-child {
	border-bottom: none;
}

.shopsaas-search-result-item:hover {
	background: #f6f8ff;
}

.shopsaas-search-result-item img {
	width: 42px;
	height: 42px;
	object-fit: cover;
	border-radius: 4px;
	flex-shrink: 0;
}

.shopsaas-search-result-title {
	font-size: 13.5px;
	line-height: 1.3;
}

.shopsaas-search-result-price {
	font-size: 12.5px;
	color: #1d4ed8;
	font-weight: 600;
}

.shopsaas-search-status {
	padding: 14px 12px;
	font-size: 13px;
	color: #6b7280;
	text-align: center;
}

.shopsaas-search-viewall {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 13px;
	font-weight: 600;
	background: #f9fafb;
	color: #1d4ed8;
}

/* ---------- Quick View button + modal ---------- */
.shopsaas-quickview-trigger {
	display: inline-block;
	margin-top: 8px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 600;
	border: 1px solid #1d2327;
	border-radius: 999px;
	background: #fff;
	color: #1d2327;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.shopsaas-quickview-trigger:hover {
	background: #1d2327;
	color: #fff;
}

.shopsaas-modal-overlay {
	position: fixed;
	inset: 0;
	background: rgba(17, 17, 17, 0.55);
	z-index: 9998;
	display: none;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.shopsaas-modal-overlay.is-open {
	display: flex;
}

.shopsaas-modal {
	background: #fff;
	max-width: 880px;
	width: 100%;
	max-height: 90vh;
	overflow-y: auto;
	border-radius: 10px;
	position: relative;
	padding: 32px;
}

.shopsaas-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: transparent;
	border: none;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: #6b7280;
}

.shopsaas-modal-close:hover {
	color: #1d2327;
}

.shopsaas-qv-content {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 32px;
}

.shopsaas-qv-loading {
	padding: 60px 0;
	text-align: center;
	color: #6b7280;
}

@media (max-width: 640px) {
	.shopsaas-qv-content {
		grid-template-columns: 1fr;
	}
}

/* ---------- Sticky Add-to-Cart bar ---------- */
.shopsaas-sticky-cart {
	position: fixed;
	left: 0;
	right: 0;
	bottom: -120px;
	background: #fff;
	border-top: 1px solid #e5e7eb;
	box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.08);
	z-index: 9990;
	transition: bottom 0.25s ease;
	padding: 12px 24px;
}

.shopsaas-sticky-cart.is-visible {
	bottom: 0;
}

.shopsaas-sticky-cart-inner {
	max-width: 1280px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 16px;
}

.shopsaas-sticky-cart-inner img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	flex-shrink: 0;
}

.shopsaas-sticky-cart-info {
	flex: 1;
	min-width: 0;
}

.shopsaas-sticky-cart-title {
	font-size: 13.5px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.shopsaas-sticky-cart-price {
	font-size: 13px;
	color: #1d4ed8;
}

.shopsaas-sticky-cart-action button {
	white-space: nowrap;
}

@media (max-width: 640px) {
	.shopsaas-sticky-cart-info {
		display: none;
	}
}

/* ---------- Product loop ---------- */
ul.products li.product {
	position: relative;
}

ul.products li.product .shopsaas-quickview-trigger {
	display: none;
}

ul.products li.product:hover .shopsaas-quickview-trigger,
ul.products li.product .shopsaas-quickview-trigger:focus {
	display: inline-block;
}

/* ---------- Footer ---------- */
.shopsaas-footer {
	background: #fff;
	border-top: 1px solid #e5e7eb;
	padding: 24px;
	text-align: center;
	font-size: 13px;
	color: #6b7280;
	margin-top: 48px;
}
