/**
 * Header: dropdown de conta (visitante e logado).
 *
 * @package Woostify_Child
 */

.ks-auth-header {
	display: inline-flex;
	align-items: center;
	font-size: 0.875rem;
	line-height: 1.25;
	color: inherit;
}

.ks-auth-header__favorites-link {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0;
	font-size: 0.875rem;
	font-weight: 600;
	color: inherit;
	text-decoration: none;
}

.ks-auth-header__favorites-link:hover,
.ks-auth-header__favorites-link:focus-visible {
	text-decoration: underline;
	text-underline-offset: 2px;
	outline: none;
}

.ks-auth-header__favorites-icon {
	display: flex;
	flex-shrink: 0;
	width: 1.1rem;
	height: 1.1rem;
	align-items: center;
	justify-content: center;
	color: inherit;
	opacity: 0.9;
}

.ks-auth-header__favorites-icon svg {
	display: block;
	flex-shrink: 0;
	width: 1.05rem;
	height: 1.05rem;
}

.ks-auth-header__favorites-link--standalone .ks-favorites-count-badge {
	margin-left: 0.15rem;
}

/* Só ícone + contador ([ks_auth_guest_favorites_link icon_only="1"]) */
.ks-auth-header__favorites-link--icon-only {
	gap: 0.2rem;
	padding: 0.35rem 0.45rem;
	min-width: 2.5rem;
	min-height: 2.5rem;
	justify-content: center;
	box-sizing: border-box;
	border-radius: 999px;
}

.ks-auth-header__favorites-link--icon-only:hover,
.ks-auth-header__favorites-link--icon-only:focus-visible {
	text-decoration: none;
	background: rgba(0, 0, 0, 0.06);
}

.ks-auth-header__favorites-link--icon-only .ks-auth-header__favorites-icon {
	width: 1.2rem;
	height: 1.2rem;
}

.ks-auth-header__favorites-link--icon-only .ks-auth-header__favorites-icon svg {
	display: block;
	width: 1.15rem;
	height: 1.15rem;
}

.ks-auth-header__favorites-link--icon-only .ks-favorites-count-badge {
	margin-left: 0;
}

/* Mobile: <a> com classes do gatilho desktop — sem title; chevron só decorativo (não abre menu) */
a.ks-auth-header--user-mobile.ks-auth-dropdown__trigger {
	text-decoration: none;
	color: inherit;
	cursor: pointer;
}

a.ks-auth-header--user-mobile:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* —— Dropdown —— */
.ks-auth-dropdown {
	position: relative;
	z-index: 300;
}

/* Ponte entre gatilho e painel: evita mouseleave ao atravessar o vão (abertura por hover). */
.ks-auth-dropdown.is-open::before {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	height: 0.65rem;
	z-index: 299;
}

.ks-auth-dropdown__trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.65rem;
	max-width: 100%;
	padding: 0.25rem 0;
	margin: 0;
	border: none;
	background: transparent;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-align: start;
}

.ks-auth-dropdown__trigger:focus {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ks-auth-dropdown__trigger-icon {
	display: flex;
	flex-shrink: 0;
	width: 2.25rem;
	height: 2.25rem;
	align-items: center;
	justify-content: center;
	border: 1.5px solid currentColor;
	border-radius: 50%;
	color: inherit;
}

.ks-auth-dropdown__trigger-icon svg {
	width: 1.15rem;
	height: 1.15rem;
}

.ks-auth-dropdown__trigger-icon .ks-auth-dropdown__trigger-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.ks-auth-dropdown__trigger-icon:has(.ks-auth-dropdown__trigger-img) {
	padding: 0;
	border: none;
	overflow: hidden;
}

.ks-auth-dropdown__trigger-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.ks-auth-dropdown__welcome {
	font-size: 0.75rem;
	opacity: 0.92;
}

.ks-auth-header--user .ks-auth-dropdown__welcome {
	font-weight: 500;
}

.ks-auth-dropdown__cta {
	font-size: 0.875rem;
	font-weight: 700;
}

.ks-auth-header--user .ks-auth-dropdown__cta {
	font-weight: 600;
}

.ks-auth-dropdown__chevron {
	display: flex;
	flex-shrink: 0;
	margin-left: 0.15rem;
	opacity: 0.7;
	transition: transform 0.2s ease;
}

.ks-auth-dropdown__chevron svg {
	width: 1rem;
	height: 1rem;
}

.ks-auth-dropdown.is-open .ks-auth-dropdown__chevron {
	transform: rotate(180deg);
}

/* Visitante: abre modal de login/registo — sem seta nem painel */
.ks-auth-header--guest-modal .ks-auth-dropdown__trigger--modal {
	cursor: pointer;
}

.ks-auth-header--guest-modal .ks-auth-dropdown__trigger--modal:hover .ks-auth-dropdown__cta,
.ks-auth-header--guest-modal .ks-auth-dropdown__trigger--modal:focus-visible .ks-auth-dropdown__cta {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Painel */
.ks-auth-dropdown__panel {
	position: absolute;
	top: calc(100% + 0.65rem);
	right: 0;
	width: min(17.5rem, calc(100vw - 1.5rem));
	padding: 0;
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12), 0 0 1px rgba(0, 0, 0, 0.08);
	color: #1a1a1a;
	text-align: start;
}

.ks-auth-dropdown__pointer {
	position: absolute;
	top: -7px;
	right: 1.25rem;
	width: 12px;
	height: 12px;
	background: #fff;
	border-right: 1px solid rgba(0, 0, 0, 0.06);
	border-bottom: 1px solid rgba(0, 0, 0, 0.06);
	transform: rotate(-135deg);
	box-shadow: -2px 2px 4px rgba(0, 0, 0, 0.04);
}

.ks-auth-dropdown__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.1rem 0.9rem;
}

.ks-auth-dropdown__avatar {
	display: flex;
	width: 2.75rem;
	height: 2.75rem;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: #e8e8e8;
	color: #fff;
}

.ks-auth-dropdown__avatar svg {
	width: 1.35rem;
	height: 1.35rem;
	stroke: #fff;
}

.ks-auth-dropdown__avatar .ks-auth-dropdown__avatar-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 50%;
}

.ks-auth-dropdown__avatar:has(.ks-auth-dropdown__avatar-img) {
	background: #ddd;
	overflow: hidden;
}

.ks-auth-dropdown__greet {
	margin: 0;
	font-size: 0.9375rem;
	line-height: 1.35;
}

.ks-auth-dropdown__greet-name {
	font-weight: 700;
}

.ks-auth-dropdown__divider {
	height: 1px;
	margin: 0 0.75rem;
	background: #e5e5e5;
}

.ks-auth-dropdown__nav {
	display: flex;
	flex-direction: column;
	padding: 0.35rem 0 0.5rem;
}

.ks-auth-dropdown__link {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 1.1rem;
	color: inherit;
	text-decoration: none;
	font-size: 0.9375rem;
	font-weight: 500;
	transition: background 0.15s ease;
}

.ks-auth-dropdown__link:hover,
.ks-auth-dropdown__link:focus {
	background: rgba(0, 0, 0, 0.04);
	outline: none;
}

.ks-auth-dropdown__link-icon {
	display: flex;
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	align-items: center;
	justify-content: center;
	color: #1a1a1a;
}

.ks-auth-dropdown__link-icon svg {
	width: 1.25rem;
	height: 1.25rem;
}

/* Rastrear Pedido — expande campo (template URL com CODE no PHP) */
.ks-auth-dropdown .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ks-auth-track {
	border-top: 1px solid #e5e5e5;
}

.ks-auth-track__head {
	display: flex;
	width: 100%;
	align-items: center;
	gap: 0.75rem;
	padding: 0.65rem 1.1rem;
	margin: 0;
	border: none;
	background: transparent;
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 500;
	color: inherit;
	text-align: start;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ks-auth-track__head:hover,
.ks-auth-track__head:focus {
	background: rgba(0, 0, 0, 0.04);
	outline: none;
}

.ks-auth-track__title {
	flex: 1;
	min-width: 0;
}

.ks-auth-track__expand-icon {
	display: flex;
	flex-shrink: 0;
	opacity: 0.55;
	transition: transform 0.2s ease;
}

.ks-auth-track__expand-icon svg {
	width: 0.9rem;
	height: 0.9rem;
}

.ks-auth-track.is-open .ks-auth-track__expand-icon {
	transform: rotate(180deg);
}

.ks-auth-track__panel {
	padding: 0 1.1rem 0.75rem;
}

.ks-auth-track__field {
	display: flex;
	align-items: stretch;
	overflow: hidden;
	border: 1px solid #d5d5d5;
	border-radius: 8px;
	background: #fff;
}

.ks-auth-track__input {
	flex: 1;
	min-width: 0;
	padding: 0.5rem 0.65rem;
	border: none;
	font: inherit;
	font-size: 0.875rem;
}

.ks-auth-track__input::placeholder {
	color: #999;
}

.ks-auth-track__input:focus {
	outline: none;
}

.ks-auth-track__submit {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	padding: 0;
	border: none;
	border-left: 1px solid #e5e5e5;
	background: #fafafa;
	color: #1a1a1a;
	cursor: pointer;
	transition: background 0.15s ease;
}

.ks-auth-track__submit:hover,
.ks-auth-track__submit:focus {
	background: #f0f0f0;
	outline: none;
}

.ks-auth-track__submit svg {
	width: 1.1rem;
	height: 1.1rem;
}

.ks-auth-dropdown__footer {
	padding: 0.5rem 1.1rem 1rem;
	border-top: 1px solid #e5e5e5;
}

.ks-auth-dropdown__logout {
	font-size: 0.875rem;
	font-weight: 600;
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ks-auth-dropdown__logout:hover {
	opacity: 0.85;
}

/* Minha Conta — página «Foto do perfil» */
.ks-account-avatar__intro {
	margin-bottom: 1rem;
	max-width: 36rem;
}

.ks-account-avatar__preview {
	margin-bottom: 0.75rem;
}

.ks-account-avatar__preview-caption {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	color: #555;
}

.ks-account-avatar__preview img {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.08);
	box-shadow: none;
	filter: none;
}

.ks-account-avatar__form .woocommerce-form-row {
	margin-bottom: 1rem;
}

.ks-account-avatar__form label {
	display: block;
	margin-bottom: 0.35rem;
	font-weight: 600;
}

.ks-account-avatar__file-error {
	margin: 0.5rem 0 0;
	font-size: 0.875rem;
	color: #b32d2e;
}

/* Remover foto: no header do cartao (ver endpoints.css .ks-account-avatar__header). */
