/*
 * "My account dashboard" block (dgs-toolkit/account-dashboard): restyles the
 * WooCommerce My account page (navigation, content, tables, forms) and adds
 * the welcome banner and the shortcut tiles. Only WooCommerce's own classes
 * (woocommerce-MyAccount-*) are targeted: its markup and behaviour stay.
 *
 * Colours are the site's GreenLight presets (--wp--preset--color--*), with
 * neutral fallbacks on sites without them.
 */

.dgs-account-dashboard .woocommerce-MyAccount-content {
	container-type: inline-size;
}

.dgs-account-dashboard .woocommerce:has(> .dgs-connexion-carte) {
	justify-content: center;
}

.dgs-account-welcome {
	display: flex;
	align-items: center;
	gap: 1em;
	margin: 0 0 2em;
}

.dgs-account-welcome .avatar {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	object-fit: cover;
	flex-shrink: 0;
}

.dgs-account-welcome p {
	margin: 0;
	color: var(--wp--preset--color--heading, #1d2327);
	font-size: 18px;
	line-height: 1.5;
}

.dgs-account-welcome .dgs-account-since {
	display: inline-block;
	margin-top: 0.5em;
	padding: 0.2em 0.85em;
	border-radius: 999px;
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 22%, var(--wp--preset--color--card-base, #ffffff));
	color: var(--wp--preset--color--brand, #2271b1);
	font-size: 0.9em;
	font-weight: 600;
}

.dgs-account-dashboard .woocommerce-MyAccount-content .dgs-shortcuts-title {
	margin: 0 0 1em;
	font-size: 1.35em;
}

.dgs-shortcuts {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 1.25em;
}

.dgs-shortcuts li {
	margin: 0;
	padding: 0;
}

.dgs-shortcut {
	display: flex;
	flex-direction: column;
	gap: 0.5em;
	height: 100%;
	box-sizing: border-box;
	padding: 1.5em;
	border-radius: 16px;
	background: var(--wp--preset--color--card-base, #ffffff);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 45%, transparent);
	color: var(--wp--preset--color--heading, #1d2327);
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.dgs-shortcut:hover,
.dgs-shortcut:focus-visible {
	transform: translateY(-3px);
	border-color: var(--wp--preset--color--brand, #2271b1);
	box-shadow: 0 12px 28px -12px color-mix(in srgb, var(--wp--preset--color--heading, #1d2327) 35%, transparent);
}

.dgs-shortcut-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	margin-bottom: 0.5em;
	border-radius: 14px;
	background: var(--wp--preset--color--brand, #2271b1);
	color: var(--wp--preset--color--text-on-brand, #ffffff);
	transition: background 0.2s ease;
}

.dgs-shortcut:hover .dgs-shortcut-icon,
.dgs-shortcut:focus-visible .dgs-shortcut-icon {
	background: var(--wp--preset--color--secondary, #1d2327);
}

.dgs-shortcut-icon svg {
	width: 28px;
	height: 28px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.dgs-shortcut-title {
	font-size: 1.15em;
	font-weight: 700;
	line-height: 1.3;
}

.dgs-shortcut-text {
	color: var(--wp--preset--color--lightgrey, #646970);
	font-size: 0.95em;
	line-height: 1.5;
}

.dgs-order-confirmation .dgs-shortcuts-title {
	margin: 0 0 1em;
	font-size: 1.35em;
}

@media (prefers-reduced-motion: reduce) {
	.dgs-shortcut,
		.dgs-shortcut:hover,
		.dgs-shortcut:focus-visible {
			transition: none;
			transform: none;
	}
}

.dgs-account-dashboard .woocommerce {
	display: flex;
	flex-wrap: wrap;
	gap: 2em;
	align-items: flex-start;
}

.woocommerce-account .dgs-account-dashboard .woocommerce {
	max-width: none;
}

.dgs-account-dashboard .woocommerce-notices-wrapper:empty {
	display: none;
}

.dgs-account-dashboard .woocommerce-notices-wrapper {
	flex-basis: 100%;
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation {
	flex: 0 0 220px;
	background: var(--wp--preset--color--background, #f6f7f7);
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 12%, var(--wp--preset--color--background, #f6f7f7));
	border-radius: 16px;
	padding: 0.75em;
	box-sizing: border-box;
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link {
	margin: 0;
	padding: 0;
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation-link a {
	display: block;
	padding: 0.65em 1em;
	border-radius: 10px;
	color: var(--wp--preset--color--heading, #1d2327);
	text-decoration: none;
	font-weight: 600;
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation-link a:hover,
.dgs-account-dashboard .woocommerce-MyAccount-navigation-link a:focus {
	background: var(--wp--preset--color--card-base, #ffffff);
}

.dgs-account-dashboard .woocommerce-MyAccount-navigation-link.is-active a {
	background: var(--wp--preset--color--secondary, #1d2327);
	color: var(--wp--preset--color--text-on-secondary, #ffffff);
}

.dgs-account-dashboard .woocommerce-MyAccount-content {
	flex: 1 1 420px;
	min-width: 0;
	box-sizing: border-box;
}

.dgs-account-dashboard .woocommerce-MyAccount-content h1,
.dgs-account-dashboard .woocommerce-MyAccount-content h2,
.dgs-account-dashboard .woocommerce-MyAccount-content h3 {
	color: var(--wp--preset--color--heading, #1d2327);
}

.dgs-account-dashboard .woocommerce-MyAccount-content mark {
	background: none;
	color: var(--wp--preset--color--brand, #2271b1);
	font-weight: 600;
}

.dgs-account-dashboard table.shop_table,
.dgs-account-dashboard table.woocommerce-orders-table {
	width: 100%;
	border-collapse: separate;
	border-spacing: 0;
	margin: 0 0 1.5em;
	background: var(--wp--preset--color--card-base, #ffffff);
	border: 1px solid var(--wp--preset--color--border, #dcdcde);
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 45%, transparent);
	border-radius: 16px;
	overflow: hidden;
}

.dgs-account-dashboard table.shop_table th,
.dgs-account-dashboard table.shop_table td {
	border: 0;
	padding: 1em 1.25em;
	text-align: left;
	vertical-align: middle;
	color: var(--wp--preset--color--heading, #1d2327);
	background: none;
}

.dgs-account-dashboard table.shop_table thead th {
	background: var(--wp--preset--color--background, #f6f7f7);
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 12%, var(--wp--preset--color--background, #f6f7f7));
	padding-top: 0.8em;
	padding-bottom: 0.8em;
	font-size: 0.8em;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

.dgs-account-dashboard table.shop_table tbody th,
.dgs-account-dashboard table.shop_table tbody td,
.dgs-account-dashboard table.shop_table tfoot th,
.dgs-account-dashboard table.shop_table tfoot td {
	border-top: 1px solid var(--wp--preset--color--border, #dcdcde);
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 35%, transparent);
}

.dgs-account-dashboard table.shop_table tbody tr {
	transition: background-color 0.2s ease-in-out;
}

.dgs-account-dashboard table.shop_table tbody tr:hover {
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 6%, var(--wp--preset--color--card-base, #ffffff));
}

.dgs-account-dashboard table.shop_table tbody th,
.dgs-account-dashboard table.shop_table tfoot th {
	font-weight: 600;
}

.dgs-account-dashboard table.shop_table td a:not(.button),
.dgs-account-dashboard table.shop_table th a:not(.button) {
	color: var(--wp--preset--color--brand, #2271b1);
	font-weight: 600;
	text-decoration: none;
}

.dgs-account-dashboard table.shop_table td a:not(.button):hover,
.dgs-account-dashboard table.shop_table th a:not(.button):hover {
	text-decoration: underline;
}

.dgs-account-dashboard .woocommerce-orders-table__cell-order-date,
.dgs-account-dashboard .woocommerce-orders-table__cell-order-status {
	white-space: nowrap;
}

.dgs-account-dashboard .woocommerce-orders-table__cell-order-status::before {
	content: "";
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 0.5em;
	border-radius: 50%;
	vertical-align: 0.1em;
	background: var(--wp--preset--color--lightgrey, #646970);
}

.dgs-account-dashboard .woocommerce-orders-table__row--status-completed .woocommerce-orders-table__cell-order-status::before {
	background: var(--wp--preset--color--brand, #2271b1);
}

.dgs-account-dashboard .woocommerce-orders-table__row--status-cancelled .woocommerce-orders-table__cell-order-status::before,
.dgs-account-dashboard .woocommerce-orders-table__row--status-failed .woocommerce-orders-table__cell-order-status::before,
.dgs-account-dashboard .woocommerce-orders-table__row--status-refunded .woocommerce-orders-table__cell-order-status::before {
	background: var(--wp--preset--color--border, #dcdcde);
}

.dgs-account-dashboard table.shop_table thead th:last-child:not(:first-child),
.dgs-account-dashboard table.shop_table tbody td:last-child:has(.button) {
	text-align: right;
	white-space: nowrap;
}

.dgs-account-dashboard table.shop_table .button.button {
	padding: 7px 18px;
	margin: 2px 0 2px 6px;
	font-size: 0.875em;
	line-height: 20px;
	background: var(--wp--preset--color--card-base, #ffffff);
	color: var(--wp--preset--color--brand, #2271b1);
	border: 1px solid var(--wp--preset--color--border, #dcdcde);
}

.dgs-account-dashboard table.shop_table .button.button:hover,
.dgs-account-dashboard table.shop_table .button.button:focus {
	background: var(--wp--preset--color--brand, #2271b1);
	color: var(--wp--preset--color--text-on-brand, #ffffff);
	border-color: var(--wp--preset--color--brand, #2271b1);
}

@media (max-width: 767px) {
	.dgs-account-dashboard table.shop_table_responsive thead {
			display: none;
	}
	.dgs-account-dashboard table.shop_table_responsive,
		.dgs-account-dashboard table.shop_table_responsive tbody,
		.dgs-account-dashboard table.shop_table_responsive tr {
			display: block;
	}
	.dgs-account-dashboard table.shop_table_responsive tbody tr + tr {
			border-top: 1px solid var(--wp--preset--color--border, #dcdcde);
			border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 45%, transparent);
	}
	.dgs-account-dashboard table.shop_table_responsive tbody th,
		.dgs-account-dashboard table.shop_table_responsive tbody td {
			display: flex;
			justify-content: space-between;
			align-items: center;
			gap: 1em;
			padding: 0.5em 1.1em;
			border-top: 0;
			text-align: right;
			white-space: normal;
	}
	.dgs-account-dashboard table.shop_table_responsive tbody tr > :first-child {
			padding-top: 1em;
	}
	.dgs-account-dashboard table.shop_table_responsive tbody tr > :last-child {
			padding-bottom: 1em;
	}
	.dgs-account-dashboard table.shop_table_responsive tbody [data-title]::before {
			content: attr(data-title);
			display: block;
			width: auto;
			height: auto;
			margin: 0;
			border-radius: 0;
			background: none;
			font-size: 0.8em;
			font-weight: 700;
			letter-spacing: 0.06em;
			text-transform: uppercase;
			text-align: left;
			color: var(--wp--preset--color--lightgrey, #646970);
	}
	.dgs-account-dashboard table.shop_table_responsive tbody td:last-child:has(.button) {
			justify-content: flex-end;
	}
	.dgs-account-dashboard table.shop_table_responsive tbody td:last-child:has(.button)::before {
			display: none;
	}
}

.dgs-account-dashboard .woocommerce-Addresses {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5em;
	list-style: none;
	margin: 0;
	padding: 0;
}

.dgs-account-dashboard .woocommerce-Address {
	flex: 1 1 260px;
	background: var(--wp--preset--color--background, #f6f7f7);
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 10%, var(--wp--preset--color--background, #f6f7f7));
	border-radius: 16px;
	padding: 1.25em;
	box-sizing: border-box;
}

.dgs-account-dashboard .woocommerce-Address-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin: 0 0 0.75em;
}

.dgs-account-dashboard .woocommerce-Address-title h2,
.dgs-account-dashboard .woocommerce-Address-title h3 {
	margin: 0;
	font-size: 1.1em;
}

.dgs-account-dashboard .woocommerce-Address address {
	font-style: normal;
	color: var(--wp--preset--color--lightgrey, #646970);
}

.dgs-account-dashboard form p.form-row,
.dgs-account-dashboard form p.woocommerce-form-row {
	margin-bottom: 1.2em;
}

.dgs-account-dashboard form label,
.dgs-onboarding-page form label {
	color: var(--wp--preset--color--heading, #1d2327);
	font-weight: 600;
}

.dgs-account-dashboard form input[type="text"],
.dgs-account-dashboard form input[type="email"],
.dgs-account-dashboard form input[type="tel"],
.dgs-account-dashboard form input[type="password"],
.dgs-account-dashboard form input[type="url"],
.dgs-account-dashboard form input[type="datetime-local"],
.dgs-account-dashboard form input[type="date"],
.dgs-account-dashboard form select,
.dgs-account-dashboard form textarea,
.dgs-onboarding-page form input[type="text"],
.dgs-onboarding-page form input[type="email"],
.dgs-onboarding-page form input[type="tel"],
.dgs-onboarding-page form input[type="password"],
.dgs-onboarding-page form input[type="url"],
.dgs-onboarding-page form input[type="datetime-local"],
.dgs-onboarding-page form input[type="date"],
.dgs-onboarding-page form select,
.dgs-onboarding-page form textarea {
	width: 100%;
	max-width: 420px;
	box-sizing: border-box;
	padding: 0.65em 0.9em;
	border: 1px solid var(--wp--preset--color--border, #dcdcde);
	border-radius: 10px;
}

.dgs-account-dashboard .button.button,
.dgs-account-dashboard button[type="submit"] {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 9px;
	background: var(--wp--preset--color--brand, #2271b1);
	color: var(--wp--preset--color--text-on-brand, #ffffff);
	border: none;
	border-radius: var(--wp--custom--border-radius--xlarge, 35px);
	padding: 13px 30px;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--s, 16px);
	line-height: var(--wp--custom--line-height--s, 24px);
	font-family: inherit;
	cursor: pointer;
	text-decoration: none;
	box-shadow: none;
	transform: none;
	transition: var(--wp--custom--transition--ease-in-out, all 0.3s ease-in-out);
}

.dgs-account-dashboard .button.button:hover,
.dgs-account-dashboard .button.button:focus,
.dgs-account-dashboard button[type="submit"]:hover,
.dgs-account-dashboard button[type="submit"]:focus {
	background: var(--wp--preset--color--lightgrey, #646970);
	color: var(--wp--preset--color--card-base, #ffffff);
	box-shadow: none;
	transform: none;
}

.dgs-account-dashboard .button.button:focus-visible,
.dgs-account-dashboard button[type="submit"]:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--wp--preset--color--card-base, #ffffff), 0 0 0 4px var(--wp--preset--color--brand, #2271b1);
}

.dgs-account-dashboard .woocommerce-message,
.dgs-account-dashboard .woocommerce-error,
.dgs-account-dashboard .woocommerce-info {
	list-style: none;
	margin: 0 0 1.5em;
	padding: 1em 1.25em;
	border-radius: 10px;
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 18%, var(--wp--preset--color--background, #f6f7f7));
	color: var(--wp--preset--color--heading, #1d2327);
}

.dgs-account-dashboard .wc-block-components-notice-banner.is-info,
.dgs-account-dashboard .wc-block-components-notice-banner.is-success {
	background: color-mix(in srgb, var(--wp--preset--color--border, #dcdcde) 18%, var(--wp--preset--color--background, #f6f7f7));
	border-color: var(--wp--preset--color--secondary, #1d2327);
	color: var(--wp--preset--color--heading, #1d2327);
}

.dgs-account-dashboard .wc-block-components-notice-banner.is-info > svg,
.dgs-account-dashboard .wc-block-components-notice-banner.is-success > svg {
	background-color: var(--wp--preset--color--secondary, #1d2327);
}

.dgs-account-dashboard .wc-block-components-notice-banner .wc-forward {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	padding: 13px 30px !important;
	border: none;
	border-radius: var(--wp--custom--border-radius--xlarge, 35px);
	background: var(--wp--preset--color--brand, #2271b1) !important;
	color: var(--wp--preset--color--text-on-brand, #ffffff) !important;
	opacity: 1 !important;
	font-family: inherit;
	font-size: var(--wp--preset--font-size--s, 16px);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--s, 24px);
	text-decoration: none;
	transition: var(--wp--custom--transition--ease-in-out, all 0.3s ease-in-out);
}

.dgs-account-dashboard .wc-block-components-notice-banner .wc-forward:hover,
.dgs-account-dashboard .wc-block-components-notice-banner .wc-forward:focus-visible {
	background: var(--wp--preset--color--lightgrey, #646970) !important;
	color: var(--wp--preset--color--card-base, #ffffff) !important;
}

.dgs-account-dashboard .wc-block-components-notice-banner .wc-forward:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--wp--preset--color--card-base, #ffffff), 0 0 0 4px var(--wp--preset--color--brand, #2271b1);
}

.dgs-account-dashboard .wc-block-components-notice-banner__content:has(> .wc-forward) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
}

.dgs-account-dashboard .wc-block-components-notice-banner__content > .wc-forward {
	float: none;
	margin: 0;
}

.dgs-account-dashboard .wc-block-components-notice-banner + .button {
	margin-top: 1em;
}

@media (max-width: 700px) {
	.dgs-account-dashboard .woocommerce-MyAccount-navigation {
			flex-basis: 100%;
	}
	.dgs-account-dashboard .woocommerce-MyAccount-navigation ul {
			flex-direction: row;
			flex-wrap: wrap;
	}
	.dgs-account-dashboard .woocommerce-Addresses {
			flex-direction: column;
	}
}

@media (max-width: 767px) {
	.dgs-account-dashboard .woocommerce {
			gap: 1.25em;
	}
	.dgs-account-dashboard .woocommerce-MyAccount-navigation,
		.dgs-account-dashboard .woocommerce-MyAccount-content {
			flex: 1 1 100%;
	}
	.dgs-account-dashboard .woocommerce-MyAccount-navigation {
			padding: 0.5em;
	}
	.dgs-account-dashboard .woocommerce-MyAccount-navigation ul {
			flex-direction: row;
			flex-wrap: wrap;
			gap: 4px;
	}
	.dgs-account-dashboard .woocommerce-MyAccount-navigation-link a {
			padding: 0.5em 0.9em;
			font-size: 0.9em;
			white-space: nowrap;
	}
	.dgs-account-welcome .avatar {
			width: 48px;
			height: 48px;
	}
}
