/* TORIDENTE スクールグッズ注文 */
.tg {
	--tg-accent: #0E4DA4;
	--tg-ink: #14181f;
	--tg-muted: #5d6673;
	--tg-line: #e2e6eb;
	--tg-soft: #f4f6f9;
	--tg-bg: #ffffff;
	--tg-danger: #c62828;
	--tg-radius: 14px;
	color: var(--tg-ink);
	font-size: 15px;
	line-height: 1.6;
	max-width: 760px;
	margin: 0 auto;
	padding: 0 0 24px;
	-webkit-text-size-adjust: 100%;
}
.tg *, .tg *::before, .tg *::after { box-sizing: border-box; }
.tg h2, .tg h3, .tg p, .tg dl, .tg dd, .tg ul { margin: 0; padding: 0; }
.tg ul { list-style: none; }
.tg[data-bar="1"] { padding-bottom: 96px; }

/* ---------- 見出し ---------- */
.tg .tg-head {
	background: var(--tg-ink);
	color: #fff;
	border-radius: var(--tg-radius);
	padding: 22px 18px 18px;
	margin-bottom: 16px;
	position: relative;
	overflow: hidden;
}
.tg .tg-head::after {
	content: "";
	position: absolute;
	right: -40px; top: -40px;
	width: 140px; height: 140px;
	border-radius: 50%;
	border: 18px solid var(--tg-accent);
	opacity: .9;
}
.tg .tg-eyebrow { font-size: 11px; letter-spacing: .16em; font-weight: 700; color: rgba(255,255,255,.7); }
.tg .tg-title { font-size: 26px; line-height: 1.3; font-weight: 800; color: #fff; margin: 4px 0 2px; border: 0; padding: 0; }
.tg .tg-lead { font-size: 13px; color: rgba(255,255,255,.8); position: relative; z-index: 1; }
.tg .tg-facts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; position: relative; z-index: 1; }
.tg .tg-fact { background: rgba(255,255,255,.1); border-radius: 10px; padding: 6px 10px; }
.tg .tg-fact dt { font-size: 10px; color: rgba(255,255,255,.65); font-weight: 700; letter-spacing: .06em; }
.tg .tg-fact dd { font-size: 14px; font-weight: 700; color: #fff; }
.tg .tg-fact--deadline { background: var(--tg-accent); }
.tg .tg-fact--deadline dt { color: rgba(255,255,255,.85); }

.tg .tg-closed {
	background: var(--tg-soft);
	border-radius: 12px;
	padding: 14px 16px;
	margin-bottom: 16px;
	font-weight: 600;
}

/* ---------- 商品カード ---------- */
.tg .tg-catalog { display: grid; gap: 12px; }
.tg .tg-card {
	background: var(--tg-bg);
	border: 1px solid var(--tg-line);
	border-radius: var(--tg-radius);
	padding: 12px;
	display: grid;
	grid-template-columns: 108px 1fr;
	gap: 12px;
	align-items: start;
}
.tg .tg-photo {
	aspect-ratio: 1 / 1;
	border-radius: 10px;
	background: var(--tg-soft);
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}
.tg .tg-photo img { width: 100%; height: 100%; object-fit: cover; display: block; margin: 0; border-radius: 0; }
.tg .tg-photo-empty { font-size: 11px; font-weight: 700; letter-spacing: .12em; color: #aab1bb; }
.tg .tg-card-body { min-width: 0; display: contents; }
.tg .tg-name { grid-column: 2; font-size: 16px; line-height: 1.4; font-weight: 800; color: var(--tg-ink); margin: 0; padding: 0; border: 0; }
.tg .tg-price { grid-column: 2; font-size: 20px; font-weight: 800; line-height: 1.2; margin-top: -6px; }
.tg .tg-yen { font-size: 13px; margin-left: 1px; }
.tg .tg-tax { font-size: 11px; color: var(--tg-muted); font-weight: 600; margin-left: 6px; }
.tg .tg-desc { grid-column: 2; font-size: 13px; color: var(--tg-muted); margin-top: -6px; }
.tg .tg-card > .tg-photo { grid-row: 1 / span 3; }
.tg .tg-pick { grid-column: 1 / -1; border-top: 1px dashed var(--tg-line); padding-top: 12px; }

.tg .tg-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.tg .tg-size {
	appearance: none;
	min-width: 48px;
	height: 40px;
	padding: 0 10px;
	border: 1.5px solid var(--tg-line);
	border-radius: 10px;
	background: var(--tg-bg);
	color: var(--tg-ink);
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
}
.tg .tg-size:hover { border-color: #b9c0ca; }
.tg .tg-size[aria-checked="true"] { border-color: var(--tg-accent); background: var(--tg-accent); color: #fff; }
.tg .tg-sizes.is-alert .tg-size { border-color: var(--tg-danger); }

.tg .tg-pick-row { display: flex; gap: 8px; align-items: center; }
.tg .tg-qty {
	display: flex;
	align-items: center;
	border: 1.5px solid var(--tg-line);
	border-radius: 10px;
	height: 44px;
	flex: none;
}
.tg .tg-qty-btn {
	appearance: none;
	width: 40px;
	height: 100%;
	border: 0;
	background: transparent;
	color: var(--tg-ink);
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	line-height: 1;
	padding: 0;
	box-shadow: none;
	cursor: pointer;
}
.tg .tg-qty-btn:disabled { color: #c3c9d1; cursor: default; }
.tg .tg-qty-num { min-width: 22px; text-align: center; font-weight: 800; font-size: 16px; }
.tg .tg-add {
	appearance: none;
	flex: 1;
	height: 44px;
	border: 0;
	border-radius: 10px;
	background: var(--tg-ink);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .02em;
	text-transform: none;
	box-shadow: none;
	padding: 0 12px;
	cursor: pointer;
}
.tg .tg-add:hover { opacity: .9; }
.tg .tg-add.is-added { background: var(--tg-accent); }
.tg .tg-pick-msg { font-size: 12px; font-weight: 700; min-height: 0; margin-top: 6px; color: var(--tg-accent); }
.tg .tg-pick-msg:empty { display: none; }
.tg .tg-pick-msg.is-alert { color: var(--tg-danger); }

/* ---------- パネル共通 ---------- */
.tg .tg-panel {
	background: var(--tg-bg);
	border: 1px solid var(--tg-line);
	border-radius: var(--tg-radius);
	padding: 18px 16px;
	margin-top: 16px;
	scroll-margin-top: 16px;
}
.tg .tg-panel-title { display: flex; align-items: center; gap: 8px; font-size: 17px; font-weight: 800; margin: 0 0 12px; padding: 0; border: 0; color: var(--tg-ink); }
.tg .tg-step {
	width: 24px; height: 24px; flex: none;
	border-radius: 50%;
	background: var(--tg-accent);
	color: #fff;
	font-size: 13px;
	display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- カート ---------- */
.tg .tg-cart-list li {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 2px 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--tg-line);
}
.tg .tg-cart-name { font-weight: 700; font-size: 14px; }
.tg .tg-cart-sub { grid-column: 2; grid-row: 1; font-weight: 800; text-align: right; }
.tg .tg-cart-ctrl { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--tg-muted); }
.tg .tg-cart-ctrl .tg-qty { height: 34px; }
.tg .tg-cart-ctrl .tg-qty-btn { width: 32px; font-size: 16px; }
.tg .tg-cart-ctrl .tg-qty-num { font-size: 14px; }
.tg .tg-remove {
	appearance: none; margin-left: auto;
	border: 0; background: none; padding: 4px;
	color: var(--tg-muted); font: inherit; font-size: 12px; text-decoration: underline;
	box-shadow: none; cursor: pointer;
}
.tg .tg-cart-empty { font-size: 13px; color: var(--tg-muted); padding: 6px 0 4px; }
.tg .tg-cart-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; font-size: 13px; font-weight: 700; }
.tg .tg-cart-total strong { font-size: 22px; font-weight: 800; }

/* ---------- フォーム ---------- */
.tg .tg-field { display: block; margin-bottom: 14px; }
.tg .tg-field-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.tg .tg-label { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; margin-bottom: 4px; }
.tg .tg-label em, .tg .tg-label i { font-style: normal; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.tg .tg-label em { background: var(--tg-accent); color: #fff; }
.tg .tg-label i { background: var(--tg-soft); color: var(--tg-muted); }
.tg .tg-field input, .tg .tg-field select, .tg .tg-field textarea {
	display: block;
	width: 100%;
	min-height: 46px;
	margin: 0;
	padding: 10px 12px;
	border: 1.5px solid var(--tg-line);
	border-radius: 10px;
	background: var(--tg-bg);
	color: var(--tg-ink);
	font: inherit;
	font-size: 16px; /* iPhoneで拡大されないように */
	line-height: 1.4;
	box-shadow: none;
	appearance: none;
}
.tg .tg-field select {
	background-image: linear-gradient(45deg, transparent 50%, var(--tg-muted) 50%), linear-gradient(135deg, var(--tg-muted) 50%, transparent 50%);
	background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
	background-size: 5px 5px;
	background-repeat: no-repeat;
	padding-right: 30px;
}
.tg .tg-field input:focus, .tg .tg-field select:focus, .tg .tg-field textarea:focus { outline: none; border-color: var(--tg-accent); }
.tg .tg-field.is-alert input, .tg .tg-field.is-alert select, .tg .tg-field.is-alert textarea { border-color: var(--tg-danger); }

.tg .tg-notes { background: var(--tg-soft); border-radius: 10px; padding: 12px; font-size: 13px; margin: 4px 0 14px; }
.tg .tg-notes p + p { margin-top: 6px; }
.tg .tg-notes b { display: inline-block; font-size: 11px; background: var(--tg-ink); color: #fff; border-radius: 4px; padding: 0 6px; margin-right: 6px; }

.tg .tg-check { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; font-weight: 600; margin-bottom: 14px; cursor: pointer; }
.tg .tg-check input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--tg-accent); }
.tg .tg-check.is-alert { color: var(--tg-danger); }

.tg .tg-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.tg .tg-error { color: var(--tg-danger); font-size: 13px; font-weight: 700; margin-bottom: 10px; }
.tg .tg-error:empty { display: none; }

.tg .tg-btn {
	appearance: none;
	display: block;
	width: 100%;
	height: 54px;
	border-radius: 12px;
	font: inherit;
	font-size: 16px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: .03em;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
}
.tg .tg-btn--main { border: 0; background: var(--tg-accent); color: #fff; }
.tg .tg-btn--main:disabled { opacity: .55; cursor: wait; }
.tg .tg-btn--ghost { border: 1.5px solid var(--tg-line); background: var(--tg-bg); color: var(--tg-ink); margin-top: 10px; height: 48px; font-size: 14px; }
.tg .tg-privacy { font-size: 11px; color: var(--tg-muted); margin-top: 12px; }
.tg .tg-privacy a { color: inherit; }

/* ---------- 確認・完了 ---------- */
.tg .tg-sum dl { display: grid; grid-template-columns: 7.5em 1fr; gap: 6px 10px; font-size: 14px; margin-bottom: 14px; }
.tg .tg-sum dt { color: var(--tg-muted); font-weight: 600; }
.tg .tg-sum dd { font-weight: 700; word-break: break-all; }
.tg .tg-sum-items { border-top: 1px solid var(--tg-line); margin-bottom: 14px; }
.tg .tg-sum-items li { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--tg-line); font-size: 14px; }
.tg .tg-sum-items li span:last-child { font-weight: 800; white-space: nowrap; }
.tg .tg-sum-total { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; font-size: 13px; margin-bottom: 16px; }
.tg .tg-sum-total strong { font-size: 24px; font-weight: 800; }

.tg .tg-done { text-align: center; padding: 28px 18px; }
.tg .tg-done-mark { width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 50%; background: var(--tg-accent); color: #fff; font-size: 28px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.tg .tg-done-title { font-size: 20px; font-weight: 800; margin: 0; padding: 0; border: 0; color: var(--tg-ink); }
.tg .tg-done-no { font-size: 13px; color: var(--tg-muted); margin: 4px 0 12px; }
.tg .tg-done-no b { color: var(--tg-ink); font-size: 15px; }
.tg .tg-done-msg { font-size: 14px; margin-bottom: 16px; }
.tg .tg-done-body { text-align: left; }

/* ---------- 画面下のバー ---------- */
.tg .tg-bar {
	position: fixed;
	left: 12px; right: 12px;
	bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	z-index: 9999;
	max-width: 736px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	background: var(--tg-ink);
	color: #fff;
	border-radius: 16px;
	padding: 10px 10px 10px 16px;
	box-shadow: 0 10px 30px rgba(10, 15, 25, .25);
	transition: transform .2s ease, opacity .2s ease;
}
.tg .tg-bar[hidden] { display: none; }
.tg .tg-bar.is-away { transform: translateY(140%); opacity: 0; pointer-events: none; }
.tg .tg-bar-info { flex: 1; line-height: 1.2; }
.tg .tg-bar-count { display: block; font-size: 11px; color: rgba(255,255,255,.7); font-weight: 700; }
.tg .tg-bar-total { font-size: 18px; font-weight: 800; }
.tg .tg-bar-btn {
	display: inline-flex; align-items: center;
	height: 44px; padding: 0 18px;
	border-radius: 11px;
	background: var(--tg-accent);
	color: #fff !important;
	font-weight: 800; font-size: 15px;
	text-decoration: none !important;
}

/* ---------- 広い画面 ---------- */
@media (min-width: 640px) {
	.tg .tg-head { padding: 28px 26px 22px; }
	.tg .tg-title { font-size: 32px; }
	.tg .tg-catalog { grid-template-columns: 1fr 1fr; }
	.tg .tg-card { grid-template-columns: 1fr; }
	.tg .tg-card > .tg-photo { grid-row: auto; aspect-ratio: 4 / 3; }
	.tg .tg-name, .tg .tg-price, .tg .tg-desc { grid-column: 1; margin-top: 0; }
	.tg .tg-panel { padding: 22px 22px; }
}

@media (prefers-reduced-motion: reduce) {
	.tg .tg-bar { transition: none; }
}
