/* Modified 7/19/26 */
/**
 *
 * Virtual Shop extension for the phpBB Forum Software package.
 *
 * Classic phpBB look: relies on prosilver's panels, tables and buttons.
 *
 * @copyright (c) phpBB Limited <https://www.phpbb.com>, phpBB.nl <https://www.phpbbextnl.be>, SpIdErPiGgY
 * @license GNU General Public License, version 2 (GPL-2.0)
 *
 */

/* Keep the submit input and cancel link centred on the same baseline. */
.virtualshop-buy-confirm .submit-buttons {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.virtualshop-buy-confirm .submit-buttons > input[type="submit"],
.virtualshop-buy-confirm .submit-buttons > a.button {
	float: none;
	margin: 0;
	vertical-align: middle;
}

/* Wallet summary line under the header */
.virtualshop-wallet {
	margin: 0;
}

.virtualshop-wallet dt {
	float: left;
	width: auto;
	font-weight: bold;
}

.virtualshop-wallet dd {
	margin-left: 0;
}

/* Category / type filter bar */
.virtualshop-filterbar {
	margin-bottom: 12px;
}

.virtualshop-filter-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
}

.virtualshop-filter-row + .virtualshop-filter-row {
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid rgba(128, 128, 128, 0.35);
}

.virtualshop-filter-label {
	flex: 0 0 90px;
	font-weight: bold;
	font-size: 1.1em;
}

.virtualshop-filter-links {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 8px;
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: 1.1em;
}

.virtualshop-filter-links li {
	max-width: 100%;
}

.virtualshop-filter-links a {
	display: block;
	padding: 3px 6px;
	border: 1px solid rgba(128, 128, 128, 0.35);
	border-radius: 2px;
	overflow-wrap: anywhere;
}

.virtualshop-filter-links a:hover,
.virtualshop-filter-links a:focus-visible,
.virtualshop-filter-links a.is-active {
	border-color: currentColor;
	background-color: rgba(128, 128, 128, 0.15);
}

.virtualshop-filter-links a.is-active {
	font-weight: bold;
}

.virtualshop-stock-form {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0;
	border: 0;
}

.virtualshop-stock-form label {
	display: flex;
	align-items: center;
	gap: 5px;
	white-space: nowrap;
}

/* Inventory on the left, pagination on the right, just below search. */
.virtualshop-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 8px;
}

.virtualshop-actions .pagination {
	float: none;
	margin-left: auto;
}

.virtualshop-inventory-button {
	font-weight: bold;
}

.virtualshop-row-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
}

/* Ultra Light's hover image is shorter than long shop descriptions.
   Stretch it vertically instead of exposing its blue fallback below it.
   Other themes without a hover image keep their existing hover colour. */
.virtualshop-list ul.topiclist li.row:hover {
	background-size: auto 100%;
}

/* Item list rows */
.virtualshop-row .virtualshop-row-image {
	float: left;
	margin-right: 10px;
}

.virtualshop-row .virtualshop-row-image img {
	width: 60px;
	height: 60px;
	object-fit: contain;
	border: 2px solid transparent;
	border-radius: 3px;
	background-color: transparent;
	padding: 0;
	box-sizing: border-box;
}

/* Detail page: rarity text follows the rarity border colours; the
   category/type line is bold and inherits the theme colour instead of grey. */
.virtualshop-detail-rarity.rarity-common-text { color: #c8c8c8; }
.virtualshop-detail-rarity.rarity-rare-text { color: #2d84ff; }
.virtualshop-detail-rarity.rarity-epic-text { color: #964cff; }
.virtualshop-detail-rarity.rarity-legendary-text { color: #ffb52b; }

.virtualshop-row.rarity-common .virtualshop-row-image img {
	border-color: #c8c8c8;
}

.virtualshop-row.rarity-rare .virtualshop-row-image img {
	border-color: #2d84ff;
}

.virtualshop-row.rarity-epic .virtualshop-row-image img {
	border-color: #964cff;
}

.virtualshop-row.rarity-legendary .virtualshop-row-image img {
	border-color: #ffb52b;
}

.virtualshop-row .virtualshop-row-desc,
.virtualshop-row .virtualshop-row-meta {
	color: inherit;
	font-size: 1.1em;
}

.virtualshop-row .virtualshop-row-meta {
	font-size: 1em;
}

.virtualshop-soldout-note,
.virtualshop-protected-note {
	color: #9c2727;
	font-size: 1.1em;
}

.virtualshop-equipped-note {
	color: #8b5a00;
}

.virtualshop-points-name {
	font-size: 1em;
	font-weight: normal;
}

/* Gift controls: button stacked above the inputs, no fieldset legend. */
.virtualshop-gift-row {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 5px;
	margin: 6px 0 0;
	border: 0;
	padding: 0;
}

.virtualshop-gift-row .inputbox {
	margin: 0;
	max-width: 100%;
}

/* Upgrade ingredient counts */
.virtualshop-ingredient.ok {
	color: #0b8a4b;
}

.virtualshop-ingredient.missing {
	color: #b03030;
}

/* Item detail page */
.virtualshop-detail-layout {
	display: table;
	width: 100%;
}

.virtualshop-detail-image {
	display: table-cell;
	width: 260px;
	vertical-align: top;
	padding-right: 20px;
}

.virtualshop-detail-image img {
	width: 100%;
	height: auto;
	max-height: 320px;
	object-fit: contain;
	background-color: transparent;
	border: 2px solid transparent;
	border-radius: 3px;
	padding: 0;
	box-sizing: border-box;
}

.virtualshop-detail-panel.rarity-common .virtualshop-detail-image img {
	border-color: #c8c8c8;
}

.virtualshop-detail-panel.rarity-rare .virtualshop-detail-image img {
	border-color: #2d84ff;
}

.virtualshop-detail-panel.rarity-epic .virtualshop-detail-image img {
	border-color: #964cff;
}

.virtualshop-detail-panel.rarity-legendary .virtualshop-detail-image img {
	border-color: #ffb52b;
}

.virtualshop-detail-info {
	display: table-cell;
	vertical-align: top;
}

.virtualshop-detail-title {
	margin-bottom: 2px;
}

.virtualshop-detail-rarity {
	font-size: 0.7em;
	font-weight: bold;
}

.virtualshop-detail-meta {
	margin-top: 0;
	color: #ffffff;
	font-weight: bold;
}

.virtualshop-detail-stats {
	display: grid;
	grid-template-columns: max-content minmax(0, 1fr);
	gap: 4px 12px;
	margin: 0 0 12px;
}

.virtualshop-detail-stats dt,
.virtualshop-detail-stats dd {
	float: none;
	width: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	overflow-wrap: anywhere;
}

.virtualshop-detail-stats dt {
	font-weight: bold;
}

/* Profile showcase (memberlist) and post mini-profile
   These classes are used by the event templates and must be kept. */
.virtualshop-profile-panel-heading {
	margin-bottom: 10px;
}

.virtualshop-profile-panel-heading h3 {
	margin-bottom: 4px;
}

.virtualshop-profile-panel-heading p {
	margin: 0;
}

.virtualshop-profile-gallery {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-evenly;
	gap: 12px;
}

/* Follow profile typography, not the board's heading/link defaults.
   Profile Styler's explicit !important font and colour rules still win. */
.virtualshop-profile-panel .virtualshop-profile-panel-heading h3,
.virtualshop-profile-panel .virtualshop-profile-panel-heading p,
.virtualshop-profile-panel .virtualshop-profile-panel-heading .button,
.virtualshop-profile-panel .virtualshop-profile-card,
.virtualshop-profile-panel .virtualshop-profile-card span {
	font-family: inherit;
}

.virtualshop-profile-panel a.virtualshop-profile-card,
.virtualshop-profile-panel .virtualshop-profile-card span {
	color: inherit;
}

.virtualshop-profile-card {
	display: flex;
	flex-direction: column;
	flex: 0 1 180px;
	min-width: 0;
	text-align: center;
	text-decoration: none !important;
	color: inherit;
}

.virtualshop-profile-card img {
	display: block;
	width: 100%;
	height: 180px;
	object-fit: contain;
	border-radius: 3px;
	background-color: transparent;
	border: 2px solid transparent;
	padding: 0;
	box-sizing: border-box;
}

.virtualshop-profile-card.rarity-rare img {
	border-color: #2d84ff;
}

.virtualshop-profile-card.rarity-epic img {
	border-color: #964cff;
}

.virtualshop-profile-card.rarity-legendary img {
	border-color: #ffb52b;
}

.virtualshop-profile-card span {
	margin-top: 5px;
	overflow-wrap: anywhere;
}

.profile-virtualshop {
	margin-top: 4px;
}

.profile-virtualshop-equipped {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	margin-top: 4px;
}

.profile-virtualshop-equipped-item {
	display: inline-flex;
	flex: 0 0 61px;
	width: 61px;
	height: 61px;
	padding: 0;
	box-sizing: border-box;
	border: 2px solid transparent;
	border-radius: 3px;
	background-color: transparent;
	overflow: hidden;
}

.profile-virtualshop-equipped-item img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border: 0;
	padding: 0;
}

.profile-virtualshop-equipped-item.rarity-rare {
	border-color: #2d84ff;
}

.profile-virtualshop-equipped-item.rarity-epic {
	border-color: #964cff;
}

.profile-virtualshop-equipped-item.rarity-legendary {
	border-color: #ffb52b;
}

.postprofile .profile-virtualshop-equipped {
	max-width: 220px;
}

/* Alignment & width fixes: topic-list resets + scoped search bar
   --------------------------------------------------------------------------- */

.virtualshop-list ul.topiclist > li.header {
	height: auto;
	min-height: 28px;
}

/* Reset phpBB's float/negative-margin and equal-height padding tricks for
   BOTH headers and rows. Keep these rules restricted to shop lists. */
.virtualshop-list ul.topiclist > li > dl {
	display: table;
	width: 100%;
	table-layout: fixed;
	margin: 0;
}

.virtualshop-list ul.topiclist > li > dl > dt,
.virtualshop-list ul.topiclist > li > dl > dd {
	display: table-cell;
	float: none;
	vertical-align: middle;
	margin: 0;
	padding: 8px;
	box-sizing: border-box;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.virtualshop-list ul.topiclist > li > dl > dt {
	width: auto;
	text-align: left;
}

.virtualshop-list ul.topiclist dt .list-inner {
	margin: 0;
	padding: 0;
}

.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-price,
.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-stock {
	width: 110px;
	text-align: center;
}

.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-action {
	width: 150px;
	text-align: center;
}

/* More specific than the topiclist .list-inner reset above: keep the
   thumbnail gutter on both desktop and mobile, including inventory rows. */
.virtualshop-list ul.topiclist > li.virtualshop-row > dl > dt .list-inner {
	position: relative;
	min-height: 60px;
	padding-left: 72px;
}

.virtualshop-list .virtualshop-row .virtualshop-row-image {
	position: absolute;
	left: 0;
	top: 0;
	float: none;
	margin: 0;
}

.virtualshop-list .vshop-col-action form + form {
	margin-top: 5px;
}

/* Compact inventory cells only; leave the shop catalogue unchanged. */
.virtualshop-inventory-list ul.topiclist > li.virtualshop-row > dl > dt,
.virtualshop-inventory-list ul.topiclist > li.virtualshop-row > dl > dd {
	padding-top: 5px;
	padding-bottom: 5px;
}

/* The gift form provides its own 3px gap, so drop the text cell's
   5px bottom padding above it and pull the form up to the text. */
.virtualshop-inventory-list ul.topiclist > li.virtualshop-row > dl > dt {
	padding-bottom: 0;
}

.virtualshop-list .vshop-col-action .button {
	max-width: 100%;
	white-space: normal;
}

/* Full-width search, with the button beside the input rather than below it. */
.virtualshop-searchbar {
	margin: 10px 0;
}

.virtualshop-searchbar fieldset {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 0;
	min-width: 0;
	width: 100%;
	box-sizing: border-box;
}

.virtualshop-searchbar .inputbox {
	flex: 1 1 auto;
	width: 100%;
	max-width: none;
	min-width: 0;
	height: 32px;
	margin: 0;
	box-sizing: border-box;
}

.virtualshop-searchbar .button {
	flex: 0 0 auto;
	height: 32px;
	box-sizing: border-box;
}

@media (max-width: 700px) {
	.virtualshop-filter-row {
		flex-direction: column;
		gap: 4px;
	}

	.virtualshop-filter-label {
		flex-basis: auto;
	}

	/* phpBB hides header cells with !important at this breakpoint. */
	.virtualshop-list ul.topiclist > li.header dd {
		display: block !important;
	}

	.virtualshop-list ul.topiclist > li > dl {
		display: grid;
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.virtualshop-list ul.topiclist > li > dl > dt {
		grid-column: 1 / -1;
	}

	.virtualshop-list ul.topiclist > li > dl > dt,
	.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-price,
	.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-stock,
	.virtualshop-list ul.topiclist > li > dl > dd.vshop-col-action {
		display: block;
		width: auto;
		min-width: 0;
	}

	.virtualshop-gift-row {
		margin: 6px 0 0;
	}

	.virtualshop-detail-layout,
	.virtualshop-detail-image,
	.virtualshop-detail-info {
		display: block;
		width: auto;
	}

	.virtualshop-detail-image {
		max-width: 260px;
		padding: 0;
		margin-bottom: 12px;
	}

	.virtualshop-detail-stats {
		grid-template-columns: fit-content(45%) minmax(0, 1fr);
	}
}
