/* ============================================================================
 * Кабинет продавца: свои экраны темы (сейчас — список товаров).
 *
 * Классы с префиксом ms-vp__ (vendor products) — чтобы стили Dokan и WooCommerce
 * не пересекались с нашими. Цвета и радиусы берём из токенов темы --ms-*.
 * ==========================================================================*/

.ms-vp {
	--ms-vp-gap: 14px;
	color: var(--ms-ink, #1c2b2d);
	font-size: 14px;
	line-height: 1.4;
}

.ms-vp *,
.ms-vp *::before,
.ms-vp *::after { box-sizing: border-box; }

/* --- Шапка экрана --- */
.ms-vp__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 var(--ms-vp-gap);
}

.ms-vp__title {
	margin: 0;
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
}

.ms-vp__sub {
	margin: 4px 0 0;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 14px;
}

.ms-vp__sub b { color: var(--ms-ink, #1c2b2d); }

/* --- Кнопки --- */
.ms-vp__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 12px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	font: inherit;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background .18s, border-color .18s, color .18s;
}

.ms-vp__btn:hover {
	background: var(--ms-accent-soft, rgba(40, 175, 177, .1));
	border-color: var(--ms-accent, #28afb1);
	color: var(--ms-accent-text, #12787a);
}

.ms-vp__btn--accent,
.ms-vp__btn--accent:hover {
	background: var(--ms-accent, #28afb1);
	border-color: var(--ms-accent, #28afb1);
	color: var(--ms-accent-ink, #0e3b3c);
}

/* --- Сообщения --- */
.ms-vp__warn,
.ms-vp__notice {
	margin: 0 0 var(--ms-vp-gap);
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 14px;
}

.ms-vp__warn { background: #fff4e5; color: #8a4b00; }
.ms-vp__notice { background: var(--ms-accent-soft, rgba(40, 175, 177, .12)); color: var(--ms-accent-text, #12787a); }

/* --- Плитки-фильтры --- */
.ms-vp__tiles {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 10px;
	margin: 0 0 var(--ms-vp-gap);
	padding: 0;
	list-style: none;
}

.ms-vp__tile a {
	display: block;
	padding: 12px 14px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 14px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	text-decoration: none;
	transition: border-color .18s, box-shadow .18s, background .18s;
}

.ms-vp__tile a:hover {
	border-color: var(--ms-accent, #28afb1);
	box-shadow: 0 6px 18px rgba(16, 40, 44, .06);
}

.ms-vp__tile-count {
	display: block;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.1;
}

.ms-vp__tile-label {
	display: block;
	margin-top: 3px;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12.5px;
}

.ms-vp__tile.is-active a {
	border-color: var(--ms-accent, #28afb1);
	background: var(--ms-accent-soft, rgba(40, 175, 177, .08));
	box-shadow: inset 0 0 0 1px var(--ms-accent, #28afb1);
}

.ms-vp__tile.is-empty a { opacity: .55; }

/* --- Фильтры --- */
.ms-vp__filters {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px 12px;
	padding: 14px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 16px;
	background: var(--ms-bg-2, #f4f7f7);
}

.ms-vp__f {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12.5px;
}

.ms-vp__f input[type="search"],
.ms-vp__f input[type="number"],
.ms-vp__f select {
	width: 100%;
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .16));
	border-radius: 10px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	font: inherit;
	font-size: 14px;
}

.ms-vp__f input:focus,
.ms-vp__f select:focus {
	outline: 2px solid rgba(40, 175, 177, .45);
	outline-offset: 1px;
}

.ms-vp__price-range { display: flex; gap: 8px; }
.ms-vp__price-range input { min-width: 0; }

.ms-vp__filters-buttons {
	display: flex;
	align-items: flex-end;
	gap: 8px;
	grid-column: -2 / -1;
}

/* --- Панель массовых действий --- */
.ms-vp__bulk { margin: 0; }

.ms-vp__bulk-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 10px;
	font-size: 13.5px;
}

.ms-vp__bulk-all {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--ms-ink-2, #5d6b6d);
	cursor: pointer;
}

.ms-vp__bulk-select select {
	height: 40px;
	padding: 0 12px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .16));
	border-radius: 10px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	font: inherit;
	font-size: 14px;
}

/* --- Таблица товаров --- */
.ms-vp__table-wrap {
	margin: 0;
	overflow-x: auto;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 16px;
	background: #fff;
	-webkit-overflow-scrolling: touch;
}

.ms-vp__table {
	width: 100%;
	min-width: 1040px;
	border-collapse: collapse;
	font-size: 14px;
}

.ms-vp__table th {
	padding: 12px;
	background: var(--ms-bg-2, #f4f7f7);
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	text-align: left;
	text-transform: uppercase;
	white-space: nowrap;
}

.ms-vp__table td {
	padding: 12px;
	border-top: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	vertical-align: middle;
}

.ms-vp__row--draft,
.ms-vp__row--pending { background: #fffdf6; }

.ms-vp__cell-check { width: 44px; }
.ms-vp__cell-photo { width: 72px; }

.ms-vp__photo img {
	display: block;
	width: 56px;
	height: 56px;
	border-radius: 10px;
	object-fit: cover;
}

.ms-vp__noimg {
	display: block;
	width: 56px;
	height: 56px;
	border: 1px dashed var(--ms-line, rgba(16, 40, 44, .2));
	border-radius: 10px;
	background: var(--ms-bg-2, #f4f7f7);
}

.ms-vp__name {
	color: var(--ms-ink, #1c2b2d);
	font-weight: 600;
	text-decoration: none;
}

.ms-vp__name:hover { color: var(--ms-accent-text, #12787a); text-decoration: underline; }

.ms-vp__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 4px;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12.5px;
}

.ms-vp__stock { font-weight: 600; }
.ms-vp__stock--low { color: #b45309; }

.ms-vp__badge {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--ms-bg-2, #eef1f2);
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

.ms-vp__badge--publish { background: #e8f5e9; color: #1b6e28; }
.ms-vp__badge--pending { background: #fff4e5; color: #8a4b00; }
.ms-vp__badge--private,
.ms-vp__badge--future { background: #eef2ff; color: #3b4c9a; }

.ms-vp__cell-actions { min-width: 200px; }
.ms-vp__action { display: inline; }

.ms-vp__act {
	display: inline-block;
	margin: 0 8px 4px 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ms-accent-text, #12787a);
	font: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
	white-space: nowrap;
}

.ms-vp__act:hover { color: var(--ms-ink, #1c2b2d); }
.ms-vp__act--trash { color: #b3261e; }

/* --- Итог и пагинация --- */
.ms-vp__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: var(--ms-vp-gap);
}

.ms-vp__found { margin: 0; color: var(--ms-ink-2, #5d6b6d); font-size: 13.5px; }

.ms-vp__pager ul {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-vp__pager a,
.ms-vp__pager span.current,
.ms-vp__pager span.dots {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 10px;
	color: var(--ms-ink, #1c2b2d);
	text-decoration: none;
}

.ms-vp__pager a:hover { border-color: var(--ms-accent, #28afb1); background: var(--ms-accent-soft, rgba(40, 175, 177, .1)); }

.ms-vp__pager span.current {
	background: var(--ms-accent, #28afb1);
	border-color: var(--ms-accent, #28afb1);
	color: var(--ms-accent-ink, #0e3b3c);
	font-weight: 700;
}

.ms-vp__pager span.dots { border-color: transparent; }

/* --- Пустое состояние --- */
.ms-vp__empty {
	padding: 48px 20px;
	border: 1px dashed var(--ms-line, rgba(16, 40, 44, .2));
	border-radius: 16px;
	text-align: center;
}

.ms-vp__empty-title { margin: 0; font-size: 18px; font-weight: 700; }
.ms-vp__empty-text { margin: 6px 0 0; color: var(--ms-ink-2, #5d6b6d); }

.ms-vp__empty-actions {
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

/* --- Адаптив --- */
@media (max-width: 1300px) {
	.ms-vp__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ms-vp__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ms-vp__filters-buttons { grid-column: 1 / -1; }
}

/* --- Редактор товара продавца --- */
.ms-vpe { margin: 0; }

.ms-vpe__back {
	display: inline-block;
	margin-bottom: 6px;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 13.5px;
	text-decoration: none;
}

.ms-vpe__back:hover { color: var(--ms-accent-text, #12787a); }

.ms-vpe__errors {
	margin: 0 0 var(--ms-vp-gap);
	padding: 14px 16px;
	border: 1px solid #f3c2bd;
	border-radius: 14px;
	background: #fdecea;
	color: #8a1c14;
}

.ms-vpe__errors ul { margin: 8px 0 0; padding-left: 20px; }

.ms-vpe__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 16px;
	align-items: start;
}

.ms-vpe__main,
.ms-vpe__side {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ms-vpe__box {
	padding: 16px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 16px;
	background: #fff;
}

.ms-vpe__box-title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 700;
}

.ms-vpe__field { margin-bottom: 14px; }
.ms-vpe__field:last-child { margin-bottom: 0; }

.ms-vpe__field label,
.ms-vpe__label {
	display: block;
	margin-bottom: 6px;
	font-size: 13.5px;
	font-weight: 600;
}

.ms-vpe__req { color: #b3261e; }

.ms-vpe__field input[type="text"],
.ms-vpe__field input[type="number"],
.ms-vpe__field select,
.ms-vpe__field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .16));
	border-radius: 10px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	font: inherit;
	font-size: 14px;
}

.ms-vpe__field textarea { resize: vertical; }

.ms-vpe__field input:focus,
.ms-vpe__field select:focus,
.ms-vpe__field textarea:focus {
	outline: 2px solid rgba(40, 175, 177, .45);
	outline-offset: 1px;
}

.ms-vpe__hint {
	margin: 6px 0 0;
	color: var(--ms-ink-2, #5d6b6d);
	font-size: 12.5px;
}

.ms-vpe__row {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 0 14px;
}

.ms-vpe__field--check { margin: 0 0 10px; }

.ms-vpe__check {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 13.5px;
	font-weight: 600;
	cursor: pointer;
}

.ms-vpe__check input[type="checkbox"] {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
}

.ms-vpe__check span { font-weight: 500; }

.ms-vpe__stock {
	margin: 0 0 10px;
	padding: 12px;
	border: 1px dashed var(--ms-line, rgba(16, 40, 44, .2));
	border-radius: 12px;
	background: var(--ms-bg-2, #f4f7f7);
}

.ms-vpe__media {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	gap: 16px;
}

.ms-vpe__image {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 260px;
	height: 200px;
	overflow: hidden;
	border: 1px dashed var(--ms-line, rgba(16, 40, 44, .2));
	border-radius: 12px;
	background: var(--ms-bg-2, #f4f7f7);
}

.ms-vpe__image img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.ms-vpe__media-actions {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 10px;
}

.ms-vpe__gallery {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	min-height: 86px;
}

.ms-vpe__gallery-item {
	position: relative;
	width: 86px;
	height: 86px;
	overflow: hidden;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 12px;
	background: #fff;
}

.ms-vpe__gallery-item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ms-vpe__gallery-tools {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	display: flex;
	justify-content: center;
	gap: 2px;
	padding: 2px;
	background: rgba(255, 255, 255, .88);
	opacity: 0;
	transition: opacity .15s;
}

.ms-vpe__gallery-item:hover .ms-vpe__gallery-tools,
.ms-vpe__gallery-item:focus-within .ms-vpe__gallery-tools { opacity: 1; }

.ms-vpe__gallery-btn {
	width: 22px;
	height: 22px;
	padding: 0;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .16));
	border-radius: 6px;
	background: #fff;
	color: var(--ms-ink, #1c2b2d);
	font-size: 12px;
	line-height: 1;
	cursor: pointer;
}

.ms-vpe__gallery-btn:hover { background: var(--ms-accent-soft, rgba(40, 175, 177, .12)); }

.ms-vpe__cats {
	max-height: 340px;
	overflow: auto;
	padding-right: 4px;
}

.ms-vpe__cats-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ms-vpe__cats-list .ms-vpe__cats-list { margin-left: 18px; }

.ms-vpe__cats-list li { margin: 0 0 6px; }

.ms-vpe__foot {
	position: sticky;
	bottom: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 16px;
	padding: 14px 16px;
	border: 1px solid var(--ms-line, rgba(16, 40, 44, .12));
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 -6px 20px rgba(16, 40, 44, .06);
}

.ms-vpe__foot .ms-vp__act--trash { margin-left: auto; }

@media (max-width: 1100px) {
	.ms-vpe__grid { grid-template-columns: minmax(0, 1fr); }
	.ms-vpe__media { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
	.ms-vpe__row { grid-template-columns: minmax(0, 1fr); }
	.ms-vpe__foot { flex-wrap: wrap; }
	.ms-vpe__foot .ms-vp__act--trash { margin-left: 0; }
}

/* --- Адаптив списка товаров --- */
@media (max-width: 1300px) {
	.ms-vp__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.ms-vp__filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ms-vp__filters-buttons { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
	.ms-vp__head { flex-direction: column; align-items: stretch; }
	.ms-vp__title { font-size: 22px; }
	.ms-vp__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ms-vp__filters { grid-template-columns: minmax(0, 1fr); }
	.ms-vp__foot { flex-direction: column; align-items: flex-start; }
}
