/* Noxora Commerce — marketplace cards, gallery lightbox, ad quote */

.nx-commerce-market__layout {
	display: grid;
	grid-template-columns: minmax(160px, 220px) 1fr;
	gap: 1.25rem;
	align-items: start;
}

.nx-commerce-market__sidebar {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem;
	position: sticky;
	top: 5rem;
}

.nx-commerce-market__cat {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.65rem;
	border-radius: 0.5rem;
	color: inherit;
	text-decoration: none;
	transition: background 0.2s, transform 0.2s;
}

.nx-commerce-market__cat--child {
	padding-left: 1.25rem;
	font-size: 0.9em;
	opacity: 0.9;
}

.nx-commerce-market__cat.is-active,
.nx-commerce-market__cat:hover {
	background: color-mix(in srgb, var(--nx-cat-color, #6ea8ff) 18%, transparent);
	transform: translateX(2px);
}

.nx-commerce-market__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

@media (min-width: 1024px) {
	.nx-commerce-market__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.nx-commerce-card {
	position: relative;
	border-radius: 1rem;
	overflow: hidden;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.nx-commerce-card:hover {
	transform: scale(1.02) perspective(800px) rotateX(2deg) rotateY(-2deg);
	box-shadow: 0 12px 40px rgba(110, 168, 255, 0.25);
}

.nx-commerce-card__media {
	position: relative;
	aspect-ratio: 4/3;
	overflow: hidden;
	background: rgba(0, 0, 0, 0.2);
}

.nx-commerce-card__cover,
.nx-commerce-card__video {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nx-commerce-card:hover .nx-commerce-card__video {
	opacity: 1;
}

.nx-commerce-card__video {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.3s;
}

.nx-commerce-card__badges {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
}

.nx-commerce-card__badge {
	font-size: 0.7rem;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.55);
}

.nx-commerce-card__badge--sale { background: #e74c3c; }
.nx-commerce-card__badge--premium { background: #9b59b6; }
.nx-commerce-card__badge--boost { background: #f39c12; }

.nx-commerce-card__body {
	padding: 0.85rem;
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
}

.nx-commerce-card__category {
	font-size: 0.75rem;
	opacity: 0.75;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.nx-commerce-card__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
}

.nx-commerce-card__price-old {
	text-decoration: line-through;
	opacity: 0.55;
	margin-right: 0.35rem;
	font-size: 0.85em;
}

.nx-commerce-card__price-new {
	font-weight: 700;
	color: #6ea8ff;
}

.nx-commerce-card__meta {
	display: flex;
	gap: 0.75rem;
	font-size: 0.8rem;
	opacity: 0.8;
}

.nx-commerce-card__buy {
	margin-top: 0.35rem;
	width: 100%;
}

.nx-commerce-inventory {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.nx-commerce-inventory__item {
	padding: 1rem;
}

.nx-commerce-inventory__head {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 0.5rem;
}

.nx-commerce-inventory__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
}

.nx-commerce-quote {
	position: fixed;
	inset: 0;
	z-index: 99990;
	display: grid;
	place-items: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.65);
}

.nx-commerce-quote[hidden] {
	display: none !important;
}

.nx-commerce-quote__form {
	max-width: 720px;
	width: 100%;
	max-height: 90vh;
	overflow: auto;
	padding: 1.25rem;
	border-radius: 1rem;
	background: var(--nx-glass-bg, rgba(20, 24, 36, 0.95));
}

.nx-commerce-quote__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1rem;
}

.nx-commerce-quote__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.75rem;
}

.nx-commerce-quote__full {
	grid-column: 1 / -1;
}

.nx-commerce-quote__grid label {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	font-size: 0.85rem;
}

.nx-commerce-quote__grid input,
.nx-commerce-quote__grid select,
.nx-commerce-quote__grid textarea {
	width: 100%;
}

.nx-commerce-lightbox {
	position: fixed;
	inset: 0;
	z-index: 99980;
	background: rgba(0, 0, 0, 0.9);
	display: grid;
	place-items: center;
	padding: 2rem;
}

.nx-commerce-lightbox[hidden] {
	display: none !important;
}

.nx-commerce-lightbox img,
.nx-commerce-lightbox video {
	max-width: min(96vw, 1200px);
	max-height: 90vh;
	object-fit: contain;
}

.nx-orders-list__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.75rem;
}

.nx-orders-list__products {
	margin: 0.35rem 0;
	padding-left: 1.1rem;
	font-size: 0.9em;
}

@media (max-width: 768px) {
	.nx-commerce-market__layout {
		grid-template-columns: 1fr;
	}

	.nx-commerce-market__sidebar {
		flex-direction: row;
		flex-wrap: wrap;
		position: static;
	}

	.nx-commerce-quote__grid {
		grid-template-columns: 1fr;
	}
}
