/* Public seller page: /anunturi/vanzator/{id} */

.vendor-page { --v-line: #e2e8f0; --v-ink: #0f172a; --v-muted: #64748b; --v-soft: #eef4f8; }
.vendor-page :focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ── Header ── */
.vendor-head {
	display: flex;
	align-items: center;
	gap: 1rem;
	background: #fff;
	border: 1px solid var(--v-line);
	border-radius: 14px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 1.5rem;
}
.vendor-avatar {
	width: 64px;
	height: 64px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	overflow: hidden;
	border-radius: 18px;
	background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
	color: #fff;
	font-family: 'Sora', sans-serif;
	font-size: 1.6rem;
	font-weight: 700;
}
.vendor-avatar img { width: 100%; height: 100%; object-fit: cover; }
.vendor-id { min-width: 0; }
.vendor-id h1 {
	font-family: 'Sora', sans-serif;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.25;
	color: var(--v-ink);
	overflow-wrap: anywhere;
}
.vendor-id p { margin-top: 0.15rem; font-size: 0.9rem; color: var(--v-muted); }

/* ── Layout ── */
.vendor-layout {
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 1.75rem;
	align-items: start;
	scroll-margin-top: 90px;
}
.vendor-main { min-width: 0; }

/* ── Categories ── */
.vc-panel {
	position: sticky;
	top: 90px;
	max-height: calc(100vh - 110px);
	overflow-y: auto;
	background: #fff;
	border: 1px solid var(--v-line);
	border-radius: 14px;
	padding: 0.5rem;
}
.vc-head { display: flex; align-items: center; justify-content: space-between; padding: 0.6rem 0.75rem 0.5rem; }
.vc-head h2 { font-family: 'Sora', sans-serif; font-size: 1rem; font-weight: 700; color: var(--v-ink); }
.vc-close { display: none; }
.vc-list { display: flex; flex-direction: column; gap: 1px; }
.vc-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	min-height: 40px;
	padding: 0.45rem 0.75rem;
	border-radius: 9px;
	font-size: 0.925rem;
	font-weight: 600;
	color: #334155;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.vc-link--sub { padding-left: 1.6rem; font-weight: 400; color: #475569; }
.vc-link:hover { background: #f1f5f9; color: var(--v-ink); }
.vc-link.is-active { background: var(--v-soft); color: var(--primary-dark); font-weight: 700; box-shadow: inset 3px 0 0 var(--primary); }
.vc-name { min-width: 0; overflow-wrap: anywhere; }
.vc-count { flex-shrink: 0; font-size: 0.8rem; font-weight: 500; color: var(--v-muted); font-variant-numeric: tabular-nums; }
.vc-backdrop { position: fixed; inset: 0; z-index: 1090; background: rgba(15, 23, 42, 0.5); }
.vc-backdrop[hidden] { display: none; }

/* ── Search ── */
.vendor-search { display: flex; gap: 0.5rem; margin-bottom: 1rem; }
.vendor-search-box {
	position: relative;
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	height: 46px;
	background: #fff;
	border: 1.5px solid #cbd5e1;
	border-radius: 11px;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.vendor-search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(45, 90, 123, 0.16); }
.vendor-search-box > svg { flex-shrink: 0; margin-left: 0.8rem; color: var(--v-muted); }
.vendor-search-box input {
	flex: 1;
	min-width: 0;
	height: 100%;
	padding: 0 0.6rem;
	border: 0;
	outline: 0;
	background: transparent;
	color: var(--v-ink);
	font: inherit;
	font-size: 16px; /* below 16px iOS zooms the page on focus */
}
.vendor-search-box input::placeholder { color: #94a3b8; text-overflow: ellipsis; }
.vendor-search-box input::-webkit-search-cancel-button { display: none; }
.vendor-search-clear {
	flex-shrink: 0;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	color: var(--v-muted);
}
.vendor-search-clear:hover { color: var(--v-ink); }
.vendor-search-btn {
	flex-shrink: 0;
	height: 46px;
	padding: 0 1.4rem;
	border: 0;
	border-radius: 11px;
	background: var(--primary);
	color: #fff;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease;
}
.vendor-search-btn:hover { background: var(--primary-dark); }

/* ── Toolbar & active filters ── */
.vendor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.875rem; }
.vendor-count { min-width: 0; font-size: 1rem; font-weight: 700; color: var(--v-ink); overflow-wrap: anywhere; }
.vc-open { display: none; }
.vendor-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin: 0 0 1rem; padding: 0; list-style: none; }
.vendor-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	max-width: 100%;
	min-height: 36px;
	padding: 0.25rem 0.7rem 0.25rem 0.85rem;
	border-radius: 999px;
	background: var(--v-soft);
	color: var(--primary-dark);
	font-size: 0.875rem;
	font-weight: 600;
	text-decoration: none;
}
.vendor-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15rem; }
.vendor-chip b { font-size: 1.1rem; line-height: 1; font-weight: 500; }
.vendor-chip:hover { background: #dfeaf2; }
.vendor-chip-reset { font-size: 0.875rem; font-weight: 600; color: var(--v-muted); text-decoration: underline; padding: 0.4rem 0.25rem; }

/* ── Results ── */
.vendor-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; }
.vendor-grid > a { min-width: 0; display: flex; flex-direction: column; }
.vendor-grid > a > .p-6 { padding: 0.875rem; }
.vendor-grid h3 { font-size: 0.975rem; line-height: 1.35; overflow-wrap: anywhere; }

.vendor-empty {
	padding: 2.5rem 1.5rem;
	text-align: center;
	background: #fff;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
}
.vendor-empty h3 { font-size: 1.1rem; font-weight: 700; color: var(--v-ink); overflow-wrap: anywhere; }
.vendor-empty p { margin: 0.4rem 0 1.25rem; color: var(--v-muted); }
.vendor-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.625rem; }
.vendor-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	min-height: 44px;
	padding: 0.5rem 1.1rem;
	border: 1.5px solid #cbd5e1;
	border-radius: 10px;
	background: #fff;
	color: #334155;
	font-size: 0.925rem;
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: anywhere;
}
.vendor-btn:hover { border-color: var(--primary); color: var(--primary); }
.vendor-btn--primary { border-color: var(--primary); background: var(--primary); color: #fff; }
.vendor-btn--primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }

/* ── Pagination ── */
.vp { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 2rem; }
.vp-pages { display: flex; align-items: center; gap: 0.25rem; margin: 0; padding: 0; list-style: none; }
.vp-num,
.vp-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 44px;
	border: 1px solid var(--v-line);
	border-radius: 10px;
	background: #fff;
	color: #334155;
	font-weight: 600;
	font-size: 0.925rem;
	font-variant-numeric: tabular-nums;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.vp-num { min-width: 44px; padding: 0 0.5rem; }
.vp-step { gap: 0.3rem; padding: 0 0.9rem; }
a.vp-num:hover,
a.vp-step:hover { border-color: var(--primary); color: var(--primary); }
.vp-num.is-current,
a.vp-num.is-current:hover { background: var(--primary); border-color: var(--primary); color: #fff; }
.vp-step.is-disabled { color: #cbd5e1; background: #f8fafc; }
.vp-gap { width: 28px; text-align: center; color: var(--v-muted); }
.vp-status { display: none; font-size: 0.925rem; color: var(--v-muted); white-space: nowrap; }
.vp-status b { color: var(--v-ink); }

@media (max-width: 1199px) {
	.vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ── Mobile: categories become a bottom sheet, closed by default ── */
@media (max-width: 899px) {
	.vendor-layout { display: block; }
	.vendor-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

	.vc-open {
		display: inline-flex;
		align-items: center;
		gap: 0.4rem;
		flex-shrink: 0;
		height: 44px;
		padding: 0 0.95rem;
		border: 1.5px solid #cbd5e1;
		border-radius: 10px;
		background: #fff;
		color: #334155;
		font-size: 0.925rem;
		font-weight: 600;
		cursor: pointer;
	}
	.vc-open-dot {
		display: inline-grid;
		place-items: center;
		width: 20px;
		height: 20px;
		border-radius: 50%;
		background: var(--primary);
		color: #fff;
		font-size: 0.72rem;
	}

	.vc-panel {
		position: fixed;
		top: auto;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 1100;
		max-height: 82vh;
		max-height: 82dvh;
		padding: 0 0.5rem calc(0.75rem + env(safe-area-inset-bottom));
		border: 0;
		border-radius: 18px 18px 0 0;
		box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.22);
		transform: translateY(100%);
		visibility: hidden;
		transition: transform 0.25s ease, visibility 0s linear 0.25s;
	}
	.vc-panel.is-open {
		transform: translateY(0);
		visibility: visible;
		transition: transform 0.25s ease;
	}
	.vc-head {
		position: sticky;
		top: 0;
		z-index: 1;
		margin: 0 -0.5rem 0.25rem;
		padding: 0.5rem 0.5rem 0.5rem 1.25rem;
		background: #fff;
		border-bottom: 1px solid var(--v-line);
	}
	.vc-head h2 { font-size: 1.1rem; }
	.vc-close {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		border: 0;
		border-radius: 10px;
		background: transparent;
		color: var(--v-muted);
		cursor: pointer;
	}
	.vc-link { min-height: 48px; font-size: 1rem; }
	.vc-count { font-size: 0.875rem; }
}

@media (max-width: 639px) {
	.vendor-head { padding: 0.875rem 1rem; gap: 0.75rem; margin-bottom: 1rem; }
	.vendor-avatar { width: 52px; height: 52px; border-radius: 14px; font-size: 1.3rem; }
	.vendor-id h1 { font-size: 1.2rem; }
	.vendor-id p { font-size: 0.825rem; }

	.vendor-search-btn { padding: 0 1rem; }
	.vendor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.625rem; }
	.vendor-grid > a > .relative { height: 9.5rem; }
	.vendor-grid > a > .p-6 { padding: 0.625rem; }
	.vendor-grid > a > .p-6 p { display: none; }
	.vendor-grid h3 { font-size: 0.9rem; margin-bottom: 0.35rem; }
	.vendor-grid > a .absolute.top-3.right-3 { top: 0.4rem; right: 0.4rem; padding: 0.15rem 0.5rem; font-size: 0.78rem; }
	.vendor-grid > a button.absolute {
		top: 0.4rem;
		left: 0.4rem;
		display: flex;
		align-items: center !important; /* a global mobile rule top-aligns icons in buttons */
		justify-content: center;
		width: 2rem;
		height: 2rem;
		min-width: 0;
		min-height: 0;
		padding: 0;
	}
	.vendor-grid > a button.absolute svg { display: block; margin: 0 !important; }

	/* Slim pagination: previous, "Pagina x din y", next */
	.vp { justify-content: space-between; }
	.vp-pages { display: none; }
	.vp-status { display: inline; }
	.vp-step { padding: 0 0.7rem; }
}

@media (prefers-reduced-motion: reduce) {
	.vc-panel,
	.vc-panel.is-open { transition: none; }
}
