/* E-commerce Auth – modal styled to match Monisa / theme (accent #ca9c85) */

.ecommerce-auth-trigger {
	display: inline-flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.ecommerce-auth-trigger .ecommerce-auth-open {
	font-family: inherit;
	font-size: 1rem;
	padding: 0.5em 1em;
	border: 1px solid #ca9c85;
	background: transparent;
	color: #ca9c85;
	cursor: pointer;
	border-radius: 0;
	transition: color 0.2s, background 0.2s, border-color 0.2s;
}

.ecommerce-auth-trigger .ecommerce-auth-open:hover {
	background: #ca9c85;
	color: #fff;
	border-color: #ca9c85;
}

/* Login option inside nav menu – same structure as theme items (li > a > span) so theme styles apply */
.ecommerce-auth-menu-item a.ecommerce-auth-open,
.ecommerce-auth-menu-item a.ecommerce-auth-logout {
	border: none;
	background: none;
	cursor: pointer;
}
.ecommerce-auth-menu-item a.ecommerce-auth-open:hover,
.ecommerce-auth-menu-item a.ecommerce-auth-logout:hover {
	background: none;
}
/* Legacy: if theme still has trigger-in-menu (buttons) */
.ecommerce-auth-trigger-in-menu {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	flex-wrap: wrap;
}
.ecommerce-auth-trigger-in-menu .ecommerce-auth-open {
	padding: 0.35em 0.5em;
	border: none;
	background: transparent;
	color: inherit;
	font-size: inherit;
}
.ecommerce-auth-trigger-in-menu .ecommerce-auth-open:hover {
	background: transparent;
	color: #ca9c85;
}
.ecommerce-auth-menu-item .ecommerce-auth-menu-sep {
	opacity: 0.85;
	font-size: 0.95em;
	margin: 0 0.15em;
	pointer-events: none;
}

/* Header fallback: Sign In / Sign Up when theme doesn't use nav menu (Elementor, custom header) */
.ecommerce-auth-header-fallback {
	position: fixed;
	top: 0;
	right: 0;
	z-index: 99998;
	padding: 10px 16px;
	font-size: 13px;
	line-height: 1.4;
	background: rgba(0, 0, 0, 0.35);
	border-bottom-left-radius: 6px;
}
.ecommerce-auth-header-fallback .ecommerce-auth-trigger-fallback {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}
.ecommerce-auth-header-fallback .ecommerce-auth-open {
	padding: 0.25em 0.5em;
	border: none;
	background: transparent;
	color: #fff;
	cursor: pointer;
	font-size: inherit;
}
.ecommerce-auth-header-fallback .ecommerce-auth-open:hover {
	background: transparent;
	opacity: 0.9;
	text-decoration: underline;
}
.ecommerce-auth-header-fallback .ecommerce-auth-menu-sep {
	color: rgba(255, 255, 255, 0.7);
}
.ecommerce-auth-header-fallback .ecommerce-auth-fallback-logout {
	color: #fff;
	text-decoration: none;
}
.ecommerce-auth-header-fallback .ecommerce-auth-fallback-logout:hover {
	opacity: 0.9;
	text-decoration: underline;
}

/* Modal */
.ecommerce-auth-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	box-sizing: border-box;
}

.ecommerce-auth-modal[hidden] {
	display: none !important;
}

.ecommerce-auth-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.ecommerce-auth-modal-box {
	position: relative;
	width: 100%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	background: #fff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
	padding: 1.75rem;
	font-family: inherit;
}

/* Dedicated row for close button so it never overlaps tabs */
.ecommerce-auth-modal-header {
	display: flex;
	justify-content: flex-end;
	align-items: center;
	min-height: 2.75rem;
	margin-bottom: 0.25rem;
}

.ecommerce-auth-modal-close {
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	border: 1px solid #ddd;
	border-radius: 50%;
	background: #fff;
	font-size: 1.35rem;
	line-height: 1;
	color: #333;
	cursor: pointer;
	transition: color 0.2s, background 0.2s, border-color 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.ecommerce-auth-modal-close:hover {
	color: #ca9c85;
	background: #f9f9f9;
	border-color: #ca9c85;
}

.ecommerce-auth-tabs {
	display: flex;
	gap: 0;
	margin-top: 0;
	margin-bottom: 1.25rem;
	border-bottom: 1px solid #e0e0e0;
}

.ecommerce-auth-tab {
	flex: 1;
	padding: 0.6em 1em;
	border: none;
	background: transparent;
	font-family: inherit;
	font-size: 1rem;
	color: #666;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
}

.ecommerce-auth-tab:hover {
	color: #ca9c85;
}

.ecommerce-auth-tab[aria-selected="true"] {
	color: #ca9c85;
	font-weight: 600;
	border-bottom-color: #ca9c85;
}

/* Social */
.ecommerce-auth-social {
	margin-bottom: 1.25rem;
	padding-bottom: 1.25rem;
	border-bottom: 1px solid #e0e0e0;
}

.ecommerce-auth-social-title {
	margin: 0 0 0.75rem;
	font-size: 0.9rem;
	color: #666;
	text-align: center;
}

.ecommerce-auth-social-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	justify-content: center;
}

.ecommerce-auth-social-btn {
	display: inline-block;
	padding: 0.5em 1em;
	border: 1px solid #ddd;
	background: #fff;
	color: #333;
	text-decoration: none;
	font-size: 0.9rem;
	border-radius: 0;
	transition: border-color 0.2s, background 0.2s;
}

.ecommerce-auth-social-btn:hover {
	border-color: #ca9c85;
	background: #fdf8f6;
	color: #ca9c85;
}

/* Forms */
.ecommerce-auth-forms {
	position: relative;
}

.ecommerce-auth-form {
	display: block;
}

.ecommerce-auth-form[hidden] {
	display: none !important;
}

.ecommerce-auth-form-title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 600;
	color: #333;
}

.ecommerce-auth-messages {
	margin-bottom: 0.75rem;
	padding: 0.5em 0.75em;
	font-size: 0.9rem;
	display: none;
}

.ecommerce-auth-messages.ecommerce-auth-error {
	display: block;
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
}

.ecommerce-auth-messages.ecommerce-auth-success {
	display: block;
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
}

.ecommerce-auth-field {
	margin-bottom: 1rem;
}

.ecommerce-auth-field label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.9rem;
	font-weight: 500;
	color: #444;
}

.ecommerce-auth-field input[type="text"],
.ecommerce-auth-field input[type="email"],
.ecommerce-auth-field input[type="password"],
.ecommerce-auth-field input[type="tel"],
.ecommerce-auth-field select,
.ecommerce-auth-field textarea {
	width: 100%;
	padding: 0.5em 0.75em;
	border: 1px solid #ddd;
	font-family: inherit;
	font-size: 1rem;
	box-sizing: border-box;
	transition: border-color 0.2s;
}

.ecommerce-auth-field input:focus,
.ecommerce-auth-field select:focus,
.ecommerce-auth-field textarea:focus {
	outline: none;
	border-color: #ca9c85;
}

.ecommerce-auth-row-half {
	display: inline-block;
	width: calc(50% - 0.25rem);
	vertical-align: top;
}

.ecommerce-auth-row-half:first-child {
	margin-right: 0.25rem;
}

.ecommerce-auth-row-half + .ecommerce-auth-row-half {
	margin-left: 0.25rem;
}

@media (max-width: 380px) {
	.ecommerce-auth-row-half {
		width: 100%;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}
}

.ecommerce-auth-remember label {
	font-weight: 400;
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.ecommerce-auth-recaptcha-wrap {
	min-height: 78px;
}

.ecommerce-auth-submit {
	margin: 1rem 0 0;
}

.ecommerce-auth-btn {
	width: 100%;
	padding: 0.65em 1em;
	border: none;
	background: #ca9c85;
	color: #fff;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, opacity 0.2s;
}

.ecommerce-auth-btn:hover {
	background: #b88870;
}

.ecommerce-auth-btn:disabled {
	opacity: 0.7;
	cursor: not-allowed;
}

.ecommerce-auth-links {
	margin-top: 0.75rem;
	text-align: center;
}

.ecommerce-auth-links button {
	background: none;
	border: none;
	color: #ca9c85;
	font-size: 0.9rem;
	cursor: pointer;
	text-decoration: underline;
	padding: 0;
}

.ecommerce-auth-links button:hover {
	color: #b88870;
}

.ecommerce-auth-verify-email-display {
	margin-bottom: 0.75rem;
	font-size: 0.95rem;
	color: #555;
}

.ecommerce-auth-form-verify .ecommerce-auth-field input#ecommerce-auth-verify-code {
	letter-spacing: 0.25em;
	text-align: center;
	font-size: 1.25rem;
}

.ecommerce-auth-logout {
	color: #ca9c85;
	text-decoration: none;
}

.ecommerce-auth-logout:hover {
	text-decoration: underline;
}
