/* Ant Antics Messages (My Account). Mobile-first, black accents on teal site chrome. */

/* Full Messages panel (My Account content column) - woodland, no 100vw bleed. */
body.woocommerce-account.aa-messaging .woocommerce-MyAccount-content {
	box-sizing: border-box;
	padding: 1.25rem 1.15rem 1.75rem;
	border-radius: 12px;
	background-color: #e7f3ec;
	background-image: url("../images/pine-needles.svg");
	background-repeat: repeat;
	background-size: 160px 160px;
}

.aa-msg {
	font-family: inherit;
	color: var(--aa-ink, #111414);
	max-width: none;
	width: 100%;
	box-sizing: border-box;
	background: transparent;
	padding: 0;
}

.aa-msg-intro,
.aa-msg p {
	margin: 0 0 1em;
	line-height: 1.5;
}

.aa-msg-hint {
	display: block;
	margin-top: 0.35em;
	font-size: 0.9em;
	font-weight: 400;
	color: #555;
}

.aa-msg label {
	display: block;
	font-weight: 600;
	margin: 0 0 0.3em;
}

.aa-msg input[type="text"],
.aa-msg input[type="email"],
.aa-msg select,
.aa-msg textarea {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 1rem;
	padding: 0.65em 0.75em;
	border: 1px solid var(--aa-line, #cfd4d4);
	border-radius: 8px;
	background: #fff;
	color: var(--aa-ink, #111414);
	line-height: 1.35;
	min-height: 3rem;
	height: auto;
}

/* Selects: theme often sets a fixed height; keep option text and descenders visible. */
.aa-msg select {
	height: auto !important;
	min-height: 3rem;
	line-height: 1.35 !important;
	padding: 0.75em 2.5em 0.75em 0.75em;
	overflow: visible;
	text-overflow: ellipsis;
	white-space: nowrap;
	vertical-align: middle;
}

.aa-msg textarea {
	padding: 0.75em;
	line-height: 1.5;
	min-height: 8rem;
}

.aa-msg input[readonly] {
	background: #f3f3f3;
	color: #333;
}

.aa-msg input:focus,
.aa-msg select:focus,
.aa-msg textarea:focus {
	outline: 2px solid #111414;
	outline-offset: 1px;
	border-color: #111414;
}

.aa-msg-btn,
a.aa-msg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0;
	min-height: 48px;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: #00818D;
	background-color: #00818D;
	color: #fff;
	font-family: Barlow, "Barlow Fallback", "Segoe UI", sans-serif;
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.2;
	text-decoration: none;
	box-shadow: none;
	transform: none;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.aa-msg-btn::after,
a.aa-msg-btn::after {
	content: "";
	display: block;
	width: 0;
	height: 0.45em;
	margin-left: 0;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translateX(-8px) rotate(45deg);
	opacity: 0;
	transition: width 0.2s ease, margin-left 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.aa-msg-btn:hover,
.aa-msg-btn:focus-visible,
a.aa-msg-btn:hover,
a.aa-msg-btn:focus-visible {
	background: #1FC8D4;
	background-color: #1FC8D4;
	color: #111414;
	transform: translateY(-2px);
	box-shadow: 0 8px 16px rgba(17, 20, 20, 0.16);
	filter: none;
}

.aa-msg-btn:hover::after,
.aa-msg-btn:focus-visible::after,
a.aa-msg-btn:hover::after,
a.aa-msg-btn:focus-visible::after {
	width: 0.45em;
	margin-left: 10px;
	opacity: 1;
	transform: translateX(0) rotate(45deg);
}

.aa-msg-btn:focus-visible,
a.aa-msg-btn:focus-visible {
	outline: 2px solid #111414;
	outline-offset: 3px;
}

.aa-msg-actions {
	margin: 0 0 1.5em;
}

.aa-msg-back {
	margin: 0 0 1em;
}

.aa-msg-back a {
	color: #111414;
	font-weight: 600;
	text-decoration: underline;
}

.aa-msg-hp {
	position: absolute;
	left: -9999px;
}

.aa-msg-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 8px;
}

.aa-msg-list-item a {
	display: grid;
	gap: 6px;
	padding: 14px 16px;
	border: 1px solid var(--aa-line, #cfd4d4);
	border-radius: 12px;
	background: #fff;
	text-decoration: none;
	color: inherit;
}

.aa-msg-list-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
}

.aa-msg-list-item a:hover,
.aa-msg-list-item a:focus-visible {
	border-color: #111414;
	outline: 2px solid #111414;
	outline-offset: 1px;
}

.aa-msg-list-title {
	font-weight: 700;
	color: #111414;
}

.aa-msg-list-meta {
	font-size: 0.9em;
	color: #555;
}

.aa-msg-empty {
	color: #555;
}

.aa-msg-thread-head {
	margin: 0 0 1.25em;
	padding-bottom: 0.75em;
	border-bottom: 2px solid #111414;
}

.aa-msg-thread-title {
	margin: 0 0 0.4em;
	font-size: 1.25rem;
	line-height: 1.3;
}

.aa-msg-thread-meta {
	margin: 0;
	font-size: 0.95em;
	color: #555;
}

.aa-msg-badge {
	display: inline-block;
	padding: 0.2em 0.65em;
	border-radius: 999px;
	font-size: 0.75em;
	font-weight: 700;
	line-height: 1.35;
	letter-spacing: 0.01em;
	vertical-align: middle;
	white-space: nowrap;
}

.aa-msg-badge-open {
	background: #1b7f4a;
	color: #fff;
}

.aa-msg-badge-needs_reply {
	background: #c47a12;
	color: #fff;
}

.aa-msg-badge-resolved {
	background: #0b9aa8;
	color: #fff;
}

.aa-msg-badge-closed {
	background: #111414;
	color: #fff;
}

.aa-msg-thread {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	margin: 0 0 1.5em;
}

.aa-msg-bubble {
	box-sizing: border-box;
	width: auto;
	max-width: 100%;
	min-width: 0;
	margin-left: 0;
	margin-right: 0;
	overflow-wrap: anywhere;
	word-wrap: break-word;
	word-break: break-word;
	white-space: normal;
	padding: 12px 14px;
	border-radius: 12px;
	border: 1px solid var(--aa-line, #cfd4d4);
	background: #fff;
}

.aa-msg-bubble-customer {
	border-left: 3px solid #111414;
}

.aa-msg-bubble-staff {
	border-left: 3px solid var(--aa-teal, #1fc8d4);
	background: #f7fbfb;
}

.aa-msg-bubble-system {
	border-left: 3px solid #999;
	color: #555;
	font-size: 0.95em;
}

.aa-msg-bubble-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1em;
	margin: 0 0 0.45em;
	font-size: 0.85em;
	color: #555;
}

.aa-msg-bubble-who {
	font-weight: 700;
	color: #111414;
}

.aa-msg-bubble-body {
	margin: 0;
}

.aa-msg-bubble-body p:last-child {
	margin-bottom: 0;
}

.aa-msg-atts {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0.75em 0 0;
	padding: 0;
}

.aa-msg-atts img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: cover;
	border-radius: 8px;
	border: 1px solid var(--aa-line, #cfd4d4);
}

.aa-msg-closed-note {
	padding: 14px 16px;
	border: 1px solid var(--aa-line, #cfd4d4);
	border-radius: 12px;
	background: #f7f7f7;
	color: #333;
}

.aa-msg-form p {
	margin: 0 0 1em;
}

/* 0.2.10: mobile wrap. Message content never wider than the bubble. */
body.woocommerce-account.aa-messaging .woocommerce-MyAccount-content,
.aa-msg {
	max-width: 100%;
	min-width: 0;
}

.aa-msg-bubble-meta > *,
.aa-msg-bubble-body {
	min-width: 0;
	max-width: 100%;
}

.aa-msg-bubble-body,
.aa-msg-bubble-body p,
.aa-msg-bubble-body a,
.aa-msg-bubble-body li {
	overflow-wrap: anywhere;
	word-break: break-word;
	white-space: normal;
}

.aa-msg-bubble-body pre,
.aa-msg-bubble-body code {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	word-break: break-word;
	max-width: 100%;
}

.aa-msg-bubble-body pre {
	overflow-x: auto;
}

.aa-msg-bubble-body img,
.aa-msg-bubble-body video,
.aa-msg-bubble-body iframe {
	max-width: 100%;
	height: auto;
}

.aa-msg-bubble-body table {
	display: block;
	max-width: 100%;
	overflow-x: auto;
}

@media (min-width: 800px) {
	.aa-msg-bubble {
		padding: 14px 18px;
	}

	/* Keep long form fields readable without shrinking the woodland panel. */
	.aa-msg-form {
		max-width: 40rem;
	}
}
