/* ==========================================================================
   Cantus My Account Tiles
   Tiles row across the top; content stacked below.
   ========================================================================== */

/* Force the My Account wrapper to stack vertically instead of the default
   two-column (nav | content) layout. */
.woocommerce-account .woocommerce-MyAccount-navigation,
.woocommerce-account .woocommerce-MyAccount-content {
	float: none;
	width: 100%;
}

.woocommerce-account .woocommerce-MyAccount-content {
	margin-top: 1.5rem;
}

/* --- Tile row --------------------------------------------------------- */
/* display:block !important guards against a theme rule that hides account
   navigation; these tiles use their own class so they shouldn't inherit it,
   but this makes the intent explicit and robust. */
.cantus-ma-tiles {
	display: block !important;
	width: 100%;
	margin: 0 0 1rem;
	/* Nav typography. Font Awesome icons set their own font-family, so they
	   are unaffected by this. */
	font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* The desktop tab row is retired in favour of the dropdown on all screens. */
.cantus-ma-tiles__list {
	display: none !important;
}

/* Optional description / instructions block above the account content. */
.cantus-ma-description {
	margin: 0 0 1.25rem;
}

.cantus-ma-description p:last-child {
	margin-bottom: 0;
}

/* --- Individual tile -------------------------------------------------- */
.cantus-ma-tile {
	margin: 0;
	padding: 0;
}

.cantus-ma-tile a {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	text-align: center;
	min-height: 92px;
	padding: 1rem 0.5rem;
	border: 1px solid #d9d9d9;
	border-radius: 10px;
	background: #f7f7f7;
	color: #222;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color 0.15s ease, border-color 0.15s ease,
		box-shadow 0.15s ease, transform 0.05s ease;
}

/* Tile icon */
.cantus-ma-tile__icon {
	display: block;
	font-size: 1.6rem;
	line-height: 1;
	color: #f5821f;
	transition: color 0.15s ease;
}

.cantus-ma-tile.is-active .cantus-ma-tile__icon {
	color: #fff;
}

.cantus-ma-tile a:hover,
.cantus-ma-tile a:focus {
	background: #ececec;
	border-color: #b9b9b9;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.cantus-ma-tile a:active {
	transform: translateY(1px);
}

/* Active / current tile. The exact color is set from the settings screen. */
.cantus-ma-tile.is-active a {
	background: #f5821f;
	border-color: #f5821f;
	color: #fff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

.cantus-ma-tile.is-active a:hover,
.cantus-ma-tile.is-active a:focus {
	background: #d8721b;
	border-color: #d8721b;
}

/* --- Mobile custom "jump to section" dropdown ------------------------- */
/* Hidden on desktop; the tab row is shown instead. */
.cantus-ma-tiles__menu {
	display: block;
	position: relative;
	width: 100%;
}

/* Toggle button: only shown once JS enhances the menu. */
.cantus-ma-menu-toggle {
	display: none;
	width: 100%;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	margin: 0;
	padding: 0.8rem 0.95rem;
	font: inherit;
	font-weight: 600;
	line-height: 1.2;
	color: #222;
	text-align: left;
	background: #f7f7f7;
	border: 1px solid #d9d9d9;
	border-radius: 10px;
	cursor: pointer;
}

.cantus-ma-menu--js .cantus-ma-menu-toggle {
	display: flex;
}

.cantus-ma-menu-current {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
}

.cantus-ma-menu-icon {
	color: #f5821f;
	font-size: 1.1rem;
	width: 1.25rem;
	text-align: center;
}

.cantus-ma-menu-caret {
	flex: none;
	width: 0;
	height: 0;
	border-left: 5px solid transparent;
	border-right: 5px solid transparent;
	border-top: 6px solid #666;
	transition: transform 0.15s ease;
}

.cantus-ma-menu--js.is-open .cantus-ma-menu-caret {
	transform: rotate(180deg);
}

/* The list: a plain stacked list without JS; an absolute dropdown with JS. */
.cantus-ma-menu-list {
	list-style: none;
	margin: 0.4rem 0 0;
	padding: 0;
	overflow: hidden; /* clip full-width items to the rounded corners */
	background: #fff;
	border: 1px solid #d9d9d9;
	border-radius: 10px;
}

.cantus-ma-menu--js .cantus-ma-menu-list {
	display: none;
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 1000;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.cantus-ma-menu--js.is-open .cantus-ma-menu-list {
	display: block;
}

/* Reset theme list styling (OnePress adds margins/padding to account <li>s,
   which shrinks the items and forces long labels to wrap). */
.cantus-ma-menu-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cantus-ma-menu-item {
	display: flex;
	align-items: center;
	width: 100%;
	box-sizing: border-box;
	gap: 1rem;
	padding: 0.8rem 0.95rem;
	border-radius: 0;
	color: #222;
	font-weight: 600;
	text-decoration: none;
}

/* Let the label take all remaining width before it wraps. */
.cantus-ma-menu-item > span {
	flex: 1 1 auto;
	min-width: 0;
}

.cantus-ma-menu-item-icon {
	flex: none;
	color: #f5821f;
	font-size: 1.1rem;
	width: 1.1rem;
	text-align: center;
}

/* Focus ring only for keyboard navigation (mouse clicks show nothing). */
.cantus-ma-menu-toggle:focus-visible,
.cantus-ma-menu-item:focus-visible {
	outline: 2px solid #f5821f;
	outline-offset: 1px;
}

