/* Odisal Shop: compact basket and checkout (the Compact shop setting).
   WooCommerce's block basket and checkout, with fewer full-width lines. */

/* ---------- Notices: "Added to your basket" as a slim line ---------- */
body.oshop-compact .wc-block-components-notice-banner {
	margin-bottom: 8px;
	padding: 10px 14px;
	font-size: 14px;
}

/* ---------- Basket ---------- */

/* The column headings and "Cart totals" heading say nothing the page doesn't. */
body.oshop-compact .wc-block-cart-items__header,
body.oshop-compact .wc-block-cart .wc-block-cart__totals-title {
	display: none;
}

/* Without the heading row the table picks its own column widths: keep the photo small. */
body.oshop-compact table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
	width: 88px;
	padding-inline-end: 16px;
}

body.oshop-compact .wc-block-cart-items {
	border-top: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
}

body.oshop-compact .wc-block-cart-items .wc-block-cart-items__row > td {
	padding-top: 14px;
	padding-bottom: 14px;
}

/* Product descriptions belong on the product page; options (colour, size) stay. */
body.oshop-compact .wc-block-components-product-metadata__description {
	display: none;
}

/* Name and price closer together. */
body.oshop-compact .wc-block-cart-item__product .wc-block-components-product-name {
	margin-bottom: 2px;
}

body.oshop-compact .wc-block-cart-item__prices {
	margin-bottom: 6px;
}

/* The totals stay in view while a long basket scrolls. */
@media (min-width: 900px) {

	body.oshop-compact .wc-block-cart__sidebar {
		position: sticky;
		top: 24px;
		align-self: flex-start;
	}
}

/* ---------- Checkout ---------- */

/* Sections closer together. */
body.oshop-compact .wc-block-components-checkout-step {
	margin-bottom: 26px;
}

body.oshop-compact .wc-block-components-checkout-step__heading {
	margin-bottom: 10px;
}

body.oshop-compact .wc-block-checkout__guest-checkout-notice {
	margin-top: 4px;
	font-size: 13px;
	opacity: 0.7;
}

/* Short fields share a line on phones too: first and last name, city and
   postcode, county and phone. */
body.oshop-compact .wc-block-components-address-form {
	display: flex;
	flex-wrap: wrap;
	column-gap: 12px;
}

body.oshop-compact .wc-block-components-address-form > * {
	flex: 1 1 100%;
}

body.oshop-compact .wc-block-components-address-form > :is(
	.wc-block-components-address-form__first_name,
	.wc-block-components-address-form__last_name,
	.wc-block-components-address-form__city,
	.wc-block-components-address-form__postcode,
	.wc-block-components-address-form__state,
	.wc-block-components-address-form__phone
) {
	flex: 1 1 calc(50% - 6px) !important;
	width: auto !important;
	min-width: 0;
}

/* The gift message only once "This is a gift" is ticked. */
body.oshop-compact .wc-block-components-address-form:not(:has(#order-odisal-gift:checked)) .wc-block-components-address-form__odisal-gift-message {
	display: none;
}

/* Tick boxes in a tighter list. */
body.oshop-compact .wc-block-components-address-form > .wc-block-components-checkbox {
	margin-top: 10px;
}

/* Order summary: smaller pictures, no descriptions. */
body.oshop-compact .wc-block-components-order-summary-item__image {
	width: 48px;
}

body.oshop-compact .wc-block-components-order-summary-item__image img {
	width: 48px;
	max-width: 48px;
}

body.oshop-compact .wc-block-components-order-summary .wc-block-components-order-summary-item {
	padding-bottom: 10px;
}

/* On the basket page, "… has been added to your basket. View basket" points to where you are. */
body.oshop-compact.woocommerce-cart :is(.wc-block-components-notice-banner.is-success, .woocommerce-message):has(a.wc-forward) {
	display: none;
}

/* ---------- My account ---------- */

/* The menu: short rows, no extra padding. */
body.oshop-compact .woocommerce-MyAccount-navigation li {
	padding: 0;
}

body.oshop-compact .woocommerce-MyAccount-navigation li a {
	display: block;
	padding: 10px 0;
}

/* Log out is in the menu already. */
body.oshop-compact .oshop-acc-foot__link {
	display: none;
}

/* Phones: the menu becomes one row of tabs that scrolls sideways. */
@media (max-width: 768px) {

	body.oshop-compact .woocommerce-MyAccount-navigation {
		margin: 0 0 20px;
	}

	body.oshop-compact .woocommerce-MyAccount-navigation ul {
		display: flex;
		gap: 8px;
		margin: 0;
		padding: 0 0 4px;
		overflow-x: auto;
		list-style: none;
		scrollbar-width: none;
	}

	body.oshop-compact .woocommerce-MyAccount-navigation ul::-webkit-scrollbar {
		display: none;
	}

	body.oshop-compact .woocommerce-MyAccount-navigation li {
		flex: none;
		border: 0;
	}

	body.oshop-compact .woocommerce-MyAccount-navigation li a {
		padding: 8px 14px;
		border: 1px solid var(--tc-line, rgba(127, 127, 127, 0.35));
		border-radius: 999px;
		font-size: 14px;
		white-space: nowrap;
		text-decoration: none;
	}

	body.oshop-compact .woocommerce-MyAccount-navigation li.is-active a {
		border-color: var(--tc-text, #1d1d1f);
		background: var(--tc-text, #1d1d1f);
		color: var(--tc-surface, #fff);
	}

	/* The three summary tiles as a short list: name on the left, detail on the right. */
	body.oshop-compact .oshop-acc-tiles {
		display: block;
		border-top: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
	}

	body.oshop-compact .oshop-acc-tile {
		display: flex;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
		margin: 0;
		padding: 12px 0;
		border: 0;
		border-bottom: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
		border-radius: 0;
		background: none;
	}

	body.oshop-compact .oshop-acc-tile__note {
		min-width: 0;
		overflow: hidden;
		text-align: end;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

/* Account details: a small hint, and the password fields folded away. */
body.oshop-compact #account_display_name_description,
body.oshop-compact #account_display_name_description em {
	display: block;
	margin-top: 4px;
	font-size: 13px;
	font-style: normal;
	opacity: 0.7;
}

body.oshop-compact .oshop-acc-fold {
	display: block;
	margin: 8px 0 18px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

body.oshop-compact form.woocommerce-EditAccountForm fieldset {
	margin: 8px 0 18px;
	padding: 14px 16px;
}

body.oshop-compact form.woocommerce-EditAccountForm .form-row {
	margin-bottom: 12px;
}

/* Buttons inside account tables and notices: small rounded pills, text centred. */
body.oshop-compact.oshop-account :is(.woocommerce-orders-table, .wc-block-components-notice-banner, .woocommerce-info, .woocommerce-message) .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: auto;
	height: auto;
	min-height: 34px;
	margin: 0;
	padding: 0 14px;
	border: 1px solid currentColor;
	border-radius: 999px;
	background: transparent;
	color: inherit;
	font-size: 13px;
	line-height: 1.2;
	white-space: nowrap;
}

/* Notices: text and button side by side, wrapping cleanly. */
body.oshop-compact.oshop-account .wc-block-components-notice-banner__content {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 16px;
}

body.oshop-compact.oshop-account .wc-block-components-notice-banner {
	align-items: center;
	padding: 10px 14px;
	font-size: 14px;
}

/* Orders: one tight row each on wide screens. */
body.oshop-compact .woocommerce-orders-table td,
body.oshop-compact .woocommerce-orders-table th {
	padding-top: 10px;
	padding-bottom: 10px;
	vertical-align: middle;
}

/* Phones: each order as two short lines (number, date, status / total) with "View" on the right. */
@media (max-width: 768px) {

	body.oshop-compact table.woocommerce-orders-table,
	body.oshop-compact table.woocommerce-orders-table tbody {
		display: block;
		border: 0;
	}

	body.oshop-compact table.woocommerce-orders-table thead {
		display: none;
	}

	body.oshop-compact table.woocommerce-orders-table tr.woocommerce-orders-table__row {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		gap: 2px 12px;
		margin: 0;
		padding: 12px 0;
		border: 0;
		border-bottom: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
		border-radius: 0;
		background: none;
	}

	body.oshop-compact table.woocommerce-orders-table tr.woocommerce-orders-table__row td,
	body.oshop-compact table.woocommerce-orders-table tr.woocommerce-orders-table__row th {
		display: block;
		flex: 0 0 auto;
		padding: 0;
		border: 0;
		text-align: start;
		font-size: 14px;
	}

	body.oshop-compact table.woocommerce-orders-table tr.woocommerce-orders-table__row :is(td, th)::before {
		display: none;
	}

	body.oshop-compact table.woocommerce-orders-table .woocommerce-orders-table__cell-order-number {
		font-weight: 600;
	}

	body.oshop-compact table.woocommerce-orders-table .woocommerce-orders-table__cell-order-total {
		flex-basis: 100%;
		order: 5;
		opacity: 0.7;
	}

	body.oshop-compact table.woocommerce-orders-table .woocommerce-orders-table__cell-order-actions {
		order: 4;
		margin-inline-start: auto;
	}

	/* The three summary tiles as a short list. */
	body.oshop-compact .oshop-acc .oshop-acc-tiles {
		display: block;
		border-top: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
	}

	body.oshop-compact .oshop-acc .oshop-acc-tiles .oshop-acc-tile {
		display: flex;
		flex-direction: row;
		align-items: baseline;
		justify-content: space-between;
		gap: 16px;
		margin: 0;
		padding: 12px 0;
		border: 0;
		border-bottom: 1px solid var(--tc-line, rgba(127, 127, 127, 0.22));
		border-radius: 0;
		background: none;
		box-shadow: none;
	}

	body.oshop-compact .oshop-acc .oshop-acc-tiles .oshop-acc-tile__title {
		flex: none;
		margin: 0;
	}

	body.oshop-compact .oshop-acc .oshop-acc-tiles .oshop-acc-tile__note {
		min-width: 0;
		margin: 0;
		overflow: hidden;
		text-align: end;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
}

body.oshop-compact.oshop-account.woocommerce-account .woocommerce-orders-table a.woocommerce-button,
body.oshop-compact.oshop-account.woocommerce-account .wc-block-components-notice-banner .button {
	display: inline-flex;
	align-items: center;
	height: 34px;
	min-height: 0;
	padding: 0 14px;
	line-height: 1;
}

/* WooCommerce puts the notice's button before its text: show the text first. */
body.oshop-compact.oshop-account .wc-block-components-notice-banner__content .button {
	order: 2;
}

body.oshop-compact.oshop-account.woocommerce-account .woocommerce-orders-table a.woocommerce-button,
body.oshop-compact.oshop-account.woocommerce-account .wc-block-components-notice-banner .button {
	padding-inline: 16px !important; /* WooCommerce's notice styles zero it. */
	border-radius: 999px;
}
