.trc-ranking-section {
	margin: clamp(42px, 7vw, 84px) 0;
}

.trc-ranking-head {
	margin-bottom: 24px;
}

.trc-ranking-head h2 {
	margin: 6px 0 10px;
}

.trc-ranking-head > p:last-child {
	margin: 0;
	color: #5b6470;
}

.trc-ranking-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

.trc-ranking-card {
	min-width: 0;
	background: #fff;
	border: 1px solid #e1e6eb;
	border-radius: 18px;
	overflow: hidden;
	box-shadow: 0 10px 28px rgba(31, 45, 61, 0.08);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trc-ranking-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(31, 45, 61, 0.13);
}

.trc-ranking-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
}

.trc-ranking-card__image {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #f3f5f7;
	overflow: hidden;
}

.trc-ranking-card__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.trc-ranking-card__noimage {
	display: grid;
	place-items: center;
	height: 100%;
	padding: 16px;
	color: #7a8491;
	font-size: 13px;
	text-align: center;
}

.trc-ranking-card__type {
	position: absolute;
	top: 10px;
	left: 10px;
	display: inline-flex;
	align-items: center;
	min-height: 26px;
	padding: 4px 9px;
	border-radius: 999px;
	background: rgba(20, 28, 38, 0.82);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
}

.trc-ranking-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 16px;
}

.trc-ranking-card__maker {
	margin: 0 0 5px;
	color: #6a7480;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.05em;
}

.trc-ranking-card h3 {
	margin: 0;
	font-size: clamp(15px, 1.4vw, 18px);
	line-height: 1.45;
}

.trc-ranking-card__mount {
	margin: 8px 0 0;
	color: #727b86;
	font-size: 12px;
	line-height: 1.5;
}

.trc-ranking-change {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 14px 0 12px;
	padding: 10px 11px;
	border-radius: 12px;
}

.trc-ranking-change strong {
	font-size: 18px;
	white-space: nowrap;
}

.trc-ranking-change span {
	font-size: 11px;
	text-align: right;
}

.trc-ranking-change--featured {
	background: #f2f6fa;
	color: #24384b;
}

.trc-ranking-change--up {
	background: #fff1f0;
	color: #b42318;
}

.trc-ranking-change--down {
	background: #eef6ff;
	color: #175cd3;
}

.trc-ranking-card__prices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	margin-top: auto;
}

.trc-ranking-card__prices > div {
	min-width: 0;
	padding: 10px;
	border-radius: 11px;
	background: #f7f8fa;
}

.trc-ranking-card__prices span,
.trc-ranking-card__prices strong {
	display: block;
}

.trc-ranking-card__prices span {
	margin-bottom: 4px;
	color: #707985;
	font-size: 10px;
}

.trc-ranking-card__prices strong {
	font-size: 14px;
	line-height: 1.3;
	white-space: nowrap;
}

.trc-ranking-card__footer {
	display: flex;
	justify-content: space-between;
	gap: 8px;
	margin-top: 12px;
	padding-top: 11px;
	border-top: 1px solid #e8ebef;
	color: #66707c;
	font-size: 11px;
}

.trc-ranking-empty {
	padding: 24px;
	border: 1px dashed #cfd6dd;
	border-radius: 14px;
	background: #f8fafb;
	color: #66707c;
	text-align: center;
}

@media (max-width: 900px) {
	.trc-ranking-grid {
		gap: 14px;
	}

	.trc-ranking-card__body {
		padding: 13px;
	}
}

@media (max-width: 767px) {
	.trc-ranking-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.trc-ranking-card {
		border-radius: 14px;
	}

	.trc-ranking-card__body {
		padding: 11px;
	}

	.trc-ranking-card h3 {
		font-size: 14px;
	}

	.trc-ranking-card__mount {
		display: none;
	}

	.trc-ranking-change {
		align-items: flex-start;
		flex-direction: column;
		margin: 10px 0;
	}

	.trc-ranking-change strong {
		font-size: 16px;
	}

	.trc-ranking-change span {
		text-align: left;
	}

	.trc-ranking-card__prices {
		grid-template-columns: 1fr;
	}

	.trc-ranking-card__prices > div:nth-child(2) {
		display: none;
	}

	.trc-ranking-card__prices strong {
		font-size: 13px;
	}

	.trc-ranking-card__footer {
		font-size: 10px;
	}
}

/* =========================================================
   TRC RANKINGS CARD FIT FIX v0.1.2
   変動率・価格・フッターのはみ出し修正
========================================================= */

/* 変動率を横並びから縦積みに変更 */
body.home .trc-ranking-change,
body.page-id-2 .trc-ranking-change {
display: flex !important;
flex-direction: column !important;
align-items: flex-start !important;
justify-content: center !important;
gap: 7px !important;
width: 100% !important;
min-width: 0 !important;
min-height: 92px !important;
margin: 18px 0 !important;
padding: 15px 16px !important;
box-sizing: border-box !important;
overflow: hidden !important;
}

body.home .trc-ranking-change strong,
body.page-id-2 .trc-ranking-change strong {
display: block !important;
width: 100% !important;
min-width: 0 !important;
margin: 0 !important;
font-size: clamp(19px, 1.45vw, 25px) !important;
line-height: 1.15 !important;
letter-spacing: -0.025em !important;
white-space: nowrap !important;
text-align: left !important;
}

body.home .trc-ranking-change span,
body.page-id-2 .trc-ranking-change span {
display: block !important;
width: 100% !important;
min-width: 0 !important;
margin: 0 !important;
font-size: 12px !important;
line-height: 1.5 !important;
white-space: nowrap !important;
text-align: left !important;
overflow: hidden !important;
text-overflow: ellipsis !important;
}

/* 価格欄の横幅を確保 */
body.home .trc-ranking-card__prices,
body.page-id-2 .trc-ranking-card__prices {
display: grid !important;
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
gap: 8px !important;
width: 100% !important;
min-width: 0 !important;
}

body.home .trc-ranking-card__prices > div,
body.page-id-2 .trc-ranking-card__prices > div {
min-width: 0 !important;
padding: 11px 8px !important;
overflow: hidden !important;
box-sizing: border-box !important;
}

body.home .trc-ranking-card__prices span,
body.page-id-2 .trc-ranking-card__prices span {
display: block !important;
min-height: 2.8em !important;
margin-bottom: 5px !important;
font-size: 10px !important;
line-height: 1.4 !important;
white-space: normal !important;
}

body.home .trc-ranking-card__prices strong,
body.page-id-2 .trc-ranking-card__prices strong {
display: block !important;
width: 100% !important;
min-width: 0 !important;
font-size: clamp(13px, 1.05vw, 17px) !important;
line-height: 1.2 !important;
letter-spacing: -0.055em !important;
white-space: nowrap !important;
font-variant-numeric: tabular-nums !important;
overflow: visible !important;
}

/* カード本文が横へ押し出されないよう固定 */
body.home .trc-ranking-card__body,
body.page-id-2 .trc-ranking-card__body {
width: 100% !important;
min-width: 0 !important;
overflow: hidden !important;
}

/* 下部情報の改行を自然にする */
body.home .trc-ranking-card__footer,
body.page-id-2 .trc-ranking-card__footer {
display: flex !important;
flex-wrap: wrap !important;
align-items: center !important;
justify-content: space-between !important;
gap: 6px 10px !important;
}

body.home .trc-ranking-card__footer span,
body.page-id-2 .trc-ranking-card__footer span {
white-space: nowrap !important;
}

/* 少し狭いPC */
@media screen and (max-width: 1300px) and (min-width: 1101px) {
body.home .trc-ranking-card__body,
body.page-id-2 .trc-ranking-card__body {
padding-left: 18px !important;
padding-right: 18px !important;
}

body.home .trc-ranking-card__prices strong,
body.page-id-2 .trc-ranking-card__prices strong {
font-size: 13px !important;
}

body.home .trc-ranking-change strong,
body.page-id-2 .trc-ranking-change strong {
font-size: 20px !important;
}
}

/* スマホ2列 */
@media screen and (max-width: 700px) {
body.home .trc-ranking-change,
body.page-id-2 .trc-ranking-change {
min-height: 78px !important;
margin: 10px 0 !important;
padding: 10px !important;
gap: 5px !important;
}

body.home .trc-ranking-change strong,
body.page-id-2 .trc-ranking-change strong {
font-size: 15px !important;
white-space: nowrap !important;
}

body.home .trc-ranking-change span,
body.page-id-2 .trc-ranking-change span {
font-size: 9px !important;
white-space: normal !important;
text-overflow: clip !important;
}

body.home .trc-ranking-card__prices,
body.page-id-2 .trc-ranking-card__prices {
grid-template-columns: 1fr !important;
}

body.home .trc-ranking-card__prices > div,
body.page-id-2 .trc-ranking-card__prices > div {
padding: 9px 8px !important;
}

body.home .trc-ranking-card__prices strong,
body.page-id-2 .trc-ranking-card__prices strong {
font-size: 14px !important;
letter-spacing: -0.04em !important;
}
}

/* =========================================================
   TRC RANKINGS FULL WIDTH FIX v0.1.3
   ショートコード親枠を解除してTOPの横幅に揃える
========================================================= */

/* WordPressショートコードブロック自体を画面幅まで広げる */
body.home .entry-content .wp-block-shortcode:has(.trc-ranking-section),
body.page-id-2 .entry-content .wp-block-shortcode:has(.trc-ranking-section) {
    position: relative !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
}

/* 過去の座標指定を解除し、各セクションを中央配置 */
body.home .trc-ranking-section,
body.page-id-2 .trc-ranking-section {
    position: static !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;

    width: calc(100% - 48px) !important;
    max-width: 1672px !important;

    margin: 56px auto 72px !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* 見出しとカード一覧をセクション幅いっぱいにする */
body.home .trc-ranking-head,
body.page-id-2 .trc-ranking-head,
body.home .trc-ranking-grid,
body.page-id-2 .trc-ranking-grid {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
}

/* PCは大きな4列 */
body.home .trc-ranking-grid,
body.page-id-2 .trc-ranking-grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 28px !important;
    align-items: stretch !important;
}

/* 各カードを列幅いっぱいにする */
body.home .trc-ranking-card,
body.page-id-2 .trc-ranking-card {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* タブレットは2列 */
@media screen and (max-width: 1100px) {
    body.home .trc-ranking-section,
    body.page-id-2 .trc-ranking-section {
        width: calc(100% - 40px) !important;
    }

    body.home .trc-ranking-grid,
    body.page-id-2 .trc-ranking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }
}

/* スマホも2列×4段 */
@media screen and (max-width: 700px) {
    body.home .trc-ranking-section,
    body.page-id-2 .trc-ranking-section {
        width: calc(100% - 32px) !important;
        margin-top: 40px !important;
        margin-bottom: 56px !important;
    }

    body.home .trc-ranking-grid,
    body.page-id-2 .trc-ranking-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }
}
/* =========================================================
   TRC SINGLE WEEK CHANGE v0.1.4
   個別商品ページ：平均価格の1週間前比
========================================================= */

.trc-week-change-panel {
	display: grid;
	grid-template-columns: minmax(180px, 1fr) auto auto;
	align-items: center;
	gap: 18px;
	width: 100%;
	margin: 20px 0 0;
	padding: 18px 22px;
	border: 1px solid #dbe4f0;
	border-radius: 16px;
	background: #f8fafc;
	box-sizing: border-box;
}

.trc-week-change-panel__label {
	color: #475569;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
}

.trc-week-change-panel__rate {
	font-size: 24px;
	font-weight: 800;
	line-height: 1.2;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.trc-week-change-panel__difference {
	min-width: 110px;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.5;
	text-align: right;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.trc-week-change-panel--up {
	background: #fff1ef;
	border-color: #fecaca;
}

.trc-week-change-panel--up .trc-week-change-panel__rate,
.trc-week-change-panel--up .trc-week-change-panel__difference {
	color: #c02b22;
}

.trc-week-change-panel--down {
	background: #eff6ff;
	border-color: #bfdbfe;
}

.trc-week-change-panel--down .trc-week-change-panel__rate,
.trc-week-change-panel--down .trc-week-change-panel__difference {
	color: #1d5fd1;
}

.trc-week-change-panel--flat {
	background: #f8fafc;
	border-color: #dbe4f0;
}

.trc-week-change-panel--flat .trc-week-change-panel__rate,
.trc-week-change-panel--flat .trc-week-change-panel__difference {
	color: #475569;
}

.trc-week-change-panel--waiting {
	background: #f8fafc;
	border-color: #e2e8f0;
}

.trc-week-change-panel--waiting .trc-week-change-panel__rate {
	color: #334155;
	font-size: 18px;
}

.trc-week-change-panel--waiting .trc-week-change-panel__difference {
	color: #64748b;
	font-size: 13px;
}

@media screen and (max-width: 700px) {
	.trc-week-change-panel {
		grid-template-columns: 1fr;
		gap: 7px;
		margin-top: 16px;
		padding: 16px 18px;
	}

	.trc-week-change-panel__label {
		font-size: 13px;
	}

	.trc-week-change-panel__rate {
		font-size: 22px;
	}

	.trc-week-change-panel__difference {
		min-width: 0;
		font-size: 14px;
		text-align: left;
	}
}

/* =========================================================
   TRC TOP RANKING CARD UNIFIED v0.1.3
   TOPランキングカードを一覧カードと同一規格へ統一
========================================================= */

body.home .trc-ranking-card__body,
body.page-id-2 .trc-ranking-card__body {
	padding: 20px !important;
}

body.home .trc-ranking-card__maker,
body.page-id-2 .trc-ranking-card__maker {
	margin: 0 0 8px !important;
	color: #2463eb !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: 0.04em !important;
}

body.home .trc-ranking-card h3,
body.page-id-2 .trc-ranking-card h3 {
	margin: 0 0 12px !important;
	font-size: clamp(17px, 1.45vw, 22px) !important;
	font-weight: 500 !important;
	line-height: 1.45 !important;
	letter-spacing: -0.02em !important;
}

body.home .trc-ranking-card__meta,
body.page-id-2 .trc-ranking-card__meta {
	display: flex !important;
	flex-direction: column !important;
	gap: 5px !important;
	margin: 0 !important;
}

body.home .trc-ranking-card__model,
body.home .trc-ranking-card__mount,
body.page-id-2 .trc-ranking-card__model,
body.page-id-2 .trc-ranking-card__mount {
	display: block !important;
	margin: 0 !important;
	color: #718197 !important;
	font-size: 13px !important;
	line-height: 1.55 !important;
	overflow-wrap: anywhere !important;
}

body.home .trc-ranking-change,
body.page-id-2 .trc-ranking-change {
	min-height: 112px !important;
	margin: 18px 0 !important;
	padding: 20px !important;
	border-radius: 18px !important;
}

body.home .trc-ranking-change strong,
body.page-id-2 .trc-ranking-change strong {
	font-size: clamp(24px, 2vw, 34px) !important;
	line-height: 1.2 !important;
}

body.home .trc-ranking-change span,
body.page-id-2 .trc-ranking-change span {
	font-size: 13px !important;
	line-height: 1.5 !important;
}

body.home .trc-ranking-card__prices,
body.page-id-2 .trc-ranking-card__prices {
	display: flex !important;
	flex-direction: column !important;
	grid-template-columns: none !important;
	gap: 12px !important;
	width: 100% !important;
	margin: 0 !important;
}

body.home .trc-ranking-card__price,
body.page-id-2 .trc-ranking-card__price {
	display: block !important;
	width: 100% !important;
	min-width: 0 !important;
	min-height: 88px !important;
	padding: 14px 16px !important;
	border: 1px solid #dfe5ec !important;
	border-radius: 16px !important;
	background: #f7f8fa !important;
	box-sizing: border-box !important;
	overflow: visible !important;
}

body.home .trc-ranking-card__price--min,
body.page-id-2 .trc-ranking-card__price--min {
	border-color: #79adff !important;
	background: #eef5ff !important;
}

body.home .trc-ranking-card__price span,
body.page-id-2 .trc-ranking-card__price span {
	display: block !important;
	min-height: 0 !important;
	margin: 0 0 7px !important;
	color: #68788d !important;
	font-size: 12px !important;
	font-weight: 600 !important;
	line-height: 1.4 !important;
	white-space: normal !important;
}

body.home .trc-ranking-card__price strong,
body.page-id-2 .trc-ranking-card__price strong {
	display: block !important;
	margin: 0 !important;
	color: #111111 !important;
	font-size: clamp(22px, 2vw, 31px) !important;
	font-weight: 700 !important;
	line-height: 1.15 !important;
	letter-spacing: -0.035em !important;
	white-space: nowrap !important;
}

body.home .trc-ranking-card__price--min strong,
body.page-id-2 .trc-ranking-card__price--min strong {
	color: #2463eb !important;
}

body.home .trc-ranking-card__footer,
body.page-id-2 .trc-ranking-card__footer {
	margin-top: 16px !important;
	padding-top: 14px !important;
	font-size: 12px !important;
}

@media (max-width: 767px) {
	body.home .trc-ranking-card__body,
	body.page-id-2 .trc-ranking-card__body {
		padding: 16px !important;
	}

	body.home .trc-ranking-card__mount,
	body.page-id-2 .trc-ranking-card__mount {
		display: block !important;
	}

	body.home .trc-ranking-change,
	body.page-id-2 .trc-ranking-change {
		min-height: 100px !important;
		padding: 17px !important;
	}

	body.home .trc-ranking-card__price,
	body.page-id-2 .trc-ranking-card__price {
		min-height: 80px !important;
		padding: 12px 13px !important;
	}

	body.home .trc-ranking-card__price strong,
	body.page-id-2 .trc-ranking-card__price strong {
		font-size: clamp(20px, 5.2vw, 27px) !important;
	}
}

/* =========================================================
   TRC RESTOCK COMPACT CARDS v0.1.6
   在庫復活商品専用。既存ランキングカードとは独立。
========================================================= */

.trc-restock-section {
    margin: clamp(42px, 7vw, 84px) 0;
}

.trc-restock-head {
    margin-bottom: 24px;
}

.trc-restock-head h2 {
    margin: 6px 0 10px;
}

.trc-restock-head > p:last-child {
    margin: 0;
    color: #5b6470;
}

.trc-restock-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.trc-restock-card {
    min-width: 0;
    border: 1px solid #e1e6eb;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 8px 22px rgba(31, 45, 61, 0.07);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.trc-restock-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(31, 45, 61, 0.11);
}

.trc-restock-card__link {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    min-height: 112px;
    color: inherit;
    text-decoration: none;
}

.trc-restock-card__image {
    width: 84px;
    height: 100%;
    min-height: 112px;
    background: #f3f5f7;
    overflow: hidden;
}

.trc-restock-card__image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.trc-restock-card__noimage {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    padding: 8px;
    color: #7a8491;
    font-size: 11px;
    line-height: 1.4;
    text-align: center;
    box-sizing: border-box;
}

.trc-restock-card__body {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 12px 13px;
}

.trc-restock-card__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    margin-bottom: 7px;
}

.trc-restock-card__badge,
.trc-restock-card__type {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.trc-restock-card__badge {
    background: #ecfdf3;
    color: #027a48;
}

.trc-restock-card__type {
    background: #eef5ff;
    color: #2463eb;
}

.trc-restock-card__maker {
    margin: 0 0 3px;
    color: #2463eb;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.trc-restock-card h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.trc-restock-card__model {
    margin: 4px 0 0;
    color: #718197;
    font-size: 10px;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.trc-restock-card__footer {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 9px;
}

.trc-restock-card__footer strong {
    color: #111111;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
}

.trc-restock-card__footer span {
    color: #66707c;
    font-size: 10px;
    line-height: 1.3;
    white-space: nowrap;
}

.trc-restock-empty {
    padding: 20px;
    border: 1px dashed #cfd6dd;
    border-radius: 14px;
    background: #f8fafb;
    color: #66707c;
    text-align: center;
}

@media (max-width: 900px) {
    .trc-restock-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .trc-restock-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .trc-restock-card__link {
        grid-template-columns: 76px minmax(0, 1fr);
        min-height: 104px;
    }

    .trc-restock-card__image {
        width: 76px;
        min-height: 104px;
    }

    .trc-restock-card__body {
        padding: 10px 12px;
    }
}

