/* WWF Beer List — card name button, sticky filter, and modal styles */

/* ─────────────────────────────────────────────────────────────────── */
/* Badges / tags                                                        */
/* ─────────────────────────────────────────────────────────────────── */
.beverage-list__badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-top: 0.4rem;
}

.beverage-list__badge {
	display: inline-block;
	padding: 0.2rem 0.55rem;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.4;
	border-radius: 999px;
	/* white-space: nowrap; */
}

.beverage-list__badge--style {
	background: var(--wp--preset--color--primary-accent, #EEE0C0);
}

.beverage-list__badge--abv {
	background: var(--wp--preset--color--tertiary, #EEF0F6);
	color: var(--wp--preset--color--main-accent, #4A5C8A);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Card header row (name + tasted button)                              */
/* ─────────────────────────────────────────────────────────────────── */
.beverage-list__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.25rem;
}

.beverage-list__item {
	border-block: 1px solid var(--wp--preset--color--border-light);
	padding-inline: .5rem;
	cursor: pointer;
	transition: background 0.15s ease;
}

.beverage-list__item:hover {
	background: var(--wp--preset--color--tertiary, #EEF0F6);
}

.beverage-list__item:active {
	background: var(--wp--preset--color--primary-accent, #EEE0C0);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Beer name                                                            */
/* ─────────────────────────────────────────────────────────────────── */
.beverage-list__name {
	display: block;
	margin: 0 0 0.25rem;
	font-weight: 800;
	font-size: 1.25rem;
	color: var(--wp--preset--color--primary, currentColor);
}

.beverage-list__brewery {
	margin: 0;
	font-weight: 600;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Tasted button — card                                                */
/* ─────────────────────────────────────────────────────────────────── */
.beverage-list__tasted {
	flex-shrink: 0;
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: var(--wp--preset--color--border-light, #C8D0E4);
	line-height: 0;
	transition: color 0.15s ease, transform 0.15s ease;
}

.beverage-list__tasted:hover {
	color: var(--wp--preset--color--primary, #C4A96B);
	transform: scale(1.15);
}

.beverage-list__tasted[aria-pressed="true"] {
	color: var(--wp--preset--color--primary, #C4A96B);
}

/* Show circle when untasted, checkmark when tasted */
.beverage-list__tasted .wwf-icon-check { display: none; }
.beverage-list__tasted[aria-pressed="true"] .wwf-icon-circle { display: none; }
.beverage-list__tasted[aria-pressed="true"] .wwf-icon-check  { display: block; }

/* Tasted card treatment */
.beverage-list__item.is-tasted {
	opacity: 0.55;
}

.beverage-list__item.is-tasted:hover {
	opacity: 0.85;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Filter bar — shared base                                            */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-beer-filters {
	margin-bottom: 1.5rem;
}

.wwf-filters-topbar {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.wwf-search {
	flex: 1;
	min-width: 0;
	padding: 0.6rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	border: 1px solid var(--wp--preset--color--border-light, #C8D0E4);
	background: transparent;
	border-radius: 0;
	-webkit-appearance: none;
}

.wwf-search:focus {
	outline: 2px solid var(--wp--preset--color--primary, #C4A96B);
	outline-offset: -2px;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Sort buttons                                                         */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-sort-buttons {
	display: flex;
	gap: 0;
	flex-shrink: 0;
}

.wwf-sort-btn {
	padding: 0.6rem 0.7rem;
	background: transparent;
	color: var(--wp--preset--color--main, #1D2B4F);
	border: 1px solid var(--wp--preset--color--border-light, #C8D0E4);
	font: inherit;
	font-size: 0.8rem;
	font-weight: 600;
	cursor: pointer;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
}

.wwf-sort-btn + .wwf-sort-btn {
	border-left: none;
}

.wwf-sort-btn:hover {
	background: var(--wp--preset--color--tertiary, #EEF0F6);
}

.wwf-sort-btn.is-active {
	background: var(--wp--preset--color--main, #1D2B4F);
	color: var(--wp--preset--color--base, #FAFAF8);
	border-color: var(--wp--preset--color--main, #1D2B4F);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Toggle button                                                        */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-filters-toggle {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 0.6rem 0.75rem;
	background: var(--wp--preset--color--main, #1D2B4F);
	color: var(--wp--preset--color--base, #FAFAF8);
	border: none;
	cursor: pointer;
	flex-shrink: 0;
	-webkit-tap-highlight-color: transparent;
}

.wwf-filters-toggle:hover {
	background: var(--wp--preset--color--main-accent, #4A5C8A);
}

.wwf-filters-toggle__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.25rem;
	height: 1.25rem;
	padding: 0 0.3rem;
	border-radius: 999px;
	background: var(--wp--preset--color--primary, #C4A96B);
	color: var(--wp--preset--color--main, #1D2B4F);
	font-size: 0.7rem;
	font-weight: 700;
	line-height: 1;
	visibility: hidden;
}

.wwf-filters-toggle__count.is-visible {
	visibility: visible;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Filter panel — selects + sort + clear                               */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-filters-panel {
	display: none; /* mobile default — shown via .is-open */
}

.wwf-filters-panel.is-open {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 0.75rem;
	background: var(--wp--preset--color--tertiary, #EEF0F6);
	border: 1px solid var(--wp--preset--color--border-light, #C8D0E4);
	border-top: none;
}

/* Sort group sits inline in the panel */
.wwf-filters-panel .wwf-sort-buttons {
	align-self: flex-start;
}

.wwf-filter,
.wwf-reset {
	width: 100%;
	padding: 0.65rem 0.75rem;
	font: inherit;
	font-size: 1rem;
	border: 1px solid var(--wp--preset--color--border-light, #C8D0E4);
	background: var(--wp--preset--color--base, #FAFAF8);
	color: var(--wp--preset--color--main, #1D2B4F);
	-webkit-appearance: none;
	appearance: none;
	border-radius: 0;
}

.wwf-search {
	-webkit-appearance: none;
	appearance: none;
}

.wwf-reset {
	background: transparent;
	border-color: var(--wp--preset--color--main, #1D2B4F);
	font-weight: 600;
	cursor: pointer;
	margin-top: 0.25rem;
}

.wwf-reset:hover {
	background: var(--wp--preset--color--main, #1D2B4F);
	color: var(--wp--preset--color--base, #FAFAF8);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Sticky filter bar — mobile only                                     */
/* ─────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
	.wwf-beer-filters {
		position: sticky;
		top: 0;
		z-index: 200;
		margin-bottom: 0;
		background: var(--wp--preset--color--base, #FAFAF8);
	}

	.wwf-beer-filters.has-shadow {
		box-shadow: 0 2px 8px rgba(29, 43, 79, 0.15);
	}

	.wwf-filters-topbar {
		padding: 0.5rem;
		border-bottom: 1px solid var(--wp--preset--color--border-light, #C8D0E4);
	}

	.beverage-list__grid {
		margin-top: 1rem;
		padding-top: 0.5rem;
	}
}

/* ─────────────────────────────────────────────────────────────────── */
/* Desktop — panel always open, toggle hidden                          */
/* ─────────────────────────────────────────────────────────────────── */
@media (min-width: 769px) {
	.wwf-beer-filters {
		position: sticky;
		top: 0;
		z-index: 200;
		margin-bottom: 1.5rem;
		padding: 0.6rem 1.5rem;
		background: var(--wp--preset--color--base, #FAFAF8);
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 0.5rem;
	}

	.wwf-beer-filters.has-shadow {
		box-shadow: 0 2px 8px rgba(29, 43, 79, 0.15);
	}

	.wwf-filters-topbar {
		display: contents; /* dissolve search input into the flex row */
	}

	.wwf-filters-toggle {
		display: none;
	}

	.wwf-filters-panel {
		display: contents; /* dissolve all panel children into the flex row */
	}

	.wwf-filters-panel .wwf-sort-buttons {
		align-self: auto;
	}

	.wwf-filter {
		width: auto;
		flex: 1;
		min-width: 130px;
	}

	.wwf-search {
		flex: 2;
		min-width: 180px;
	}

	.wwf-reset {
		width: auto;
		flex: 0 0 auto;
		margin-top: 0;
	}
}

/* ─────────────────────────────────────────────────────────────────── */
/* Modal overlay                                                        */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wwf-modal[hidden] {
	display: none;
}

.wwf-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(29, 43, 79, 0.7);
}

/* ─────────────────────────────────────────────────────────────────── */
/* Modal panel                                                          */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-modal__panel {
	position: relative;
	background: #fff;
	max-width: 540px;
	width: calc(100% - 2rem);
	max-height: calc(100dvh - 2rem);
	overflow-y: auto;
	padding: 2rem;
	border-top: 4px solid var(--wp--preset--color--primary, #C4A96B);
	box-shadow: 0 24px 64px rgba(29, 43, 79, 0.3);
}

@media (max-width: 768px) {
	.wwf-modal__panel {
		width: 100%;
		max-height: 85dvh;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		border-radius: 0;
		border-top-width: 4px;
		padding: 1.5rem 1.25rem;
	}

	.wwf-modal {
		align-items: flex-end;
	}
}

.wwf-modal__close {
	position: absolute;
	top: 0.875rem;
	right: 0.875rem;
	background: none;
	border: none;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	padding: 0.25rem 0.5rem;
	color: inherit;
	opacity: 0.5;
}

.wwf-modal__close:hover {
	opacity: 1;
}

.wwf-modal__name {
	margin: 0 2.5rem 0.35rem 0;
	font-size: 2rem;
	line-height: 1.2;
	color: var(--wp--preset--color--main, #1D2B4F);
}

.wwf-modal__brewery {
	margin: 0 0 1.25rem;
	font-size: 0.9rem;
	opacity: 0.7;
}

.wwf-modal__fields {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: 1.25rem;
	padding: 1rem;
	background: var(--wp--preset--color--tertiary, #EEF0F6);
}

.wwf-modal__field {
	display: flex;
	gap: 0.5rem;
	font-size: 0.9rem;
}

.wwf-modal__field[hidden] {
	display: none;
}

.wwf-modal__label {
	font-weight: 700;
	min-width: 3.5rem;
	color: var(--wp--preset--color--primary-alt, #BF3939);
}

.wwf-modal__label::after {
	content: ":";
}

.wwf-modal__notes {
	font-size: 0.9rem;
	line-height: 1.6;
	margin: 0 0 1.25rem;
	color: var(--wp--preset--color--main-accent, #4A5C8A);
}

.wwf-modal__notes[hidden] {
	display: none;
}

/* ─────────────────────────────────────────────────────────────────── */
/* Modal actions row (tasted + untappd)                                */
/* ─────────────────────────────────────────────────────────────────── */
.wwf-modal__actions {
	display: flex;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	margin-top: 0.5rem;
}

.wwf-modal__tasted {
	flex: 1;
	padding: 0.65rem 1.25rem;
	background: var(--wp--preset--color--tertiary, #EEF0F6);
	color: var(--wp--preset--color--main, #1D2B4F);
	border: 2px solid var(--wp--preset--color--border-light, #C8D0E4);
	font: inherit;
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.wwf-modal__tasted:hover {
	background: var(--wp--preset--color--primary-accent, #EEE0C0);
	border-color: var(--wp--preset--color--primary, #C4A96B);
}

.wwf-modal__tasted[aria-pressed="true"] {
	background: var(--wp--preset--color--primary, #C4A96B);
	border-color: var(--wp--preset--color--primary, #C4A96B);
	color: var(--wp--preset--color--main, #1D2B4F);
}

.wwf-modal__untappd {
	display: inline-flex;
	align-items: center;
	line-height: 0;
	border-radius: 50%;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.wwf-modal__untappd:hover {
	opacity: 0.85;
	transform: scale(1.1);
}

.wwf-modal__untappd[hidden] {
	display: none;
}

.wwf-untappd-logo {
	display: block;
}
