/**
 * HZ Wholesale Portal
 * Brand red (#9a1f21) matches the existing product table styling.
 */

.hzwp-card {
	--hzwp-red: #9a1f21;
	--hzwp-red-dark: #7d1a1c;
	--hzwp-ink: #1a1a1a;
	--hzwp-muted: #6b7280;
	--hzwp-line: #e5e7eb;

	max-width: 352px;
	margin: 40px auto;
	padding: 24px;
	background: #fff;
	border: 1px solid var(--hzwp-line);
	border-radius: 12px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .07);
	color: var(--hzwp-ink);
	font-size: 13px;
	line-height: 1.55;
	box-sizing: border-box;
}

.hzwp-account__title {
	margin: 0 0 6px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.25;
}

.hzwp-account__greeting {
	margin: 0 0 16px;
	color: var(--hzwp-muted);
	font-size: 13px;
}

/* ---------- details ---------- */

.hzwp-details {
	margin: 0 0 20px;
	padding: 0;
	border-top: 1px solid var(--hzwp-line);
}

.hzwp-details__row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px solid var(--hzwp-line);
}

.hzwp-details dt {
	margin: 0;
	color: var(--hzwp-muted);
	font-size: 12.5px;
	font-weight: 400;
	flex: 0 0 auto;
}

.hzwp-details dd {
	margin: 0;
	font-size: 12.5px;
	font-weight: 400;
	text-align: right;
	word-break: break-word;
}

/* ---------- status pill ---------- */

.hzwp-pill {
	display: inline-block;
	padding: 3px 11px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.6;
}

.hzwp-pill--approved { background: #e7f7ed; color: #0a7c3f; }
.hzwp-pill--pending  { background: #fff4e5; color: #a35c00; }
.hzwp-pill--rejected { background: #fdeaea; color: var(--hzwp-red); }

/* ---------- buttons ---------- */

.hzwp-actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hzwp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 11px 18px;
	border: 1px solid transparent;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
	font-family: inherit;
}

/* Width intentionally omitted — .hzwp-actions and .hzwp-modal__actions are
   flex columns, so buttons stretch to full width via align-items: stretch. */
.hzwp-btn--block { display: flex; }

.hzwp-btn--primary {
	background: var(--hzwp-red, #9a1f21);
	border-color: var(--hzwp-red, #9a1f21);
	color: #fff;
}

.hzwp-btn--primary:hover,
.hzwp-btn--primary:focus {
	background: var(--hzwp-red-dark, #7d1a1c);
	border-color: var(--hzwp-red-dark, #7d1a1c);
	color: #fff;
}

.hzwp-btn--outline {
	background: #fff;
	border-color: var(--hzwp-red, #9a1f21);
	color: var(--hzwp-red, #9a1f21);
}

.hzwp-btn--outline:hover:not([disabled]),
.hzwp-btn--outline:focus:not([disabled]) {
	background: var(--hzwp-red, #9a1f21);
	border-color: var(--hzwp-red, #9a1f21);
	color: #fff;
}

.hzwp-btn[disabled],
.hzwp-btn[aria-disabled="true"] {
	opacity: .5;
	cursor: not-allowed;
	pointer-events: none;
}

.hzwp-actions__hint {
	margin: -4px 0 0;
	color: var(--hzwp-muted, #6b7280);
	font-size: 13px;
	text-align: center;
}

/* ---------- sign-in pill inside table cells ---------- */

.hzwp-signin-pill {
	display: inline-block;
	padding: 5px 14px;
	background: #9a1f21;
	border-radius: 999px;
	color: #fff !important;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.6;
	text-decoration: none;
	white-space: nowrap;
}

.hzwp-signin-pill:hover { background: #7d1a1c; color: #fff !important; }

/* ---------- modal ---------- */

.hzwp-modal { position: fixed; inset: 0; z-index: 99999; }
.hzwp-modal[hidden] { display: none; }

.hzwp-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(15, 15, 15, .55);
}

.hzwp-modal__dialog {
	position: relative;
	max-width: 440px;
	margin: 10vh auto 0;
	padding: 32px;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	text-align: center;
	box-sizing: border-box;
}

.hzwp-modal__close {
	position: absolute;
	top: 10px;
	right: 14px;
	background: none;
	border: 0;
	color: #9ca3af;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.hzwp-modal__title { margin: 0 0 8px; font-size: 20px; font-weight: 700; }
.hzwp-modal__text  { margin: 0 0 20px; color: #6b7280; font-size: 14px; }

.hzwp-modal__actions { display: flex; flex-direction: column; gap: 12px; }

.hzwp-modal__direct { font-size: 13px; color: #6b7280; }

.hzwp-modal__status:not(:empty) {
	margin-bottom: 14px;
	padding: 10px 12px;
	border-radius: 8px;
	font-size: 14px;
}

.hzwp-modal__status.is-success { background: #e7f7ed; color: #0a7c3f; }
.hzwp-modal__status.is-error   { background: #fdeaea; color: #9a1f21; }

/* ---------- auth forms ---------- */

.hzwp-form__row { margin-bottom: 14px; text-align: left; }

.hzwp-form__row label {
	display: block;
	margin-bottom: 5px;
	font-size: 14px;
	font-weight: 600;
}

.hzwp-form__row label span { color: #9a1f21; }

.hzwp-form__row input {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #d1d5db;
	border-radius: 8px;
	font-size: 15px;
	box-sizing: border-box;
	font-family: inherit;
}

.hzwp-form__row input:focus {
	border-color: #9a1f21;
	outline: 2px solid rgba(154, 31, 33, .15);
}

/* Honeypot — off-screen, never display:none (bots skip hidden fields). */
.hzwp-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 1px;
	overflow: hidden;
}

.hzwp-notice {
	margin-bottom: 18px;
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 14px;
}

.hzwp-notice--success { background: #e7f7ed; color: #0a7c3f; }
.hzwp-notice--error   { background: #fdeaea; color: #9a1f21; }
.hzwp-notice--info    { background: #eef4ff; color: #1e40af; }

.hzwp-card__title { margin: 0 0 6px; font-size: 22px; font-weight: 700; }
.hzwp-card__lead  { margin: 0 0 20px; color: #6b7280; font-size: 14px; }
.hzwp-auth__alt   { margin: 14px 0 0; font-size: 14px; text-align: center; }

@media (max-width: 560px) {
	.hzwp-card { margin: 20px 16px; padding: 24px 20px; }
	.hzwp-details__row { flex-direction: column; align-items: flex-start; gap: 2px; }
	.hzwp-details dd { text-align: left; }
	.hzwp-modal__dialog { margin: 6vh 16px 0; padding: 26px 20px; }
}

/* ---------------------------------------------------------------------------
   Card-only account dashboard
   Themes float .woocommerce-MyAccount-content beside the nav, so removing the
   nav in PHP is not enough — the content column keeps its 70% width.
   --------------------------------------------------------------------------- */

body.hzwp-account-card-only .woocommerce-MyAccount-navigation,
body.hzwp-account-card-only .woocommerce-MyAccount-navigation-wrap,
body.hzwp-account-card-only nav.woocommerce-MyAccount-navigation {
	display: none !important;
}

body.hzwp-account-card-only .woocommerce-MyAccount-content {
	width: 100% !important;
	max-width: none !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
}

/* Hide the "Hello X (not X? Log out)" intro and leftover notices. */
body.hzwp-account-card-only .woocommerce-MyAccount-content > p:first-child:not(.hzwp-actions__hint),
body.hzwp-account-card-only .woocommerce-notices-wrapper:empty {
	display: none;
}

/* The card provides its own spacing; drop any doubled-up wrapper padding. */
body.hzwp-account-card-only .woocommerce {
	max-width: none;
	padding: 0;
}

/* ---------------------------------------------------------------------------
   Sign in / Sign up pages
   wp_login_form() emits its own markup (.login-username, .login-submit …),
   so it needs styling to match the card rather than the theme's form defaults.
   --------------------------------------------------------------------------- */

.hzwp-card--auth { max-width: 400px; }

.hzwp-card--auth .login-username,
.hzwp-card--auth .login-password,
.hzwp-card--auth .login-remember,
.hzwp-card--auth .login-submit {
	margin: 0 0 14px;
	text-align: left;
}

.hzwp-card--auth .login-username label,
.hzwp-card--auth .login-password label {
	display: block;
	margin-bottom: 5px;
	font-size: 13px;
	font-weight: 600;
}

.hzwp-card--auth input[type="text"],
.hzwp-card--auth input[type="email"],
.hzwp-card--auth input[type="tel"],
.hzwp-card--auth input[type="password"] {
	width: 100%;
	padding: 11px 13px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	box-sizing: border-box;
	background: #fff;
}

.hzwp-card--auth input[type="text"]:focus,
.hzwp-card--auth input[type="email"]:focus,
.hzwp-card--auth input[type="tel"]:focus,
.hzwp-card--auth input[type="password"]:focus {
	border-color: #9a1f21;
	outline: 2px solid rgba(154, 31, 33, .15);
}

.hzwp-card--auth .login-remember {
	font-size: 13px;
	color: #6b7280;
}

.hzwp-card--auth .login-remember input { margin-right: 6px; }

.hzwp-card--auth .login-submit input[type="submit"],
.hzwp-card--auth #wp-submit {
	display: flex;
	justify-content: center;
	width: 100%;
	padding: 11px 18px;
	background: #9a1f21;
	border: 1px solid #9a1f21;
	border-radius: 6px;
	color: #fff;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background-color .15s ease;
}

.hzwp-card--auth .login-submit input[type="submit"]:hover,
.hzwp-card--auth #wp-submit:hover { background: #7d1a1c; border-color: #7d1a1c; }

.hzwp-auth__alt a { color: #9a1f21; font-weight: 600; text-decoration: none; }
.hzwp-auth__alt a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------------------
   Combined Sign in / Create account tabs
   Panels are visible by default so the page still works without JavaScript;
   the script hides the inactive one on load.
   --------------------------------------------------------------------------- */

.hzwp-tabs {
	display: flex;
	gap: 4px;
	margin: 0 0 20px;
	padding: 4px;
	background: #f3f4f6;
	border-radius: 8px;
}

.hzwp-tab {
	flex: 1 1 0;
	padding: 9px 12px;
	background: transparent;
	border: 0;
	border-radius: 6px;
	color: #6b7280;
	font-size: 13px;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: background-color .15s ease, color .15s ease;
}

.hzwp-tab:hover { color: #9a1f21; }

.hzwp-tab.is-active {
	background: #fff;
	color: #9a1f21;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}

.hzwp-auth .hzwp-tabpanel + .hzwp-tabpanel { margin-top: 24px; }

/* Once JS is running, only the active panel shows and the divider is dropped. */
.hzwp-auth.is-enhanced .hzwp-tabpanel[hidden] { display: none; }
.hzwp-auth.is-enhanced .hzwp-tabpanel + .hzwp-tabpanel { margin-top: 0; }

/* ---------------------------------------------------------------------------
   Standalone header Sign In / Sign Up button (not a menu item)
   --------------------------------------------------------------------------- */

.hzwp-header-auth {
	display: flex !important;
	align-items: center;
	align-self: center;
	margin: 0 10px 0 18px;
	padding: 0;
	flex: 0 0 auto;
	list-style: none;
}

/* It lives inside the nav <ul>, so neutralise any inherited menu-item styling. */
li.hzwp-header-auth::before,
li.hzwp-header-auth::after { display: none !important; content: none !important; }
li.hzwp-header-auth > a::before,
li.hzwp-header-auth > a::after { display: none !important; content: none !important; }

.hzwp-header-auth[hidden] { display: none; }

.hzwp-header-auth__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 7px 13px;
	background: #9a1f21;
	border: 1px solid #9a1f21;
	border-radius: 6px;
	color: #fff !important;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: none !important;
	white-space: nowrap;
	transition: background-color .15s ease, border-color .15s ease;
}

.hzwp-header-auth__btn:hover,
.hzwp-header-auth__btn:focus {
	background: #7d1a1c;
	border-color: #7d1a1c;
	color: #fff !important;
}

@media (max-width: 1200px) {
	.hzwp-header-auth { margin-right: 6px; margin-left: 12px; }
	.hzwp-header-auth__btn { padding: 6px 10px; font-size: 11px; }
}

/* The header nav list is width-constrained, so adding the button can push the
   last item onto a second row. Keep it on one line — there is free space to
   the right of the nav, and this list is hidden below tablet anyway. */
ul.hzwp-has-auth {
	flex-wrap: nowrap !important;
	white-space: nowrap;
}

/* Theme rules on .elementor-nav-menu li out-specify a lone class selector,
   so pin the spacing with the list context. */
ul.hzwp-has-auth > li.hzwp-header-auth {
	margin-left: 20px !important;
	margin-right: 12px !important;
}

@media (max-width: 1200px) {
	ul.hzwp-has-auth > li.hzwp-header-auth {
		margin-left: 12px !important;
		margin-right: 6px !important;
	}
}
