/**
 * Ultimate Shop - front-end theme
 * @copyright (c) 2026 dmzx - https://www.dmzx-web.net
 * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
 */

.icon {
	font-family: "Font Awesome 6 Free", "Font Awesome 6 Brands", FontAwesome;
	font-weight: 900;
	font-style: normal;
	display: inline-block;
	text-rendering: auto;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

:root {
	--shop-radius: 8px;
	--shop-gap: 14px;
	--shop-price-color: #1f7a4d;
	--shop-warning-color: #b3401f;
	--shop-protected-color: #a8690a;
	--shop-featured-color: #a8690a;
	--shop-new-color: #1d4ed8;
	--shop-sale-color: #b3125a;
	--shop-accent-color: #2f6fa8;
}

@media (prefers-color-scheme: dark) {
	:root {
		--shop-price-color: #4fbf87;
		--shop-warning-color: #e2734c;
		--shop-protected-color: #f0b429;
		--shop-featured-color: #f0b429;
		--shop-new-color: #60a5fa;
		--shop-sale-color: #f0629b;
		--shop-accent-color: #6fa8dc;
	}
}

:root[data-theme="dark"] {
	--shop-price-color: #4fbf87;
	--shop-warning-color: #e2734c;
	--shop-protected-color: #f0b429;
	--shop-featured-color: #f0b429;
	--shop-new-color: #60a5fa;
	--shop-sale-color: #f0629b;
	--shop-accent-color: #6fa8dc;
}

:root[data-theme="light"] {
	--shop-price-color: #1f7a4d;
	--shop-warning-color: #b3401f;
	--shop-protected-color: #a8690a;
	--shop-featured-color: #a8690a;
	--shop-new-color: #1d4ed8;
	--shop-sale-color: #b3125a;
	--shop-accent-color: #2f6fa8;
}

.shop-category-pills {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0;
	margin: 0 0 1.2em;
}

.shop-pill {
	border-radius: 999px;
	padding: 5px 14px;
	font-size: .92em;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

/* Shop header row: title on the left, search + sort on the right. */
.shop-panel-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: var(--shop-gap);
}

.shop-panel-header h2 {
	margin: 0;
}

.shop-filter-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
}

.shop-search-input {
	flex: 1 1 200px;
	min-width: 140px;
}

.shop-search-submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 5px 10px;
}

.shop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: var(--shop-gap);
}

.shop-card {
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: var(--shop-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform .15s ease, box-shadow .15s ease;
}

.shop-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 16px color-mix(in srgb, currentColor 14%, transparent);
}

.shop-card-image {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.shop-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.shop-card-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	font-size: 2.2em;
	opacity: .45;
}

.shop-detail-placeholder {
	min-height: 200px;
}

.shop-card-body {
	padding: 10px 12px 12px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	flex: 1;
}

.shop-card-name {
	font-weight: 700;
	text-decoration: none;
}

.shop-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.shop-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
}

.shop-card-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.shop-icon-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	flex: none;
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	border-radius: calc(var(--shop-radius) - 2px);
	border: 1px solid color-mix(in srgb, var(--shop-accent-color) 45%, transparent);
	background: color-mix(in srgb, var(--shop-accent-color) 10%, Canvas);
	color: var(--shop-accent-color);
	text-decoration: none;
	vertical-align: middle;
	cursor: pointer;
}

.shop-icon-btn:hover,
.shop-icon-btn:focus-visible {
	background: color-mix(in srgb, var(--shop-accent-color) 22%, Canvas);
	border-color: var(--shop-accent-color);
}

.shop-icon-btn-on {
	background: var(--shop-accent-color);
	border-color: var(--shop-accent-color);
	color: Canvas;
}

.shop-icon-btn .icon {
	font-size: 14px;
	line-height: 1;
}

.shop-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: .72em;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 999px;
	line-height: 1.4;
	white-space: nowrap;
}

.shop-badge-rarity {
	color: var(--rarity-color, inherit);
	background: color-mix(in srgb, var(--rarity-color, currentColor) 18%, Canvas);
	border: 1px solid var(--rarity-color, currentColor);
}

.shop-card-image .shop-badge-rarity {
	position: absolute;
	top: 8px;
	left: 8px;
}

.shop-badge-outofstock {
	position: absolute;
	top: 8px;
	right: 8px;
	background: var(--shop-warning-color);
	color: #fff;
}

.shop-badge-qty {
	position: absolute;
	bottom: 8px;
	right: 8px;
	background: rgba(0, 0, 0, .65);
	color: #fff;
}

.shop-badge-type {
	background: color-mix(in srgb, currentColor 10%, transparent);
	opacity: .85;
}

.shop-badge-protected,
.shop-badge-unique {
	background: color-mix(in srgb, #eab308 20%, transparent);
	color: var(--shop-protected-color);
}

.shop-badge-featured {
	background: color-mix(in srgb, var(--shop-featured-color) 20%, transparent);
	color: var(--shop-featured-color);
}

.shop-badge-new {
	background: color-mix(in srgb, var(--shop-new-color) 18%, transparent);
	color: var(--shop-new-color);
}

.shop-badge-sale {
	background: var(--shop-sale-color);
	color: #fff;
}

.shop-badge-download {
	background: color-mix(in srgb, var(--shop-accent-color) 18%, transparent);
	color: var(--shop-accent-color);
}

.shop-badge-auction {
	background: color-mix(in srgb, var(--shop-warning-color) 18%, transparent);
	color: var(--shop-warning-color);
}

.shop-card-image .shop-badge-featured {
	position: absolute;
	bottom: 8px;
	left: 8px;
}

.shop-price-original {
	text-decoration: line-through;
	opacity: .6;
	font-weight: 400;
	margin-right: 4px;
}

.shop-price {
	font-weight: 800;
	color: var(--shop-price-color);
	font-variant-numeric: tabular-nums;
}

.shop-owned {
	font-size: .85em;
	opacity: .7;
}

.shop-gifts-date {
	white-space: nowrap;
}

.shop-empty {
	opacity: .7;
	padding: 2em 0;
	text-align: center;
	grid-column: 1 / -1;
}

.shop-warning {
	color: var(--shop-warning-color);
	font-size: .9em;
}

.shop-leaderboard-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--shop-gap);
}

.shop-detail {
	display: flex;
	gap: 20px;
}

.shop-detail-image {
	flex: 0 0 240px;
	border-radius: calc(var(--shop-radius) - 2px);
	overflow: hidden;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
}

.shop-detail-image img {
	width: 100%;
	display: block;
}

.shop-detail-body {
	flex: 1;
	min-width: 0;
}

.shop-detail-desc {
	opacity: .8;
}

.shop-detail-facts {
	display: grid;
	grid-template-columns: max-content 1fr;
	gap: 4px 12px;
	margin: 1em 0;
}

.shop-detail-facts dt {
	opacity: .7;
}

.shop-detail-facts dd {
	margin: 0;
}

.shop-inline-form {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.shop-sell-form {
	display: flex;
	align-items: center;
	gap: 6px;
	background: color-mix(in srgb, var(--shop-price-color) 10%, transparent);
	border-radius: 5px;
	padding: 5px 6px;
}

.shop-sell-form input[type="number"] {
	width: 38px;
	text-align: center;
	border-radius: calc(var(--shop-radius) - 2px);
}

.shop-sell-price {
	margin-left: auto;
	font-weight: 700;
	font-size: .85em;
	color: var(--shop-price-color);
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.shop-sell-btn {
	appearance: none;
	-webkit-appearance: none;
	font: inherit;
	font-size: .85em;
	font-weight: 700;
	border: 1px solid var(--shop-price-color);
	border-radius: calc(var(--shop-radius) - 2px);
	background: var(--shop-price-color);
	color: Canvas;
	padding: 5px 10px;
	cursor: pointer;
	flex: none;
}

.shop-sell-btn:hover,
.shop-sell-btn:focus-visible {
	background: color-mix(in srgb, var(--shop-price-color) 85%, black);
	border-color: color-mix(in srgb, var(--shop-price-color) 85%, black);
}

.shop-protected-note {
	opacity: .7;
	font-size: .85em;
	margin: 0;
}

.shop-pagination {
	display: flex;
	justify-content: space-between;
	margin-top: 1.2em;
}

.shop-reveal-card {
	max-width: 620px;
}

.shop-reveal-label {
	text-transform: uppercase;
	letter-spacing: .06em;
	font-size: .8em;
	font-weight: 700;
	opacity: .7;
	margin: 0 0 4px;
}

.shop-recipe-list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--shop-gap);
}

.shop-recipe-card {
	display: flex;
	gap: 14px;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: var(--shop-radius);
	padding: 14px;
}

.shop-recipe-result {
	flex: 0 0 68px;
	height: 68px;
	border-radius: calc(var(--shop-radius) - 2px);
	overflow: hidden;
	background: color-mix(in srgb, currentColor 5%, transparent);
}

.shop-recipe-result img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.shop-recipe-body {
	flex: 1;
	min-width: 0;
}

.shop-recipe-body h3 {
	margin: 0 0 4px;
	font-size: 1em;
}

.shop-ingredient-list {
	list-style: none;
	margin: 10px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: .88em;
}

.shop-ingredient-list li {
	display: flex;
	align-items: center;
	gap: 6px;
}

.shop-ingredient-list img {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	object-fit: cover;
}

.shop-ingredient-count {
	margin-left: auto;
	font-weight: 700;
}

.shop-ingredient-ok {
	color: var(--shop-price-color);
}

.shop-ingredient-missing {
	color: var(--shop-warning-color);
}

.shop-equipped {
	display: inline-flex;
	gap: 4px;
	margin-top: 4px;
}

.shop-equipped img {
	width: 20px;
	height: 20px;
	border-radius: 4px;
	object-fit: cover;
	border: 1px solid color-mix(in srgb, currentColor 20%, transparent);
}

.shop-showcase {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
	gap: 8px;
	max-width: 420px;
}

.shop-showcase a {
	display: block;
	transition: transform .15s ease;
}

.shop-showcase a:hover {
	transform: translateY(-2px);
}

.shop-showcase img,
.shop-showcase .shop-card-image-placeholder {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	object-fit: contain;
	background: color-mix(in srgb, currentColor 5%, transparent);
	border-radius: 8px;
	border: 2px solid color-mix(in srgb, currentColor 20%, transparent);
}

.shop-showcase .shop-card-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: .55;
}

@media (max-width: 700px) {
	.shop-detail {
		flex-direction: column;
	}

	.shop-detail-image {
		flex-basis: auto;
	}

	.shop-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.shop-panel-header {
		flex-direction: column;
		align-items: stretch;
	}

	.shop-filter-bar {
		flex-direction: column;
		align-items: stretch;
	}
}
