/* Konto klienta (/moje-konto/): logowanie, panel, zamówienia, adresy, dane konta – styl Brendz (jak kasa) */

.account-page {
	padding-bottom: 56px;
	background: #f6f9fc;
}
.account-page .container { padding-top: 28px; }

.account-page__title {
	margin: 0 0 20px;
	font-family: "Baloo 2", var(--font);
	font-size: 28px;
	font-weight: 700;
	line-height: 1.25;
	color: #1a1b1d;
}
@media (min-width: 768px) { .account-page__title { font-size: 35px; } }

.account-page .woocommerce { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; align-items: start; min-width: 0; }
.account-page .woocommerce > * { min-width: 0; }
.account-page .woocommerce > .woocommerce-notices-wrapper,
.account-page .woocommerce > .woocommerce-message,
.account-page .woocommerce > .woocommerce-error,
.account-page .woocommerce > .woocommerce-info { grid-column: 1 / -1; margin-bottom: 0; }
@media (min-width: 992px) {
	.account-page .woocommerce:has(.woocommerce-MyAccount-navigation) { grid-template-columns: 260px minmax(0, 1fr); gap: 28px; }
}

.account-page h2,
.account-page h3 {
	margin: 0 0 16px;
	font-family: "Baloo 2", var(--font);
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
	color: #1a1b1d;
}
@media (min-width: 768px) { .account-page h2 { font-size: 22px; } }
.account-page p { margin: 0 0 14px; font-size: 15px; line-height: 24px; color: var(--text-soft); }
.account-page p:last-child { margin-bottom: 0; }
.account-page a:not(.button) { color: var(--green); text-underline-offset: 2px; }
.account-page a:not(.button):hover { text-decoration: none; }
.account-page strong, .account-page mark { color: var(--text); }
.account-page mark { background: none; font-weight: 700; }

/* ---------- Menu konta ---------- */

.woocommerce-MyAccount-navigation ul {
	display: flex;
	gap: 6px;
	margin: 0;
	padding: 8px;
	overflow-x: auto;
	border-radius: 14px;
	background: #fff;
	list-style: none;
	scrollbar-width: none;
}
.woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }
.woocommerce-MyAccount-navigation li { flex: none; margin: 0; }
.woocommerce-MyAccount-navigation a {
	display: block;
	padding: 11px 14px;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 700;
	line-height: 22px;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s, color 0.2s;
}
.woocommerce-MyAccount-navigation a:hover { background: #f4fbf5; color: var(--green); }
.woocommerce-MyAccount-navigation .is-active a { background: #eaf7ec; color: var(--green); }
.woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--customer-logout a { color: var(--muted); }
@media (min-width: 992px) {
	.woocommerce-MyAccount-navigation { position: sticky; top: 140px; }
	body.admin-bar .woocommerce-MyAccount-navigation { top: 172px; }
	.woocommerce-MyAccount-navigation ul { flex-direction: column; gap: 2px; overflow: visible; }
	.woocommerce-MyAccount-navigation li { flex: auto; }
	.woocommerce-MyAccount-navigation .woocommerce-MyAccount-navigation-link--customer-logout { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--border); }
}

/* ---------- Karta z treścią ---------- */

.woocommerce-MyAccount-content,
.account-page .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) {
	min-width: 0;
	padding: 22px 20px;
	border-radius: 14px;
	background: #fff;
}
@media (min-width: 768px) {
	.woocommerce-MyAccount-content,
	.account-page .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) { padding: 28px 30px; }
}
/* Logowanie i reset hasła: wąska karta na środku */
.account-page .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) { width: 100%; max-width: 480px; margin-inline: auto; }
.account-page .woocommerce:not(:has(.woocommerce-MyAccount-navigation)) > .woocommerce-notices-wrapper:empty { display: none; }

/* ---------- Formularze ---------- */

.account-page form .form-row,
.account-page .woocommerce-form-row {
	display: block;
	width: 100%;
	margin: 0 0 16px;
	padding: 0;
	float: none;
}
.account-page .woocommerce-address-fields__field-wrapper,
.account-page .woocommerce-EditAccountForm {
	display: flex;
	flex-wrap: wrap;
	gap: 0 16px;
}
.account-page .woocommerce-EditAccountForm > * { width: 100%; }
.account-page .woocommerce-EditAccountForm .clear { display: none; }
@media (min-width: 576px) {
	.account-page .form-row-first,
	.account-page .form-row-last,
	.account-page .woocommerce-EditAccountForm .woocommerce-form-row--first,
	.account-page .woocommerce-EditAccountForm .woocommerce-form-row--last { width: calc(50% - 8px); }
}

.account-page label {
	display: block;
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	line-height: 20px;
	color: var(--text);
}
.account-page label .required { color: #d33; text-decoration: none; }
.account-page label .optional { font-weight: 400; color: var(--muted); }
.account-page em,
.account-page .description { display: block; margin-top: 6px; font-size: 13px; font-style: normal; line-height: 20px; color: var(--muted); }

.account-page input[type="text"],
.account-page input[type="email"],
.account-page input[type="tel"],
.account-page input[type="password"],
.account-page input[type="number"],
.account-page textarea,
.account-page select,
.account-page .select2-container .select2-selection--single {
	display: block;
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid var(--border-strong);
	border-radius: 5px;
	background: #fff;
	font: 400 15px/44px var(--font);
	color: var(--text);
	transition: border-color 0.2s, box-shadow 0.2s;
}
.account-page textarea { height: auto; min-height: 96px; padding: 12px 14px; line-height: 22px; resize: none; }
.account-page .select2-container .select2-selection--single .select2-selection__rendered { padding: 0; line-height: 44px; color: var(--text); }
.account-page .select2-container .select2-selection--single .select2-selection__arrow { top: 0; right: 8px; height: 44px; }
.account-page input:focus,
.account-page textarea:focus,
.account-page select:focus,
.account-page .select2-container--open .select2-selection--single,
.account-page .select2-container--focus .select2-selection--single {
	border-color: var(--green);
	box-shadow: 0 0 0 3px rgba(43, 176, 57, 0.15);
	outline: 0;
}
.account-page .woocommerce-invalid input,
.account-page .woocommerce-invalid select,
.account-page .woocommerce-invalid .select2-selection--single { border-color: #d33; }
.account-page input[type="checkbox"] { accent-color: var(--green); }

/* Zapamiętaj mnie + przycisk w jednej linii */
.account-page .woocommerce-form-login .form-row:has(.woocommerce-form-login__submit) {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-bottom: 14px;
}
.account-page .woocommerce-form-login__rememberme {
	display: flex;
	align-items: center;
	gap: 8px;
	order: 2;
	margin: 0;
	font-weight: 400;
	cursor: pointer;
}
.account-page .woocommerce-form-login__submit { order: 1; }
.account-page .woocommerce-LostPassword { margin: 0; font-size: 14px; }

.account-page .woocommerce-ResetPassword .form-row-first,
.account-page .woocommerce-ResetPassword .form-row-last { width: 100%; }

/* Przyciski (zielone .button z main.css) */
.account-page .woocommerce-Button,
.account-page .woocommerce-button,
.account-page button.button,
.account-page a.button { padding: 14px 24px; }
.account-page .woocommerce-orders-table .button,
.account-page .order-again .button { padding: 10px 16px; }
.account-page .woocommerce-MyAccount-content form > p:last-of-type:has(> button) { margin-top: 8px; }

/* Hasło: „Pokaż” / „Ukryj” zamiast ikony oka */
.account-page .woocommerce-input-wrapper { display: block; }
.account-page .password-input { position: relative; display: block; }
.account-page .password-input input { padding-right: 80px; }
.account-page .show-password-input {
	position: absolute;
	top: 0;
	right: 0;
	width: auto;
	height: 46px;
	padding: 0 14px;
	border: 0;
	background: transparent;
	font: 700 13px/46px var(--font);
	color: var(--green);
	cursor: pointer;
}
.account-page .show-password-input::before,
.account-page .show-password-input::after { background: none; }
.account-page .show-password-input::after { content: "Pokaż"; }
.account-page .show-password-input.display-password::after { content: "Ukryj"; }

/* Informacja pod logowaniem: konto powstaje przy zamówieniu */
.account-register-note {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	margin-top: 20px;
	padding: 14px 16px;
	border-radius: 10px;
	background: #eef9ef;
}
.account-register-note .icon { flex: none; margin-top: 1px; color: var(--green); }
.account-page .account-register-note p { margin: 0; font-size: 14px; line-height: 22px; color: var(--text-soft); }

/* Grupa „Zmiana hasła” */
.account-page fieldset {
	margin: 4px 0 20px;
	padding: 18px 18px 2px;
	border: 0;
	border-radius: 10px;
	background: #f6f9fc;
}
.account-page fieldset legend {
	float: left;
	width: 100%;
	margin: 0 0 14px;
	padding: 0;
	font-size: 15px;
	font-weight: 700;
	color: #1a1b1d;
}
.account-page fieldset legend + * { clear: both; }

/* ---------- Tabele (zamówienia, szczegóły zamówienia) ---------- */

.account-page table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 22px; }
.account-page thead th {
	padding: 0 12px 12px;
	border-bottom: 1px solid var(--border);
	font-size: 13px;
	font-weight: 700;
	text-align: left;
	color: var(--muted);
}
/* nagłówki wierszy (numer zamówienia, „Kwota:”, „Razem:”) wyglądają jak zwykłe komórki */
.account-page tbody th,
.account-page tfoot th {
	padding: 14px 12px;
	border-bottom: 1px solid var(--border);
	font-size: 14px;
	font-weight: 700;
	text-align: left;
	vertical-align: middle;
	color: var(--text);
}
.account-page td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: var(--text); }
.account-page th:first-child, .account-page td:first-child { padding-left: 0; }
.account-page th:last-child, .account-page td:last-child { padding-right: 0; }
.account-page tbody tr:last-child td,
.account-page tbody tr:last-child th { border-bottom: 0; }
.account-page td a:not(.button),
.account-page tbody th a:not(.button) { font-weight: 700; text-decoration: none; }
.account-page td a:not(.button):hover,
.account-page tbody th a:not(.button):hover { text-decoration: underline; }
.account-page td.woocommerce-orders-table__cell-order-actions { text-align: right; white-space: nowrap; }

/* Szczegóły zamówienia */
.woocommerce-table--order-details tfoot th,
.woocommerce-table--order-details tfoot td { border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text-soft); }
.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td { border-bottom: 0; font-size: 16px; font-weight: 700; color: #1a1b1d; }
.woocommerce-table--order-details thead th { text-align: left; }
.woocommerce-table--order-details thead th:last-child,
.woocommerce-table--order-details td:last-child,
.woocommerce-table--order-details tfoot td { text-align: right; }
.woocommerce-table--order-details .product-name { font-weight: 700; }
.woocommerce-table--order-details .product-quantity { font-weight: 400; color: var(--muted); }
.woocommerce-table--order-details img { width: 56px; height: 56px; margin-right: 12px; border: 1px solid var(--border); border-radius: 8px; object-fit: cover; vertical-align: middle; }
.woocommerce-order-details { margin-top: 24px; }
.woocommerce-order-details .order-again { margin: 16px 0 0; }
.woocommerce-customer-details { margin-top: 28px; }

/* Adresy */
.woocommerce-Addresses,
.woocommerce-columns--addresses { display: grid; gap: 20px; margin-top: 8px; }
@media (min-width: 768px) {
	.woocommerce-Addresses,
	.woocommerce-columns--addresses { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.woocommerce-Address-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 4px 12px;
	margin-bottom: 12px;
}
.woocommerce-Address-title h2,
.woocommerce-Address-title h3,
.woocommerce-columns--addresses h2 { margin: 0; font-size: 18px; }
.woocommerce-Address-title .edit { font-size: 14px; font-weight: 700; }
.account-page address {
	margin: 0;
	padding: 16px 18px;
	border-radius: 10px;
	background: #f6f9fc;
	font-size: 14px;
	font-style: normal;
	line-height: 24px;
	color: var(--text);
}
.woocommerce-columns--addresses .woocommerce-column__title { margin-bottom: 12px; }
.woocommerce-customer-details--phone,
.woocommerce-customer-details--email { margin: 6px 0 0; padding: 0; font-size: 14px; }

/* Brak zamówień / komunikaty w treści */
.woocommerce-MyAccount-content .woocommerce-message,
.woocommerce-MyAccount-content .woocommerce-info { margin-bottom: 0; }

.woocommerce-pagination { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- Telefon: tabela zamówień jako karty ---------- */

@media (max-width: 767px) {
	.woocommerce-orders-table thead { display: none; }
	.woocommerce-orders-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--border); }
	.woocommerce-orders-table tbody tr:last-child { border-bottom: 0; }
	.woocommerce-orders-table td,
	.woocommerce-orders-table tbody th {
		display: block;
		padding: 6px 0;
		border: 0;
		text-align: right;
	}
	.woocommerce-orders-table td::before,
	.woocommerce-orders-table tbody th::before { content: attr(data-title); float: left; font-size: 13px; font-weight: 700; color: var(--muted); }
	.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions { padding-top: 10px; }
	.woocommerce-orders-table td.woocommerce-orders-table__cell-order-actions::before { display: none; }
	.woocommerce-table--order-details img { display: none; }
}
