/*
 * Natural Peptides Store Reviews - frontend štýly.
 * CSS premenné umožňujú jednoduché prispôsobenie dizajnu bez zásahu do štruktúry.
 */

:root {
	/* Zladené s Woodmart témou Natural Peptides (--wd-* premenné z live webu). */
	--nps-star-color: #fb8e28;
	--nps-star-empty-color: #cccccc;
	--nps-text-color: #191919;
	--nps-heading-color: #111111;
	--nps-bg-color: #ffffff;
	--nps-border-color: rgba(0, 0, 0, 0.105);
	--nps-border-radius: 10px;
	--nps-control-radius: 5px;
	--nps-spacing: 20px;
	--nps-author-color: #333333;
	--nps-date-color: #767676;
	--nps-accent-color: rgb(42, 122, 157);
	--nps-accent-color-hover: rgb(0, 110, 158);
	--nps-aside-bg: rgba(42, 122, 157, 0.05);
	--nps-aside-border: rgba(42, 122, 157, 0.15);
	--nps-error-color: #cf2e2e;
	--nps-error-bg: rgba(207, 46, 46, 0.08);
	--nps-success-color: rgb(42, 122, 157);
	--nps-success-bg: rgba(42, 122, 157, 0.08);
	--nps-font-family: "Manrope", Arial, Helvetica, sans-serif;
	--nps-font-size: 14px;
	--nps-card-shadow: 0 2px 8px rgba(17, 17, 17, 0.06);
	--nps-card-shadow-hover: 0 12px 28px rgba(17, 17, 17, 0.1);
	--nps-avatar-bg: rgba(42, 122, 157, 0.12);
}

/*
 * Poistka: Elementor niekedy uloží pre widget pevnú výšku pre konkrétny breakpoint
 * (napr. z predchádzajúcej verzie obsahu), ktorá potom na mobile/tablete nesedí
 * s aktuálnym (kratším) obsahom a vytvára prázdne miesto pod widgetom. Tu obalový
 * Elementor kontajner pre istotu prinútime na "auto" výšku, nech sa vždy prispôsobí
 * skutočnému obsahu pluginu. Vyžaduje :has() (Chrome/Edge/Safari/Firefox 2023+).
 */
.elementor-widget-shortcode:has(.store-reviews),
.elementor-widget-shortcode:has(.store-review-rating-summary),
.elementor-widget-shortcode:has(.nps-review-form-wrap),
.elementor-widget-shortcode:has(.store-reviews-compact-wrap),
.elementor-widget-container:has(.store-reviews),
.elementor-widget-container:has(.store-review-rating-summary),
.elementor-widget-container:has(.nps-review-form-wrap),
.elementor-widget-container:has(.store-reviews-compact-wrap),
.elementor-widget:has(.store-reviews),
.elementor-widget:has(.store-review-rating-summary),
.elementor-widget:has(.nps-review-form-wrap),
.elementor-widget:has(.store-reviews-compact-wrap),
.elementor-column:has(.store-reviews),
.elementor-column:has(.store-review-rating-summary),
.elementor-column:has(.nps-review-form-wrap),
.elementor-column:has(.store-reviews-compact-wrap),
.elementor-container:has(.store-reviews),
.elementor-container:has(.store-review-rating-summary),
.elementor-container:has(.nps-review-form-wrap),
.elementor-container:has(.store-reviews-compact-wrap),
.e-con:has(.store-reviews),
.e-con:has(.store-review-rating-summary),
.e-con:has(.nps-review-form-wrap),
.e-con:has(.store-reviews-compact-wrap),
.e-con-inner:has(.store-reviews),
.e-con-inner:has(.store-review-rating-summary),
.e-con-inner:has(.nps-review-form-wrap),
.e-con-inner:has(.store-reviews-compact-wrap) {
	height: auto !important;
	min-height: 0 !important;
}

/* ---------- Carousel ---------- */

.store-reviews {
	position: relative;
	--nps-cards-per-view: 3;
	padding: 4px 44px 0;
	margin: 0 0 40px;
	box-sizing: border-box;
	font-family: var(--nps-font-family);
}

.store-reviews-empty {
	color: var(--nps-date-color);
	font-family: var(--nps-font-family);
}

.store-reviews-viewport {
	overflow: hidden;
	padding: 4px;
	margin: -4px;
}

.store-reviews-track {
	display: flex;
	transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
	will-change: transform;
}

.store-reviews-slide {
	flex: 0 0 calc(100% / var(--nps-cards-per-view));
	max-width: calc(100% / var(--nps-cards-per-view));
	box-sizing: border-box;
	padding: 0 10px;
}

.store-review-card {
	position: relative;
	background: var(--nps-bg-color);
	border: 1px solid var(--nps-border-color);
	border-radius: var(--nps-border-radius);
	padding: 26px 24px 22px;
	height: 100%;
	box-sizing: border-box;
	box-shadow: var(--nps-card-shadow);
	display: flex;
	flex-direction: column;
	gap: 16px;
	font-size: var(--nps-font-size);
	color: var(--nps-text-color);
	transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.store-review-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--nps-card-shadow-hover);
	border-color: transparent;
}

.store-review-card__top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
}

.store-review-quote {
	font-size: 46px;
	line-height: 1;
	font-family: Georgia, "Times New Roman", serif;
	color: var(--nps-accent-color);
	opacity: 0.15;
}

.store-review-stars {
	font-size: 16px;
	letter-spacing: 2px;
	line-height: 1;
}

.store-review-stars__filled {
	color: var(--nps-star-color);
}

.store-review-stars__empty {
	color: var(--nps-star-empty-color);
}

.store-review-text {
	color: var(--nps-text-color);
	line-height: 1.6;
	flex-grow: 1;
	margin: 0;
}

.store-review-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 14px;
	border-top: 1px solid var(--nps-border-color);
}

.store-review-avatar {
	flex: 0 0 auto;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: var(--nps-avatar-bg);
	color: var(--nps-accent-color);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 15px;
}

.store-review-meta-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.store-review-author {
	display: block;
	font-weight: 600;
	color: var(--nps-heading-color);
	margin: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.store-review-date {
	display: block;
	color: var(--nps-date-color);
	font-size: 0.85em;
	margin: 0;
}

.store-reviews-arrow {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	border-radius: 50%;
	border: 1px solid var(--nps-border-color);
	background: var(--nps-bg-color);
	color: var(--nps-text-color);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 2;
	padding: 0;
	margin: 0;
}

.store-reviews-arrow--prev {
	left: 0;
}

.store-reviews-arrow--next {
	right: 0;
}

.store-reviews-arrow:hover {
	background: var(--nps-accent-color-hover);
	color: #fff;
	border-color: var(--nps-accent-color-hover);
}

.store-reviews-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin: 28px 0 0;
	min-height: 9px;
}

.store-reviews-dot {
	-webkit-appearance: none;
	appearance: none;
	box-sizing: border-box;
	width: 9px;
	height: 9px;
	min-width: 9px;
	min-height: 9px;
	line-height: 1;
	border-radius: 50%;
	border: none;
	padding: 0;
	margin: 0;
	background: var(--nps-star-empty-color);
	cursor: pointer;
	flex: 0 0 auto;
}

.store-reviews-dot.is-active {
	background: var(--nps-accent-color);
}

@media (max-width: 1023px) {
	.store-reviews {
		--nps-cards-per-view: 2;
	}
}

@media (max-width: 640px) {
	.store-reviews {
		--nps-cards-per-view: 1;
		/* Šípky sa na mobile skrývajú (ovládanie swipe/dots), takže karta môže využiť takmer celú šírku. */
		padding: 4px 6px 0;
	}

	.store-reviews-arrow {
		display: none;
	}
}

/* ---------- Kompaktný carousel [store_reviews_compact] (napr. produktové stránky) ---------- */

.store-reviews-compact-wrap {
	display: flex;
	align-items: stretch;
	gap: 28px;
	container-type: inline-size;
	font-family: var(--nps-font-family);
}

.store-reviews-compact-summary {
	flex: 0 0 220px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;
	padding: 20px;
	background: var(--nps-aside-bg);
	border: 1px solid var(--nps-aside-border);
	border-radius: var(--nps-border-radius);
	box-sizing: border-box;
}

.store-reviews-compact-value {
	font-size: 1.8em;
	font-weight: 800;
	color: var(--nps-heading-color);
	letter-spacing: -0.02em;
}

.store-reviews-compact-count {
	color: var(--nps-date-color);
	font-size: 0.85em;
}

.store-reviews-compact-cta {
	margin-top: 8px;
	display: inline-flex;
	align-items: center;
	padding: 10px 18px;
	border-radius: var(--nps-control-radius);
	background: var(--nps-accent-color);
	color: #fff;
	text-decoration: none;
	font-size: 0.85em;
	font-weight: 600;
	transition: background 0.2s ease;
}

.store-reviews-compact-cta:hover {
	background: var(--nps-accent-color-hover);
	color: #fff;
}

.store-reviews--compact {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0 32px;
	margin: 0;
}

.store-reviews--compact .store-reviews-slide {
	padding: 0 8px;
}

.store-reviews--compact .store-reviews-arrow {
	width: 30px;
	height: 30px;
	min-width: 30px;
	min-height: 30px;
	font-size: 16px;
}

.store-review-card--compact {
	padding: 16px 18px;
	gap: 10px;
}

.store-review-card--compact:hover {
	transform: none;
}

.store-review-card--compact .store-review-meta {
	border-top: none;
	padding-top: 0;
}

.store-review-card--compact .store-review-avatar {
	width: 32px;
	height: 32px;
	font-size: 13px;
}

.store-review-card--compact .store-review-stars {
	font-size: 14px;
}

.store-review-card--compact .store-review-text {
	font-size: 0.9em;
	line-height: 1.5;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
	overflow: hidden;
}

/* Pod ~620px šírky widgetu sa panel s priemerom presunie nad karty. */
@container (max-width: 620px) {
	.store-reviews-compact-wrap {
		flex-direction: column;
	}

	.store-reviews-compact-summary {
		flex: 0 0 auto;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	.store-reviews-compact-cta {
		margin-top: 0;
		margin-left: auto;
	}
}

@media (max-width: 620px) {
	.store-reviews-compact-wrap {
		flex-direction: column;
	}

	.store-reviews-compact-summary {
		flex: 0 0 auto;
		flex-direction: row;
		flex-wrap: wrap;
		align-items: center;
	}

	.store-reviews-compact-cta {
		margin-top: 0;
		margin-left: auto;
	}
}

/* Na užšom widgete (typicky mobil) šípky prekážajú rovnako ako pri hlavnom carouseli.
   Rovnaký breakpoint 640px ako pri .store-reviews, aby sa oba carousely správali konzistentne. */
@container (max-width: 640px) {
	.store-reviews--compact {
		padding: 4px 4px 0;
	}

	.store-reviews--compact .store-reviews-arrow {
		display: none;
	}
}

@media (max-width: 640px) {
	.store-reviews--compact {
		padding: 4px 4px 0;
	}

	.store-reviews--compact .store-reviews-arrow {
		display: none;
	}
}

/* ---------- Priemerné hodnotenie / počet ---------- */

.store-review-rating-summary {
	display: flex;
	align-items: baseline;
	gap: 12px;
	flex-wrap: wrap;
	font-size: var(--nps-font-size);
	color: var(--nps-text-color);
	font-family: var(--nps-font-family);
	margin: 0 0 24px;
}

.store-review-rating-summary .store-review-stars {
	align-self: center;
	font-size: 20px;
}

.store-review-rating-summary__value {
	font-size: 2em;
	font-weight: 800;
	color: var(--nps-heading-color);
	letter-spacing: -0.02em;
}

.store-review-rating-summary__count {
	color: var(--nps-date-color);
	align-self: center;
}

.store-review-count {
	font-weight: 600;
}

/* ---------- Formulár ---------- */

.nps-review-form-wrap {
	max-width: 1100px;
	margin-top: 32px;
	font-family: var(--nps-font-family);
	container-type: inline-size;
}

.nps-review-header {
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid var(--nps-border-color);
}

.nps-review-title {
	margin: 0 0 6px;
	color: var(--nps-heading-color);
	font-size: 1.7em;
	font-weight: 800;
	letter-spacing: -0.01em;
}

.nps-review-subtitle {
	margin: 0;
	color: var(--nps-date-color);
}

.nps-review-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.9fr);
	column-gap: 64px;
	row-gap: 32px;
	align-items: start;
}

/* Záložný breakpoint podľa šírky okna (pre prehliadače bez podpory container queries). */
@media (max-width: 900px) {
	.nps-review-layout {
		grid-template-columns: 1fr;
	}

	.nps-review-aside-card {
		position: static;
	}
}

/* Primárny breakpoint podľa skutočnej šírky widgetu (funguje spoľahlivo aj v užšom Elementor stĺpci na širokej obrazovke). */
@container (max-width: 780px) {
	.nps-review-layout {
		grid-template-columns: 1fr;
	}

	.nps-review-aside-card {
		position: static;
	}
}

.nps-review-aside-card {
	background: var(--nps-aside-bg, rgba(42, 122, 157, 0.05));
	border: 1px solid var(--nps-aside-border, rgba(42, 122, 157, 0.15));
	border-radius: var(--nps-border-radius);
	padding: 24px;
	position: sticky;
	top: 24px;
}

.nps-review-aside-card h3 {
	margin: 0 0 18px;
	color: var(--nps-heading-color);
	font-size: 1.1em;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.nps-review-benefits {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.nps-review-benefits li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.nps-review-benefits strong {
	display: block;
	color: var(--nps-heading-color);
	font-size: 0.95em;
}

.nps-review-benefits p {
	margin: 2px 0 0;
	color: var(--nps-date-color);
	font-size: 0.85em;
	line-height: 1.4;
}

.nps-benefit-icon {
	flex: 0 0 auto;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--nps-bg-color);
	color: var(--nps-accent-color);
	display: flex;
	align-items: center;
	justify-content: center;
}

.nps-benefit-icon svg {
	width: 18px;
	height: 18px;
}

.nps-review-thanks {
	margin: 20px 0 0;
	padding-top: 16px;
	border-top: 1px solid var(--nps-aside-border, rgba(42, 122, 157, 0.15));
	color: var(--nps-accent-color);
	font-style: italic;
}

.nps-review-trust-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 28px 0 0;
	padding: 16px 20px;
	background: var(--nps-aside-bg, rgba(42, 122, 157, 0.05));
	border: 1px solid var(--nps-aside-border, rgba(42, 122, 157, 0.15));
	border-radius: var(--nps-control-radius);
	color: var(--nps-text-color);
	font-size: 0.88em;
	line-height: 1.5;
}

.nps-trust-icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: var(--nps-accent-color);
}

.nps-trust-icon svg {
	width: 100%;
	height: 100%;
}

.nps-form-message {
	padding: 12px 16px;
	border-radius: var(--nps-control-radius);
	margin-bottom: var(--nps-spacing);
}

.nps-form-message--success {
	background: var(--nps-success-bg);
	color: var(--nps-success-color);
}

.nps-form-message--error {
	background: var(--nps-error-bg);
	color: var(--nps-error-color);
}

.nps-review-form .nps-form-row {
	margin-bottom: var(--nps-spacing);
}

.nps-review-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--nps-heading-color);
}

.nps-review-form input[type="text"],
.nps-review-form input[type="email"],
.nps-review-form textarea {
	width: 100%;
	box-sizing: border-box;
	padding: 12px 14px;
	border: 1px solid var(--nps-border-color);
	border-radius: var(--nps-control-radius);
	font-size: var(--nps-font-size);
	color: var(--nps-text-color);
	background: var(--nps-bg-color);
	font-family: inherit;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.nps-review-form input[type="text"]::placeholder,
.nps-review-form input[type="email"]::placeholder,
.nps-review-form textarea::placeholder {
	color: var(--nps-date-color);
}

.nps-review-form textarea {
	resize: vertical;
	min-height: 120px;
}

.nps-review-form input:focus-visible,
.nps-review-form textarea:focus-visible {
	outline: none;
	border-color: var(--nps-accent-color);
	box-shadow: 0 0 0 3px var(--nps-aside-bg, rgba(42, 122, 157, 0.12));
}

.nps-textarea-meta {
	display: flex;
	justify-content: space-between;
	margin-top: 6px;
	font-size: 0.8em;
	color: var(--nps-date-color);
}

.nps-textarea-count.is-over-limit {
	color: var(--nps-error-color);
	font-weight: 600;
}

.nps-required {
	color: var(--nps-error-color);
}

.nps-hp-row {
	position: absolute;
	left: -9999px;
	top: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.nps-form-row--checkbox label {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	font-weight: 400;
}

.nps-form-row--checkbox input {
	margin-top: 4px;
}

.nps-submit-button {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	background: var(--nps-accent-color);
	color: #fff;
	border: none;
	border-radius: var(--nps-control-radius);
	padding: 13px 30px;
	font-size: var(--nps-font-size);
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
	box-shadow: 0 2px 6px rgba(42, 122, 157, 0.25);
}

.nps-submit-button:hover {
	background: var(--nps-accent-color-hover);
	transform: translateY(-1px);
	box-shadow: 0 6px 14px rgba(42, 122, 157, 0.3);
}

.nps-submit-button:active {
	transform: translateY(0);
}

.nps-submit-icon {
	display: inline-flex;
	width: 16px;
	height: 16px;
}

.nps-submit-icon svg {
	width: 100%;
	height: 100%;
}

/* Star rating input - funguje aj bez JS (čisté CSS), JS iba dopĺňa prístupnosť */
.nps-star-rating {
	border: none;
	padding: 0;
	margin: 0;
}

.nps-star-rating-hint {
	margin: 6px 0 0;
	font-size: 0.8em;
	color: var(--nps-date-color);
}

.nps-star-rating legend {
	font-weight: 600;
	margin-bottom: 6px;
	color: var(--nps-heading-color);
	padding: 0;
}

.nps-star-rating-stars {
	display: inline-flex;
	flex-direction: row-reverse;
	font-size: 30px;
	line-height: 1;
}

.nps-star-rating-stars input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.nps-star-rating-stars label {
	cursor: pointer;
	color: var(--nps-star-empty-color);
	padding: 0 2px;
	margin: 0;
	font-weight: normal;
	display: inline-block;
}

.nps-star-rating-stars label:hover,
.nps-star-rating-stars label:hover ~ label,
.nps-star-rating-stars input:checked ~ label {
	color: var(--nps-star-color);
}

.nps-star-rating-stars input:focus-visible + label {
	outline: 2px solid var(--nps-accent-color);
	outline-offset: 2px;
	border-radius: 3px;
}

/* ---------- Admin badge pre testovacie recenzie ---------- */

.nps-test-badge {
	display: inline-block;
	background: #c0392b;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 3px;
	letter-spacing: 0.5px;
}

.nps-test-notice {
	background: #fff3cd;
	border: 1px solid #ffe69c;
	padding: 10px 14px;
	border-radius: 6px;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
