/**
 * Product rating — composite badge + review form (docs/design-system.md tokens).
 */

/* Hero overall assessment — laurel wreath + centred score */
.md-hero-assessment {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	font-family: "Open Sans", sans-serif;
}

.md-hero-assessment__badge {
	position: relative;
	display: inline-grid;
	place-items: center;
	line-height: 0;
}

.md-hero-assessment__laurel {
	grid-area: 1 / 1;
	display: block;
	width: 140px;
	height: auto;
	max-width: 100%;
}

.md-hero-assessment__score {
	grid-area: 1 / 1;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.md-hero-assessment__value {
	display: block;
	margin: 0;
}

.md-hero-assessment__label {
	margin: 0;
}

/* 0–100 composite badge */
.md-rating-badge {
	display: inline-flex;
	align-items: baseline;
	gap: 2px;
	padding: 4px 12px;
	background: #f6f1eb;
	border: 1px solid #dad3c7;
	border-radius: 12px;
	font-family: "Open Sans", sans-serif;
}

.md-rating-badge__score {
	font-size: 1.125rem;
	font-weight: 600;
	color: #111111;
}

.md-rating-badge__scale {
	font-size: 0.75rem;
	color: #9a958c;
}

/* Review form */
.md-review-form {
	margin: 24px 0;
	padding: 20px;
	background: #ffffff;
	border: 1px solid #dad3c7;
	border-radius: 16px;
	max-width: 640px;
	font-family: "Open Sans", sans-serif;
}

.md-review-form__heading {
	font-family: Belleza, serif;
	font-weight: 400;
	font-size: 1.25rem;
	margin: 0 0 14px;
}

.md-review-form__field {
	margin: 0 0 14px;
}

.md-review-form__field label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	margin: 0 0 4px;
}

.md-review-form__field--slider output {
	color: #d3a877;
	font-weight: 600;
}

.md-review-form__field input[type="range"] {
	width: 100%;
	accent-color: #d3a877;
}

.md-review-form__flavor {
	border: 1px solid #dad3c7;
	border-radius: 12px;
	padding: 12px 16px 4px;
	margin: 0 0 14px;
}

.md-review-form__flavor legend {
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	padding: 0 6px;
}

.md-review-form__anchors {
	display: flex;
	justify-content: space-between;
	font-size: 0.75rem;
	color: #9a958c;
	margin-top: -2px;
}

/* Published tasting-review cards */
.md-tasting-reviews {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 24px 0;
	font-family: "Open Sans", sans-serif;
}

.md-tasting-review {
	background: #ffffff;
	border: 1px solid #dad3c7;
	border-radius: 16px;
	padding: 20px;
}

/* Header: score ring left, reviewer identity to its right */
.md-tasting-review__header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #dad3c7;
	margin-bottom: 16px;
}

.md-tasting-review__meta {
	min-width: 0;
}

.md-tasting-review__identity {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.md-tasting-review__name {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.md-tasting-review__verified-badge {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	flex-shrink: 0;
	color: #16a34a;
}

.md-tasting-review__verified-tip-wrap {
	position: relative;
	display: inline-flex;
	font-size: 1.125rem;
	line-height: 1;
	cursor: help;
}

.md-tasting-review__verified-label {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1px;
	font-family: "Open Sans", sans-serif;
	font-size: 7px;
	font-weight: 500;
	line-height: 1;
	color: #16a34a;
	letter-spacing: 0.02em;
	text-align: center;
}

.md-tasting-review__verified-label-line {
	display: block;
}

.md-tasting-review__verified-tooltip {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	transform: translateX(-50%);
	padding: 6px 10px;
	border-radius: 6px;
	background: #111111;
	color: #ffffff;
	font-family: "Open Sans", sans-serif;
	font-size: 0.75rem;
	font-weight: 500;
	line-height: 1.3;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	visibility: hidden;
	z-index: 2;
	transition: opacity 0.15s ease, visibility 0.15s ease;
}

.md-tasting-review__verified-tip-wrap:hover .md-tasting-review__verified-tooltip,
.md-tasting-review__verified-tip-wrap:focus-visible .md-tasting-review__verified-tooltip,
.md-tasting-review__verified-badge:hover .md-tasting-review__verified-tooltip {
	opacity: 1;
	visibility: visible;
}

.md-tasting-review__verified-tip-wrap:focus-visible {
	outline: 2px solid #d3a877;
	outline-offset: 2px;
	border-radius: 2px;
}

.md-tasting-review__role {
	font-family: Belleza, serif;
	font-weight: 400;
	font-size: 1.25rem;
	letter-spacing: 0.02em;
	color: #111111;
	text-decoration: none;
}

a.md-tasting-review__role:hover {
	color: #d3a877;
}

.md-tasting-review__rater {
	display: inline-block;
	padding: 2px 10px;
	background: #f6f1eb;
	border: 1px solid #dad3c7;
	border-radius: 12px;
	font-size: 0.75rem;
	color: #6e6a63;
}

/* Intent pill tints (Would stock / Would buy again) */
.md-tasting-review__rater--yes {
	background: #ecf6ef;
	color: #16a34a;
}

.md-tasting-review__rater--no {
	background: #fbedea;
	border-color: #ead0c9;
	color: #c8523d;
}

.md-tasting-review__byline {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 4px 12px;
	margin-top: 4px;
	font-size: 0.875rem;
	color: #6e6a63;
}

.md-tasting-review__date {
	color: #9a958c;
}

.md-tasting-review__social {
	display: inline-flex;
	gap: 8px;
}

.md-tasting-review__social a {
	color: #111111;
	text-decoration: none;
}

.md-tasting-review__social a:hover {
	color: #d3a877;
}

/* 0–100 score ring — gold arc is decorative, value stays ink */
.md-tasting-review__score {
	--md-score: 0;
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: conic-gradient(#d3a877 calc(var(--md-score) * 1%), #efe7db 0);
	display: grid;
	place-items: center;
	flex-shrink: 0;
}

.md-tasting-review__score::before {
	content: "";
	position: absolute;
	inset: 4px;
	background: #ffffff;
	border-radius: 50%;
}

.md-tasting-review__score-inner {
	position: relative;
	display: flex;
	align-items: baseline;
	gap: 1px;
}

.md-tasting-review__score-value {
	font-size: 1.25rem;
	font-weight: 600;
	color: #111111;
	line-height: 1;
}

.md-tasting-review__score-scale {
	font-size: 0.625rem;
	color: #9a958c;
}

/* Flavor profile — slider-style descriptor meters (shared: review cards + PDP block) */
.md-flavor-meters {
	display: grid;
	gap: 10px;
	margin: 0 0 16px;
	max-width: 460px;
}

.md-flavor-meter {
	display: grid;
	grid-template-columns: minmax(110px, auto) auto 1fr auto;
	align-items: center;
	gap: 8px;
}

.md-flavor-meter__label {
	font-size: 0.875rem;
	font-weight: 600;
	color: #111111;
}

.md-flavor-meter__anchor {
	font-size: 0.75rem;
	color: #9a958c;
	text-align: right;
}

.md-flavor-meter__anchor--high {
	text-align: left;
}

.md-flavor-meter__track {
	position: relative;
	height: 6px;
	min-width: 90px;
	border-radius: 3px;
	background: #efe7db;
	border: 1px solid #dad3c7;
}

.md-flavor-meter__fill {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	border-radius: 3px;
	background: #d3a877;
}

.md-flavor-meter__thumb {
	position: absolute;
	top: 50%;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #d3a877;
	border: 2px solid #ffffff;
	box-shadow: 0 0 0 1px #dad3c7;
	transform: translate(-50%, -50%);
}

/* Product flavor profile — producer + community columns (reuses the 5-dot meters) */
.md-flavor-profile {
	margin: 24px 0;
	font-family: "Open Sans", sans-serif;
}

.md-flavor-profile__title {
	font-family: Belleza, serif;
	font-weight: 400;
	font-size: 1.5rem;
	margin: 0 0 12px;
}

.md-flavor-profile__cols {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
}

.md-flavor-profile__col {
	flex: 1 1 320px;
	max-width: 500px;
	background: #ffffff;
	border: 1px solid #dad3c7;
	border-radius: 16px;
	padding: 20px;
}

.md-flavor-profile__col-title {
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 600;
	color: #111111;
	margin: 0 0 12px;
}

.md-flavor-profile__col-count {
	font-weight: 400;
	color: #9a958c;
}

.md-flavor-profile__col .md-flavor-meters {
	margin: 0;
	max-width: none;
}

.md-flavor-profile__basis {
	margin: 12px 0 0;
	font-size: 0.75rem;
	color: #9a958c;
}

/* Organoleptic profile rows (white card via .md-flavor-profile__col) */
.md-flavor-profile__notes {
	display: grid;
	gap: 12px;
	margin: 0;
}

.md-flavor-profile__note dt {
	font-size: 0.875rem;
	font-weight: 600;
	color: #111111;
	margin: 0 0 2px;
}

.md-flavor-profile__note dt i {
	color: #d3a877;
	margin-right: 6px;
	font-size: 1.125rem;
}

.md-flavor-profile__note dd {
	margin: 0;
	font-size: 0.875rem;
	color: #111111;
}

/* Organoleptic notes */
.md-tasting-review__notes {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 12px;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #f6f1eb;
	border-radius: 12px;
}

.md-tasting-review__note dt {
	font-size: 0.75rem;
	font-weight: 600;
	color: #6e6a63;
	margin: 0 0 2px;
}

.md-tasting-review__note dt i {
	color: #d3a877;
	margin-right: 4px;
}

.md-tasting-review__note dd {
	margin: 0;
	font-size: 0.875rem;
	color: #111111;
}

/* Review text + optional photo */
.md-tasting-review__body {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.md-tasting-review__text {
	font-size: 1rem;
	line-height: 1.6;
	color: #111111;
	flex: 1;
}

.md-tasting-review__photo {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 12px;
	border: 1px solid #dad3c7;
	flex-shrink: 0;
}

@media (max-width: 480px) {
	.md-tasting-review__header {
		flex-direction: row;
	}

	.md-flavor-meter {
		grid-template-columns: minmax(90px, auto) 1fr;
	}

	.md-flavor-meter__anchor {
		display: none;
	}

	.md-tasting-review__body {
		flex-direction: column;
	}

	.md-tasting-review__photo {
		width: 100%;
		height: auto;
		max-height: 240px;
	}
}

.md-review-form__field textarea {
	width: 100%;
	padding: 8px 12px;
	border: 1px solid #dad3c7;
	border-radius: 8px;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
}

.md-review-form__submit button {
	background: #111111;
	color: #ffffff;
	border: 0;
	border-radius: 8px;
	padding: 10px 20px;
	font-family: "Open Sans", sans-serif;
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
}

.md-review-form__submit button:hover {
	background: #262626;
}

.md-review-form__hint {
	font-size: 0.75rem;
	color: #9a958c;
	margin: 8px 0 0;
}

.md-review-form__notice {
	padding: 10px 14px;
	border-radius: 12px;
	font-size: 0.875rem;
	margin: 0 0 14px;
}

.md-review-form__notice--success {
	background: #ecf6ef;
	color: #16a34a;
}

.md-review-form__notice--error {
	background: #fbedea;
	border: 1px solid #ead0c9;
	color: #c8523d;
}

.md-review-form__login a {
	color: #111111;
	text-decoration: underline;
}
