/* ==========================================================================
   Header: alb, logo portocaliu, căutare și „Toate categoriile” pe Rich Black.
   ========================================================================== */

/* Sticky pe toate paginile, sub bara de admin WordPress (când există).
   site.js pune .is-compact după primul ecran derulat și --header-h pe :root. */
.site-header {
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	z-index: 50;
	background: var(--c-white);
	border-bottom: 1px solid var(--c-line);
	transition: box-shadow 0.2s ease;
}

.site-header.is-compact {
	box-shadow: 0 12px 28px -22px rgba(1, 28, 37, 0.5);
}

.site-header.is-compact .header-top {
	padding-top: 10px;
	padding-bottom: 10px;
}

.site-header.is-compact .brand__tagline {
	display: none;
}

.site-header.is-compact .main-nav {
	padding-bottom: 10px;
}

/* Sub 600px bara de admin nu mai e fixă, deci headerul se lipește de marginea de sus. */
@media (max-width: 600px) {
	.site-header {
		top: 0;
	}
}

.header-top {
	padding-top: 18px;
	padding-bottom: 18px;
	display: flex;
	flex-wrap: wrap;
	gap: 16px 32px;
	align-items: center;
}

.header-top__menu {
	display: none;
}

/* Logo */
.brand {
	display: inline-flex;
	flex-direction: column;
	gap: 6px;
	color: var(--c-ink);
}

.brand .logo {
	height: 30px;
	width: auto;
}

.brand__tagline {
	font-size: 10px;
	font-weight: 700;
	color: var(--c-muted);
	letter-spacing: 0.16em;
}

/* Căutare */
.site-search {
	position: relative;
	flex: 1 1 360px;
	min-width: 0;
	display: flex;
	align-items: stretch;
	height: 48px;
	border: 1.5px solid var(--c-line-strong);
	border-radius: 14px;
	background: var(--c-white);
}

/* Cu lista deschisă, câmpul și lista formează un singur bloc. */
.site-search.is-open {
	border-bottom-left-radius: 0;
	border-bottom-right-radius: 0;
}

.site-search:focus-within {
	border-color: var(--c-green);
	box-shadow: 0 0 0 3px rgba(7, 80, 86, 0.18);
}

.search__input {
	flex: 1;
	min-width: 0;
	min-height: 0;
	border: 0;
	border-radius: 12px 0 0 12px;
	outline: none;
	padding: 0 18px;
	font-size: 15px;
	color: var(--c-ink);
	background: transparent;
}

.search__input::placeholder {
	color: #6B7678;
}

.search__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.search__cat {
	border: 0;
	border-left: 1px solid var(--c-line);
	padding: 0 14px;
	font-size: 14px;
	color: var(--c-muted);
	background: var(--c-white);
	cursor: pointer;
}

.search__cat:focus-visible,
.search__input:focus-visible {
	outline: none;
}

.search__submit {
	width: 56px;
	flex: none;
	margin: -1.5px -1.5px -1.5px 0;
	border: 0;
	border-radius: 0 14px 14px 0;
	background: var(--c-ink);
	color: var(--c-white);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease;
}

.search__submit:hover {
	background: var(--c-ink-hover);
}

.search__submit:focus-visible {
	outline: 3px solid var(--c-amber);
	outline-offset: -3px;
	border-radius: 0 14px 14px 0;
}

.site-search.is-open .search__submit {
	border-bottom-right-radius: 0;
}

/* Acțiuni */
.header-actions {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.pill-whatsapp {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--c-mint);
	color: var(--c-mint-ink);
	font-weight: 700;
	font-size: 14px;
}

.pill-whatsapp:hover {
	color: var(--c-mint-ink);
	background: #D5F0E0;
}

.header-action {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	height: 44px;
	padding: 0 12px;
	color: var(--c-ink);
}

.header-action:hover,
.header-action--fav:hover {
	color: var(--c-green);
}

.header-action__text {
	display: flex;
	flex-direction: column;
	line-height: 1.2;
}

.header-action__kicker {
	font-size: 12px;
	color: var(--c-muted);
}

.header-action__label {
	font-size: 14px;
	font-weight: 700;
	max-width: 160px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cart-icon {
	position: relative;
	display: inline-flex;
}

.cart-icon__count {
	position: absolute;
	top: -6px;
	right: -8px;
	min-width: 18px;
	height: 18px;
	border-radius: 9px;
	background: var(--c-persimmon);
	color: var(--c-white);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
}

/* Meniul principal */
.main-nav {
	padding-bottom: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 10px 8px;
	align-items: center;
}

.main-nav__all {
	height: 44px;
	padding: 0 18px;
	border-radius: 12px;
	font-size: 14px;
	margin-right: 12px;
}

.main-nav__link {
	padding: 12px 14px;
	font-weight: 600;
	font-size: 14px;
	color: var(--c-ink);
	border-radius: 10px;
}

.main-nav__link:hover,
.main-nav__link.is-current {
	color: var(--c-green);
}

.promo-pill {
	margin-left: auto;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border-radius: 999px;
	background: var(--c-amber);
	color: var(--c-ink);
	font-weight: 700;
	font-size: 14px;
	transition: background-color 0.15s ease;
}

.promo-pill:hover {
	color: var(--c-ink);
	background: #FFC929;
}

/* Chip-uri de categorii (doar mobil) */
.chips {
	display: none;
}

/* Meniul lateral (mobil) */
.drawer {
	position: fixed;
	inset: 0 auto 0 0;
	width: min(86vw, 360px);
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 16px;
	border: 0;
	background: var(--c-white);
	box-shadow: 0 0 40px rgba(1, 28, 37, 0.25);
	flex-direction: column;
	gap: 16px;
	overflow-y: auto;
}

.drawer[open] {
	display: flex;
}

.drawer::backdrop {
	background: rgba(1, 28, 37, 0.45);
}

.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.drawer__head .logo {
	height: 22px;
	width: auto;
}

.drawer__nav {
	display: flex;
	flex-direction: column;
}

.drawer__link {
	display: flex;
	align-items: center;
	min-height: 48px;
	padding: 0 4px;
	border-bottom: 1px solid var(--c-line-soft);
	color: var(--c-ink);
	font-weight: 600;
}

.drawer__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.drawer__actions .promo-pill {
	margin-left: 0;
}

/* Mobil ---------------------------------------------------------------- */
@media (max-width: 760px) {
	.header-top {
		padding: 12px 16px 14px;
		gap: 12px 4px;
	}

	.header-top__menu {
		display: inline-flex;
		order: 1;
		margin-left: -10px;
	}

	.brand {
		order: 2;
		flex: 1;
		flex-direction: row;
		align-items: center;
	}

	.brand .logo {
		height: 22px;
	}

	.brand__tagline {
		display: none;
	}

	.header-actions {
		order: 3;
		gap: 0;
		flex-wrap: nowrap;
	}

	.header-actions .pill-whatsapp,
	.header-action--fav {
		display: none;
	}

	.header-action {
		position: relative;
		width: 44px;
		padding: 0;
		justify-content: center;
	}

	.header-action .icon {
		width: 22px;
		height: 22px;
	}

	.header-action--cart {
		margin-right: -8px;
	}

	.header-action__text {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
		white-space: nowrap;
	}

	.cart-icon__count {
		top: -5px;
		right: -7px;
		min-width: 17px;
		height: 17px;
		font-size: 10px;
	}

	.site-search {
		order: 4;
		flex: 1 1 100%;
		height: 46px;
	}

	.search__input {
		padding: 0 14px;
	}

	.search__cat {
		display: none;
	}

	.search__submit {
		width: 50px;
	}

	.main-nav {
		display: none;
	}

	.chips {
		display: flex;
		gap: 8px;
		padding: 14px 16px;
		overflow-x: auto;
		border-top: 1px solid var(--c-line);
		scrollbar-width: none;
	}

	.chips::-webkit-scrollbar {
		display: none;
	}

	.chip {
		flex: none;
		height: 38px;
		padding: 0 14px;
		border-radius: 999px;
		background: var(--c-line-soft);
		color: var(--c-ink);
		font-size: 13px;
		font-weight: 600;
		display: inline-flex;
		align-items: center;
	}

	.chip:hover {
		color: var(--c-ink);
		background: var(--c-line);
	}

	.chip.is-active {
		background: var(--c-ink);
		color: var(--c-white);
		font-weight: 700;
	}

	/* Header compact pe mobil: fără chip-uri, ca să rămână loc pentru conținut. */
	.site-header.is-compact .chips {
		display: none;
	}
}

/* ==========================================================================
   „Toate categoriile” din căutare: listbox propriu (selectul nativ rămâne
   ascuns în formular, ca valoarea să se trimită la fel).
   ========================================================================== */
.has-cat-pick .js-cat-native {
	display: none;
}

.cat-pick {
	position: relative;
	display: flex;
	flex: none;
}

.cat-pick[hidden] {
	display: none;
}

.cat-pick__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 0 16px;
	border: 0;
	border-left: 1px solid var(--c-line);
	background: var(--c-white);
	color: var(--c-muted);
	font-size: 14px;
	font-weight: 500;
	white-space: nowrap;
}

.cat-pick__btn:hover,
.cat-pick__btn[aria-expanded="true"] {
	color: var(--c-ink);
}

.cat-pick__btn:focus-visible {
	outline: 3px solid var(--c-green);
	outline-offset: -3px;
	border-radius: 4px;
}

/* Butonul e cât cea mai lungă categorie (etichetele invizibile îi țin lățimea),
   deci lista de sub el are exact aceeași lățime și nu taie niciun nume. */
.cat-pick__value {
	display: grid;
	text-align: left;
}

.cat-pick__value > * {
	grid-area: 1 / 1;
}

.cat-pick__value > [aria-hidden] {
	visibility: hidden;
	font-weight: 700;
}

.cat-pick__chev {
	transition: transform 0.15s ease;
}

.cat-pick__btn[aria-expanded="true"] .cat-pick__chev {
	transform: rotate(180deg);
}

.cat-pick__list {
	position: absolute;
	z-index: 30;
	top: calc(100% + 1.5px);
	left: 0;
	right: 0;
	max-height: 360px;
	overflow-y: auto;
	margin: 0;
	padding: 5px;
	list-style: none;
	background: var(--c-white);
	border: 1.5px solid var(--c-line-strong);
	border-top-color: var(--c-line);
	border-radius: 0 0 14px 14px;
	box-shadow: 0 18px 30px -18px rgba(1, 28, 37, 0.35);
}

.cat-pick__list:focus {
	outline: none;
}

.cat-pick__option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 42px;
	padding: 0 9.5px;
	border-radius: 10px;
	font-size: 14px;
	color: var(--c-ink);
	cursor: pointer;
}

.cat-pick__option:hover,
.cat-pick__option.is-active {
	background: var(--c-latte);
}

.cat-pick__option[aria-selected="true"] {
	font-weight: 700;
	color: var(--c-green);
}

.cat-pick__option .icon {
	visibility: hidden;
}

.cat-pick__option[aria-selected="true"] .icon {
	visibility: visible;
}

/* ==========================================================================
   Sugestii de căutare (combobox)
   ========================================================================== */
.suggest {
	position: absolute;
	z-index: 30;
	top: 100%;
	left: -1.5px;
	right: -1.5px;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	background: var(--c-white);
	border: 1.5px solid var(--c-green);
	border-top: 1px solid var(--c-line);
	border-radius: 0 0 14px 14px;
	box-shadow: 0 0 0 3px rgba(7, 80, 86, 0.18), 0 24px 40px -24px rgba(1, 28, 37, 0.45);
	clip-path: inset(0 -6px -60px -6px);
}

.suggest[hidden] {
	display: none;
}

.suggest__list {
	list-style: none;
	margin: 0;
	padding: 6px;
}

.suggest__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr) auto;
	gap: 4px 14px;
	align-items: center;
	padding: 8px 10px 8px 8px;
	border-radius: 12px;
	color: var(--c-ink);
	cursor: pointer;
}

.suggest__item:hover,
.suggest__item.is-active {
	background: var(--c-latte);
}

.suggest__img {
	grid-row: span 2;
	width: 56px;
	height: 56px;
	border-radius: 12px;
	object-fit: cover;
	background: var(--c-img);
}

.suggest__text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.suggest__name {
	font-size: 15px;
	font-weight: 700;
	line-height: 1.3;
}

.suggest__name mark {
	background: none;
	color: var(--c-green);
}

.suggest__variant {
	font-size: 12px;
	font-weight: 600;
	color: var(--c-muted);
}

.suggest__excerpt {
	font-size: 13px;
	line-height: 1.4;
	color: var(--c-muted);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suggest__price {
	grid-row: span 2;
	font-size: 17px;
	white-space: nowrap;
}

.suggest__price--none {
	font-size: 14px;
	color: var(--c-muted);
}

.suggest__all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 48px;
	margin: 2px 0 0;
	padding: 0 12px;
	border-top: 1px solid var(--c-line-soft);
	border-radius: 0 0 10px 10px;
	font-size: 14px;
	font-weight: 700;
	color: var(--c-green);
	cursor: pointer;
}

.suggest__all:hover,
.suggest__all.is-active {
	background: var(--c-teal-soft);
}

.suggest__empty {
	padding: 18px 16px;
	font-size: 14px;
	color: var(--c-muted);
}

.suggest__empty[hidden] {
	display: none;
}

/* Numărul de favorite pe inimă */
.cart-icon__count--fav {
	background: var(--c-green);
}

.cart-icon__count[hidden] {
	display: none;
}

/* Contul și favoritele în meniul de pe mobil */
.drawer__account {
	display: flex;
	flex-direction: column;
	margin-top: auto;
	border-top: 1px solid var(--c-line);
}

.drawer__account .drawer__link {
	gap: 12px;
}

.drawer__count {
	margin-left: auto;
	min-width: 24px;
	height: 24px;
	padding: 0 7px;
	border-radius: 12px;
	background: var(--c-green);
	color: var(--c-white);
	font-size: 12px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.drawer__count[hidden] {
	display: none;
}

/* ==========================================================================
   Coșul lateral (dialog din dreapta)
   ========================================================================== */
html.has-modal {
	overflow: hidden;
}

.cart-drawer {
	position: fixed;
	inset: 0 0 0 auto;
	width: min(100vw, 440px);
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--c-latte);
	box-shadow: 0 0 48px rgba(1, 28, 37, 0.28);
	flex-direction: column;
	overflow: hidden;
}

.cart-drawer[open] {
	display: flex;
	animation: smast-drawer-in 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cart-drawer::backdrop {
	background: rgba(1, 28, 37, 0.45);
}

@keyframes smast-drawer-in {
	from {
		transform: translateX(32px);
		opacity: 0;
	}
}

.cart-drawer__head {
	flex: none;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 16px 16px 24px;
	background: var(--c-white);
	border-bottom: 1px solid var(--c-line);
}

.cart-drawer__title {
	font-size: 24px;
	letter-spacing: -0.01em;
}

.cart-drawer__body {
	flex: 1;
	min-height: 0;
	display: flex;
	flex-direction: column;
	transition: opacity 0.15s ease;
}

.cart-drawer__body.is-busy {
	pointer-events: none;
}

.cart-drawer__body.is-busy > * {
	opacity: 0.45;
}

.cart-drawer__items {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	margin: 0;
	padding: 16px;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cart-line {
	display: flex;
	gap: 14px;
	padding: 12px;
	background: var(--c-white);
	border: 1px solid var(--c-line);
	border-radius: 20px;
}

.cart-line__media {
	flex: none;
	width: 88px;
	height: 88px;
	border-radius: 14px;
	background: var(--c-img);
	overflow: hidden;
}

.cart-line__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cart-line__info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.cart-line__name {
	font-family: var(--f-head);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.25;
	color: var(--c-ink);
}

a.cart-line__name:hover {
	color: var(--c-green);
}

.cart-line__variant {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	font-size: 13px;
	color: var(--c-muted);
}

.cart-line__price {
	margin-top: 2px;
	font-size: 18px;
}

.cart-line__actions {
	margin-top: 8px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.qty {
	display: inline-flex;
	align-items: center;
	height: 40px;
	border: 1.5px solid var(--c-line-strong);
	border-radius: 12px;
	background: var(--c-white);
	overflow: hidden;
}

.qty__btn {
	width: 38px;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--c-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.qty__btn:hover:not(:disabled) {
	background: var(--c-latte);
}

.qty__btn:disabled {
	color: #A9B0B1;
	cursor: not-allowed;
}

.qty__btn:focus-visible,
.qty__input:focus-visible {
	outline: 3px solid var(--c-green);
	outline-offset: -3px;
	border-radius: 10px;
}

.qty__input {
	width: 40px;
	height: 100%;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	text-align: center;
	font-weight: 700;
	-moz-appearance: textfield;
	appearance: textfield;
}

.qty__input:focus {
	box-shadow: none;
}

.qty__input::-webkit-outer-spin-button,
.qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cart-line__remove {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 40px;
	padding: 0 8px;
	border: 0;
	border-radius: 10px;
	background: transparent;
	color: var(--c-muted);
	font-size: 13px;
	font-weight: 600;
}

.cart-line__remove:hover {
	color: var(--c-orange-ink);
	background: var(--c-orange-soft);
}

.cart-drawer__foot {
	flex: none;
	padding: 18px 24px 24px;
	background: var(--c-white);
	border-top: 1px solid var(--c-line);
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cart-drawer__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	font-weight: 700;
}

.cart-drawer__subtotal .price {
	font-size: 26px;
}

.cart-drawer__note {
	font-size: 13px;
	color: var(--c-muted);
}

.cart-drawer__ctas {
	margin-top: 6px;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: 10px;
}

.cart-drawer__ctas .btn-secondary,
.cart-drawer__ctas .btn-buy {
	min-height: 54px;
	height: auto;
	padding: 0 14px;
}

.cart-drawer__empty {
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 40px 32px;
	text-align: center;
}

.cart-drawer__empty .ibox {
	margin-bottom: 6px;
}

.cart-drawer__empty-title {
	font-family: var(--f-head);
	font-size: 22px;
	font-weight: 800;
}

.cart-drawer__empty-text {
	color: var(--c-muted);
	max-width: 280px;
}

.cart-drawer__error {
	margin: 0 16px 16px;
	padding: 12px 14px;
	border-radius: 12px;
	background: var(--c-orange-soft);
	color: var(--c-orange-ink);
	font-size: 14px;
	font-weight: 600;
}

.cart-drawer__error[hidden] {
	display: none;
}


@media (max-width: 760px) {
	.suggest__item {
		grid-template-columns: 48px minmax(0, 1fr) auto;
		gap: 2px 10px;
	}

	.suggest__img {
		width: 48px;
		height: 48px;
	}

	.suggest__excerpt {
		display: none;
	}

	.suggest__price {
		font-size: 15px;
	}

	.cart-drawer {
		width: 100%;
	}

	.cart-drawer__head {
		padding: 12px 8px 12px 18px;
	}

	.cart-drawer__title {
		font-size: 22px;
	}

	.cart-drawer__items {
		padding: 12px;
	}

	.cart-line__media {
		width: 72px;
		height: 72px;
	}

	.cart-drawer__foot {
		padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
	}

	.cart-drawer__ctas {
		grid-template-columns: minmax(0, 1fr);
	}

	.cart-drawer__ctas .btn-buy {
		order: -1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cart-drawer[open] {
		animation: none;
	}
}

@media (max-width: 760px) {
	/* Pe mobil categoria se alege din chip-uri, ca în design. */
	.site-search .cat-pick {
		display: none !important;
	}
}
