/**
 * Marketplace Hub — public storefront, directory, wishlist.
 * Uses design tokens from mh-tokens.css.
 */

/* ============================================================
 * Store page
 * ============================================================ */
.mh-marketplace-store {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--mh-space-6) var(--mh-space-4);
}

.mh-marketplace-store__header {
	display: grid;
	grid-template-columns: 140px 1fr;
	gap: var(--mh-space-6);
	align-items: start;
	padding: var(--mh-space-6);
	margin-bottom: var(--mh-space-7);
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-xl);
	box-shadow: var(--mh-shadow-sm);
}

.mh-marketplace-store__logo {
	width: 140px;
	height: 140px;
	object-fit: cover;
	border-radius: var(--mh-radius-lg);
	border: 1px solid var(--mh-border);
	background: var(--mh-bg-sunken);
}

.mh-marketplace-store__name {
	font-size: var(--mh-text-3xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 var(--mh-space-3);
	color: var(--mh-text);
}

.mh-marketplace-store__meta {
	display: flex;
	flex-wrap: wrap;
	gap: var(--mh-space-4);
	color: var(--mh-text-muted);
	font-size: var(--mh-text-sm);
	margin-bottom: var(--mh-space-4);
}

.mh-marketplace-store__meta > span {
	display: inline-flex;
	align-items: center;
	gap: var(--mh-space-2);
}

.mh-marketplace-store__rating {
	font-weight: 600;
	color: var(--mh-warning);
}

.mh-marketplace-store__description {
	color: var(--mh-text-muted);
	line-height: 1.7;
	font-size: var(--mh-text-base);
	max-width: 65ch;
}

.mh-marketplace-store__products h2,
.mh-marketplace-store__reviews h2 {
	font-size: var(--mh-text-2xl);
	font-weight: 700;
	letter-spacing: -0.01em;
	margin: 0 0 var(--mh-space-5);
}

.mh-marketplace-store__products {
	margin-bottom: var(--mh-space-7);
}

/* ============================================================
 * Vendor directory
 * ============================================================ */
.mh-marketplace-vendors {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--mh-space-6) var(--mh-space-4);
}

.mh-marketplace-vendors h1 {
	font-size: var(--mh-text-3xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 var(--mh-space-6);
}

.mh-marketplace-vendor-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--mh-space-5);
	list-style: none;
	margin: 0;
	padding: 0;
}

.mh-marketplace-vendor-card {
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-lg);
	padding: var(--mh-space-5);
	text-align: center;
	transition: transform var(--mh-duration) var(--mh-ease),
		box-shadow var(--mh-duration) var(--mh-ease),
		border-color var(--mh-duration) var(--mh-ease);
}

.mh-marketplace-vendor-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--mh-shadow-md);
	border-color: var(--mh-border-strong);
}

.mh-marketplace-vendor-card a {
	text-decoration: none;
	color: inherit;
}

.mh-marketplace-vendor-card__logo {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	object-fit: cover;
	margin: 0 auto var(--mh-space-3);
	display: block;
	border: 2px solid var(--mh-bg-elevated);
	box-shadow: var(--mh-shadow-sm);
}

.mh-marketplace-vendor-card__name {
	font-size: var(--mh-text-base);
	font-weight: 700;
	margin: 0 0 var(--mh-space-2);
	color: var(--mh-text);
}

.mh-marketplace-vendor-card__meta {
	font-size: var(--mh-text-xs);
	color: var(--mh-text-muted);
	margin: 0;
}

/* ============================================================
 * Wishlist / grids
 * ============================================================ */
.mh-marketplace-wishlist {
	max-width: 1200px;
	margin: 0 auto;
	padding: var(--mh-space-6) var(--mh-space-4);
}

.mh-marketplace-wishlist h1 {
	font-size: var(--mh-text-3xl);
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 var(--mh-space-6);
}

.mh-marketplace-product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: var(--mh-space-5);
	list-style: none;
	margin: 0;
	padding: 0;
}

/* ============================================================
 * Wishlist toggle
 * ============================================================ */
.mh-marketplace-wishlist-toggle {
	display: inline-flex;
	align-items: center;
	gap: var(--mh-space-2);
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border-strong);
	border-radius: var(--mh-radius-md);
	padding: 0.5rem 0.875rem;
	cursor: pointer;
	font-size: var(--mh-text-xs);
	font-weight: 600;
	color: var(--mh-text);
	transition: background var(--mh-duration) var(--mh-ease),
		color var(--mh-duration) var(--mh-ease),
		border-color var(--mh-duration) var(--mh-ease);
}

.mh-marketplace-wishlist-toggle:hover {
	background: var(--mh-bg-hover);
}

.mh-marketplace-wishlist-toggle.is-active {
	color: var(--mh-danger);
	border-color: var(--mh-danger);
	background: var(--mh-danger-soft);
}

.mh-marketplace-wishlist-icon {
	font-size: 1.1em;
	line-height: 1;
}

/* ============================================================
 * Book details
 * ============================================================ */
.mh-marketplace-book-details {
	margin: var(--mh-space-5) 0;
}

.mh-marketplace-book-details h3 {
	font-size: var(--mh-text-lg);
	font-weight: 700;
	margin: 0 0 var(--mh-space-4);
}

.mh-marketplace-book-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-lg);
	overflow: hidden;
}

.mh-marketplace-book-table th,
.mh-marketplace-book-table td {
	padding: var(--mh-space-3) var(--mh-space-5);
	text-align: left;
	border-bottom: 1px solid var(--mh-border);
	font-size: var(--mh-text-sm);
}

.mh-marketplace-book-table th {
	width: 40%;
	background: var(--mh-bg-sunken);
	font-weight: 600;
	color: var(--mh-text-muted);
}

.mh-marketplace-book-table tr:last-child th,
.mh-marketplace-book-table tr:last-child td {
	border-bottom: 0;
}

/* ============================================================
 * Order cards (vendor orders view)
 * ============================================================ */
.mh-marketplace-order-card {
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-lg);
	padding: var(--mh-space-5);
	margin-bottom: var(--mh-space-4);
	box-shadow: var(--mh-shadow-xs);
}

.mh-marketplace-order-card__header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: var(--mh-space-3);
	margin-bottom: var(--mh-space-4);
}

.mh-marketplace-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.25rem 0.625rem;
	border-radius: var(--mh-radius-full);
	background: var(--mh-bg-sunken);
	color: var(--mh-text-muted);
	font-size: var(--mh-text-xs);
	font-weight: 600;
}

.mh-marketplace-badge--completed { background: var(--mh-success-soft); color: var(--mh-success); }
.mh-marketplace-badge--shipped   { background: var(--mh-primary-soft); color: var(--mh-primary); }
.mh-marketplace-badge--pending   { background: var(--mh-warning-soft); color: #b45309; }

/* ============================================================
 * Reviews
 * ============================================================ */
.mh-marketplace-reviews {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: var(--mh-space-4);
}

.mh-marketplace-review {
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-lg);
	padding: var(--mh-space-5);
}

.mh-marketplace-review__meta {
	display: flex;
	gap: var(--mh-space-3);
	align-items: center;
	font-size: var(--mh-text-xs);
	color: var(--mh-text-muted);
	margin-bottom: var(--mh-space-2);
}

.mh-marketplace-review__meta strong {
	color: var(--mh-text);
	font-size: var(--mh-text-sm);
}

.mh-marketplace-review__content {
	color: var(--mh-text);
	line-height: 1.7;
}

/* ============================================================
 * Pagination (marketplace)
 * ============================================================ */
.mh-marketplace-pagination {
	margin: var(--mh-space-6) 0;
	text-align: center;
}

.mh-marketplace-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	height: 2.5rem;
	padding: 0 0.75rem;
	margin: 0 0.125rem;
	border-radius: var(--mh-radius-md);
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	color: var(--mh-text);
	text-decoration: none;
	font-weight: 600;
	font-size: var(--mh-text-sm);
	transition: background var(--mh-duration-fast) var(--mh-ease);
}

.mh-marketplace-pagination .page-numbers:hover {
	background: var(--mh-bg-hover);
}

.mh-marketplace-pagination .page-numbers.current {
	background: var(--mh-primary);
	color: var(--mh-primary-text);
	border-color: var(--mh-primary);
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media (max-width: 782px) {
	.mh-marketplace-store__header {
		grid-template-columns: 1fr;
		text-align: center;
		padding: var(--mh-space-5);
	}

	.mh-marketplace-store__logo {
		margin: 0 auto;
	}

	.mh-marketplace-store__meta {
		justify-content: center;
	}

	.mh-marketplace-store__description {
		text-align: left;
	}

	.woocommerce table.shop_table {
		display: block;
		overflow-x: auto;
		white-space: nowrap;
	}
}

/* ============================================================
 * Author / vendor directory enhancements
 * ============================================================ */
.mh-marketplace-vendors__hero {
	background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
	border-bottom: 1px solid #d1fae5;
	padding: 3.5rem 1.25rem 3rem;
	margin-bottom: 2.5rem;
}

.mh-marketplace-vendors__hero-inner {
	max-width: 760px;
	margin: 0 auto;
	text-align: center;
}

.mh-marketplace-vendors__title {
	font-size: 2rem;
	font-weight: 900;
	letter-spacing: -.02em;
	color: #064e3b;
	margin: 0 0 .75rem;
}

.mh-marketplace-vendors__subtitle {
	font-size: 1rem;
	color: #065f46;
	line-height: 1.7;
	margin: 0;
}

.mh-marketplace-vendor-card__logo--initial {
	width: 88px;
	height: 88px;
	border-radius: 50%;
	background: #10b981;
	color: #fff;
	font-size: 2rem;
	font-weight: 900;
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0 auto var(--mh-space-3);
}

.mh-marketplace-vendor-card__bio {
	font-size: var(--mh-text-xs);
	color: var(--mh-text-muted);
	line-height: 1.6;
	margin: 0 0 var(--mh-space-2);
}

.mh-marketplace-vendor-card__btn {
	display: inline-block;
	padding: .4rem 1rem;
	background: #10b981;
	color: #fff;
	border-radius: 999px;
	font-size: var(--mh-text-xs);
	font-weight: 700;
	text-decoration: none;
	margin-top: var(--mh-space-3);
	transition: background 150ms ease;
}

.mh-marketplace-vendor-card__btn:hover {
	background: #059669;
	color: #fff;
}

/* ============================================================
 * Vendor registration form styling
 * ============================================================ */
.mh-marketplace-registration {
	max-width: 680px;
	margin: 0 auto;
	padding: var(--mh-space-6) var(--mh-space-4);
}

.mh-marketplace-form {
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-lg);
	padding: var(--mh-space-6);
}

.mh-marketplace-form h2 {
	font-size: var(--mh-text-2xl);
	font-weight: 800;
	margin: 0 0 var(--mh-space-5);
	letter-spacing: -.02em;
}

.mh-marketplace-field {
	display: flex;
	flex-direction: column;
	gap: var(--mh-space-2);
	margin-bottom: var(--mh-space-4);
}

.mh-marketplace-field label {
	font-size: var(--mh-text-sm);
	font-weight: 600;
	color: var(--mh-text);
}

.mh-marketplace-field label .required {
	color: var(--mh-danger);
	margin-left: 2px;
}

.mh-marketplace-field input[type="text"],
.mh-marketplace-field input[type="email"],
.mh-marketplace-field input[type="password"],
.mh-marketplace-field input[type="tel"],
.mh-marketplace-field input[type="url"],
.mh-marketplace-field input[type="number"],
.mh-marketplace-field select,
.mh-marketplace-field textarea {
	width: 100%;
	padding: .625rem .875rem;
	border: 1px solid var(--mh-border-strong);
	border-radius: var(--mh-radius-md);
	background: var(--mh-bg-elevated);
	color: var(--mh-text);
	font-family: inherit;
	font-size: var(--mh-text-sm);
	line-height: 1.5;
	transition: border-color var(--mh-duration) var(--mh-ease),
	            box-shadow var(--mh-duration) var(--mh-ease);
}

.mh-marketplace-field input:focus,
.mh-marketplace-field select:focus,
.mh-marketplace-field textarea:focus {
	outline: none;
	border-color: #10b981;
	box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}

.mh-marketplace-field small {
	font-size: var(--mh-text-xs);
	color: var(--mh-text-muted);
}

.mh-marketplace-fieldset {
	border: 1px solid var(--mh-border);
	border-radius: var(--mh-radius-md);
	padding: var(--mh-space-4) var(--mh-space-5);
	margin-bottom: var(--mh-space-4);
}

.mh-marketplace-fieldset legend {
	font-weight: 700;
	font-size: var(--mh-text-sm);
	padding: 0 var(--mh-space-2);
}

.mh-marketplace-actions {
	margin-top: var(--mh-space-5);
	margin-bottom: 0;
}

.mh-marketplace-actions .button,
.mh-marketplace-actions .button.alt {
	display: inline-flex;
	align-items: center;
	padding: .875rem 2rem;
	background: #10b981;
	color: #fff;
	border: 0;
	border-radius: var(--mh-radius-md);
	font-size: var(--mh-text-base);
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
	transition: background 150ms ease;
}

.mh-marketplace-actions .button:hover,
.mh-marketplace-actions .button.alt:hover {
	background: #059669;
	color: #fff;
}

.mh-marketplace-categories {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: var(--mh-space-2);
	margin-bottom: var(--mh-space-4);
}

.mh-marketplace-checkbox {
	display: flex;
	align-items: center;
	gap: var(--mh-space-2);
	font-size: var(--mh-text-sm);
	cursor: pointer;
	padding: var(--mh-space-2);
	border-radius: var(--mh-radius-sm);
	transition: background var(--mh-duration-fast) var(--mh-ease);
}

.mh-marketplace-checkbox:hover {
	background: var(--mh-bg-hover);
}

.mh-marketplace-checkbox input[type="checkbox"] {
	accent-color: #10b981;
	width: 1.0625rem;
	height: 1.0625rem;
}

.mh-marketplace-notice {
	padding: var(--mh-space-4);
	border-radius: var(--mh-radius-md);
	margin-bottom: var(--mh-space-4);
	background: var(--mh-bg-elevated);
	border: 1px solid var(--mh-border);
	font-size: var(--mh-text-sm);
}

.mh-marketplace-notice--error {
	background: var(--mh-danger-soft);
	border-color: #fecaca;
	color: #991b1b;
}

.mh-marketplace-notice--success {
	background: var(--mh-success-soft);
	border-color: #a7f3d0;
	color: #065f46;
}

.mh-marketplace-delete-form {
	margin-top: var(--mh-space-5);
	padding-top: var(--mh-space-5);
	border-top: 1px solid var(--mh-border);
}

.mh-marketplace-danger {
	background: var(--mh-danger) !important;
	color: #fff !important;
	border: 0 !important;
}

/* ============================================================
 * Registration page hero
 * ============================================================ */
.mh-marketplace-registration__hero {
	background: linear-gradient(135deg, #ecfdf5 0%, #f0f9ff 100%);
	border-bottom: 1px solid #d1fae5;
	padding: 3rem 1.25rem 2.5rem;
	margin-bottom: 2rem;
	text-align: center;
}

.mh-marketplace-registration__title {
	font-size: 2rem;
	font-weight: 900;
	letter-spacing: -.02em;
	color: #064e3b;
	margin: 0 0 .75rem;
}

.mh-marketplace-registration__subtitle {
	font-size: 1rem;
	color: #065f46;
	line-height: 1.7;
	margin: 0 auto;
	max-width: 50ch;
}

@media (max-width: 600px) {
	.mh-marketplace-form [style*="grid-template-columns:1fr 1fr"] {
		grid-template-columns: 1fr !important;
	}
}
