/* Qutub Digital Marketplace Main Layout & Components */

/* Reset & Root Design Tokens */
:root {
	--qd-bg: #ffffff;
	--qd-bg-secondary: #f8fafc;
	--qd-surface: #ffffff;
	--qd-text: #0f172a;
	--qd-text-secondary: #64748b;
	--qd-border: #e2e8f0;
	--qd-primary: #2563eb;
	--qd-primary-hover: #1d4ed8;
	--qd-primary-light: #eff6ff;
	--qd-accent: #10b981;
	--qd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
	--qd-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
	--qd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
	--qd-radius: 12px;
	--qd-radius-sm: 8px;
	--qd-radius-lg: 16px;
	--qd-font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

[data-theme="dark"] {
	--qd-bg: #0f172a;
	--qd-bg-secondary: #1e293b;
	--qd-surface: #1e293b;
	--qd-text: #f8fafc;
	--qd-text-secondary: #94a3b8;
	--qd-border: #334155;
	--qd-primary: #3b82f6;
	--qd-primary-hover: #60a5fa;
	--qd-primary-light: #1e3a8a;
	--qd-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
	--qd-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
	--qd-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
}

* {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

body {
	font-family: var(--qd-font-family);
	background-color: var(--qd-bg);
	color: var(--qd-text);
	line-height: 1.6;
	font-size: 16px;
	-webkit-font-smoothing: antialiased;
	transition: background-color 0.3s ease, color 0.3s ease;
}

a {
	color: var(--qd-primary);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover {
	color: var(--qd-primary-hover);
}

.container {
	max-width: 1280px;
	margin: 0 auto;
	padding: 0 20px;
}

/* Header & Navigation */
.site-header {
	background-color: var(--qd-surface);
	border-bottom: 1px solid var(--qd-border);
	position: sticky;
	top: 0;
	z-index: 1000;
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

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

.site-branding .site-title a {
	font-weight: 800;
	font-size: 22px;
	color: var(--qd-text);
	letter-spacing: -0.5px;
}

.site-branding .site-title span {
	color: var(--qd-primary);
}

/* SKELETON SHIMMER LOADER SYSTEM FOR ULTRA FAST SPEED PERCEPTION */
@keyframes qdSkeletonShimmer {
	0% {
		background-position: -200% 0;
	}
	100% {
		background-position: 200% 0;
	}
}

.qd-skeleton {
	background: linear-gradient(90deg, var(--qd-bg-secondary) 25%, var(--qd-border) 50%, var(--qd-bg-secondary) 75%);
	background-size: 200% 100%;
	animation: qdSkeletonShimmer 1.5s infinite linear;
	border-radius: var(--qd-radius-sm);
	display: block;
}

.qd-skeleton-img {
	width: 100%;
	height: 200px;
	border-radius: var(--qd-radius);
}

.qd-skeleton-text {
	height: 16px;
	margin-bottom: 8px;
	width: 80%;
}

.qd-skeleton-card {
	background: var(--qd-surface);
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

/* Smooth Image Fade-In on Load */
img.qd-lazy-img {
	opacity: 0;
	transition: opacity 0.4s ease-in-out;
}

img.qd-lazy-img.loaded {
	opacity: 1;
}

/* Product Cards Grid */
.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
}

.qd-product-card {
	background: var(--qd-surface);
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
}

.qd-product-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--qd-shadow-lg);
	border-color: var(--qd-primary);
}

/* Mobile Bottom Navigation Bar (Native App Style) */
.mobile-bottom-nav {
	display: none;
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	height: 65px;
	background: rgba(255, 255, 255, 0.95);
	backdrop-filter: blur(16px);
	-webkit-backdrop-filter: blur(16px);
	border-top: 1px solid var(--qd-border);
	z-index: 99999;
	align-items: center;
	justify-content: space-around;
	box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
	padding: 0 5px;
}

[data-theme="dark"] .mobile-bottom-nav {
	background: rgba(15, 23, 42, 0.95);
}

.mobile-nav-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-width: 48px;
	min-height: 48px;
	font-size: 11px;
	font-weight: 700;
	color: var(--qd-text-secondary);
	text-decoration: none;
	transition: all 0.2s ease;
}

.mobile-nav-item i {
	font-size: 20px;
	width: 20px;
	height: 20px;
	margin-bottom: 3px;
}

.mobile-nav-item.active {
	color: var(--qd-primary);
}

.qd-mobile-cart-badge {
	position: absolute;
	top: 2px;
	right: 12px;
	background: var(--qd-primary);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	width: 17px;
	height: 17px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
}

@media (max-width: 992px) {
	.hero-section .container {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 768px) {
	.main-navigation {
		display: none;
	}
	.mobile-bottom-nav {
		display: flex;
	}
	.hero-title {
		font-size: 32px;
	}
	body {
		padding-bottom: 60px;
	}
}

/* Main Navigation Styles */
.main-navigation ul {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 32px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.main-navigation li {
	position: relative;
}
.main-navigation a {
	color: var(--qd-text);
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
	padding: 8px 0;
	display: inline-block;
	transition: color 0.3s ease;
}
.main-navigation a:hover {
	color: var(--qd-primary);
}
.main-navigation a::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	width: 0%;
	height: 2px;
	background-color: var(--qd-primary);
	transition: width 0.3s ease;
	border-radius: 2px;
}
.main-navigation a:hover::after,
.main-navigation .current-menu-item > a::after {
	width: 100%;
}
.main-navigation .current-menu-item > a {
	color: var(--qd-primary);
}

/* Submenus */
.main-navigation ul ul {
	display: flex;
	flex-direction: column;
	position: absolute;
	top: 100%;
	left: 0;
	background: var(--qd-surface);
	border: 1px solid var(--qd-border);
	box-shadow: var(--qd-shadow-lg);
	border-radius: var(--qd-radius-sm);
	min-width: 220px;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: all 0.3s ease;
	z-index: 100;
	padding: 10px 0;
	gap: 0;
}
.main-navigation li:hover > ul {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.main-navigation ul ul li {
	width: 100%;
}
.main-navigation ul ul a {
	padding: 10px 20px;
	font-size: 14px;
	font-weight: 500;
	width: 100%;
}
.main-navigation ul ul a::after {
	display: none;
}
.main-navigation ul ul a:hover {
	background: var(--qd-bg-secondary);
	color: var(--qd-primary);
}

/* ============================================
   GLASSMORPHISM UTILITY
   ============================================ */
.qd-glass {
	background: rgba(255, 255, 255, 0.85) !important;
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
}
[data-theme="dark"] .qd-glass {
	background: rgba(15, 23, 42, 0.88) !important;
}

/* ============================================
   BUTTON SYSTEM — QD PRIMARY & OUTLINE
   ============================================ */
.qd-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	border: none;
	border-radius: 8px;
	font-family: var(--qd-font-family);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	text-decoration: none;
	transition: all 0.2s ease;
	white-space: nowrap;
}
.qd-btn-primary {
	background: var(--qd-primary);
	color: #ffffff !important;
	border: 1.5px solid var(--qd-primary);
}
.qd-btn-primary:hover {
	background: var(--qd-primary-hover);
	border-color: var(--qd-primary-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}
.qd-btn-outline {
	background: transparent;
	color: var(--qd-text) !important;
	border: 1.5px solid var(--qd-border);
}
.qd-btn-outline:hover {
	border-color: var(--qd-primary);
	color: var(--qd-primary) !important;
}
.qd-btn-sm {
	padding: 6px 14px;
	font-size: 12px;
	border-radius: 6px;
}

/* ============================================
   MEGA DROPDOWN MENU SYSTEM
   ============================================ */

/* Override basic sub-menu for custom mega menu */
.qd-mega-menu-list {
	display: flex;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 4px;
}

.qd-mega-menu-list > .menu-item {
	position: static;
}

.qd-mega-menu-list > .menu-item > a {
	color: var(--qd-text);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
	padding: 8px 12px;
	border-radius: 8px;
	display: flex;
	align-items: center;
	gap: 4px;
	transition: background 0.2s ease, color 0.2s ease;
	white-space: nowrap;
}

.qd-mega-menu-list > .menu-item > a:hover,
.qd-mega-menu-list > .menu-item.active > a {
	background: var(--qd-bg-secondary);
	color: var(--qd-primary);
}

/* Dropdown Box — the floating panel */
.qd-dropdown-box {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	left: 50%;
	transform: translateX(-50%);
	background: var(--qd-surface);
	border: 1px solid var(--qd-border);
	border-radius: var(--qd-radius);
	box-shadow: 0 20px 40px -8px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0,0,0,0.06);
	min-width: 230px;
	padding: 12px;
	z-index: 1001;
	animation: qdDropIn 0.18s ease;
}

.qd-dropdown-box a {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 9px 12px;
	border-radius: 8px;
	font-size: 13.5px;
	font-weight: 500;
	color: var(--qd-text);
	text-decoration: none;
	transition: background 0.15s ease, color 0.15s ease;
}
.qd-dropdown-box a i {
	color: var(--qd-text-secondary);
	font-size: 15px;
	width: 15px;
	height: 15px;
	flex-shrink: 0;
}
.qd-dropdown-box a:hover {
	background: var(--qd-bg-secondary);
	color: var(--qd-primary);
}
.qd-dropdown-box a:hover i {
	color: var(--qd-primary);
}

/* Featured link inside dropdown */
.qd-dropdown-featured {
	margin-top: 6px;
	border-top: 1px solid var(--qd-border);
	padding-top: 9px !important;
	font-weight: 700 !important;
	color: var(--qd-primary) !important;
}
.qd-dropdown-featured:hover {
	background: var(--qd-primary-light) !important;
}

/* Mega Grid — 2 columns */
.qd-dropdown-box.mega-grid {
	display: none;
	min-width: 480px;
	left: 0;
	transform: none;
}

/* Mega Grid Wide — wider 2 columns */
.qd-dropdown-box.mega-grid-wide {
	display: none;
	min-width: 560px;
	left: 0;
	transform: none;
}

/* Show on hover */
.qd-mega-menu-list > .menu-item.has-dropdown {
	position: relative;
}
.qd-mega-menu-list > .menu-item.has-dropdown:hover > .qd-dropdown-box,
.qd-mega-menu-list > .menu-item.has-dropdown:focus-within > .qd-dropdown-box {
	display: flex;
}
.qd-mega-menu-list > .menu-item:not(.mega-dropdown):hover > .qd-dropdown-box {
	display: flex;
	flex-direction: column;
}
.qd-mega-menu-list > .menu-item.mega-dropdown:hover > .qd-dropdown-box {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

/* Dropdown heading/section label */
.qd-dropdown-heading {
	display: block;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--qd-text-secondary);
	padding: 6px 12px 4px;
	margin-bottom: 2px;
}

/* Dropdown column separator */
.qd-dropdown-col {
	display: flex;
	flex-direction: column;
}
.qd-dropdown-col + .qd-dropdown-col {
	border-left: 1px solid var(--qd-border);
	padding-left: 8px;
}

@keyframes qdDropIn {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}
@keyframes qdDropInCenter {
	from {
		opacity: 0;
		transform: translateX(-50%) translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateX(-50%) translateY(0);
	}
}

/* Toast Notification */
#qd-toast-container {
	position: fixed;
	bottom: 90px;
	right: 20px;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: 10px;
	pointer-events: none;
}
.qd-toast-card {
	background: var(--qd-surface);
	border: 1px solid var(--qd-border);
	border-radius: 14px;
	padding: 14px 18px;
	box-shadow: 0 8px 24px rgba(0,0,0,0.12);
	min-width: 280px;
	max-width: 340px;
	pointer-events: all;
	opacity: 1;
	transform: translateY(0);
	transition: opacity 0.3s ease, transform 0.3s ease;
	font-size: 14px;
	font-weight: 600;
	color: var(--qd-text);
}
.qd-toast-card.success {
	border-color: #10b981;
}
.qd-toast-card.error {
	border-color: #ef4444;
}
.qd-toast-content {
	display: flex;
	align-items: center;
	gap: 10px;
}
.qd-toast-icon-box {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--qd-bg-secondary);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.qd-toast-link {
	display: block;
	margin-top: 8px;
	font-size: 12px;
	font-weight: 700;
	color: var(--qd-primary);
}
.qd-toast-link:hover {
	text-decoration: underline;
}

/* Spin animation for loading icons */
@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}
.spin {
	animation: spin 0.8s linear infinite;
	display: inline-block;
}
