/**
 * Account modal — the bottom nav's "Account" tab (mobile only, see
 * parts/bottom-nav.html) opens this as a bottom sheet instead of navigating
 * straight to /my-account/, so a shopper mid-browse can check an order or
 * log in without losing their place on the page. Structurally mirrors
 * cart-drawer.css (same backdrop + panel + open-state pattern) but slides up
 * from the bottom instead of in from the side, and adds swipe-to-dismiss
 * (assets/js/account-modal.js) since that's the expected gesture for a
 * mobile bottom sheet.
 */

.zozia-account-modal [hidden] {
	display: none !important;
}

.zozia-account-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	visibility: hidden;
	pointer-events: none;
}

.zozia-account-modal.is-open {
	visibility: visible;
	pointer-events: auto;
}

.zozia-account-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(36, 16, 25, 0.45);
	opacity: 0;
	transition: opacity 0.3s ease;
	border: none;
	padding: 0;
	margin: 0;
	cursor: default;
}

.zozia-account-modal.is-open .zozia-account-modal__backdrop {
	opacity: 1;
}

.zozia-account-modal__panel {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	background: var(--wp--preset--color--white);
	border-radius: 20px 20px 0 0;
	box-shadow: 0 -12px 32px rgba(36, 16, 25, 0.18);
	transform: translateY(100%);
	transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
	/* iOS home-indicator safe area — otherwise the last link/CTA sits flush
	   against the gesture bar on notched devices. */
	padding-bottom: env(safe-area-inset-bottom);
}

.zozia-account-modal.is-open .zozia-account-modal__panel {
	transform: translateY(0);
}

/* Dragged mid-swipe by assets/js/account-modal.js — no transition while the
   finger is actively moving the sheet, only on release (open or close). */
.zozia-account-modal__panel.is-dragging {
	transition: none;
}

.zozia-account-modal__handle {
	flex-shrink: 0;
	width: 36px;
	height: 4px;
	border-radius: 2px;
	background: var(--wp--preset--color--border-light);
	margin: 12px auto 4px;
	/* Generous invisible hit area around the visible pill — a 4px-tall bar
	   is nearly impossible to grab with a thumb otherwise. touch-action
	   keeps vertical drags from also scrolling the page underneath. */
	position: relative;
	touch-action: none;
}

.zozia-account-modal__handle::before {
	content: "";
	position: absolute;
	inset: -16px -60px;
}

.zozia-account-modal__header {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 8px 24px 12px;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.zozia-account-modal__title {
	margin: 0;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 20px;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.zozia-account-modal__close {
	border: none;
	background: none;
	padding: 4px;
	margin: -4px;
	cursor: pointer;
	display: flex;
	color: var(--wp--preset--color--ink);
}

.zozia-account-modal__body {
	overflow-y: auto;
	padding: 20px 24px calc(24px + env(safe-area-inset-bottom));
}

/* Logged in ------------------------------------------------------------ */

.zozia-account-modal__profile {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-bottom: 20px;
	margin-bottom: 4px;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
}

.zozia-account-modal__avatar {
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--heading);
	font-size: 19px;
	font-weight: 600;
}

.zozia-account-modal__profile-text {
	min-width: 0;
}

.zozia-account-modal__name {
	margin: 0 0 2px;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 16px;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zozia-account-modal__email {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 13px;
	color: var(--wp--preset--color--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.zozia-account-modal__links {
	list-style: none;
	margin: 0;
	padding: 0;
}

.zozia-account-modal__link {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 15px 2px;
	border-bottom: 1px solid var(--wp--preset--color--border-light);
	text-decoration: none;
	color: var(--wp--preset--color--ink);
}

.zozia-account-modal__links li:last-child .zozia-account-modal__link {
	border-bottom: none;
}

.zozia-account-modal__link span {
	flex: 1 1 auto;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 600;
}

.zozia-account-modal__chevron {
	flex-shrink: 0;
}

.zozia-account-modal__logout {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 8px;
	padding: 16px 2px 4px;
	border: none;
	background: none;
	text-decoration: none;
	cursor: pointer;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 700;
	color: var(--wp--preset--color--sale);
}

/* Logged out ------------------------------------------------------------ */

.zozia-account-modal__guest {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 12px 0 8px;
}

.zozia-account-modal__guest-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	border-radius: 50%;
	background: var(--wp--preset--color--surface);
	margin-bottom: 16px;
}

.zozia-account-modal__guest-title {
	margin: 0 0 8px;
	font-family: var(--wp--preset--font-family--heading);
	font-size: 20px;
	font-weight: 600;
	color: var(--wp--preset--color--ink);
}

.zozia-account-modal__guest-copy {
	margin: 0;
	max-width: 30ch;
	font-family: var(--wp--preset--font-family--body);
	font-size: 14px;
	line-height: 1.5;
	color: var(--wp--preset--color--muted);
}

.zozia-account-modal__cta {
	display: block;
	width: 100%;
	margin-top: 24px;
	padding: 16px 0;
	border-radius: 26px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--white);
	text-align: center;
	text-decoration: none;
	font-family: var(--wp--preset--font-family--body);
	font-size: 15px;
	font-weight: 700;
}

/* Locks the page behind the sheet — a bottom sheet that still lets the page
   scroll underneath reads as broken, since the sheet itself doesn't move
   with it. */
body.zozia-account-modal-open {
	overflow: hidden;
}
