/* =========================================
 * Single Post — Layout, Sidebar, TOC, Related
 * ========================================= */

.nextshop-single-post-wrap {
	padding: 0;
	background: transparent;
	border: none;
}

.nextshop-single-post-layout {
	display: flex;
	flex-wrap: nowrap;
	align-items: flex-start;
	gap: 2rem;
	margin-top: 1.5rem;
}

.nextshop-single-post-main {
	flex: 1 1 0;
	min-width: 0;
}

.nextshop-single-post-sidebar {
	width: 300px;
	flex: 0 0 300px;
	max-width: 300px;
	min-width: 0;
	position: sticky;
	top: calc(var(--nextshop-header-height, 72px) + 1.25rem);
	align-self: flex-start;
}

.nextshop-single-post {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 2.5rem;
}

.nextshop-single-post .nextshop-page-header {
	text-align: right;
	margin-bottom: 2rem;
}

.nextshop-single-post .nextshop-page-title {
	font-size: 2rem;
	line-height: 1.45;
}

.nextshop-post-meta--single {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 1.25rem;
	margin-top: 1.25rem;
	padding-top: 1.25rem;
	border-top: 1px solid #f3f4f6;
	color: #6b7280;
	font-size: 0.9rem;
}

.nextshop-post-meta--single span,
.nextshop-post-meta--single time {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}

.nextshop-post-meta--single i {
	color: var(--ns-primary);
	font-size: 0.95rem;
}

.nextshop-post-meta--single .nextshop-meta-reading {
	color: #9ca3af;
}

.nextshop-single-thumb {
	margin: 0 0 2rem;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
}

.nextshop-single-thumb img {
	display: block;
	width: 100%;
	max-height: 480px;
	object-fit: cover;
	border-radius: 14px;
}

/* Table of Contents */
.nextshop-post-toc {
	background: linear-gradient(135deg, #fafbfc 0%, #f3f4f6 100%);
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 1.25rem 1.5rem;
	margin-bottom: 2rem;
}

.nextshop-post-toc__header {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-bottom: 1rem;
	color: #1f2937;
	font-weight: 800;
	font-size: 1rem;
}

.nextshop-post-toc__header i {
	color: var(--ns-primary);
}

.nextshop-post-toc__list {
	list-style: none;
	margin: 0;
	padding: 0;
	counter-reset: toc;
}

.nextshop-post-toc__item {
	margin: 0;
	padding: 0;
	border-bottom: 1px dashed #e5e7eb;
}

.nextshop-post-toc__item:last-child {
	border-bottom: none;
}

.nextshop-post-toc__item a {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	padding: 0.65rem 0;
	color: #4b5563;
	text-decoration: none;
	font-size: 0.92rem;
	line-height: 1.6;
	transition: color 0.2s ease, padding-inline-start 0.2s ease;
}

.nextshop-post-toc__item a::before {
	counter-increment: toc;
	content: counter(toc) ".";
	flex-shrink: 0;
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--ns-primary);
	min-width: 1.25rem;
}

.nextshop-post-toc__item a:hover,
.nextshop-post-toc__item a.is-active {
	color: var(--ns-primary);
	padding-inline-start: 0.25rem;
}

.nextshop-post-toc__item--h3 a {
	padding-inline-start: 1rem;
	font-size: 0.88rem;
	color: #6b7280;
}

.nextshop-post-toc__item--h3 a::before {
	content: "›";
	counter-increment: none;
	font-size: 1rem;
	min-width: auto;
}

.nextshop-page-content h2[id],
.nextshop-page-content h3[id] {
	scroll-margin-top: calc(var(--nextshop-header-height, 72px) + 1.5rem);
}

/* Sidebar widgets */
.nextshop-post-sidebar-widget {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	padding: 1.35rem;
	margin-bottom: 1.25rem;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
}

.nextshop-post-sidebar-widget__title {
	font-size: 1rem;
	font-weight: 800;
	color: #1f2937;
	margin: 0 0 1rem;
	padding-bottom: 0.65rem;
	border-bottom: 2px solid var(--ns-primary);
	display: inline-block;
}

.nextshop-post-sidebar-search {
	display: flex;
	align-items: stretch;
	gap: 0;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	background: #f9fafb;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nextshop-post-sidebar-search:focus-within {
	border-color: var(--ns-primary);
	box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.1);
	background: #fff;
}

.nextshop-post-sidebar-search__input {
	flex: 1;
	min-width: 0;
	border: none;
	background: transparent;
	padding: 0.75rem 1rem;
	font-size: 0.9rem;
	color: #1f2937;
	outline: none;
}

.nextshop-post-sidebar-search__btn {
	flex-shrink: 0;
	border: none;
	background: var(--ns-primary);
	color: #fff;
	padding: 0 1rem;
	cursor: pointer;
	transition: background 0.2s ease;
}

.nextshop-post-sidebar-search__btn:hover {
	background: #d63044;
}

.nextshop-post-sidebar-cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nextshop-post-sidebar-cats li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.55rem 0;
	border-bottom: 1px solid #f3f4f6;
}

.nextshop-post-sidebar-cats li:last-child {
	border-bottom: none;
}

.nextshop-post-sidebar-cats a {
	color: #4b5563;
	text-decoration: none;
	font-size: 0.9rem;
	transition: color 0.2s ease;
}

.nextshop-post-sidebar-cats a:hover {
	color: var(--ns-primary);
}

.nextshop-post-sidebar-cats__count {
	flex-shrink: 0;
	font-size: 0.78rem;
	color: #9ca3af;
	background: #f3f4f6;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
}

.nextshop-post-tag-cloud {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.nextshop-post-tag-cloud__tag {
	display: inline-block;
	padding: 0.3rem 0.75rem;
	border-radius: 999px;
	background: #f3f4f6;
	color: #4b5563;
	text-decoration: none;
	font-size: calc(0.82rem * var(--tag-weight, 1));
	font-weight: 500;
	transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nextshop-post-tag-cloud__tag:hover,
.nextshop-post-tag-cloud__tag.is-current {
	background: var(--ns-primary);
	color: #fff;
	transform: translateY(-1px);
}

/* Related posts */
.nextshop-related-posts {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e7eb;
}

.nextshop-related-posts__title {
	font-size: 1.35rem;
	font-weight: 800;
	color: #1f2937;
	margin: 0;
	position: relative;
	display: inline-block;
}

.nextshop-related-posts__title::after {
	content: "";
	position: absolute;
	bottom: -8px;
	inset-inline-start: 0;
	width: 40px;
	height: 3px;
	background: var(--ns-primary);
	border-radius: 3px;
}

.nextshop-related-posts__header {
	margin-bottom: 1.5rem;
}

.nextshop-related-posts__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 1.25rem;
}

.nextshop-related-post-card {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	overflow: hidden;
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.nextshop-related-post-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.08);
	border-color: transparent;
}

.nextshop-related-post-card__thumb {
	display: block;
	height: 160px;
	overflow: hidden;
	background: #f3f4f6;
}

.nextshop-related-post-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.nextshop-related-post-card:hover .nextshop-related-post-card__thumb img {
	transform: scale(1.06);
}

.nextshop-related-post-card__no-thumb {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
}

.nextshop-related-post-card__body {
	padding: 1rem 1.15rem 1.15rem;
}

.nextshop-related-post-card__cat {
	display: inline-block;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--ns-primary);
	margin-bottom: 0.4rem;
}

.nextshop-related-post-card__title {
	font-size: 0.95rem;
	font-weight: 800;
	line-height: 1.55;
	margin: 0 0 0.5rem;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.nextshop-related-post-card__title a {
	color: #1f2937;
	text-decoration: none;
	transition: color 0.2s ease;
}

.nextshop-related-post-card__title a:hover {
	color: var(--ns-primary);
}

.nextshop-related-post-card__date {
	font-size: 0.8rem;
	color: #9ca3af;
}

.nextshop-single-post-main .nextshop-post-nav {
	margin-top: 2rem;
}

.nextshop-single-post-main .comment-respond,
.nextshop-single-post-main #comments,
.nextshop-single-post-main .nextshop-comments {
	margin-top: 2rem;
}

/* =========================================
 * Comments Section
 * ========================================= */
.nextshop-comments {
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	padding: 2rem;
}

.nextshop-comments__header {
	margin-bottom: 1.5rem;
	padding-bottom: 1rem;
	border-bottom: 1px solid #f3f4f6;
}

.nextshop-comments__title {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	color: #1f2937;
}

.nextshop-comments__title i {
	color: var(--ns-primary);
	font-size: 1.1rem;
}

.nextshop-comments__closed {
	margin: 0 0 1.5rem;
	padding: 0.85rem 1rem;
	border-radius: 10px;
	background: #fef3c7;
	color: #92400e;
	font-size: 0.9rem;
}

.nextshop-comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.nextshop-comment-list .children {
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
	padding-inline-start: 1.25rem;
	border-inline-start: 2px solid #f3f4f6;
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.nextshop-comment__card {
	display: flex;
	gap: 1rem;
	padding: 1.15rem 1.25rem;
	background: #f9fafb;
	border: 1px solid #e5e7eb;
	border-radius: 14px;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nextshop-comment:hover > .nextshop-comment__card {
	border-color: #d1d5db;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.nextshop-comment__avatar img {
	display: block;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nextshop-comment__body {
	flex: 1;
	min-width: 0;
}

.nextshop-comment__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem 0.65rem;
	margin-bottom: 0.65rem;
}

.nextshop-comment__author {
	font-style: normal;
	font-weight: 800;
	font-size: 0.95rem;
	color: #1f2937;
}

.nextshop-comment__date {
	font-size: 0.8rem;
	color: #9ca3af;
}

.nextshop-comment__time-sep {
	opacity: 0.6;
}

.nextshop-comment__moderation {
	display: block;
	margin-top: 0.35rem;
	font-size: 0.82rem;
	color: #d97706;
	font-style: normal;
}

.nextshop-comment__content {
	color: #4b5563;
	font-size: 0.95rem;
	line-height: 1.85;
}

.nextshop-comment__content p {
	margin: 0 0 0.75rem;
}

.nextshop-comment__content p:last-child {
	margin-bottom: 0;
}

.nextshop-comment__footer {
	margin-top: 0.85rem;
}

.nextshop-comment__footer a {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--ns-primary);
	text-decoration: none;
	padding: 0.25rem 0;
	transition: opacity 0.2s ease;
}

.nextshop-comment__footer a:hover {
	opacity: 0.8;
}

.nextshop-comments-pagination {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid #f3f4f6;
}

.nextshop-comments-pagination__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.nextshop-comments-pagination__links .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.65rem;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	color: #4b5563;
	text-decoration: none;
	font-size: 0.88rem;
	transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.nextshop-comments-pagination__links .page-numbers:hover,
.nextshop-comments-pagination__links .page-numbers.current {
	border-color: var(--ns-primary);
	color: var(--ns-primary);
	background: rgba(239, 57, 78, 0.06);
}

/* Comment form */
.nextshop-comment-respond {
	margin-top: 2rem;
	padding-top: 2rem;
	border-top: 1px solid #f3f4f6;
}

.nextshop-comments:not(:has(.nextshop-comment-list li)) .nextshop-comment-respond {
	margin-top: 0;
	padding-top: 0;
	border-top: none;
}

.nextshop-comment-form__title {
	margin: 0 0 1.25rem;
	font-size: 1.1rem;
	font-weight: 800;
	color: #1f2937;
}

.nextshop-comment-form__cancel a {
	font-size: 0.85rem;
	color: #6b7280;
	text-decoration: none;
	margin-inline-start: 0.5rem;
}

.nextshop-comment-form__cancel a:hover {
	color: var(--ns-primary);
}

.nextshop-comment-form__logged-in {
	margin: 0 0 1rem;
	font-size: 0.88rem;
	color: #6b7280;
}

.nextshop-comment-form__logged-in a {
	color: var(--ns-primary);
	text-decoration: none;
}

.nextshop-comment-form {
	display: grid;
	gap: 1rem;
}

.nextshop-comment-form__field label {
	display: block;
	margin-bottom: 0.4rem;
	font-size: 0.88rem;
	font-weight: 600;
	color: #374151;
}

.nextshop-comment-form__field .required {
	color: var(--ns-primary);
}

.nextshop-comment-form__field input[type="text"],
.nextshop-comment-form__field input[type="email"],
.nextshop-comment-form__field textarea {
	width: 100%;
	padding: 0.75rem 0.9rem;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	font-family: inherit;
	font-size: 0.92rem;
	color: #1f2937;
	background: #fff;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	resize: vertical;
}

.nextshop-comment-form__field input:focus,
.nextshop-comment-form__field textarea:focus {
	outline: none;
	border-color: var(--ns-primary);
	box-shadow: 0 0 0 3px rgba(239, 57, 78, 0.1);
}

.nextshop-comment-form__field--comment textarea {
	min-height: 140px;
}

.nextshop-comment-form__fields-row {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem;
}

.nextshop-comment-form p.comment-form-author,
.nextshop-comment-form p.comment-form-email,
.nextshop-comment-form p.comment-form-url {
	margin: 0;
}

.nextshop-comment-form__submit-wrap {
	margin: 0;
}

.nextshop-comment-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	border: none;
	border-radius: 10px;
	padding: 0.8rem 1.5rem;
	background: var(--ns-primary);
	color: #fff;
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.nextshop-comment-form__submit:hover {
	background: #d63044;
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(239, 57, 78, 0.25);
}

.nextshop-comment-form__submit:active {
	transform: translateY(0);
}

.nextshop-comment-form .must-log-in {
	margin: 0;
	padding: 0.85rem 1rem;
	border-radius: 10px;
	background: #f3f4f6;
	color: #4b5563;
	font-size: 0.9rem;
}

.nextshop-comment-form .must-log-in a {
	color: var(--ns-primary);
	font-weight: 600;
}

@media (max-width: 768px) {
	.nextshop-comments {
		padding: 1.35rem;
	}

	.nextshop-comment__card {
		padding: 1rem;
	}

	.nextshop-comment-list .children {
		padding-inline-start: 0.75rem;
	}

	.nextshop-comment-form__fields-row,
	.nextshop-comment-form:has(.nextshop-comment-form__field--author) {
		grid-template-columns: 1fr;
	}
}

/* Name + email side by side when both present */
@media (min-width: 600px) {
	.nextshop-comment-form:has(.nextshop-comment-form__field--author):has(.nextshop-comment-form__field--email) {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.nextshop-comment-form:has(.nextshop-comment-form__field--author):has(.nextshop-comment-form__field--email) .nextshop-comment-form__field--comment,
	.nextshop-comment-form:has(.nextshop-comment-form__field--author):has(.nextshop-comment-form__field--email) .nextshop-comment-form__logged-in,
	.nextshop-comment-form:has(.nextshop-comment-form__field--author):has(.nextshop-comment-form__field--email) .nextshop-comment-form__submit-wrap,
	.nextshop-comment-form:has(.nextshop-comment-form__field--author):has(.nextshop-comment-form__field--email) .must-log-in {
		grid-column: 1 / -1;
	}
}

/* Responsive */
@media (max-width: 1024px) {
	.nextshop-related-posts__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.nextshop-single-post-layout {
		flex-direction: column;
	}

	.nextshop-single-post-sidebar {
		width: 100%;
		flex: none;
		max-width: none;
		position: static;
		order: 2;
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}

	.nextshop-post-sidebar-widget {
		margin-bottom: 0;
	}

	.nextshop-post-sidebar-widget--search {
		grid-column: 1 / -1;
	}
}

@media (max-width: 768px) {
	.nextshop-single-post {
		padding: 1.5rem;
	}

	.nextshop-single-post .nextshop-page-title {
		font-size: 1.65rem;
	}

	.nextshop-single-post-sidebar {
		grid-template-columns: 1fr;
	}

	.nextshop-related-posts__grid {
		grid-template-columns: 1fr;
	}
}
