/* Layout CSS */

/* --- Header --- */
header {
	background-color: var(--surface-color);
	color: var(--text-color);
	height: var(--header-height);
	position: sticky;
	top: 0;
	z-index: 100;
	box-shadow: var(--shadow-sm);
	border-bottom: 1px solid var(--border-color);
}

#header-placeholder {
	position: sticky;
	top: 0;
	z-index: 1000;
}

.header-container {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 100%;
}

.logo img {
	height: 40px; /* Adaptive width needed */
}

/* Nav Desktop */
.nav-desktop {
	display: none;
	height: 100%;
}
.nav-desktop ul {
	display: flex;
	align-items: center;
	gap: 30px;
	height: 100%;
}
.nav-desktop a {
	font-weight: 500;
	text-transform: uppercase;
	font-size: 16px;
}
.nav-desktop a:hover,
.nav-desktop a.active {
	font-weight: 700;
}

/* Header Actions */
.header-actions {
	display: flex;
	align-items: center;
	gap: 20px;
}
.auth-user-btn {
	position: relative;
}
.auth-user-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	background: transparent;
	border: none;
	cursor: pointer;
	color: var(--text-color);
	font-weight: 600;
}
.auth-user-name {
	color: var(--text-color);
}
.auth-menu {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	background: #fff;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	min-width: 140px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	padding: 6px 0;
	display: none;
	z-index: 1300;
}
.auth-user-btn.open .auth-menu {
	display: block;
}
.auth-menu-item {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	color: var(--text-color);
	font-size: 0.9rem;
}
.auth-menu-item:hover {
	background: #f5f5f5;
}
.header-icon {
	font-size: 1.2rem;
	cursor: pointer;
	position: relative;
	display: flex;
	align-items: center;
}
.count-badge {
	position: absolute;
	top: -5px;
	right: -8px;
	background-color: #ff4444; /* Standard alert color */
	color: white;
	font-size: 10px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Sample Search Box */
.search-box {
	display: none; /* Mobile hidden mainly? Or just icon? Req says "Logo, Nav, Search, Icons". */
	position: relative;
}
.search-input {
	padding: 8px 15px;
	border-radius: 20px;
	border: 1px solid var(--border-color);
	background: var(--accent-color);
	color: var(--text-color);
}
.search-suggest {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	width: 320px;
	max-height: 360px;
	overflow-y: auto;
	background: var(--surface-color);
	border: 1px solid var(--border-color);
	border-radius: 10px;
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
	display: none;
	z-index: 1200;
}
.search-suggest-item {
	display: flex;
	gap: 12px;
	padding: 10px 12px;
	align-items: center;
	border-bottom: 1px solid #f3f4f6;
}
.search-suggest-item:last-child {
	border-bottom: none;
}
.search-suggest-item:hover {
	background: #f8f8f8;
}
.search-suggest-img {
	width: 44px;
	height: 44px;
	border-radius: 6px;
	object-fit: cover;
	background: #f3f4f6;
}
.search-suggest-title {
	font-size: 0.9rem;
	color: #111;
	margin: 0;
}
.search-suggest-price {
	font-size: 0.85rem;
	color: var(--primary-color);
	margin-top: 2px;
}

/* Mobile Toggle */
.mobile-toggle {
	display: block;
	font-size: 1.5rem;
	cursor: pointer;
}

/* Desktop Styles */
@media (min-width: 1024px) {
	.nav-desktop {
		display: block;
	}
	.mobile-toggle {
		display: none;
	}
	.search-box {
		display: block;
	}

	.logo img {
		height: 50px;
	}
}

/* --- Mobile Menu Drawer --- */
.mobile-drawer {
	position: fixed;
	top: 0;
	left: -100%;
	width: 80%;
	max-width: 300px;
	height: 100vh;
	background: var(--white);
	z-index: 2100;
	transition: var(--transition);
	padding: 20px;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}
.mobile-drawer.active {
	left: 0;
}
.drawer-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 2000;
	display: none;
}
.drawer-overlay.active {
	display: block;
}

.mobile-nav li {
	margin-bottom: 15px;
	border-bottom: 1px solid #eee;
	padding-bottom: 10px;
}

/* --- Cart Drawer --- */
.cart-drawer {
	position: fixed;
	top: 0;
	right: -100%;
	width: 500px;
	height: 100vh;
	background: var(--white);
	z-index: 2200;
	transition: var(--transition);
	display: flex;
	flex-direction: column;
	box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "Noto Sans", sans-serif;
}
.cart-drawer.active {
	right: 0;
}
@media (max-width: 500px) {
	.cart-drawer {
		width: 100%;
	} /* Mobile fullwidth */
}

.cart-header {
	padding: 20px;
	border-bottom: 1px solid #eee;
	display: flex;
	justify-content: space-between;
	align-items: center;
}
.cart-body {
	flex: 1;
	overflow-y: auto;
	padding: 20px;
}
.cart-footer {
	padding: 20px;
	border-top: 1px solid #eee;
	background: #f9f9f9;
}
.cart-footer .btn,
.cart-footer .btn-outline {
	height: 40px;
	line-height: 40px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.cart-item {
	display: flex;
	gap: 12px;
	margin-bottom: 16px;
	border-bottom: 1px solid var(--border-color);
	padding-bottom: 16px;
	align-items: flex-start;
}
.cart-item img {
	width: 80px;
	height: 110px;
	object-fit: contain;
	border-radius: 8px;
}
.cart-item h4 {
	font-size: 0.95rem;
	margin-bottom: 6px;
}
.cart-item-line {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: nowrap;
}
.cart-item-line p {
	margin: 0;
	white-space: nowrap;
	color: var(--primary-color);
	font-weight: 600;
}
.cart-item-line .cart-qty-control {
	/* flex: 1 1 auto; */
}
.cart-qty-control .qty-input {
	width: 70px;
}
.cart-qty-control {
	margin-top: 12px;
	display: flex;
	width: 100%;
	max-width: 220px;
	justify-content: space-between;
	border: 1px solid var(--border-color);
	border-radius: 0;
	height: 40px;
	overflow: hidden;
}
.cart-qty-control .qty-input {
	text-align: center;
	width: 100%;
	padding: 8px 6px;
	border: none;
	background: transparent;
	font-weight: 600;
	height: 40px;
	flex: 1 1 auto;
	border-radius: 0;
}
.cart-qty-control .qty-input:focus {
	box-shadow: none;
	border: none !important;
}

.cart-qty-control .qty-btn {
	width: 40px;
	height: 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	font-size: 16px;
	color: var(--text-color);
	flex: 0 0 40px;
	border-radius: 0;
	border-right: 1px solid var(--border-color);
}
.cart-qty-control .qty-btn:last-child {
	border-right: none;
	border-left: 1px solid var(--border-color);
}
.cart-qty-control .qty-btn:hover {
	background: var(--accent-color);
}
.cart-remove-btn-lg {
	font-size: 1.2rem;
	line-height: 1;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid #ef4444;
	border-radius: 999px;
	background: #fff5f5;
}

/* --- Footer --- */
footer {
	background: #f8f8f8;
	padding: 60px 0 20px;
	margin-top: 60px;
}
.footer-grid {
	display: grid;
	grid-template-columns: repeat(1, 1fr);
	gap: 40px;
}
@media (min-width: 768px) {
	.footer-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
.footer-col h4 {
	margin-bottom: 20px;
}
.footer-links li {
	margin-bottom: 10px;
}
.copyright {
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid #eee;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
}
@media (min-width: 768px) {
	.copyright {
		flex-direction: row;
		justify-content: space-between;
	}
}

/* Top Banner Global Component Styles */
.top-banner {
	background-color: #111827;
	color: #f9fafb;
	text-align: center;
	padding: 8px 0;
	font-size: 0.9rem;
	position: relative;
	z-index: 1001;
}
.top-banner strong {
	color: var(--primary-color);
	margin-left: 5px;
}
