/*
 * Koszyk, checkout, potwierdzenie zamówienia i konto klienta.
 *
 * Projekt nie obejmuje tych stron, więc układ pochodzi z reszty sklepu: etykieta z linią,
 * duży nagłówek, pola z podkreśleniem i ciemne przyciski. Style działają na standardowych
 * znacznikach WooCommerce, dzięki czemu aktualizacje wtyczki nie wymagają zmian w szablonach.
 */

.wc-page {
	padding: 32px 24px 64px;
}

.wc-page__title {
	margin-top: 24px;
	font-size: 36px;
	line-height: 1.16;
}

.wc-page__content {
	margin-top: 32px;
	font-size: 14px;
	line-height: 24px;
}

.wc-page__content a:not(.button, .checkout-button, .btn, .product-card__link) {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/*
 * Przyciski. Reguły bazowe są w :where(), żeby warianty niżej mogły je nadpisać:
 * selektor atrybutu miałby wyższą specyficzność i dawałby ciemny tekst na ciemnym tle.
 */
.wc-page :where(.button, button[type="submit"]:not(.quantity__step)) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 8px 24px;
	border: 1px solid var(--color-ink);
	color: var(--color-ink);
	font-size: 12px;
	font-weight: 500;
	letter-spacing: var(--tracking-caps);
	line-height: 20px;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color var(--transition), color var(--transition);
}

.wc-page :where(.button, button[type="submit"]:not(.quantity__step)):hover {
	background: var(--color-ink);
	color: var(--color-bg);
}

.wc-page .checkout-button,
.wc-page #place_order,
.wc-page .woocommerce-form-login__submit,
.wc-page .woocommerce-form-register__submit,
.wc-page .woocommerce-Button,
.wc-page .woocommerce-button--next,
.wc-page .return-to-shop .button {
	width: 100%;
	background: var(--color-ink);
	color: var(--color-bg);
}

.wc-page .checkout-button:hover,
.wc-page #place_order:hover,
.wc-page .woocommerce-form-login__submit:hover,
.wc-page .woocommerce-form-register__submit:hover,
.wc-page .woocommerce-Button:hover,
.wc-page .return-to-shop .button:hover {
	background: var(--color-black);
	color: var(--color-bg);
}

.wc-page .button:disabled,
.wc-page button[type="submit"]:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* Pola formularzy */
.wc-page .form-row {
	margin: 0 0 24px;
	padding: 0;
}

.wc-page .form-row > label:not(.checkbox, .woocommerce-form__label-for-checkbox),
.wc-page label[for="coupon_code"] {
	display: block;
	margin-bottom: 4px;
	color: rgb(42 42 38 / 0.78);
	font-size: 11px;
	letter-spacing: 0.2em;
	line-height: 20px;
	text-transform: uppercase;
}

.wc-page .required {
	color: #b08d57;
	text-decoration: none;
}

.wc-page .input-text,
.wc-page select,
.wc-page input[type="text"],
.wc-page input[type="email"],
.wc-page input[type="tel"],
.wc-page input[type="password"],
.wc-page textarea {
	display: block;
	width: 100%;
	min-height: 44px;
	padding: 8px 0;
	border: 0;
	border-bottom: 1px solid var(--color-field);
	border-radius: 0;
	background: none;
	font-size: 14px;
	font-weight: 300;
}

.wc-page .quantity input {
	min-height: 0;
	padding: 0;
	border: 0;
	font-weight: 400;
}

.wc-page textarea {
	min-height: 96px;
	resize: vertical;
}

.wc-page .input-text:focus,
.wc-page select:focus,
.wc-page textarea:focus {
	outline: 0;
	border-bottom-color: var(--color-ink);
	box-shadow: 0 1px 0 var(--color-ink);
}

.wc-page .woocommerce-invalid .input-text,
.wc-page .woocommerce-invalid .select2-selection {
	border-bottom-color: #a33a2a;
}

.wc-page input[type="checkbox"],
.wc-page input[type="radio"] {
	flex: none;
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--color-ink);
}

.wc-page .woocommerce-form__label-for-checkbox,
.wc-page .checkbox {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 13px;
	line-height: 20px;
	cursor: pointer;
}

.wc-page .woocommerce-form__label-for-checkbox input,
.wc-page .checkbox input {
	margin-top: 2px;
}

/* Lista wyboru kraju i województwa */
.wc-page .select2-container .select2-selection--single {
	height: 44px;
	border: 0;
	border-bottom: 1px solid var(--color-field);
	border-radius: 0;
	background: none;
}

.wc-page .select2-container .select2-selection__rendered {
	padding: 0;
	color: var(--color-ink);
	font-size: 14px;
	font-weight: 300;
	line-height: 44px;
}

.wc-page .select2-container .select2-selection__arrow {
	height: 44px;
}

.select2-dropdown {
	border-color: var(--color-field);
	border-radius: 0;
	font-size: 14px;
}

.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted[data-selected] {
	background: var(--color-ink);
}

/* Tabele */
.wc-page .shop_table {
	width: 100%;
	margin: 0;
	border-collapse: collapse;
}

.wc-page .shop_table th,
.wc-page .shop_table td {
	padding: 14px 0;
	border-bottom: 1px solid rgb(42 42 38 / 0.3);
	font-size: 14px;
	font-weight: 400;
	line-height: 22px;
	text-align: left;
	vertical-align: top;
}

.wc-page .shop_table tfoot th,
.wc-page .shop_table tbody th {
	color: rgb(42 42 38 / 0.78);
}

.wc-page .shop_table td:last-child,
.wc-page .shop_table th:last-child {
	text-align: right;
}

.wc-page .order-total th,
.wc-page .order-total td {
	border-bottom: 0;
	font-size: 16px;
	font-weight: 500;
}

.wc-page .order-total strong .amount {
	font-size: 22px;
	font-weight: 500;
}

.wc-page .includes_tax,
.wc-page .tax_label {
	display: block;
	color: var(--color-field);
	font-size: 12px;
	font-weight: 400;
}

.wc-page .includes_tax .amount {
	font-size: inherit;
	font-weight: inherit;
}

.wc-page .shop_table tr > th {
	padding-right: 16px;
}

.wc-page .woocommerce-shipping-methods {
	text-align: left;
}

.wc-page .woocommerce-shipping-methods li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.wc-page .woocommerce-shipping-methods li + li {
	margin-top: 8px;
}

.wc-page .woocommerce-shipping-methods input {
	margin-top: 3px;
}

.wc-page .woocommerce-shipping-destination,
.wc-page .woocommerce-shipping-calculator {
	margin: 8px 0 0;
	font-size: 12px;
	line-height: 18px;
	text-align: left;
}

/* Koszyk: wiersze produktu */
.woocommerce-cart-form__contents thead {
	display: none;
}

.woocommerce-cart-form__contents,
.woocommerce-cart-form__contents tbody {
	display: block;
}

.wc-page .woocommerce-cart-form__cart-item {
	display: grid;
	grid-template-areas:
		"thumb name remove"
		"thumb price price"
		"thumb qty total";
	grid-template-columns: 92px minmax(0, 1fr) 32px;
	column-gap: 16px;
	padding-block: 20px;
	border-bottom: 1px solid rgb(42 42 38 / 0.3);
}

.wc-page .woocommerce-cart-form__cart-item td {
	display: block;
	padding: 0;
	border: 0;
	text-align: left;
}

.wc-page .woocommerce-cart-form__cart-item .product-thumbnail {
	grid-area: thumb;
}

.product-thumbnail img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
}

.wc-page .woocommerce-cart-form__cart-item .product-name {
	grid-area: name;
	font-size: 16px;
	font-weight: 500;
}

.wc-page .woocommerce-cart-form__cart-item .product-name a {
	text-decoration: none;
}

.variation {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0 6px;
	margin: 6px 0 0;
	color: rgb(42 42 38 / 0.78);
	font-size: 12px;
	font-weight: 400;
	line-height: 18px;
}

.variation dt {
	font-weight: 400;
}

.variation dd,
.variation p {
	margin: 0;
}

.wc-page .woocommerce-cart-form__cart-item .product-price {
	grid-area: price;
	margin-top: 6px;
	color: var(--color-field);
	font-size: 12px;
}

.wc-page .woocommerce-cart-form__cart-item .product-quantity {
	grid-area: qty;
	align-self: end;
	margin-top: 12px;
}

.wc-page .woocommerce-cart-form__cart-item .quantity {
	display: inline-flex;
	width: 106px;
	height: 44px;
	border: 1px solid var(--color-ink);
}

.wc-page .woocommerce-cart-form__cart-item .product-subtotal {
	grid-area: total;
	grid-column: 2 / -1;
	align-self: end;
	font-size: 16px;
	font-weight: 500;
	text-align: right;
}

.wc-page .woocommerce-cart-form__cart-item .product-remove {
	grid-area: remove;
	text-align: right;
}

.wc-page .woocommerce-cart-form__cart-item .remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	color: var(--color-ink);
	font-size: 22px;
	font-weight: 300;
	line-height: 1;
	text-decoration: none;
}

.wc-page .woocommerce-cart-form__cart-item .remove:hover {
	background: var(--color-sand);
}

/* Na małych kartach ilość i suma muszą się mieścić obok siebie. */
.wc-page .woocommerce-cart-form__cart-item .product-quantity {
	grid-column: 2;
}

.wc-page .woocommerce-cart-form__cart-item .product-subtotal {
	grid-column: 2 / -1;
	grid-row: 3;
}

.quantity .qty::-webkit-outer-spin-button,
.quantity .qty::-webkit-inner-spin-button {
	margin: 0;
	appearance: none;
}

.wc-page .quantity__step {
	flex: none;
	width: 32px;
	height: 100%;
	font-size: 17px;
}

.wc-page .quantity__step:hover {
	background: var(--color-sand);
}

.wc-page .quantity input {
	width: 100%;
	min-width: 0;
	height: 100%;
	min-height: 0;
	background: none;
	font-size: 16px;
	text-align: center;
	appearance: textfield;
}

.wc-page .quantity input:focus {
	box-shadow: none;
}

/* Wiersz akcji: kupon i ręczna aktualizacja */
.woocommerce-cart-form__contents tbody > tr:not(.woocommerce-cart-form__cart-item) {
	display: block;
}

.wc-page .woocommerce-cart-form .actions {
	display: block;
	padding: 24px 0 0;
	border: 0;
}

.wc-page .coupon {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 12px;
}

.wc-page .coupon label {
	flex: 0 0 100%;
	margin: 0;
}

.wc-page .coupon .input-text {
	flex: 1;
	min-width: 140px;
	width: auto;
}

.wc-page .coupon .button {
	min-height: 44px;
}

.wc-page .actions > .button {
	width: 100%;
	margin-top: 16px;
}

.has-cart-auto-update .wc-page .actions > .button {
	display: none;
}

/* Podsumowanie koszyka */
.cart-collaterals {
	margin-top: 40px;
}

.cart_totals,
.woocommerce-checkout-review-order {
	padding: 24px;
	background: var(--color-surface);
}

.cart_totals h2,
#order_review_heading,
.woocommerce-billing-fields h3,
.woocommerce-shipping-fields h3,
.woocommerce-additional-fields h3,
.woocommerce-order-details__title,
.woocommerce-column__title,
.woocommerce-order-downloads__title,
.u-column1 > h2,
.u-column2 > h2,
.cross-sells > h2 {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 400;
	line-height: 1.3;
}

.wc-proceed-to-checkout {
	margin-top: 16px;
}

/* Pusty koszyk */
.cart-empty {
	display: block;
	margin-bottom: 24px;
	border: 0;
	padding: 0;
	font-size: 18px;
}

.return-to-shop .button {
	max-width: 320px;
}

/* Propozycje pod koszykiem */
.cross-sells {
	margin-top: 56px;
}

.cross-sells .products {
	margin: 0;
}

/* Checkout */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-shipping-fields__field-wrapper {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 16px;
}

.woocommerce-billing-fields__field-wrapper .form-row-wide,
.woocommerce-shipping-fields__field-wrapper .form-row-wide,
.woocommerce-billing-fields__field-wrapper .form-row:not(.form-row-first, .form-row-last),
.woocommerce-shipping-fields__field-wrapper .form-row:not(.form-row-first, .form-row-last) {
	grid-column: 1 / -1;
}

.wc-page .woocommerce-form-coupon-toggle .woocommerce-info,
.wc-page .woocommerce-form-login-toggle .woocommerce-info {
	display: block;
	border: 0;
	padding: 0;
}

.wc-page .checkout_coupon,
.wc-page .woocommerce-form-login {
	margin-bottom: 24px;
}

#order_review_heading {
	margin-top: 40px;
}

.woocommerce-checkout-review-order-table .product-name {
	padding-right: 16px;
}

.woocommerce-checkout-review-order-table .product-quantity {
	white-space: nowrap;
}

.woocommerce-checkout-review-order-table .variation {
	display: block;
}

.woocommerce-checkout-review-order-table .variation dt {
	margin-top: 4px;
	color: var(--color-field);
}

.wc_payment_methods {
	margin-top: 20px;
}

.wc_payment_method {
	padding-block: 10px;
	border-bottom: 1px solid rgb(42 42 38 / 0.3);
}

.wc_payment_method > label {
	margin-left: 8px;
	font-size: 14px;
	font-weight: 500;
	cursor: pointer;
}

.wc_payment_method > label img {
	display: inline-block;
	height: 22px;
	margin-left: 8px;
	vertical-align: middle;
}

.payment_box {
	margin-top: 8px;
	color: rgb(42 42 38 / 0.78);
	font-size: 13px;
	line-height: 20px;
}

.payment_box p {
	margin: 0;
}

.woocommerce-terms-and-conditions-wrapper {
	margin-block: 20px;
	font-size: 12px;
	line-height: 18px;
}

.woocommerce-privacy-policy-text p {
	margin: 0 0 12px;
}

.wc-page .woocommerce-terms-and-conditions-wrapper .form-row {
	margin: 0;
}

/* Potwierdzenie zamówienia */
.woocommerce-thankyou-order-received {
	margin: 0 0 32px;
	font-size: 18px;
	line-height: 28px;
}

.woocommerce-order-overview {
	display: grid;
	gap: 16px;
	margin-bottom: 40px;
	padding: 24px;
	background: var(--color-surface);
}

.woocommerce-order-overview li {
	color: var(--color-field);
	font-size: 11px;
	letter-spacing: 0.2em;
	line-height: 20px;
	text-transform: uppercase;
}

.woocommerce-order-overview strong {
	display: block;
	margin-top: 2px;
	color: var(--color-ink);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
}

.woocommerce-order-details,
.woocommerce-customer-details,
.woocommerce-bacs-bank-details {
	margin-top: 40px;
}

.wc-bacs-bank-details-heading,
.wc-bacs-bank-details-account-name {
	margin: 0 0 12px;
	font-size: 18px;
	font-weight: 400;
}

.wc-bacs-bank-details {
	display: grid;
	gap: 8px;
}

.wc-page address {
	font-style: normal;
	line-height: 24px;
}

.woocommerce-columns--addresses {
	display: grid;
	gap: 32px;
}

/* Konto klienta */
.woocommerce-MyAccount-navigation {
	margin-bottom: 32px;
}

.woocommerce-MyAccount-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wc-page .woocommerce-MyAccount-navigation a {
	display: block;
	padding: 8px 14px;
	border: 1px solid var(--color-ink);
	font-size: 11px;
	font-weight: 500;
	letter-spacing: 0.16em;
	line-height: 18px;
	text-decoration: none;
	text-transform: uppercase;
	transition: background-color var(--transition);
}

.wc-page .woocommerce-MyAccount-navigation a:hover,
.wc-page .woocommerce-MyAccount-navigation .is-active a {
	background: var(--color-sand);
}

.woocommerce-MyAccount-content > p:first-child {
	margin-top: 0;
}

.woocommerce-Addresses {
	display: grid;
	gap: 32px;
}

.woocommerce-Address-title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
}

.woocommerce-Address-title h2 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 400;
}

.wc-page fieldset {
	margin: 24px 0;
	padding: 0;
	border: 0;
}

.wc-page legend {
	margin-bottom: 16px;
	padding: 0;
	font-size: 18px;
}

/* Logowanie i rejestracja */
.u-columns {
	display: grid;
	gap: 48px;
}

.wc-page .woocommerce-LostPassword {
	margin: 16px 0 0;
}

.wc-page .woocommerce-form-login__rememberme {
	margin-bottom: 16px;
}

/* Tabele na telefonie: wiersze zamiast kolumn */
@media (max-width: 767px) {
	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) thead {
		display: none;
	}

	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents),
	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) tbody,
	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) tr {
		display: block;
	}

	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) tr {
		padding-block: 8px;
		border-bottom: 1px solid rgb(42 42 38 / 0.3);
	}

	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) td {
		display: flex;
		justify-content: space-between;
		gap: 16px;
		padding: 6px 0;
		border: 0;
		text-align: right;
	}

	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) td::before {
		content: attr(data-title);
		color: var(--color-field);
		text-align: left;
	}

	.wc-page .shop_table_responsive td.woocommerce-orders-table__cell-order-actions::before,
	.wc-page .shop_table_responsive:not(.woocommerce-cart-form__contents) td:not([data-title])::before {
		content: none;
	}
}

@media (min-width: 1024px) {
	.wc-page {
		min-height: calc(700 * var(--u));
		padding: calc(70 * var(--u)) 0 calc(160 * var(--u));
	}

	.wc-page__title {
		width: calc(1390 * var(--u));
		margin: calc(45 * var(--u)) 0 0 calc(205 * var(--u));
		font-size: calc(70 * var(--u));
		line-height: calc(80 * var(--u));
	}

	.wc-page__content {
		width: calc(1390 * var(--u));
		margin: calc(72 * var(--u)) 0 0 calc(205 * var(--u));
	}

	.wc-page :where(.button, button[type="submit"]:not(.quantity__step)) {
		min-height: max(44px, calc(55 * var(--u)));
	}

	/* Dwie kolumny: treść i podsumowanie, proporcje jak na stronie produktu. */
	.woocommerce-cart .woocommerce:has(.cart-collaterals) {
		display: grid;
		grid-template-columns: minmax(0, 1fr) max(360px, calc(490 * var(--u)));
		column-gap: calc(90 * var(--u));
		align-items: start;
	}

	.woocommerce-cart .woocommerce > .woocommerce-notices-wrapper,
	.woocommerce-cart .woocommerce > .cross-sells {
		grid-column: 1 / -1;
	}

	.cart-collaterals {
		position: sticky;
		top: 24px;
		margin: 0;
	}

	.cart_totals,
	.woocommerce-checkout-review-order {
		padding: calc(32 * var(--u));
	}

	.wc-page .woocommerce-cart-form__cart-item {
		grid-template-columns: calc(138 * var(--u)) minmax(0, 1fr) 32px;
		column-gap: calc(28 * var(--u));
		padding-block: calc(24 * var(--u));
	}

	.wc-page .woocommerce-cart-form__cart-item:first-child {
		padding-top: 0;
	}

	.cross-sells {
		margin-top: calc(120 * var(--u));
	}

	.cross-sells .products {
		grid-template-columns: repeat(3, calc(422 * var(--u)));
	}

	form.woocommerce-checkout {
		display: grid;
		grid-template-columns: minmax(0, 1fr) max(360px, calc(490 * var(--u)));
		grid-template-rows: auto 1fr;
		column-gap: calc(90 * var(--u));
		align-items: start;
	}

	form.woocommerce-checkout > .woocommerce-NoticeGroup {
		grid-column: 1 / -1;
	}

	form.woocommerce-checkout #customer_details {
		grid-column: 1;
		grid-row: 1 / span 3;
	}

	form.woocommerce-checkout #order_review_heading {
		grid-column: 2;
		margin-top: 0;
	}

	form.woocommerce-checkout #order_review {
		position: sticky;
		top: 24px;
		grid-column: 2;
	}

	.woocommerce-billing-fields__field-wrapper,
	.woocommerce-shipping-fields__field-wrapper {
		column-gap: calc(24 * var(--u));
	}

	.woocommerce-order {
		width: calc(810 * var(--u));
	}

	.woocommerce-order-overview {
		grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
	}

	.woocommerce-columns--addresses {
		grid-template-columns: repeat(2, 1fr);
	}

	.woocommerce-account .woocommerce:has(.woocommerce-MyAccount-navigation) {
		display: grid;
		grid-template-columns: calc(300 * var(--u)) minmax(0, calc(900 * var(--u)));
		column-gap: calc(90 * var(--u));
		align-items: start;
	}

	.woocommerce-account .woocommerce > .woocommerce-notices-wrapper {
		grid-column: 1 / -1;
	}

	.woocommerce-MyAccount-navigation {
		margin: 0;
	}

	.woocommerce-MyAccount-navigation ul {
		display: block;
		border-top: 1px solid rgb(42 42 38 / 0.3);
	}

	.wc-page .woocommerce-MyAccount-navigation a {
		padding: 14px 0;
		border: 0;
		border-bottom: 1px solid rgb(42 42 38 / 0.3);
		font-size: 12px;
		letter-spacing: 0.18em;
	}

	.wc-page .woocommerce-MyAccount-navigation a:hover,
	.wc-page .woocommerce-MyAccount-navigation .is-active a {
		padding-left: 12px;
	}

	.woocommerce-Addresses {
		grid-template-columns: repeat(2, 1fr);
	}

	.u-columns {
		grid-template-columns: repeat(auto-fit, minmax(0, calc(576 * var(--u))));
		column-gap: calc(90 * var(--u));
	}

	.wc-page .woocommerce-form-login:only-child,
	.woocommerce-account .woocommerce > .woocommerce-form-login {
		max-width: calc(576 * var(--u));
	}

	.woocommerce-ResetPassword,
	.woocommerce-EditAccountForm {
		max-width: calc(810 * var(--u));
	}
}
