/*
 * 共通部品（R3）：開閉・数量の増減・タブ・セレクト・モーダル・トースト
 *
 * 開閉・数量・タブの値は、公開サイトの表示を測った仕様書（docs/specs/components/）から。
 * モーダル・トースト・セレクトは公開サイトにないため、土台の値（色・角丸・動きの時間）に合わせて新しく決めた。
 * 横から出るパネル（.gb-drawer）は gb-layout.css。
 */

/* ------------------------------------------------------------------ 開閉（アコーディオン） */

/* 見出しは 15px / 500、上下 20px。右端の矢印（上向き）は、閉じている間は裏返して下向きにする。高さの動きは gb-components.js */
.gb-accordion {
	border-bottom: 1px solid var(--gb-color-border);
}

/* 一覧の最初の行にも上の線を付ける（商品ページ） */
.gb-accordion-group--top > .gb-accordion:first-child {
	border-top: 1px solid var(--gb-color-border);
}

.gb-accordion-group {
	margin-bottom: 25px;
}

.gb-accordion__summary {
	position: relative;
	display: block;
	padding: 20px 40px 20px 0;
	color: var(--gb-color-heading);
	font-size: 15px;
	font-weight: 500;
	line-height: 15px;
	list-style: none;
	cursor: pointer;
}

.gb-accordion__summary::-webkit-details-marker {
	display: none;
}

.gb-accordion__icon {
	position: absolute;
	top: 50%;
	right: 0;
	margin-top: -4px;
	transform: rotateX(180deg);
	transition: transform var(--gb-duration) var(--gb-ease);
}

.gb-accordion[open] > .gb-accordion__summary .gb-accordion__icon {
	transform: rotateX(0deg);
}

.gb-accordion__content {
	overflow: hidden;
	padding-bottom: 15px;
	font-size: 15px;
	line-height: 24px;
}

.gb-accordion__content p:last-child {
	margin-bottom: 0;
}

/* ------------------------------------------------------------------ 数量の増減 */

/* 幅 100px・高さ 44px・枠 1px・角丸 6px。−／＋ は幅 32px。最小のときの − は押せない（薄いまま） */
.gb-qty {
	position: relative;
	display: inline-flex;
	width: 100px;
	height: 44px;
	padding-inline: 32px;
	border: 1px solid var(--gb-color-input-border);
	border-radius: var(--gb-radius-input);
}

.gb-qty__button {
	position: absolute;
	top: 0;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gb-color-text);
	line-height: 1;
	cursor: pointer;
}

.gb-qty__button--minus {
	left: 0;
}

.gb-qty__button--plus {
	right: 0;
}

.gb-qty__button .gb-icon {
	opacity: 0.8;
	user-select: none;
	transition: all var(--gb-duration) var(--gb-ease);
}

.gb-qty__button:hover .gb-icon {
	opacity: 1;
}

.gb-qty__button:disabled {
	cursor: not-allowed;
}

.gb-qty__button:disabled .gb-icon {
	opacity: 0.6;
}

.gb-qty__input {
	display: flex;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	padding: 0;
	border: 0;
	border-radius: var(--gb-radius-input);
	background: transparent;
	font-size: 13px;
	line-height: 42px;
	text-align: center;
	-moz-appearance: textfield;
	appearance: textfield;
}

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

.gb-qty__input:focus {
	outline: none;
}

.gb-qty:focus-within {
	border-color: var(--gb-color-text);
}

/* ------------------------------------------------------------------ タブ（丸い小さなボタン） */

/* 選ばれている・マウスを乗せたボタンはアクセントの色（0.25 秒で切り替わる） */
.gb-tabs {
	display: flex;
	overflow-x: auto;
	white-space: nowrap;
	text-align: left;
	scrollbar-width: none;
}

.gb-tabs::-webkit-scrollbar {
	display: none;
}

.gb-tab {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	min-height: 31px;
	margin: 0 2px 2px 0;
	padding: 5px 15px;
	border: 0;
	border-radius: var(--gb-radius-button);
	background: rgba(var(--gb-color-text-rgb), 0.05);
	color: rgba(var(--gb-color-text-rgb), 0.8);
	font-family: var(--gb-font-body);
	font-size: 13px;
	font-weight: 500;
	line-height: 13px;
	cursor: pointer;
	transition:
		color var(--gb-duration) var(--gb-ease),
		background-color var(--gb-duration) var(--gb-ease);
}

.gb-tab + .gb-tab {
	margin-left: 10px;
}

.gb-tab:hover,
.gb-tab[aria-selected='true'] {
	background: var(--gb-color-accent);
	color: #fff;
}

.gb-tab-panel[hidden] {
	display: none;
}

/* ------------------------------------------------------------------ セレクト（入力欄と同じ形） */

.gb-select {
	position: relative;
	display: block;
}

.gb-select select {
	width: 100%;
	height: 50px;
	padding: 12px 42px 12px 17px;
	border: 1px solid var(--gb-color-input-border);
	border-radius: var(--gb-radius-input);
	background: transparent;
	font-size: 13px;
	line-height: 1.15;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: all var(--gb-duration) var(--gb-ease);
}

.gb-select select:focus {
	outline: none;
	border-color: var(--gb-color-text);
}

.gb-select .gb-icon {
	position: absolute;
	top: 50%;
	right: 17px;
	margin-top: -4px;
	pointer-events: none;
}

/* ------------------------------------------------------------------ モーダル（年齢確認など） */

/* 画面の中央の白い箱。後ろはパネルと同じ幕（灰色 40%・7px のぼかし）。0.25 秒で浮き上がる */
.gb-modal {
	width: min(480px, calc(100vw - 2 * var(--gb-gutter-sm)));
	max-height: calc(100dvh - 40px);
	margin: auto;
	padding: 40px 30px 30px;
	overflow-y: auto;
	border: 0;
	border-radius: var(--gb-radius-block);
	background: #fff;
	box-shadow: 0 4px 6px rgba(0, 0, 0, 0.08);
	color: var(--gb-color-text);
	text-align: center;
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity var(--gb-duration) var(--gb-ease),
		transform var(--gb-duration) var(--gb-ease),
		overlay var(--gb-duration) allow-discrete,
		display var(--gb-duration) allow-discrete;
}

.gb-modal[open] {
	opacity: 1;
	transform: none;
}

@starting-style {
	.gb-modal[open] {
		opacity: 0;
		transform: translateY(20px);
	}
}

.gb-modal::backdrop {
	background: rgba(var(--gb-color-overlay-rgb), 0.4);
	-webkit-backdrop-filter: blur(7px);
	backdrop-filter: blur(7px);
}

.gb-modal__title {
	margin-bottom: 15px;
}

.gb-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	justify-content: center;
	margin-top: 25px;
}

.gb-modal__actions .gb-btn {
	flex: 1 1 160px;
}

.gb-modal__close {
	position: absolute;
	top: 18px;
	right: 18px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

/* ------------------------------------------------------------------ トースト（短い通知） */

/* 画面の下の中央に 3 秒ほど出る。読み上げソフトにも伝える（aria-live） */
.gb-toast-region {
	position: fixed;
	left: 50%;
	bottom: 30px;
	z-index: 100;
	display: grid;
	gap: 10px;
	width: min(420px, calc(100vw - 2 * var(--gb-gutter-sm)));
	transform: translateX(-50%);
	pointer-events: none;
}

.gb-toast {
	padding: 14px 20px;
	border-radius: var(--gb-radius-button);
	background: var(--gb-btn-bg);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	color: var(--gb-btn-text);
	font-size: 14px;
	line-height: 1.6;
	text-align: center;
	opacity: 0;
	transform: translateY(20px);
	transition:
		opacity var(--gb-duration) var(--gb-ease),
		transform var(--gb-duration) var(--gb-ease);
	pointer-events: auto;
}

.gb-toast.is-shown {
	opacity: 1;
	transform: none;
}

.gb-toast--error {
	background: var(--gb-color-accent);
}

@media (prefers-reduced-motion: reduce) {
	.gb-accordion__icon,
	.gb-tab,
	.gb-modal,
	.gb-toast {
		transition-duration: 0.01s;
	}
}

/* ------------------------------------------------------------------ 法定ページ（特商法の表記・プライバシーポリシー・利用規約など） */

.gb-policy {
	max-width: 800px;
	margin: 0 auto;
	padding: 40px 0 60px;
}

.gb-policy__title {
	margin: 0 0 30px;
	text-align: center;
}

.gb-policy__body {
	font-size: 15px;
	line-height: 1.8;
	overflow-wrap: anywhere;
}

.gb-policy__body h2 {
	margin: 40px 0 15px;
	font-size: 20px;
	line-height: 28px;
}

.gb-policy__body h3 {
	margin: 25px 0 10px;
	font-size: 17px;
	line-height: 26px;
}

.gb-policy__body p {
	margin: 0 0 15px;
}

.gb-policy__body table {
	display: block;
	overflow-x: auto;
}

.gb-policy__body tbody,
.gb-policy__body thead {
	display: table;
	width: 100%;
}

.gb-policy__body th {
	background: rgba(var(--gb-color-text-rgb), 0.04);
	font-weight: 500;
}

.gb-legal-table th {
	width: 30%;
	min-width: 110px;
}

.gb-legal-table td > p:last-child {
	margin-bottom: 0;
}

@media (min-width: 768px) {
	.gb-policy {
		padding: 60px 0 100px;
	}
}

/* ------------------------------------------------------------------ ウィッシュリスト（ハートのボタン・一覧ページ） */

.gb-wish {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--gb-color-text);
	font: inherit;
	cursor: pointer;
	transition: color var(--gb-duration) var(--gb-ease);
}

.gb-wish svg {
	fill: transparent;
	transition: fill var(--gb-duration) var(--gb-ease);
}

.gb-wish.is-on,
.gb-wish:hover {
	color: var(--gb-color-accent);
}

.gb-wish.is-on svg {
	fill: currentColor;
}

.gb-wish:disabled {
	opacity: 0.6;
	cursor: default;
}

/* 商品カード：画像の左上の丸いボタン */
.gb-wish--card {
	position: absolute;
	top: 7px;
	left: 7px;
	z-index: 30;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* 商品ページ：購入のボタンの下 */
.gb-wish--summary {
	margin-top: 15px;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
}

.gb-wishlist {
	padding-bottom: 60px;
}

.gb-wishlist__status,
.gb-wishlist__empty {
	padding: 40px 0;
	text-align: center;
}

.gb-wishlist__empty p {
	margin: 0 0 25px;
}

.gb-wishlist__note {
	margin: 30px 0 0;
	font-size: 13px;
	line-height: 1.6;
	opacity: 0.8;
}

.gb-wishlist__note a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

@media (min-width: 768px) {
	.gb-wish--card {
		top: 14px;
		left: 14px;
	}

	.gb-wishlist {
		padding-bottom: 100px;
	}
}

