/*
 * カート（R6）：ドロワー・カートのページ・送料無料までの表示・まとめ買い割引
 *
 * 空の状態は公開サイトの表示を測った仕様書（docs/specs/cart/）から。
 * 商品が入った状態は、公開サイトのカートに商品を入れずに作るため（ユーザー決定）、測った部品
 * （パネルの枠・ボタン・数量・価格・商品カードの文字）を組み合わせて作った。
 */

/* ------------------------------------------------------------------ ドロワー */

.gb-cart-drawer .gb-drawer__header-inner {
	height: auto;
	padding-block: 23px;
}

.gb-cart-drawer__title {
	display: block;
	font-family: var(--gb-font-heading);
	font-size: 18px;
	font-weight: 500;
	line-height: 18px;
}

.gb-cart-drawer__title sup {
	position: relative;
	top: -6.75px;
	margin-left: 4px;
	font-size: 13.5px;
	line-height: 0;
	vertical-align: baseline;
}

.gb-cart-drawer__body {
	display: flex;
	flex-direction: column;
}

.gb-cart-drawer[aria-busy='true'] .gb-cart-items {
	opacity: 0.5;
	pointer-events: none;
}

/* 空のとき：赤いカートのアイコン・文・「お買い物を始める」を真ん中に */
.gb-cart-empty {
	display: flex;
	flex: 1;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding-block: 90px;
	text-align: center;
}

/* 赤いカートに、右上の丸い ✕ を重ねる（82px 四方） */
.gb-cart-empty__icon {
	position: relative;
	width: 82px;
	height: 82px;
	margin-bottom: 45px;
	color: var(--gb-color-accent);
}

.gb-cart-empty__icon > .gb-icon:first-child {
	position: absolute;
	bottom: 0;
	left: 0;
}

.gb-cart-empty__x {
	position: absolute;
	top: 0;
	right: 0;
	border-radius: 50%;
	background: var(--gb-color-drawer-bg);
}

.gb-cart-empty__text {
	margin: 0 0 20px;
}

/* 下：合計とボタン（中身が長くても常に見える） */
.gb-cart-drawer__footer {
	position: sticky;
	bottom: 0;
	margin-top: auto;
	padding: 20px 30px 25px;
	border-top: 1px solid var(--gb-color-border);
	background: var(--gb-color-drawer-bg);
	font-size: 15px;
	line-height: 24px;
}

.gb-cart-drawer__buttons {
	display: grid;
	gap: 12px;
	margin-top: 15px;
	text-align: center;
}

.gb-cart-drawer__view {
	justify-self: center;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.6;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.gb-cart-drawer__view:hover {
	color: var(--gb-color-accent);
}

/* ------------------------------------------------------------------ 送料無料までの表示 */

.gb-free-shipping {
	margin-bottom: 10px;
	font-size: 13px;
	line-height: 1.6;
}

.gb-free-shipping__text {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
}

.gb-free-shipping__text strong {
	margin-inline: 2px;
	color: var(--gb-color-accent);
	font-weight: 500;
}

.gb-free-shipping__bar {
	height: 6px;
	overflow: hidden;
	border-radius: 3px;
	background: var(--gb-color-border);
}

.gb-free-shipping__bar span {
	display: block;
	height: 100%;
	border-radius: 3px;
	background: var(--gb-color-accent);
	transition: width var(--gb-duration) var(--gb-ease);
}

.gb-free-shipping.is-free .gb-free-shipping__bar span {
	background: var(--gb-color-stock-in);
}

/* ------------------------------------------------------------------ 商品の行 */

.gb-cart-items {
	margin: 0;
	padding: 0;
	list-style: none;
}

.gb-cart-item {
	display: grid;
	grid-template-columns: 80px minmax(0, 1fr) auto;
	gap: 15px;
	align-items: start;
	padding-block: 20px;
	border-bottom: 1px solid var(--gb-color-border);
}

.gb-cart-item:last-child {
	border-bottom: 0;
}

.gb-cart-item__image {
	width: 80px;
	height: 80px;
	overflow: hidden;
	border-radius: 8px;
}

.gb-cart-item__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.gb-cart-item__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

.gb-cart-item__vendor {
	margin-bottom: 4px;
	font-size: 11px;
	line-height: 1.6;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.8;
}

.gb-cart-item__title {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	transition: color var(--gb-duration) var(--gb-ease);
}

a.gb-cart-item__title:hover {
	color: var(--gb-color-accent);
}

.gb-cart-item__option {
	margin-top: 2px;
	font-size: 13px;
	line-height: 1.6;
	opacity: 0.8;
}

.gb-cart-item__preorder {
	margin-top: 2px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	color: var(--gb-color-header-links-hover, #3f72e5);
}

.gb-cart-item__unit {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.6;
}

.gb-cart-item__discount {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-top: 4px;
	color: var(--gb-color-accent);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
}

.gb-cart-item__actions {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-top: 10px;
}

/* 小さい数量の部品（高さ 36px） */
.gb-qty--sm {
	width: 90px;
	height: 36px;
	padding-inline: 28px;
}

.gb-qty--sm .gb-qty__button {
	width: 28px;
}

.gb-qty--sm .gb-qty__input {
	line-height: 34px;
}

.gb-cart-item__remove {
	font-size: 12px;
	line-height: 1.6;
	text-decoration: underline;
	text-underline-offset: 3px;
	opacity: 0.8;
	transition: color var(--gb-duration) var(--gb-ease);
}

.gb-cart-item__remove:hover {
	color: var(--gb-color-accent);
	opacity: 1;
}

.gb-cart-item__total {
	font-size: 15px;
	font-weight: 500;
	line-height: 1.4;
	text-align: right;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ 合計 */

.gb-cart-totals {
	margin: 0;
}

.gb-cart-totals__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 15px;
	padding-block: 2px;
}

.gb-cart-totals dt,
.gb-cart-totals dd {
	margin: 0;
}

.gb-cart-totals__row--discount {
	color: var(--gb-color-accent);
}

.gb-cart-totals__row--discount dt {
	display: inline-flex;
	align-items: center;
	gap: 5px;
}

.gb-cart-totals__row--total {
	margin-top: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--gb-color-border);
	font-size: 17px;
	font-weight: 500;
}

.gb-cart-totals__note {
	margin: 6px 0 0;
	font-size: 12px;
	line-height: 1.6;
	opacity: 0.8;
}

.gb-cart-totals__preorder {
	margin: 10px 0 0;
	padding: 10px 12px;
	border: 1px solid var(--gb-color-border, #dadce0);
	border-radius: 4px;
	background: #fff;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.6;
}

.gb-cart-totals__note a {
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ カートのページ */

.gb-cart-page {
	padding-bottom: 80px;
}

/* 空のとき：大きな見出し（54px）と「お買い物を続ける」 */
.gb-cart-page-empty {
	max-width: 570px;
	margin-inline: auto;
	padding-block: 100px;
	text-align: center;
}

.gb-cart-page-empty__title {
	margin: 0 0 20px;
	color: var(--gb-color-heading);
	font-family: var(--gb-font-heading);
	font-size: 54px;
	font-weight: 500;
	line-height: 62px;
	letter-spacing: -0.02em;
}

.gb-cart-page-empty .gb-btn {
	margin-top: 20px;
}

@media (max-width: 767px) {
	.gb-cart-page-empty {
		padding-block: 40px;
	}

	.gb-cart-page-empty__title {
		font-size: 34px;
		line-height: 42px;
	}
}

.gb-cart-page__grid {
	display: grid;
	gap: 40px;
}

@media (min-width: 1068px) {
	.gb-cart-page__grid {
		grid-template-columns: minmax(0, 1fr) 400px;
		gap: 50px;
		align-items: start;
	}
}

.gb-cart-page__labels {
	display: flex;
	justify-content: space-between;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--gb-color-border);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.6;
}

.gb-cart-item--page {
	grid-template-columns: 100px minmax(0, 1fr) auto;
	gap: 20px;
	padding-block: 25px;
}

.gb-cart-item--page:last-child {
	border-bottom: 1px solid var(--gb-color-border);
}

.gb-cart-item--page .gb-cart-item__image {
	width: 100px;
	height: 100px;
}

.gb-cart-page__summary {
	display: grid;
	gap: 15px;
	padding: 30px;
	border-radius: var(--gb-radius-block);
	background: #fff;
	font-size: 15px;
	line-height: 24px;
}

@media (min-width: 1068px) {
	.gb-cart-page__summary {
		position: sticky;
		top: 100px;
	}
}

.gb-cart-page__note .gb-textarea {
	height: auto;
	min-height: 90px;
	resize: vertical;
	font-family: inherit;
	line-height: 1.6;
}

.gb-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1.6;
	letter-spacing: 0.02em;
}

.gb-cart-page__update {
	justify-self: center;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-family: inherit;
	font-size: 13px;
	text-decoration: underline;
	cursor: pointer;
}

.gb-cart-page__update[hidden] {
	display: none;
}

@media (max-width: 767px) {
	.gb-cart-item--page {
		grid-template-columns: 80px minmax(0, 1fr) auto;
		gap: 15px;
	}

	.gb-cart-item--page .gb-cart-item__image {
		width: 80px;
		height: 80px;
	}

	.gb-cart-page__summary {
		padding: 20px;
	}
}

/* WooCommerce のお知らせ（数量の上限など） */
.gb-cart-page .woocommerce-notices-wrapper:not(:empty),
.gb-cart-page .woocommerce-message,
.gb-cart-page .woocommerce-error,
.gb-cart-page .woocommerce-info {
	margin: 0 0 20px;
	padding: 12px 17px;
	border-radius: var(--gb-radius-input);
	background: #fff;
	font-size: 13px;
	line-height: 1.6;
	list-style: none;
}

.gb-cart-page .woocommerce-error {
	color: var(--gb-color-accent);
}
