/* =====================================================================
   Vendor store page — Depop-direction.
   Loaded only on Dokan store pages by Compat\VendorStorePage.
   Depends on pb-design-system for brand tokens.
   ===================================================================== */

:root {
	--pb-store-ink: #16202a;
	--pb-store-ink-2: #4a5763;
	--pb-store-line: #e6ebf0;
	--pb-store-line-2: #f1f4f6;
}

/* Kill Motta's blog-page leak so site-content top padding matches the shop. */
body.dokan-store .site-content,
body.motta-dokan-store-page .site-content {
	padding-top: 15px;
}
body.dokan-store .page-header,
body.motta-dokan-store-page .page-header {
	margin-bottom: 4px;
}

.pb-vendor-store {
	margin: 0 0 40px;
}

/* ── Header card ──────────────────────────────────────────────────── */
.pb-store-header {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	gap: 20px;
	align-items: start;
	padding: 20px 0 24px;
	border-bottom: 1px solid var(--pb-store-line);
}
/* minmax(0, 1fr) cap (NOT bare 1fr) — without it the body track grows past
   the viewport on long store names because grid's `1fr` is really
   `minmax(auto, 1fr)`. That spilled the actions row offscreen on mobile. */

.pb-store-header__avatar {
	width: 104px;
	height: 104px;
	border-radius: 50%;
	overflow: hidden;
	flex: 0 0 auto;
	background: var(--pb-store-line-2);
	display: flex;
	align-items: center;
	justify-content: center;
}
.pb-store-header__avatar .pb-avatar__img,
.pb-store-header__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.pb-store-header__avatar .pb-avatar--initials {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	background: var(--pb-av-bg, #0e7c86);
	color: #fff;
	font-size: 38px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: center;
	letter-spacing: -0.02em;
}

.pb-store-header__body {
	min-width: 0;
	padding-top: 4px;
}

.pb-store-header__name {
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 6px;
	color: var(--pb-store-ink);
	letter-spacing: -0.01em;
	word-break: break-word;
}

.pb-store-header__rating {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--pb-store-ink-2);
	margin: 0 0 10px;
}
.pb-stars {
	color: #f5a623;
	letter-spacing: 1px;
	font-size: 15px;
	line-height: 1;
}
.pb-store-header__rating-count {
	color: var(--pb-store-ink-2);
}

.pb-store-header__meta {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: 14px;
	color: var(--pb-store-ink-2);
}
.pb-store-header__meta li {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
}
.pb-store-header__meta svg {
	flex: 0 0 auto;
	color: var(--pb-store-ink-2);
}
.pb-store-meta__follows {
	color: var(--pb-store-ink-2);
}
.pb-store-meta__follows strong {
	color: var(--pb-store-ink);
	font-weight: 600;
}
.pb-store-meta__dot {
	margin: 0 4px;
	color: var(--pb-store-ink-2);
}

/* Followers/Following counts behave as inline link-buttons that open the
   list modal. Strip Motta's button-reset shield so they sit inline like
   the surrounding text. */
.pb-follow-link {
	all: unset;
	cursor: pointer;
	color: var(--pb-store-ink-2);
	border-radius: 4px;
	transition: color 120ms ease;
}
.pb-follow-link strong {
	color: var(--pb-store-ink);
	font-weight: 600;
}
.pb-follow-link:hover,
.pb-follow-link:focus-visible {
	color: var(--pb-store-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
	outline: none;
}

/* ── Actions: Follow + message ──────────────────────────────────────── */
.pb-store-header__actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 0 0 auto;
}

/* "Report shop" sits beside Follow + Message in the header. Render it as a 40px
   bare icon (matching the bare Message icon) instead of a tiny inline text link,
   so the three controls align. The accessible label stays via aria-label. */
.pb-store-header__actions .pb-report-trigger--store {
	width: 40px; height: 40px; min-width: 0 !important; padding: 0 !important;
	display: inline-flex; align-items: center; justify-content: center;
	font-size: 0; line-height: 1 !important;
	color: var(--pb-store-ink, #1a1a1a); background: none; border: 0; cursor: pointer;
	text-decoration: none;
}
.pb-store-header__actions .pb-report-trigger--store:hover { color: var(--pb-brand-teal, #2095b8); }
.pb-store-header__actions .pb-report-trigger--store .pb-report-flag { font-size: 18px; line-height: 1; }

.pb-follow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 40px;
	min-width: 110px !important;       /* Motta button-reset shield */
	padding: 0 20px;
	background: var(--pb-primary, #1aa3a3);
	color: #fff;
	border: 1px solid var(--pb-primary, #1aa3a3);
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	line-height: 1 !important;          /* Motta button-reset shield */
	cursor: pointer;
	transition: background 140ms ease, color 140ms ease, border-color 140ms ease;
}
.pb-follow:hover {
	filter: brightness(1.06);
}
.pb-follow.is-following {
	background: #fff;
	color: var(--pb-store-ink);
	border-color: var(--pb-store-line);
}
.pb-follow.is-following:hover {
	background: #ffeaea;
	color: #b00020;
	border-color: #f4c8c8;
}
.pb-follow.is-following:hover .pb-follow__label::before {
	content: "Unfollow";
}
.pb-follow.is-following:hover .pb-follow__label {
	font-size: 0;
}
.pb-follow.is-following:hover .pb-follow__label::before {
	font-size: 14px;
}
.pb-follow[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.pb-store-message {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px !important;            /* Motta button-reset shield */
	height: 40px;
	min-width: 0 !important;
	padding: 0 !important;
	/* Bare icon — no circle/border/fill (owner: unify interactive icons to no
	   background). Hover = colour change instead of a filled circle. */
	border-radius: 0 !important;
	border: 0 !important;
	color: var(--pb-store-ink);
	background: transparent !important;
	line-height: 1 !important;
	transition: color 120ms ease;
	flex: 0 0 auto;
	cursor: pointer;
}
.pb-store-message:hover,
.pb-store-message:focus-visible {
	background: transparent !important;
	outline: none;
	color: var(--pb-brand-teal, #2095b8);
}
.pb-store-message svg {
	display: block;
}

/* ── Tabs (Listings / Reviews) ─────────────────────────────────────── */
.pb-store-tabs {
	display: flex;
	gap: 24px;
	border-bottom: 1px solid var(--pb-store-line);
	margin-top: 8px;
}
.pb-store-tab {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 12px 0;
	font-size: 14px;
	font-weight: 500;
	color: var(--pb-store-ink-2);
	text-decoration: none;
	border-bottom: 2px solid transparent;
	transition: color 120ms ease, border-color 120ms ease;
	margin-bottom: -1px;        /* overlap parent border-bottom */
}
.pb-store-tab:hover {
	color: var(--pb-store-ink);
}
.pb-store-tab.is-active {
	color: var(--pb-store-ink);
	border-bottom-color: var(--pb-store-ink);
	font-weight: 600;
}
.pb-store-tab__count {
	color: var(--pb-store-ink-2);
	font-weight: 500;
}

/* ── Reviews list ──────────────────────────────────────────────────── */
.pb-store-reviews {
	padding-top: 20px;
}
.pb-store-reviews__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0;
}
.pb-store-review {
	padding: 16px 0;
	border-bottom: 1px solid var(--pb-store-line-2);
}
.pb-store-review:last-child {
	border-bottom: 0;
}
.pb-store-review__head {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 13px;
	color: var(--pb-store-ink-2);
}
.pb-store-review__head .pb-stars {
	font-size: 14px;
}
.pb-store-review__author {
	font-weight: 600;
	color: var(--pb-store-ink);
}
.pb-store-review__dot {
	color: var(--pb-store-ink-2);
}
.pb-store-review__body {
	margin: 0 0 6px;
	color: var(--pb-store-ink);
	font-size: 14px;
	line-height: 1.5;
}
.pb-store-review__product {
	font-size: 12px;
	color: var(--pb-store-ink-2);
	text-decoration: none;
}
.pb-store-review__product:hover {
	color: var(--pb-store-ink);
	text-decoration: underline;
}

/* ── Products section ──────────────────────────────────────────────── */
.pb-store-products {
	padding-top: 24px;
}
.pb-store-products__count {
	font-size: 14px;
	color: var(--pb-store-ink-2);
	font-weight: 500;
	margin: 0 0 16px;
}
.pb-store-empty {
	padding: 40px 0;
	color: var(--pb-store-ink-2);
	text-align: center;
}

/* The shop's products UL is fine as-is — content-product.php gives us
   WooCommerce defaults. Just tighten the surround. */
.pb-store-products .products {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ── Tablet ≤768 ─────────────────────────────────────────────────── */
@media (max-width: 767.98px) {
	.pb-store-header {
		grid-template-columns: auto minmax(0, 1fr);
		grid-template-areas:
			"avatar body"
			"actions actions";
		gap: 16px;
		padding: 16px 0 20px;
	}
	.pb-store-header__avatar {
		grid-area: avatar;
		width: 72px;
		height: 72px;
	}
	.pb-store-header__avatar .pb-avatar--initials {
		font-size: 28px;
	}
	.pb-store-header__body {
		grid-area: body;
		padding-top: 2px;
	}
	.pb-store-header__name {
		font-size: 19px;
		margin-bottom: 4px;
	}
	.pb-store-header__rating {
		font-size: 12px;
		margin-bottom: 6px;
	}
	.pb-store-header__meta {
		font-size: 13px;
	}
	.pb-store-header__actions {
		grid-area: actions;
		gap: 8px;
		justify-content: flex-start;      /* keep Follow + msg as a tight pair */
	}
	.pb-follow {
		flex: 0 0 auto;                   /* don't stretch — sized to content */
		min-width: 128px !important;      /* decent tap target without going full-width */
		max-width: 180px;
	}
	.pb-store-message {
		width: 40px;
		height: 40px;
	}
	.pb-store-products {
		padding-top: 16px;
	}
}

/* ── Trust Badges ───────────────────────────────────────────────────── */
.pb-store-trust {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 20px;
	margin: 10px 0 12px;
}

.pb-store-trust__item {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pb-store-trust__icon {
	flex: 0 0 auto;
	color: var(--pb-primary, #1aa3a3);
	display: block;
}

.pb-store-trust__text {
	display: flex;
	flex-direction: column;
	gap: 1px;
	min-width: 0;
}

.pb-store-trust__title {
	font-size: 13px;
	font-weight: 600;
	color: var(--pb-store-ink);
	line-height: 1.3;
}

.pb-store-trust__subline {
	font-size: 12px;
	color: var(--pb-store-ink-2);
	line-height: 1.3;
}

/* New Seller badge — warm amber accent, same layout as other items. */
.pb-store-trust__item--new_seller .pb-store-trust__icon {
	color: #c08a3e;
}
.pb-store-trust__item--new_seller .pb-store-trust__title {
	color: #7a4f10;
}

/* Mobile ≤767px: stack vertically */
@media (max-width: 767.98px) {
	.pb-store-trust {
		flex-direction: column;
		gap: 8px;
		margin: 8px 0 10px;
	}
}

/* ── Followers / Following list modal ─────────────────────────────────
   Centred card on desktop, bottom-sheet on mobile. Lock body scroll
   while open. Rows are anchor links to each user's store. */
body.pb-follow-modal-open { overflow: hidden; }

.pb-follow-modal {
	position: fixed;
	inset: 0;
	z-index: 1100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}
.pb-follow-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 23, 30, 0.55);
	animation: pbFollowFade 160ms ease-out both;
}
.pb-follow-modal__card {
	position: relative;
	z-index: 2;
	background: #fff;
	width: 100%;
	max-width: 420px;
	max-height: min(640px, 80vh);
	border-radius: var(--pb-radius-lg);
	box-shadow: 0 24px 48px -12px rgba(15, 23, 30, 0.45);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: pbFollowPop 200ms cubic-bezier(.22,.61,.36,1) both;
}
.pb-follow-modal__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--pb-store-line);
}
.pb-follow-modal__title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
	color: var(--pb-store-ink);
}
.pb-follow-modal__close {
	all: unset;
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: var(--pb-store-ink-2);
	cursor: pointer;
}
.pb-follow-modal__close:hover {
	background: var(--pb-store-line-2);
	color: var(--pb-store-ink);
}
.pb-follow-modal__body {
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	padding: 8px 0;
}
.pb-follow-modal__loading,
.pb-follow-modal__empty {
	margin: 0;
	padding: 24px 20px;
	text-align: center;
	color: var(--pb-store-ink-2);
	font-size: 14px;
}
.pb-follow-modal__list {
	list-style: none;
	margin: 0;
	padding: 0;
}
.pb-follow-modal__row {
	border-bottom: 1px solid var(--pb-store-line-2);
}
.pb-follow-modal__row:last-child { border-bottom: 0; }
.pb-follow-modal__row-link {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	color: var(--pb-store-ink);
	text-decoration: none;
	transition: background 120ms ease;
}
.pb-follow-modal__row-link:hover {
	background: var(--pb-store-line-2);
}
.pb-follow-modal__avatar {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	overflow: hidden;
	background: var(--pb-store-line-2);
	display: flex;
	align-items: center;
	justify-content: center;
}
.pb-follow-modal__avatar .pb-avatar__img,
.pb-follow-modal__avatar img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.pb-follow-modal__avatar .pb-avatar--initials {
	width: 100%;
	height: 100%;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--pb-av-bg, #0e7c86);
	color: #fff;
	font-weight: 600;
	font-size: 16px;
}
.pb-follow-modal__name {
	font-size: 14px;
	font-weight: 500;
	color: var(--pb-store-ink);
}
.pb-follow-modal__more {
	margin: 0;
	padding: 10px 16px;
	font-size: 12px;
	color: var(--pb-store-ink-2);
	text-align: center;
	border-top: 1px solid var(--pb-store-line-2);
}

@keyframes pbFollowFade {
	from { opacity: 0; }
	to   { opacity: 1; }
}
@keyframes pbFollowPop {
	from { opacity: 0; transform: scale(0.96) translateY(8px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* Mobile → bottom-sheet (Vinted/Depop pattern). */
@media (max-width: 600px) {
	.pb-follow-modal {
		align-items: flex-end;
		padding: 0;
	}
	.pb-follow-modal__card {
		max-width: 100%;
		width: 100%;
		max-height: 80vh;
		border-radius: 16px 16px 0 0;
		animation: pbFollowSheetIn 220ms cubic-bezier(.22,.61,.36,1) both;
	}
	@keyframes pbFollowSheetIn {
		from { transform: translateY(100%); }
		to   { transform: translateY(0); }
	}
}
