/**
 * Custom styles for WooCommerce MyAccount Shortcodes
 */

/* Hide sidebar navigation when shortcode is used */
.woocommerce-myaccount-endpoint .woocommerce-MyAccount-navigation {
	display: none !important;
}

/* Ensure content takes full width */
.woocommerce-myaccount-endpoint .woocommerce-MyAccount-content {
	width: 100%;
	float: none;
}

/* Pagination styling */
.woocommerce-myaccount-endpoint .woocommerce-pagination {
	margin-top: 20px;
	text-align: center;
}

/* Orders summary text above table */
.woocommerce-myaccount-endpoint .wc-myaccount-orders-summary {
	margin: 0 0 12px;
	font-size: 14px;
	color: #50575e;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filters-form {
	margin: 0 0 16px;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filters-row {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex-wrap: wrap;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 180px;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group-date {
	min-width: 260px;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group label {
	font-size: 13px;
	font-weight: 600;
	color: #1d2327;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group select {
	min-height: 38px;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-date-selectors {
	display: flex;
	gap: 8px;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-date-selectors select {
	flex: 1;
}

.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-actions {
	display: flex;
	gap: 8px;
}

@media (max-width: 768px) {
	.woocommerce-myaccount-endpoint .wc-myaccount-orders-filters-row {
		flex-direction: column;
		align-items: stretch;
	}

	.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group,
	.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-group-date {
		min-width: 0;
		width: 100%;
	}

	.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-actions {
		width: 100%;
	}

	.woocommerce-myaccount-endpoint .wc-myaccount-orders-filter-actions .button {
		flex: 1;
		text-align: center;
	}
}

.woocommerce-myaccount-endpoint .woocommerce-pagination ul {
	display: inline-block;
	list-style: none;
	margin: 0;
	padding: 0;
}

.woocommerce-myaccount-endpoint .woocommerce-pagination li {
	display: inline-block;
	margin: 0 5px;
}

.woocommerce-myaccount-endpoint .woocommerce-pagination a,
.woocommerce-myaccount-endpoint .woocommerce-pagination span {
	display: inline-block;
	padding: 8px 12px;
	text-decoration: none;
	border: 1px solid #ddd;
	border-radius: 3px;
}

.woocommerce-myaccount-endpoint .woocommerce-pagination .current {
	background-color: #0073aa;
	color: #fff;
	border-color: #0073aa;
}

/* Order Details Modal */
.wc-myaccount-order-modal {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wc-myaccount-order-modal-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background-color: rgba(0, 0, 0, 0.7);
	backdrop-filter: blur(2px);
}

.wc-myaccount-order-modal-content {
	position: relative;
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
	max-width: 900px;
	width: 90%;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	z-index: 1;
	overflow: hidden;
}

.wc-myaccount-order-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px 30px;
	border-bottom: 1px solid #e0e0e0;
	background: #f8f9fa;
}

.wc-myaccount-order-modal-header h2 {
	margin: 0;
	font-size: 24px;
	font-weight: 600;
	color: #333;
}

.wc-myaccount-order-modal-close {
	background: none;
	border: none;
	font-size: 32px;
	line-height: 1;
	color: #666;
	cursor: pointer;
	padding: 0;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: color 0.2s;
}

.wc-myaccount-order-modal-close:hover {
	color: #000;
}

.wc-myaccount-order-modal-body {
	padding: 30px;
	overflow-y: auto;
	max-height: calc(90vh - 80px);
}

.wc-myaccount-order-modal-loading {
	text-align: center;
	padding: 40px 20px;
	color: #666;
}

.wc-myaccount-order-modal-content-inner {
	animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Responsive modal */
@media (max-width: 768px) {
	.wc-myaccount-order-modal-content {
		width: 95%;
		max-height: 95vh;
	}

	.wc-myaccount-order-modal-header {
		padding: 15px 20px;
	}

	.wc-myaccount-order-modal-header h2 {
		font-size: 20px;
	}

	.wc-myaccount-order-modal-body {
		padding: 20px;
		max-height: calc(95vh - 70px);
	}
}

/* Login and Registration Forms Styling */
.woocommerce-myaccount-shortcodes-login-wrapper {
	max-width: 1200px;
	margin: 40px auto;
	padding: 20px;
}

.woocommerce-myaccount-shortcodes-login-message {
	text-align: center;
	margin-bottom: 30px;
}

.woocommerce-myaccount-shortcodes-login-message p {
	font-size: 16px;
	color: #666;
	margin: 0;
}

/* When only login is available - center it */
.woocommerce-myaccount-shortcodes-login-wrapper.login-only {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.woocommerce-myaccount-shortcodes-login-wrapper.login-only .woocommerce-myaccount-shortcodes-forms-container {
	max-width: 400px;
	width: 100%;
}

/* When both login and registration are available - side by side */
.woocommerce-myaccount-shortcodes-login-wrapper.has-registration .woocommerce-myaccount-shortcodes-forms-container {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 40px;
	align-items: stretch; /* Make columns equal height */
}

.woocommerce-myaccount-shortcodes-login-form-wrapper,
.woocommerce-myaccount-shortcodes-register-wrapper {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
	display: flex;
	flex-direction: column;
	height: 100%; /* Take full height of grid cell */
}

.woocommerce-myaccount-shortcodes-login-form-wrapper h2,
.woocommerce-myaccount-shortcodes-register-wrapper h2 {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 24px;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 10px;
}

/* Hide duplicate registration form that might be in WooCommerce template */
.woocommerce-myaccount-shortcodes-login-form-wrapper .u-columns,
.woocommerce-myaccount-shortcodes-login-form-wrapper .u-column2,
.woocommerce-myaccount-shortcodes-login-form-wrapper .col-2 {
	display: none !important;
}

/* Hide ALL headings from WooCommerce template - we use our own */
.woocommerce-myaccount-shortcodes-login-form-wrapper h2:not(.woocommerce-myaccount-shortcodes-login-title),
.woocommerce-myaccount-shortcodes-login-form-wrapper .col-1 > h2,
.woocommerce-myaccount-shortcodes-login-form-wrapper .u-column1 > h2,
.woocommerce-myaccount-shortcodes-login-form-wrapper #customer_login h2 {
	display: none !important;
}

/* Style our custom heading */
.woocommerce-myaccount-shortcodes-login-form-wrapper .woocommerce-myaccount-shortcodes-login-title {
	margin-top: 0;
	margin-bottom: 20px;
	font-size: 24px;
	font-weight: 600;
	color: #333;
	border-bottom: 2px solid #0073aa;
	padding-bottom: 10px;
}

/* Ensure only the login form shows in the login wrapper */
.woocommerce-myaccount-shortcodes-login-form-wrapper > form.login,
.woocommerce-myaccount-shortcodes-login-form-wrapper form.login {
	display: block;
}

.woocommerce-myaccount-shortcodes-login-form-wrapper .col2-set {
	display: block !important;
}

.woocommerce-myaccount-shortcodes-login-form-wrapper .col-1,
.woocommerce-myaccount-shortcodes-login-form-wrapper .u-column1 {
	width: 100% !important;
	float: none !important;
}

/* Hide the registration section that WooCommerce template might add */
.woocommerce-myaccount-shortcodes-login-form-wrapper #customer_login > .u-column2,
.woocommerce-myaccount-shortcodes-login-form-wrapper #customer_login > .col-2 {
	display: none !important;
}

/* Hide any duplicate forms - ensure only one login form shows */
.woocommerce-myaccount-shortcodes-login-form-wrapper form.login + form.login,
.woocommerce-myaccount-shortcodes-login-form-wrapper form.woocommerce-form-login + form.woocommerce-form-login {
	display: none !important;
}

/* Ensure only the first login form is visible */
.woocommerce-myaccount-shortcodes-login-form-wrapper form.login:not(:first-of-type),
.woocommerce-myaccount-shortcodes-login-form-wrapper form.woocommerce-form-login:not(:first-of-type) {
	display: none !important;
}

/* Responsive: Stack forms on mobile */
@media (max-width: 768px) {
	.woocommerce-myaccount-shortcodes-login-wrapper.has-registration .woocommerce-myaccount-shortcodes-forms-container {
		grid-template-columns: 1fr;
		gap: 30px;
	}

	.woocommerce-myaccount-shortcodes-login-wrapper {
		padding: 15px;
		margin: 20px auto;
	}

	.woocommerce-myaccount-shortcodes-login-form-wrapper,
	.woocommerce-myaccount-shortcodes-register-wrapper {
		padding: 20px;
	}
}

/* User Name Placeholder Styling */
/* Base styles - must work everywhere */
.wc-myaccount-shortcodes-user-name-wrapper,
body .wc-myaccount-shortcodes-user-name-wrapper,
body.page .wc-myaccount-shortcodes-user-name-wrapper,
body.post .wc-myaccount-shortcodes-user-name-wrapper,
body.single .wc-myaccount-shortcodes-user-name-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	gap: 10px !important;
	vertical-align: middle !important;
	line-height: 1 !important;
	white-space: nowrap !important;
}

/* Ensure wrapper displays correctly on WooCommerce product pages and other contexts */
.woocommerce .wc-myaccount-shortcodes-user-name-wrapper,
.single-product .wc-myaccount-shortcodes-user-name-wrapper,
.product .wc-myaccount-shortcodes-user-name-wrapper,
.woocommerce-page .wc-myaccount-shortcodes-user-name-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	gap: 10px !important;
	vertical-align: middle !important;
}

.wc-myaccount-shortcodes-user-avatar,
body .wc-myaccount-shortcodes-user-avatar,
body .wc-myaccount-shortcodes-user-name-wrapper .avatar,
body .wc-myaccount-shortcodes-user-name-wrapper img.avatar,
body .wc-myaccount-shortcodes-user-name-wrapper img {
	width: 45px !important;
	height: 45px !important;
	border-radius: 50% !important;
	display: inline-block !important;
	flex-shrink: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	vertical-align: middle !important;
	object-fit: cover !important;
	max-width: 45px !important;
	max-height: 45px !important;
	min-width: 45px !important;
	min-height: 45px !important;
}

/* Ensure avatar displays correctly on WooCommerce product pages */
.woocommerce .wc-myaccount-shortcodes-user-avatar,
.single-product .wc-myaccount-shortcodes-user-avatar,
.product .wc-myaccount-shortcodes-user-avatar,
.woocommerce-page .wc-myaccount-shortcodes-user-avatar {
	display: inline-block !important;
	width: 45px !important;
	height: 45px !important;
	flex-shrink: 0 !important;
}

.wc-myaccount-shortcodes-user-name,
body .wc-myaccount-shortcodes-user-name,
body .wc-myaccount-shortcodes-user-name-wrapper .wc-myaccount-shortcodes-user-name {
	font-weight: inherit !important;
	color: inherit !important;
	display: inline !important;
	vertical-align: middle !important;
	line-height: 1.5 !important;
	margin: 0 !important;
	padding: 0 !important;
	white-space: normal !important;
}

/* Ensure name displays correctly on WooCommerce product pages */
.woocommerce .wc-myaccount-shortcodes-user-name,
.single-product .wc-myaccount-shortcodes-user-name,
.product .wc-myaccount-shortcodes-user-name,
.woocommerce-page .wc-myaccount-shortcodes-user-name {
	display: inline !important;
	vertical-align: middle !important;
}

/* Override WooCommerce product page styles that might affect placeholder display */
.woocommerce .wc-myaccount-shortcodes-user-name-wrapper img,
.single-product .wc-myaccount-shortcodes-user-name-wrapper img,
.product .wc-myaccount-shortcodes-user-name-wrapper img,
.woocommerce-page .wc-myaccount-shortcodes-user-name-wrapper img {
	display: inline-block !important;
	width: 45px !important;
	height: 45px !important;
	max-width: 45px !important;
	max-height: 45px !important;
	margin: 0 !important;
	padding: 0 !important;
	vertical-align: middle !important;
	float: none !important;
	clear: none !important;
}

/* Ensure placeholder works in product descriptions and other content areas */
.woocommerce div[class*="product"] .wc-myaccount-shortcodes-user-name-wrapper,
.woocommerce .product-summary .wc-myaccount-shortcodes-user-name-wrapper,
.woocommerce .entry-content .wc-myaccount-shortcodes-user-name-wrapper,
.woocommerce .product .wc-myaccount-shortcodes-user-name-wrapper {
	display: inline-flex !important;
	align-items: center !important;
	gap: 10px !important;
	vertical-align: middle !important;
}

/* Prevent any WooCommerce grid/flex layouts from breaking the placeholder */
.woocommerce .wc-myaccount-shortcodes-user-name-wrapper,
.woocommerce-page .wc-myaccount-shortcodes-user-name-wrapper {
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	justify-content: flex-start !important;
}

/* Blocksy Wishlist Endpoint Fixes */
/* Ensure product images are always visible - prevent any hiding */
.woocommerce-myaccount-endpoint .ct-wishlist-table img,
.woocommerce-myaccount-endpoint .ct-wishlist-table .product-thumbnail,
.woocommerce-myaccount-endpoint .ct-wishlist-table .product-thumbnail img,
.woocommerce-myaccount-endpoint .ct-wishlist-table td:first-child img,
.woocommerce-myaccount-endpoint [class*="wishlist"] img,
.woocommerce-myaccount-endpoint [class*="wishlist"] .product-thumbnail,
.woocommerce-myaccount-endpoint [class*="wishlist"] .product-thumbnail img,
.woocommerce-myaccount-endpoint [class*="wishlist"] td:first-child img,
.woocommerce-myaccount-endpoint table[class*="wishlist"] img,
.woocommerce-myaccount-endpoint table[class*="wishlist"] .product-thumbnail img {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	max-width: 100% !important;
	width: auto !important;
	height: auto !important;
}

/* Fix huge add to cart button on desktop - normalize button sizes */
.woocommerce-myaccount-endpoint .ct-wishlist-table .button,
.woocommerce-myaccount-endpoint .ct-wishlist-table .add_to_cart_button,
.woocommerce-myaccount-endpoint .ct-wishlist-table .single_add_to_cart_button,
.woocommerce-myaccount-endpoint .ct-wishlist-table button[type="submit"],
.woocommerce-myaccount-endpoint [class*="wishlist"] .button,
.woocommerce-myaccount-endpoint [class*="wishlist"] .add_to_cart_button,
.woocommerce-myaccount-endpoint [class*="wishlist"] .single_add_to_cart_button,
.woocommerce-myaccount-endpoint [class*="wishlist"] button[type="submit"],
.woocommerce-myaccount-endpoint table[class*="wishlist"] .button,
.woocommerce-myaccount-endpoint table[class*="wishlist"] .add_to_cart_button {
	max-width: 200px !important;
	width: auto !important;
	min-width: auto !important;
	padding: 10px 20px !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	white-space: nowrap !important;
	overflow: hidden !important;
	text-overflow: ellipsis !important;
	display: inline-block !important;
	box-sizing: border-box !important;
}

/* Ensure product images are visible on all devices */
.woocommerce-myaccount-endpoint .ct-wishlist-table img,
.woocommerce-myaccount-endpoint .ct-wishlist-table .product-thumbnail img,
.woocommerce-myaccount-endpoint [class*="wishlist"] img,
.woocommerce-myaccount-endpoint [class*="wishlist"] .product-thumbnail img,
.woocommerce-myaccount-endpoint table[class*="wishlist"] img {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
	max-width: 100% !important;
	height: auto !important;
}

/* Hide duplicate add to cart buttons on tablets and mobiles - more aggressive targeting */
@media (max-width: 1024px) {
	/* Hide all but the first button in each cell - use more specific selectors */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .button ~ .button,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .add_to_cart_button ~ .add_to_cart_button,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .single_add_to_cart_button ~ .single_add_to_cart_button,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td button[type="submit"] ~ button[type="submit"],
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .button ~ .button,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .add_to_cart_button ~ .add_to_cart_button,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .single_add_to_cart_button ~ .single_add_to_cart_button,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td button[type="submit"] ~ button[type="submit"],
	.woocommerce-myaccount-endpoint table[class*="wishlist"] td .button ~ .button,
	.woocommerce-myaccount-endpoint table[class*="wishlist"] td .add_to_cart_button ~ .add_to_cart_button {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
	}
	
	/* Hide duplicate buttons that might be in different containers or wrappers */
	.woocommerce-myaccount-endpoint .ct-wishlist-table tr td:last-child .button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table tr td:last-child .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table tr td:last-child .single_add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] tr td:last-child .button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] tr td:last-child .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] tr td:last-child .single_add_to_cart_button:not(:first-child) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
	}
	
	/* Hide buttons that appear after the first one in any container */
	.woocommerce-myaccount-endpoint .ct-wishlist-table .button:nth-of-type(n+2),
	.woocommerce-myaccount-endpoint .ct-wishlist-table .add_to_cart_button:nth-of-type(n+2),
	.woocommerce-myaccount-endpoint .ct-wishlist-table .single_add_to_cart_button:nth-of-type(n+2),
	.woocommerce-myaccount-endpoint [class*="wishlist"] .button:nth-of-type(n+2),
	.woocommerce-myaccount-endpoint [class*="wishlist"] .add_to_cart_button:nth-of-type(n+2),
	.woocommerce-myaccount-endpoint [class*="wishlist"] .single_add_to_cart_button:nth-of-type(n+2) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
	}
	
	/* Target buttons in table cells more specifically - use :has() if supported, fallback to direct targeting */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td:has(.button) .button:not(:first-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td:has(.add_to_cart_button) .add_to_cart_button:not(:first-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td:has(.button) .button:not(:first-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td:has(.add_to_cart_button) .add_to_cart_button:not(:first-of-type) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
	}
	
	/* More aggressive: Hide any button that's not the first button in its parent */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td > *:not(:first-child) .button,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td > *:not(:first-child) .add_to_cart_button,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td > *:not(:first-child) .button,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td > *:not(:first-child) .add_to_cart_button {
		display: none !important;
	}
	
	/* Hide duplicate buttons in action columns or last columns */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td.actions .button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td.actions .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td:last-child .button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td:last-child .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td.actions .button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td.actions .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td:last-child .button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td:last-child .add_to_cart_button:not(:first-child) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
	}
}

/* Ensure table cells don't force full width buttons */
.woocommerce-myaccount-endpoint .ct-wishlist-table td,
.woocommerce-myaccount-endpoint [class*="wishlist"] td,
.woocommerce-myaccount-endpoint table[class*="wishlist"] td {
	position: relative;
}

.woocommerce-myaccount-endpoint .ct-wishlist-table td .button:first-of-type,
.woocommerce-myaccount-endpoint .ct-wishlist-table td .add_to_cart_button:first-of-type,
.woocommerce-myaccount-endpoint .ct-wishlist-table td .single_add_to_cart_button:first-of-type,
.woocommerce-myaccount-endpoint [class*="wishlist"] td .button:first-of-type,
.woocommerce-myaccount-endpoint [class*="wishlist"] td .add_to_cart_button:first-of-type,
.woocommerce-myaccount-endpoint [class*="wishlist"] td .single_add_to_cart_button:first-of-type {
	display: inline-block !important;
}

/* On mobile/tablet: Limit each table cell to show only ONE button total */
@media (max-width: 1024px) {
	.woocommerce-myaccount-endpoint .ct-wishlist-table td,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td {
		/* Count buttons and hide all but first */
	}
	
	/* Hide all buttons except the very first one in each cell - most aggressive approach */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .single_add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td button[type="submit"]:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .single_add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td button[type="submit"]:not(:first-child) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
	
	/* Also target buttons that might be in nested containers */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td * .button:not(:first-child),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td * .add_to_cart_button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td * .button:not(:first-child),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td * .add_to_cart_button:not(:first-child) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
	
	/* Hide duplicate delete/remove buttons on mobile and tablet - specifically target product-mobile-actions */
	.woocommerce-myaccount-endpoint .product-mobile-actions .remove,
	.woocommerce-myaccount-endpoint .ct-wishlist-table .product-mobile-actions .remove,
	.woocommerce-myaccount-endpoint [class*="wishlist"] .product-mobile-actions .remove {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
	
	/* Hide duplicate delete/remove buttons on mobile and tablet - keep only the rightmost/last one */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove:not(:last-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove-from-wishlist:not(:last-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td a[class*="remove"]:not(:last-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td button[class*="remove"]:not(:last-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td [class*="remove"]:not(:last-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove:not(:last-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove-from-wishlist:not(:last-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td a[class*="remove"]:not(:last-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td button[class*="remove"]:not(:last-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td [class*="remove"]:not(:last-of-type) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
	
	/* Hide first delete button specifically (the left one) */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove-from-wishlist:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td a[class*="remove"]:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td button[class*="remove"]:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint .ct-wishlist-table td [class*="remove"]:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove-from-wishlist:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td a[class*="remove"]:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td button[class*="remove"]:first-of-type:not(:only-of-type),
	.woocommerce-myaccount-endpoint [class*="wishlist"] td [class*="remove"]:first-of-type:not(:only-of-type) {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
	
	/* Also target delete buttons that might be siblings of other elements */
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove ~ .remove,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td .remove-from-wishlist ~ .remove-from-wishlist,
	.woocommerce-myaccount-endpoint .ct-wishlist-table td a[class*="remove"] ~ a[class*="remove"],
	.woocommerce-myaccount-endpoint .ct-wishlist-table td button[class*="remove"] ~ button[class*="remove"],
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove ~ .remove,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td .remove-from-wishlist ~ .remove-from-wishlist,
	.woocommerce-myaccount-endpoint [class*="wishlist"] td a[class*="remove"] ~ a[class*="remove"],
	.woocommerce-myaccount-endpoint [class*="wishlist"] td button[class*="remove"] ~ button[class*="remove"] {
		display: none !important;
		visibility: hidden !important;
		opacity: 0 !important;
		height: 0 !important;
		width: 0 !important;
		padding: 0 !important;
		margin: 0 !important;
		overflow: hidden !important;
		position: absolute !important;
		left: -9999px !important;
		pointer-events: none !important;
	}
}

/* Account Details Message Container - Prevents Layout Shift */
.wc-myaccount-account-details-message {
	min-height: 0;
	margin-bottom: 20px;
	opacity: 0;
	max-height: 0;
	overflow: hidden;
	transition: opacity 0.3s ease-in-out, max-height 0.3s ease-in-out, margin-bottom 0.3s ease-in-out;
}

/* When message container has content, show it smoothly */
.wc-myaccount-account-details-message.has-message {
	opacity: 1;
	max-height: 200px;
	margin-bottom: 20px;
	min-height: auto;
}

/* Ensure smooth appearance of messages */
.wc-myaccount-account-details-message .woocommerce-message,
.wc-myaccount-account-details-message .woocommerce-error {
	animation: slideDownFadeIn 0.3s ease-out;
	margin: 0;
}

@keyframes slideDownFadeIn {
	from {
		opacity: 0;
		transform: translateY(-10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Ensure WooCommerce message styles are preserved */
.wc-myaccount-account-details-message .woocommerce-message,
.wc-myaccount-account-details-message .woocommerce-error {
	display: block;
	width: 100%;
	box-sizing: border-box;
}

/* Remove duplicate notification icons - WooCommerce adds icons via ::before pseudo-element */
/* Hide duplicate icons that appear from multiple WooCommerce classes on the same element */
.wc-myaccount-account-details-message .woocommerce-message.woocommerce-Message::before,
.wc-myaccount-account-details-message .woocommerce-message.woocommerce-message--success::before,
.wc-myaccount-account-details-message .woocommerce-message.woocommerce-Message--success::before {
	/* Hide duplicate - keep only the first ::before icon from .woocommerce-message */
	display: none !important;
	content: none !important;
}

/* Ensure container itself doesn't show an icon */
.wc-myaccount-account-details-message.woocommerce-message::before,
.wc-myaccount-account-details-message.woocommerce-error::before {
	display: none !important;
	content: none !important;
}

/* Keep only the icon from the inner .woocommerce-message element */
.wc-myaccount-account-details-message > .woocommerce-message::before {
	/* This is the only icon we want to show */
	display: block;
}
