/**
 * MyHerbals Vendor Marketplace - Vendor area styles.
 *
 * Covers two things, both deliberately minimal:
 * 1. The vendor's own "My Shop" / "My Products" screens (a plain,
 *    theme-friendly form layout, similar to the application form).
 * 2. The banner/logo header block this plugin adds above the product
 *    grid on the public shop page (templates/frontend/public-shop/shop.php).
 *    The product grid itself deliberately has NO styling here — it uses
 *    the active theme's own WooCommerce template output untouched.
 */

.mhvm-vendor-area {
	--mhvm-accent: #2e7d32;
	--mhvm-border: #d7d7d7;
	max-width: 760px;
}

.mhvm-vendor-area .mhvm-field {
	margin-bottom: 16px;
}

.mhvm-vendor-area .mhvm-field label {
	display: block;
	font-weight: 600;
	margin-bottom: 4px;
}

.mhvm-vendor-area .mhvm-field input[type="text"],
.mhvm-vendor-area .mhvm-field input[type="url"],
.mhvm-vendor-area .mhvm-field input[type="number"],
.mhvm-vendor-area .mhvm-field textarea {
	width: 100%;
	max-width: 480px;
	padding: 8px 10px;
	border: 1px solid var(--mhvm-border);
	border-radius: 4px;
	box-sizing: border-box;
}

.mhvm-vendor-area .mhvm-current-image img {
	max-width: 200px;
	height: auto;
	display: block;
	margin-bottom: 8px;
	border: 1px solid var(--mhvm-border);
	border-radius: 4px;
}

/* Price + Volume side by side (Version 0.4.8). */

.mhvm-vendor-area .mhvm-field-row {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
}

.mhvm-vendor-area .mhvm-field-row .mhvm-field {
	flex: 1 1 220px;
}

.mhvm-vendor-area .mhvm-input-with-suffix {
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 480px;
}

.mhvm-vendor-area .mhvm-input-with-suffix input {
	flex: 1;
}

.mhvm-vendor-area .mhvm-input-suffix {
	color: #666;
	font-weight: 600;
}

.mhvm-vendor-area .optional {
	color: #666;
	font-weight: 400;
	font-size: 0.85em;
}

.mhvm-vendor-area .mhvm-checkbox-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 6px;
}

.mhvm-vendor-area .required {
	color: #b32d2e;
}

.mhvm-vendor-area .mhvm-field-error {
	color: #b32d2e;
	font-size: 0.9em;
	margin: 4px 0 0;
}

.mhvm-vendor-area .mhvm-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.8em;
	font-weight: 600;
	background: #f0f0f1;
}

.mhvm-vendor-area .mhvm-badge--pending { background: #fff3cd; color: #6b5300; }
.mhvm-vendor-area .mhvm-badge--under_review { background: #fff3cd; color: #6b5300; }
.mhvm-vendor-area .mhvm-badge--approved { background: #d7f5da; color: #00641e; }
.mhvm-vendor-area .mhvm-badge--rejected { background: #f8d7d7; color: #8a2424; }
.mhvm-vendor-area .mhvm-badge--paid { background: #d7f5da; color: #00641e; }
.mhvm-vendor-area .mhvm-badge--cancelled { background: #f0f0f1; color: #50575e; }

/* Public shop page banner/logo header block. */

/*
 * The underlying Elementor page used for /shop/{vendor-slug}/ carries its
 * own generic page title (e.g. "Vendor Shop"), rendered by the theme above
 * this plugin's shortcode output. It duplicates the vendor's own name,
 * which already appears in the banner below, so it is hidden here rather
 * than left showing on every vendor shop page. Scoped to the
 * `mhvm-vendor-shop-page` body class (see Vendor_Assets::maybe_add_shop_page_body_class())
 * so this never affects any other page on the site.
 */
body.mhvm-vendor-shop-page .entry-title {
	display: none;
}

.mhvm-vendor-shop .mhvm-shop-banner {
	position: relative;
	margin-bottom: 24px;
}

.mhvm-vendor-shop .mhvm-shop-banner__image img {
	width: 100%;
	height: auto;
	max-height: 320px;
	object-fit: cover;
	border-radius: 4px;
}

.mhvm-vendor-shop .mhvm-shop-banner__details {
	display: flex;
	align-items: center;
	gap: 16px;
	margin-top: 12px;
	flex-wrap: wrap;
}

.mhvm-vendor-shop .mhvm-shop-logo img {
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #d7d7d7;
}

.mhvm-vendor-shop .mhvm-shop-title {
	margin: 0;
}

.mhvm-vendor-shop .mhvm-shop-description {
	flex-basis: 100%;
	margin: 8px 0 0;
}

.mhvm-vendor-shop .mhvm-shop-links a {
	margin-right: 12px;
}

/* Vendor shop shortcode: two-column layout with left-side category filter. */

.mhvm-vendor-shop .mhvm-shop-layout {
	display: grid;
	grid-template-columns: 220px 1fr;
	gap: 32px;
	align-items: start;
}

.mhvm-vendor-shop .mhvm-shop-filters {
	border: 1px solid #d7d7d7;
	border-radius: 6px;
	padding: 16px;
}

.mhvm-vendor-shop .mhvm-shop-filters h2 {
	margin-top: 0;
	font-size: 1em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mhvm-vendor-shop .mhvm-shop-filters__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mhvm-vendor-shop .mhvm-shop-filters__list li {
	padding: 4px 0;
}

.mhvm-vendor-shop .mhvm-shop-filters__list a {
	text-decoration: none;
}

.mhvm-vendor-shop .mhvm-shop-filters__list li.is-active a {
	font-weight: 700;
	color: var(--mhvm-accent, #2e7d32);
}

.mhvm-vendor-shop .mhvm-shop-filters__count {
	color: #777;
	font-size: 0.85em;
}

@media screen and (max-width: 782px) {
	.mhvm-vendor-shop .mhvm-shop-layout {
		grid-template-columns: 1fr;
	}
}

/* Vendor directory grid. */

.mhvm-vendor-directory__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.mhvm-vendor-card {
	display: block;
	text-align: center;
	text-decoration: none;
	padding: 16px;
	border: 1px solid #d7d7d7;
	border-radius: 6px;
	color: inherit;
}

.mhvm-vendor-card__logo img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 50%;
	margin: 0 auto 8px;
}

.mhvm-vendor-card__name {
	font-weight: 600;
}

/* Earnings dashboard. */

.mhvm-earnings .mhvm-balance-summary {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 16px;
	margin: 16px 0 24px;
}

.mhvm-earnings .mhvm-balance-card {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 16px 20px;
	border: 1px solid #d7d7d7;
	border-radius: 6px;
	background: #f7f7f5;
}

.mhvm-earnings .mhvm-balance-label {
	font-size: 0.85em;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mhvm-earnings .mhvm-balance-amount {
	font-size: 1.6em;
	font-weight: 700;
	color: var(--mhvm-accent, #2e7d32);
}

.mhvm-earnings .mhvm-withdrawal-form input[type="number"],
.mhvm-earnings .mhvm-withdrawal-form textarea {
	width: 100%;
	max-width: 320px;
	padding: 8px 10px;
	border: 1px solid #d7d7d7;
	border-radius: 4px;
	box-sizing: border-box;
}

.mhvm-earnings table.mhvm-status-table th,
.mhvm-earnings table.mhvm-status-table td {
	padding: 8px 10px;
	border-bottom: 1px solid #f0f0f1;
	text-align: left;
}

/* Version 0.3.8: clearer vendor product management list. */

.mhvm-product-list {
	max-width: 100%;
}

.mhvm-product-list__header {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 20px;
	margin-bottom: 22px;
}

.mhvm-product-list__header h2 {
	margin: 0 0 5px;
	font-size: 30px;
	line-height: 1.2;
}

.mhvm-product-list__header p {
	margin: 0;
	color: #666;
}

.mhvm-add-product-button {
	white-space: nowrap;
}

.mhvm-product-table-wrap {
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	overflow: hidden;
}

.mhvm-product-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
}

.mhvm-product-table th {
	background: #f7f8f7;
	font-weight: 700;
	text-align: left;
	padding: 14px 16px;
	border-bottom: 1px solid #e7e7e7;
}

.mhvm-product-table td {
	padding: 16px;
	vertical-align: middle;
	border-bottom: 1px solid #eeeeee;
}

.mhvm-product-table tbody tr:last-child td {
	border-bottom: 0;
}

.mhvm-vendor-product-cell {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 220px;
}

.mhvm-vendor-product-thumb {
	width: 64px;
	height: 64px;
	border: 1px solid #e1e1e1;
	border-radius: 6px;
	overflow: hidden;
	background: #f7f7f7;
	flex: 0 0 64px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 10px;
	color: #777;
}

.mhvm-vendor-product-thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	display: block;
}

.mhvm-vendor-product-title {
	display: block;
	font-size: 15px;
	line-height: 1.35;
	margin-bottom: 4px;
}

.mhvm-vendor-product-cell small,
.mhvm-status-help {
	display: block;
	color: #727272;
	font-size: 12px;
}

.mhvm-vendor-price {
	font-weight: 700;
	white-space: nowrap;
}

.mhvm-vendor-price .woocommerce-Price-amount {
	font-weight: 700;
}

.mhvm-status-help {
	margin-top: 5px;
	max-width: 210px;
	line-height: 1.35;
}

.mhvm-rejection-reason {
	margin-top: 8px;
	padding: 8px 10px;
	border-radius: 5px;
	background: #fff3f3;
	color: #8a2424;
	font-size: 12px;
	line-height: 1.4;
	max-width: 280px;
}

.mhvm-product-actions {
	white-space: nowrap;
}

.mhvm-product-actions .button + .button {
	margin-left: 5px;
}

.mhvm-empty-products {
	padding: 32px;
	text-align: center;
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
}

@media screen and (max-width: 782px) {
	.mhvm-product-list__header {
		flex-direction: column;
	}

	.mhvm-product-table-wrap {
		border: 0;
		background: transparent;
		overflow: visible;
	}

	.mhvm-product-table thead {
		display: none;
	}

	.mhvm-product-table,
	.mhvm-product-table tbody,
	.mhvm-product-table tr,
	.mhvm-product-table td {
		display: block;
		width: 100%;
		box-sizing: border-box;
	}

	.mhvm-product-table tr {
		margin-bottom: 14px;
		background: #fff;
		border: 1px solid #e1e1e1;
		border-radius: 8px;
		overflow: hidden;
	}

	.mhvm-product-table td {
		position: relative;
		padding: 12px 14px;
		border-bottom: 1px solid #eeeeee;
	}

	.mhvm-product-table td::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		color: #777;
		margin-bottom: 5px;
	}

	.mhvm-product-table td:first-child::before {
		display: none;
	}

	.mhvm-product-actions {
		white-space: normal;
	}
}

/* Shop analytics summary (My Shop, My Products). */

.mhvm-shop-analytics-summary {
	display: flex;
	gap: 16px;
	margin-bottom: 20px;
	flex-wrap: wrap;
}

.mhvm-shop-analytics-summary .mhvm-balance-card {
	padding: 14px 18px;
	border: 1px solid #d7d7d7;
	border-radius: 6px;
	background: #f7f7f5;
}

.mhvm-shop-analytics-summary .mhvm-balance-card > span:first-child {
	display: block;
	font-size: 0.8em;
	color: #666;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.mhvm-shop-analytics-summary .mhvm-balance-card > span:last-child {
	font-size: 1.4em;
	font-weight: 700;
}

.mhvm-top-products ol {
	margin: 0;
	padding-left: 20px;
}

/* ==========================================================================
   Vendor order management (My Orders)
   ========================================================================== */

.mhvm-vendor-orders .mhvm-orders-intro {
	color: #666;
	max-width: 640px;
	margin: 4px 0 20px;
}

/* Filter tabs: a segmented pill row. Horizontal-scrolls on narrow
   screens instead of wrapping onto multiple ragged lines. */

.mhvm-vendor-orders .mhvm-order-filter-tabs {
	display: flex;
	gap: 8px;
	margin: 0 0 22px;
	padding: 4px 2px 10px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.mhvm-vendor-orders .mhvm-order-filter-tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
	padding: 8px 8px 8px 16px;
	border: 1px solid var(--mhvm-border, #dcdcde);
	border-radius: 999px;
	background: #fff;
	text-decoration: none;
	color: #3c434a;
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
	transition: border-color 0.15s ease, background-color 0.15s ease, color 0.15s ease;
}

.mhvm-vendor-orders .mhvm-order-filter-tab span {
	line-height: 1;
}

.mhvm-vendor-orders .mhvm-order-filter-tab strong {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: #f0f0f1;
	color: #50575e;
	font-size: 12px;
	font-weight: 600;
}

.mhvm-vendor-orders .mhvm-order-filter-tab:hover {
	border-color: var(--mhvm-accent, #2e7d32);
	color: var(--mhvm-accent, #2e7d32);
}

.mhvm-vendor-orders .mhvm-order-filter-tab:hover strong {
	background: #e3f1e4;
	color: var(--mhvm-accent, #2e7d32);
}

.mhvm-vendor-orders .mhvm-order-filter-tab.is-active {
	border-color: var(--mhvm-accent, #2e7d32);
	background: var(--mhvm-accent, #2e7d32);
	color: #fff;
}

.mhvm-vendor-orders .mhvm-order-filter-tab.is-active strong {
	background: rgba(255, 255, 255, 0.24);
	color: #fff;
}

/* Order table, wrapped in a proper card. */

.mhvm-vendor-orders .mhvm-product-table-wrap {
	background: #fff;
	border: 1px solid var(--mhvm-border, #dcdcde);
	border-radius: 10px;
	overflow-x: auto;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.mhvm-order-table {
	width: 100%;
	min-width: 860px;
	border-collapse: collapse;
}

.mhvm-order-table thead th {
	padding: 12px 14px;
	background: #f7f8f6;
	border-bottom: 1px solid var(--mhvm-border, #dcdcde);
	text-align: left;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #6b7280;
	white-space: nowrap;
}

.mhvm-order-table tbody td {
	padding: 14px;
	border-bottom: 1px solid #f0f0f1;
	text-align: left;
	vertical-align: middle;
	font-size: 14px;
	color: #1d2327;
}

.mhvm-order-table tbody tr:last-child td {
	border-bottom: none;
}

.mhvm-order-table tbody tr:hover td {
	background: #fafbf9;
}

.mhvm-order-table .mhvm-order-number {
	font-weight: 600;
	color: #1d2327;
}

.mhvm-order-table .mhvm-order-date {
	display: block;
	font-size: 12px;
	color: #8a8f98;
	margin-top: 2px;
}

.mhvm-order-table .mhvm-unassigned {
	color: #8a8f98;
	font-style: italic;
}

.mhvm-order-table .mhvm-tracking-number {
	display: block;
	font-size: 12px;
	color: #8a8f98;
	margin-top: 4px;
}

.mhvm-order-table .mhvm-view-order-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 14px;
	border: 1px solid var(--mhvm-accent, #2e7d32);
	border-radius: 6px;
	background: #fff;
	color: var(--mhvm-accent, #2e7d32);
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.mhvm-order-table .mhvm-view-order-btn:hover {
	background: var(--mhvm-accent, #2e7d32);
	color: #fff;
}

.mhvm-vendor-orders .mhvm-empty-products {
	background: #fff;
	border: 1px dashed var(--mhvm-border, #dcdcde);
	border-radius: 10px;
	padding: 40px 20px;
	text-align: center;
	color: #666;
}

/* Shipment status pills — mirrors the admin Deliveries screen exactly, so
   the same status always looks the same whether an admin or a vendor is
   looking at it. */

.mhvm-delivery-status {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 4px 11px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 600;
	background: #f0f0f1;
	color: #50575e;
	white-space: nowrap;
}

.mhvm-delivery-status::before {
	content: "";
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: currentColor;
	flex-shrink: 0;
}

.mhvm-delivery-status--active,
.mhvm-delivery-status--delivered {
	background: #edfaef;
	color: #00641e;
}

.mhvm-delivery-status--new,
.mhvm-delivery-status--preparing {
	background: #f0f0f1;
	color: #50575e;
}

.mhvm-delivery-status--paused,
.mhvm-delivery-status--ready_for_pickup,
.mhvm-delivery-status--courier_assigned,
.mhvm-delivery-status--picked_up,
.mhvm-delivery-status--in_transit {
	background: #fff8e5;
	color: #7a4f01;
}

.mhvm-delivery-status--disabled,
.mhvm-delivery-status--failed,
.mhvm-delivery-status--returned,
.mhvm-delivery-status--cancelled {
	background: #fce8e8;
	color: #8a2424;
}

/* ==========================================================================
   Order detail screen
   ========================================================================== */

.mhvm-order-detail .mhvm-back-link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 12px;
	color: #666;
	text-decoration: none;
	font-size: 13px;
}

.mhvm-order-detail .mhvm-back-link:hover {
	color: var(--mhvm-accent, #2e7d32);
}

.mhvm-order-detail .mhvm-order-detail-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 16px;
	margin-bottom: 16px;
	align-items: stretch;
}

.mhvm-order-detail .mhvm-card {
	background: #fff;
	border: 1px solid var(--mhvm-border, #dcdcde);
	border-radius: 10px;
	padding: 18px 20px;
	margin-bottom: 16px;
	box-sizing: border-box;
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.mhvm-order-detail .mhvm-card h3 {
	margin-top: 0;
	margin-bottom: 14px;
	font-size: 14px;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #6b7280;
}

.mhvm-order-detail .mhvm-review-facts {
	display: grid;
	gap: 12px;
}

.mhvm-order-detail .mhvm-review-facts > div {
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.mhvm-order-detail .mhvm-review-facts > div > span {
	font-size: 11px;
	color: #8a8f98;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.mhvm-order-detail .mhvm-review-facts strong {
	font-size: 14px;
	color: #1d2327;
	font-weight: 600;
}

.mhvm-order-detail .mhvm-order-action-form {
	margin-top: 16px;
	padding-top: 16px;
	border-top: 1px solid #f0f0f1;
}

.mhvm-order-detail .mhvm-order-action-form .button-primary {
	width: 100%;
	text-align: center;
	padding: 10px 16px;
	font-weight: 600;
}

.mhvm-shipment-timeline {
	list-style: none;
	margin: 0;
	padding: 0;
}

.mhvm-shipment-timeline li {
	position: relative;
	padding: 0 0 16px 22px;
	border-left: 2px solid #ecebe9;
}

.mhvm-shipment-timeline li::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 2px;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--mhvm-accent, #2e7d32);
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #ecebe9;
}

.mhvm-shipment-timeline li:last-child {
	padding-bottom: 0;
	border-left-color: transparent;
}

.mhvm-shipment-timeline strong {
	display: block;
	font-size: 14px;
	color: #1d2327;
}

.mhvm-shipment-timeline .description {
	font-size: 12px;
	color: #8a8f98;
}

.mhvm-vendor-product-cell {
	display: flex;
	align-items: center;
	gap: 10px;
}

.mhvm-vendor-product-thumb img {
	width: 48px;
	height: 48px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #f0f0f1;
}

@media screen and (max-width: 782px) {
	.mhvm-order-table thead {
		display: none;
	}

	.mhvm-order-table,
	.mhvm-order-table tbody,
	.mhvm-order-table tr,
	.mhvm-order-table td {
		display: block;
		width: 100%;
		min-width: 0;
	}

	.mhvm-vendor-orders .mhvm-product-table-wrap {
		border: none;
		box-shadow: none;
		background: transparent;
		overflow: visible;
	}

	.mhvm-order-table tr {
		margin-bottom: 14px;
		background: #fff;
		border: 1px solid var(--mhvm-border, #dcdcde);
		border-radius: 10px;
		padding: 4px 14px;
		box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
	}

	/* Stacked label-then-value layout, not a flex row: cells that
	   contain more than one inner element (order number + date, status
	   pill + tracking number) stay grouped correctly this way, which a
	   flex "space-between" row does not guarantee once a cell has more
	   than one child node. */
	.mhvm-order-table td {
		padding: 10px 0;
		border-bottom: 1px solid #f4f4f3;
		text-align: left;
	}

	.mhvm-order-table tr td:last-child {
		border-bottom: none;
	}

	.mhvm-order-table td::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		text-transform: uppercase;
		letter-spacing: 0.03em;
		color: #8a8f98;
		margin-bottom: 4px;
	}

	.mhvm-order-table .mhvm-order-date {
		margin-top: 0;
	}

	.mhvm-order-table .mhvm-view-order-btn {
		width: 100%;
		justify-content: center;
	}
}
