/*
 * Recensionssidan (Template Name: Reviews, se page-reviews.php). Återanvänder
 * medvetet .np-review-title/.np-review-text/.np-review-avatar/.np-review-name/
 * .np-review-location/.np-star-rating/.np-star-box från customer-reviews.css
 * (enqueue:ad som dependency, se functions.php) istället för att duplicera
 * dem - den här filen lägger bara till sidans EGNA layout-klasser
 * (hero/summering/flikar/piller/kort-grid/sidnumrering).
 *
 * Mobil-först: staplad en-kolumnslayout som grundläge, tvåkolumns-element
 * (sammanfattning, kontroller) blir sida-vid-sida först från 768px.
 */

.np-reviews-page {
	padding-block: 32px 60px;
}

/* --- Hero -------------------------------------------------------------- */

.np-reviews-page-hero {
	max-width: 720px;
	margin: 0 auto 28px;
	text-align: center;
}

.np-reviews-page-hero h1 {
	margin: 0 0 12px;
	font-size: 28px;
	line-height: 1.2;
}

.np-reviews-page-hero p {
	margin: 0;
	color: #555;
	font-size: 15px;
	line-height: 1.5;
}

/* --- Summering: snittbetyg + fördelning + CTA --------------------------- */

.np-reviews-page-summary {
	max-width: 720px;
	margin: 0 auto 32px;
	padding: 24px;
	border: 1px solid #eee;
	border-radius: 12px;
}

.np-reviews-page-summary-top {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 20px;
}

.np-reviews-page-average {
	font-size: 24px;
	font-weight: 800;
	line-height: 1;
}

.np-reviews-page-total {
	color: #555;
	font-size: 14px;
}

.np-reviews-page-summary-bottom {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.np-reviews-page-breakdown {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.np-reviews-page-breakdown-row {
	display: grid;
	grid-template-columns: 78px 1fr 34px;
	align-items: center;
	gap: 10px;
	padding: 4px 6px;
	border: none;
	border-radius: 6px;
	background: none;
	cursor: pointer;
	font: inherit;
	text-align: left;
	transition: background-color 0.15s ease;
}

.np-reviews-page-breakdown-row:hover,
.np-reviews-page-breakdown-row.is-active {
	background: #f5f5f5;
}

.np-reviews-page-breakdown-bar {
	position: relative;
	display: block;
	height: 8px;
	border-radius: 4px;
	background: #e3e5e8;
	overflow: hidden;
}

.np-reviews-page-breakdown-fill {
	position: absolute;
	inset: 0 auto 0 0;
	background: #00b67a;
	border-radius: 4px;
}

.np-reviews-page-breakdown-count {
	color: #555;
	font-size: 13px;
	text-align: right;
}

.np-reviews-page-write-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 20px;
	border-radius: 10px;
	background: var( --wd-primary-color, #8a1f1f );
	color: #fff !important;
	font-size: 15px;
	font-weight: 700;
	text-decoration: none !important;
	transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.np-reviews-page-write-btn:hover {
	filter: brightness( 0.92 );
	transform: translateY( -1px );
	box-shadow: 0 6px 14px rgba( 138, 31, 31, 0.25 );
}

/* --- Review highlights --------------------------------------------------- */

.np-reviews-page-highlights {
	max-width: 720px;
	margin: 0 auto 32px;
}

.np-reviews-page-highlights h2 {
	margin: 0 0 12px;
	font-size: 18px;
}

.np-reviews-page-highlights ul {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.np-reviews-page-highlights a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 4px;
	color: #111;
	text-decoration: none;
	border-bottom: 1px solid #f0f0f0;
}

.np-reviews-page-highlights a:hover span:first-child {
	text-decoration: underline;
}

.np-reviews-page-highlight-arrow {
	flex: 0 0 auto;
	color: var( --wd-primary-color, #8a1f1f );
	font-size: 18px;
}

/* --- Flikar + kontroller (filter/sortering) ------------------------------ */

.np-reviews-page-list-section {
	max-width: 900px;
	margin: 0 auto;
}

.np-reviews-page-tabs {
	display: flex;
	gap: 4px;
	overflow-x: auto;
	border-bottom: 1px solid #eee;
	margin-bottom: 20px;
}

.np-reviews-page-tab {
	flex: 0 0 auto;
	padding: 10px 14px;
	border: none;
	border-bottom: 2px solid transparent;
	background: none;
	color: #777;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
	transition: color 0.15s ease, border-color 0.15s ease;
}

.np-reviews-page-tab:hover:not( .is-active ) {
	color: #333;
	border-bottom-color: #ddd;
}

.np-reviews-page-tab.is-active {
	color: #111;
	border-bottom-color: var( --wd-primary-color, #8a1f1f );
}

.np-reviews-page-controls {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 20px;
}

.np-reviews-page-rating-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.np-reviews-page-pill {
	padding: 6px 12px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #555;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.np-reviews-page-pill:hover {
	border-color: var( --wd-primary-color, #8a1f1f );
	background: #fdf4f4;
	color: var( --wd-primary-color, #8a1f1f );
}

.np-reviews-page-pill.is-active {
	background: var( --wd-primary-color, #8a1f1f );
	border-color: var( --wd-primary-color, #8a1f1f );
	color: #fff;
}

.np-reviews-page-sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #555;
}

.np-reviews-page-sort select {
	padding: 6px 10px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font: inherit;
	font-size: 13px;
	background: #fff;
}

.np-reviews-page-empty {
	padding: 40px 0;
	text-align: center;
	color: #777;
}

/* --- Recensionskort -------------------------------------------------- */

.np-reviews-page-cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.np-reviews-page-card {
	padding: 20px;
	border: 1px solid #eee;
	border-radius: 12px;
}

.np-reviews-page-card-author {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 14px;
}

.np-reviews-page-card-author-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.np-reviews-page-card-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-size: 12px;
	color: #888;
}

.np-reviews-page-card-badge {
	display: inline-flex;
	align-items: center;
	padding: 2px 8px;
	border: 1px solid #d5e9e0;
	border-radius: 999px;
	color: #00875a;
	font-weight: 700;
	font-size: 11px;
}

/* Full text i kortet - INGEN klippning, till skillnad från samma klasser i
   karusellen på startsidan (se customer-reviews.css: den klipper med
   -webkit-line-clamp eftersom kortet där är litet och skrollbart). */
.np-reviews-page-card .np-review-title,
.np-reviews-page-card .np-review-text {
	-webkit-line-clamp: unset;
	line-clamp: unset;
	overflow: visible;
}

.np-reviews-page-card-body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}

.np-reviews-page-card-body .np-star-rating {
	margin-bottom: 4px;
}

.np-reviews-page-card-tag {
	display: inline-flex;
	margin-top: 8px;
	padding: 6px 10px;
	border-radius: 8px;
	background: #f7f3ea;
	color: #7a6a45;
	font-size: 12px;
}

/* --- Sidnumrering ------------------------------------------------------- */

.np-reviews-page-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 28px;
}

.np-reviews-page-page-btn {
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid #ddd;
	border-radius: 8px;
	background: #fff;
	color: #555;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.np-reviews-page-page-btn:hover:not(:disabled) {
	border-color: var( --wd-primary-color, #8a1f1f );
	background: #fdf4f4;
	color: var( --wd-primary-color, #8a1f1f );
}

.np-reviews-page-page-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.np-reviews-page-page-btn.is-active {
	background: var( --wd-primary-color, #8a1f1f );
	border-color: var( --wd-primary-color, #8a1f1f );
	color: #fff;
}

.np-reviews-page-page-dots {
	color: #999;
	padding: 0 2px;
}

/* --- "Write a review"-modalen -------------------------------------------
   Mobil-först: dialogen fyller nästan hela bredden med liten marginal,
   blir en fast, smalare bredd centrerad i fönstret från 768px. */

body.np-review-modal-open {
	overflow: hidden;
}

.np-review-modal {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

/* Author-CSS:ens display:flex ovan vinner annars över webbläsarens
   inbyggda [hidden]{display:none} (UA-stylesheet har lägre prioritet än
   author-stylesheets oavsett specificitet) - utan denna regel ligger
   modalen kvar osynlig men FORTFARANDE klickbar ovanpå hela sidan när
   .np-review-modal har hidden-attributet. */
.np-review-modal[hidden] {
	display: none;
}

.np-review-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba( 20, 20, 20, 0.55 );
}

.np-review-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 440px;
	max-height: calc( 100vh - 32px );
	overflow-y: auto;
	padding: 32px 24px;
	border-radius: 14px;
	background: #fff;
	text-align: center;
}

.np-review-modal-close {
	position: absolute;
	top: 12px;
	right: 12px;
	width: 32px;
	height: 32px;
	border: none;
	border-radius: 50%;
	background: none;
	color: #555;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.np-review-modal-close:hover {
	background: #f5f5f5;
	color: #111;
	transform: scale( 1.08 );
}

.np-review-modal-step h2,
.np-review-modal-success h2 {
	margin: 0 0 8px;
	font-size: 22px;
}

.np-review-modal-step p,
.np-review-modal-success p {
	margin: 0 0 24px;
	color: #555;
	font-size: 14px;
	line-height: 1.5;
}

.np-review-modal-stars {
	display: flex;
	justify-content: center;
	gap: 10px;
	margin-bottom: 8px;
}

.np-review-modal-star {
	padding: 0;
	border: none;
	background: none;
	color: #ddd;
	font-size: 34px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.1s ease, transform 0.1s ease;
}

.np-review-modal-star:hover,
.np-review-modal-star.is-filled {
	color: #f5a623;
}

.np-review-modal-star:hover {
	transform: scale( 1.08 );
}

.np-review-modal-star-labels {
	display: flex;
	justify-content: space-between;
	max-width: 220px;
	margin: 0 auto;
	color: #888;
	font-size: 12px;
}

.np-review-modal-form {
	text-align: left;
}

.np-review-modal-change-rating {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 16px;
	padding: 0;
	border: none;
	background: none;
	color: #555;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.np-review-modal-change-rating [data-review-selected-stars] {
	color: #f5a623;
	text-decoration: none;
	font-size: 15px;
	letter-spacing: 1px;
}

.np-review-modal-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.np-review-modal-subject-toggle {
	display: flex;
	gap: 8px;
	margin-bottom: 10px;
}

.np-review-modal-subject-btn {
	padding: 8px 14px;
	border: 1px solid #ddd;
	border-radius: 999px;
	background: #fff;
	color: #555;
	font: inherit;
	font-size: 13px;
	cursor: pointer;
	transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.np-review-modal-subject-btn:hover {
	border-color: var( --wd-primary-color, #8a1f1f );
	background: #fdf4f4;
	color: var( --wd-primary-color, #8a1f1f );
}

.np-review-modal-subject-btn.is-active {
	background: var( --wd-primary-color, #8a1f1f );
	border-color: var( --wd-primary-color, #8a1f1f );
	color: #fff;
}

.np-review-modal-product-picker {
	position: relative;
}

.np-review-modal-product-search {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
}

.np-review-modal-product-suggestions {
	position: absolute;
	z-index: 1;
	left: 0;
	right: 0;
	top: calc( 100% + 4px );
	max-height: 220px;
	overflow-y: auto;
	margin: 0;
	padding: 6px;
	list-style: none;
	border: 1px solid #eee;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 8px 20px rgba( 0, 0, 0, 0.1 );
}

.np-review-modal-product-suggestions li {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px 10px;
	border-radius: 6px;
	font-size: 13px;
	cursor: pointer;
}

.np-review-modal-product-suggestions li:hover {
	background: #f5f5f5;
}

.np-review-modal-product-suggestions li img {
	flex: 0 0 auto;
	width: 28px;
	height: 28px;
	border-radius: 6px;
	object-fit: cover;
	background: #f5f5f5;
}

.np-review-modal-product-empty {
	color: #999;
	cursor: default !important;
}

.np-review-modal-product-empty:hover {
	background: none !important;
}

/* Se motsvarande kommentar vid .np-review-modal[hidden] - samma anledning. */
.np-review-modal-product-selected[hidden] {
	display: none;
}

.np-review-modal-product-selected {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	border: 1px solid #d5e9e0;
	border-radius: 8px;
	background: #f3faf7;
	font-size: 13px;
	font-weight: 600;
}

.np-review-modal-product-selected img {
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	border-radius: 6px;
	object-fit: cover;
	background: #fff;
}

.np-review-modal-product-selected [data-review-product-selected-name] {
	flex: 1 1 auto;
}

.np-review-modal-product-selected button {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: none;
	border-radius: 50%;
	background: none;
	color: #555;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.np-review-modal-product-selected button:hover {
	background: #e5f0eb;
}

.np-review-modal-field {
	margin-bottom: 14px;
}

.np-review-modal-field label {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
}

.np-review-modal-field input,
.np-review-modal-field textarea {
	width: 100%;
	padding: 10px 12px;
	border: 1px solid #ddd;
	border-radius: 8px;
	font: inherit;
	font-size: 14px;
}

.np-review-modal-row {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.np-review-modal-privacy {
	margin: -4px 0 14px;
	color: #888;
	font-size: 12px;
}

.np-review-modal-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.np-review-modal-submit {
	width: 100%;
	padding: 13px 20px;
	border: none;
	border-radius: 10px;
	background: var( --wd-primary-color, #8a1f1f );
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: filter 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.np-review-modal-submit:hover:not(:disabled) {
	filter: brightness( 0.92 );
	transform: translateY( -1px );
	box-shadow: 0 6px 14px rgba( 138, 31, 31, 0.25 );
}

.np-review-modal-submit:disabled {
	opacity: 0.6;
	cursor: default;
}

.np-review-modal-status {
	margin: 10px 0 0;
	font-size: 13px;
	text-align: center;
}

.np-review-modal-status.is-error {
	color: #c0392b;
}

.np-review-modal-status.is-success {
	color: #00875a;
}

.np-review-modal-success .np-review-modal-done {
	padding: 12px 22px;
	border: 1px solid #ddd;
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

/* --- Desktop/surfplatta -------------------------------------------------- */

@media ( min-width: 768px ) {
	.np-reviews-page-hero h1 {
		font-size: 34px;
	}

	.np-reviews-page-summary-bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.np-reviews-page-breakdown {
		flex: 1 1 auto;
		max-width: 420px;
	}

	.np-reviews-page-controls {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}

	.np-reviews-page-card-author {
		align-items: center;
	}

	.np-review-modal-row {
		flex-direction: row;
		gap: 12px;
	}

	.np-review-modal-row .np-review-modal-field {
		flex: 1 1 0;
	}
}
