/*
 * Cart button, add buttons, drawer, toast and checkout frame.
 * Colors, type and corners come from the theme's tokens.
 */

.oakum-cart-button {
	display: inline-flex;
	gap: 0.5rem;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.5rem 0.875rem;
	border: 1px solid currentcolor;
	border-radius: var(--wp--custom--radius, 0);
	color: var(--wp--preset--color--contrast);
	font-weight: 700;
	letter-spacing: var(--wp--custom--label-spacing, 0);
	text-decoration: none;
	text-transform: var(--wp--custom--label-transform, none);
}

.oakum-cart-button__count {
	min-width: 1.5rem;
	padding: 0 0.375rem;
	border-radius: 999px;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	font-size: 0.8125rem;
	text-align: center;
}

.oakum-cart-button__count.is-empty {
	background: var(--wp--preset--color--line);
	color: var(--wp--preset--color--contrast);
}

.oakum-add {
	position: relative;
	z-index: 1;
	display: inline-block;
	min-height: 2.75rem;
	padding: 0.5rem 1rem;
	border: 0;
	border-radius: var(--wp--custom--radius, 0);
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--on-primary);
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	cursor: pointer;
}

.oakum-add--link {
	border: 1px solid currentcolor;
	background: transparent;
	color: inherit;
}

.oakum-product-card__add {
	margin: 0;
}

.oakum-product__add {
	width: 1%;
	padding-left: 1rem;
	white-space: nowrap;
}

.oakum-drawer {
	width: min(100%, 28rem);
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0 0 0 auto;
	padding: 1.25rem;
	border: 0;
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.oakum-drawer::backdrop {
	background: rgb(0 0 0 / 50%);
}

.oakum-drawer__head {
	display: flex;
	justify-content: space-between;
	align-items: center;
}

.oakum-drawer__head h2 {
	margin: 0;
	font-size: var(--wp--preset--font-size--large);
}

.oakum-drawer__close {
	min-width: 2.75rem;
	min-height: 2.75rem;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 1.75rem;
	cursor: pointer;
}

.oakum-cart__list {
	margin: 1rem 0;
	padding: 0;
	list-style: none;
}

.oakum-cart__item {
	display: grid;
	grid-template-columns: 4rem 1fr auto;
	gap: 0.75rem;
	align-items: start;
	padding-block: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--line);
}

.oakum-cart__item img,
.oakum-cart__noimg {
	display: block;
	width: 4rem;
	height: 4rem;
	object-fit: cover;
	background: var(--wp--preset--color--surface);
}

.oakum-cart__info a {
	color: inherit;
	font-weight: 700;
}

.oakum-cart__size,
.oakum-cart__store,
.oakum-cart__note {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

.oakum-cart__qty {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-top: 0.5rem;
}

.oakum-cart__qty button {
	min-width: 2.25rem;
	min-height: 2.25rem;
	border: 1px solid var(--wp--preset--color--line);
	background: transparent;
	color: inherit;
	font: inherit;
	cursor: pointer;
}

.oakum-cart__qty .oakum-cart__remove {
	border: 0;
	text-decoration: underline;
}

.oakum-cart__total {
	display: flex;
	justify-content: space-between;
	margin-bottom: 0;
	font-size: var(--wp--preset--font-size--large);
}

.oakum-toast {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 99999;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1rem;
	align-items: center;
	max-width: min(calc(100% - 2rem), 26rem);
	padding: 0.875rem 1rem;
	border: 1px solid var(--wp--preset--color--line);
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--contrast);
}

.oakum-toast[hidden] {
	display: none;
}

.oakum-toast p {
	flex: 1 1 100%;
	margin: 0;
}

.oakum-toast button {
	min-height: 2.5rem;
	padding: 0.375rem 0.875rem;
	border: 1px solid currentcolor;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.oakum-checkout__frame {
	display: block;
	width: 100%;
	min-height: 80vh;
	border: 0;
	background: #fff;
}
