/* ==========================================================================
   Multibrand: brands, product types, availability and volume prices
   ==========================================================================
 *
 * Loaded after refresh.css. Mobile first: every block is a single column on a
 * phone and opens out from 600px and 960px. Uses the store's own tokens only.
 */

/* --- Section header with a link on the right --------------------------- */

.cod-mb-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 8px 24px;
}
.cod-mb-head .cod-section__sub { margin-bottom: 0; }
.cod-mb-head__link {
	font-weight: 600;
	color: var(--cod-blue);
	white-space: nowrap;
}
.cod-mb-head__link::after { content: " \2192"; }

/* --- Availability chip ------------------------------------------------- */

.cod-avail {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: var(--cod-radius-pill);
	font-size: .78rem;
	font-weight: 600;
	line-height: 1.4;
	white-space: nowrap;
	background: #ecfdf5;
	color: #047857;
}
.cod-avail::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: currentColor;
}
.cod-avail--order { background: #fff7ed; color: #b45309; }
.cod-avail--out { background: var(--cod-tile); color: var(--cod-muted); }

.cod-shopcard__avail { position: absolute; top: 12px; left: 12px; }

.cod-shopcard__brand {
	font-size: .78rem;
	font-weight: 600;
	color: var(--cod-muted);
	letter-spacing: .01em;
}

/* --- Product grids: two columns on a larger phone, four on a desktop ---- */

@media (min-width: 480px) and (max-width: 767px) {
	.woocommerce ul.products:has(> li.cod-shopcard),
	ul.products:has(> li.cod-shopcard) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
	.cod-shopcard__media { aspect-ratio: 1 / 1; }
}
@media (min-width: 1100px) {
	.cod-mb-featured ul.products:has(> li.cod-shopcard) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* --- Brand tiles -------------------------------------------------------- */

.cod-mb-tiles {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 600px) { .cod-mb-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .cod-mb-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.cod-mb-tile__link {
	display: flex;
	flex-direction: column;
	gap: 6px;
	height: 100%;
	padding: 22px 22px 20px;
	border: 1px solid var(--cod-hairline);
	border-radius: var(--cod-radius-lg);
	background: var(--cod-surface);
	color: inherit;
	text-decoration: none;
	transition: border-color .15s ease, box-shadow .15s ease;
}
.cod-mb-tile__link:hover { border-color: var(--cod-blue); box-shadow: var(--cod-shadow); text-decoration: none; }
.cod-mb-tile__link:focus-visible { outline: 2px solid var(--cod-blue); outline-offset: 3px; }
.cod-mb-tile__logo { max-height: 44px; width: auto; margin-bottom: 6px; }
.cod-mb-tile__name {
	font-family: var(--cod-font-heading);
	font-size: 1.35rem;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--cod-ink);
}
.cod-mb-tile__count { font-size: .85rem; font-weight: 600; color: var(--cod-blue); }
.cod-mb-tile__desc { font-size: .92rem; color: var(--cod-ink-soft); }

/* --- Product-type chips ------------------------------------------------- */

.cod-mb-chips {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}
@media (min-width: 600px) { .cod-mb-chips { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); } }

.cod-mb-chip {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 12px;
	padding: 16px 18px;
	border-radius: var(--cod-radius);
	background: var(--cod-tile);
	color: inherit;
	text-decoration: none;
}
.cod-mb-chip:hover { background: var(--cod-surface-deep); text-decoration: none; }
.cod-mb-chip__name { font-weight: 600; color: var(--cod-ink); }
.cod-mb-chip__count {
	align-self: start;
	min-width: 26px;
	padding: 1px 8px;
	border-radius: var(--cod-radius-pill);
	background: var(--cod-surface);
	font-size: .8rem;
	font-weight: 600;
	text-align: center;
	color: var(--cod-blue);
}
.cod-mb-chip__desc { grid-column: 1 / -1; font-size: .85rem; color: var(--cod-ink-soft); }

/* --- Volume price table: a table on a desktop, cards on a phone -------- */

.cod-mb-volume__brand { display: block; font-size: .78rem; font-weight: 600; color: var(--cod-muted); }
.cod-mb-volume__from { display: block; font-size: .8rem; color: var(--cod-muted); }
.cod-mb-volume__note { margin-top: 18px; text-align: center; font-weight: 600; }
.cod-mb-volume__table td,
.cod-mb-volume__table th { vertical-align: middle; font-variant-numeric: tabular-nums; }

@media (max-width: 699px) {
	/* The base table keeps 560px for scrolling; as cards it needs none of it. */
	.cod-mb-volume .cod-table-wrap { overflow: visible; border: 0; background: none; box-shadow: none; }
	.cod-mb-volume__table { min-width: 0; }
	.cod-mb-volume__table td .cod-avail { white-space: normal; }
	.cod-mb-volume__table thead { display: none; }
	.cod-mb-volume__table,
	.cod-mb-volume__table tbody,
	.cod-mb-volume__table tr,
	.cod-mb-volume__table th,
	.cod-mb-volume__table td { display: block; width: 100%; }
	.cod-mb-volume__table tr {
		margin-bottom: 12px;
		padding: 14px 16px;
		border-radius: var(--cod-radius);
		background: var(--cod-surface);
	}
	.cod-mb-volume__table th { padding: 0 0 8px; border: 0; }
	.cod-mb-volume__table td {
		display: flex;
		justify-content: space-between;
		gap: 12px;
		padding: 6px 0;
		border: 0;
		border-top: 1px solid var(--cod-hairline);
		text-align: right;
	}
	.cod-mb-volume__table td::before {
		content: attr(data-label);
		color: var(--cod-muted);
		text-align: left;
	}
}

/* --- Delivery summary ---------------------------------------------------- */

.cod-delivery__facts {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 12px;
	margin: 0;
}
@media (min-width: 768px) { .cod-delivery__facts { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.cod-delivery__fact {
	padding: 18px 20px;
	border-radius: var(--cod-radius);
	background: var(--cod-surface);
}
.cod-delivery__fact dt { margin-bottom: 4px; font-size: .8rem; font-weight: 600; color: var(--cod-muted); }
.cod-delivery__fact dd { margin: 0; font-weight: 600; color: var(--cod-ink); }
.cod-delivery__more,
.cod-steps__more,
.cod-faq__more { margin-top: 20px; font-weight: 600; }
.cod-steps__more,
.cod-faq__more { text-align: center; }

/* --- Brand directory ----------------------------------------------------- */

.cod-branddir { display: grid; gap: 20px; margin: 24px 0 40px; }
.cod-branddir__brand {
	padding: clamp(18px, 3vw, 28px);
	border: 1px solid var(--cod-hairline);
	border-radius: var(--cod-radius-lg);
	scroll-margin-top: 96px;
}
.cod-branddir__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 14px; }
.cod-branddir__logo { max-height: 40px; width: auto; }
.cod-branddir__name { margin: 0; font-size: clamp(1.35rem, 1.2rem + .6vw, 1.7rem); }
.cod-branddir__count { margin: 0; font-size: .85rem; font-weight: 600; color: var(--cod-blue); }
.cod-branddir__desc { margin: 10px 0 14px; color: var(--cod-ink-soft); }
.cod-branddir__lines { margin: 0 0 16px; padding: 0; list-style: none; border-top: 1px solid var(--cod-hairline); }
.cod-branddir__line a {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 4px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cod-hairline);
	color: inherit;
	text-decoration: none;
}
.cod-branddir__line a:hover .cod-branddir__line-name { color: var(--cod-blue); }
.cod-branddir__line-name { font-weight: 600; color: var(--cod-ink); }
.cod-branddir__line-facts { font-size: .88rem; color: var(--cod-ink-soft); font-variant-numeric: tabular-nums; }
.cod-branddir__line .cod-avail { justify-self: start; }
@media (min-width: 768px) {
	.cod-branddir__line a { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.6fr) auto; align-items: center; gap: 16px; }
}
.cod-branddir__formats { display: flex; flex-wrap: wrap; gap: 10px; padding: 0; list-style: none; }
.cod-branddir__formats li { padding: 8px 14px; border-radius: var(--cod-radius-pill); background: var(--cod-tile); }

/* --- Navigation: the "all brands" link under the brand dropdown -------- */

.cod-mega__all { width: 100%; margin: 8px 0 0; font-weight: 600; }

/* Prose headings carry a top margin for long pages; inside a brand card the card's padding does that job. */
.cod-branddir__brand > .cod-branddir__head > h2.cod-branddir__name { margin: 0; }
.cod-branddir__brand { padding-top: clamp(16px, 2.4vw, 22px); }
