/*
 * Welcart Rental Calendar - Base Styles
 * ------------------------------------------------------------
 * このファイルは最低限のレイアウト用スタイルです。
 * 見た目のデザインは、子テーマ側やこのファイルを直接編集して
 * 自由にカスタマイズしてください（クラス名は変更しないことを推奨します）。
 * ------------------------------------------------------------
 */

/* ===== フロント：カレンダー本体 ===== */
.wrc-calendar-wrap {
	max-width: 480px;
	margin: 16px 0;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 16px;
	font-size: 14px;
	box-sizing: border-box;
}

.wrc-calendar-wrap * {
	box-sizing: border-box;
}

.wrc-calendar__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 8px;
}

.wrc-calendar__prev,
.wrc-calendar__next {
	background: #f5f5f5;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 4px 10px;
	cursor: pointer;
}

.wrc-calendar__prev:disabled,
.wrc-calendar__prev.is-disabled-nav {
	opacity: 0.4;
	cursor: not-allowed;
}

.wrc-calendar__title {
	font-weight: bold;
	font-size: 16px;
}

.wrc-calendar__table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.wrc-calendar__table th,
.wrc-calendar__table td {
	text-align: center;
	padding: 6px 2px;
	border: 1px solid #eee;
	vertical-align: top;
}

.wrc-calendar__weekdays th {
	background: #fafafa;
	font-weight: normal;
	font-size: 12px;
	color: #666;
}

.wrc-calendar__day {
	cursor: pointer;
	position: relative;
	min-height: 46px;
}

.wrc-calendar__day.is-disabled {
	color: #aaa;
	cursor: not-allowed;
	background: #ececec;
}

.wrc-calendar__day.is-empty {
	background: transparent;
	border: none;
	cursor: default;
}

.wrc-calendar__day-num {
	display: block;
	font-size: 13px;
}

.wrc-calendar__day-mark {
	display: block;
	font-size: 12px;
}

.wrc-calendar__day-mark.mark-ok {
	color: #2e7d32;
}

.wrc-calendar__day-mark.mark-ng {
	color: #c62828;
}

.wrc-calendar__day-stock {
	display: block;
	font-size: 10px;
	color: #888;
}

.wrc-calendar__day.is-in-range {
	background: #e3f2fd;
}

.wrc-calendar__day.is-start,
.wrc-calendar__day.is-end {
	background: #1976d2;
	color: #fff;
}

.wrc-calendar__day.is-start .wrc-calendar__day-mark,
.wrc-calendar__day.is-end .wrc-calendar__day-mark,
.wrc-calendar__day.is-start .wrc-calendar__day-stock,
.wrc-calendar__day.is-end .wrc-calendar__day-stock {
	color: #fff;
}

.wrc-calendar-wrap--archive .wrc-calendar__day {
	cursor: default;
}

.wrc-calendar__stock-list {
	margin-top: 8px;
	font-size: 12px;
	color: #555;
}

.wrc-calendar__selection {
	margin-top: 16px;
	border-top: 1px solid #eee;
	padding-top: 12px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px 16px;
}

.wrc-calendar__field label {
	display: block;
	font-size: 12px;
	color: #777;
	margin-bottom: 2px;
}

.wrc-calendar__price {
	font-weight: bold;
	font-size: 16px;
	color: #c62828;
}

.wrc-calendar__options-note {
	font-size: 12px;
	color: #555;
	margin: 2px 0 8px;
}

.wrc-calendar__options-note.is-error {
	color: #c62828;
	font-weight: bold;
}

.wrc-calendar__quantity {
	width: 70px;
}

.wrc-calendar__reset {
	grid-column: 1 / -1;
	background: none;
	border: 1px solid #ccc;
	border-radius: 4px;
	padding: 6px 10px;
	cursor: pointer;
	width: fit-content;
}

/* ===== エラーダイアログ ===== */
.wrc-calendar__error-dialog {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 100000;
	align-items: center;
	justify-content: center;
}

.wrc-calendar__error-dialog[aria-hidden="false"] {
	display: flex;
}

.wrc-calendar__error-dialog-inner {
	background: #fff;
	max-width: 90%;
	width: 360px;
	padding: 20px;
	border-radius: 8px;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.wrc-calendar__error-title {
	font-weight: bold;
	color: #c62828;
	margin: 0 0 8px;
}

.wrc-calendar__error-message {
	margin: 0 0 16px;
	white-space: pre-wrap;
}

.wrc-calendar__error-close {
	background: #1976d2;
	color: #fff;
	border: none;
	border-radius: 4px;
	padding: 8px 16px;
	cursor: pointer;
}

/* ===== 管理画面：商品編集画面のレンタル設定 ===== */
.wrc-metabox .wrc-form-table th {
	width: 260px;
}

/* ===== 管理画面：予約状況カレンダー（月グリッドUI） ===== */
.wrc-admin-calendar {
	max-width: 640px;
}

.wrc-admin-calendar__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 10px;
}

.wrc-admin-calendar__title,
.wrc-admin-cal-title {
	font-weight: bold;
	font-size: 15px;
}

.wrc-admin-calendar__grid {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.wrc-admin-calendar__grid th,
.wrc-admin-calendar__grid td {
	text-align: center;
	padding: 6px 2px;
	border: 1px solid #eee;
	vertical-align: top;
}

.wrc-admin-calendar__grid thead th {
	background: #fafafa;
	font-weight: normal;
	font-size: 12px;
	color: #666;
}

.wrc-admin-cal-day {
	cursor: pointer;
	min-height: 52px;
}

.wrc-admin-cal-day:hover {
	background: #f0f7ff;
}

.wrc-admin-cal-day.is-empty {
	background: transparent;
	border: none;
	cursor: default;
}

.wrc-admin-cal-day.is-shortage {
	background: #fff1f0;
}

.wrc-admin-cal-day.is-selected {
	outline: 2px solid #1976d2;
	outline-offset: -2px;
}

.wrc-admin-cal-day-num {
	display: block;
	font-size: 13px;
}

.wrc-admin-cal-day-mark {
	display: block;
	font-size: 12px;
}

.wrc-admin-cal-day-mark.mark-ok {
	color: #2e7d32;
}

.wrc-admin-cal-day-mark.mark-ng {
	color: #c62828;
}

.wrc-admin-cal-day-stock {
	display: block;
	font-size: 10px;
	color: #888;
}

.wrc-admin-cal-day-memo {
	display: block;
	font-size: 10px;
	line-height: 1;
	margin-top: 2px;
}

.wrc-admin-calendar__legend {
	display: flex;
	gap: 16px;
	margin-top: 10px;
	font-size: 12px;
	color: #555;
}

.wrc-legend-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.wrc-legend-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	border-radius: 2px;
	border: 1px solid #ddd;
}

.wrc-legend-swatch.is-ok {
	background: #fff;
}

.wrc-legend-swatch.is-shortage {
	background: #fff1f0;
}

/* ===== 管理画面：日別クイック編集パネル ===== */
.wrc-admin-cal-editor {
	margin-top: 14px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	padding: 14px;
	background: #f6f7f7;
	max-width: 360px;
}

.wrc-admin-cal-editor__date {
	font-weight: bold;
	font-size: 14px;
	margin-bottom: 8px;
}

.wrc-admin-cal-editor__summary {
	width: 100%;
	margin-bottom: 10px;
}

.wrc-admin-cal-editor__summary th {
	text-align: left;
	color: #666;
	font-weight: normal;
	width: 90px;
	padding: 2px 0;
}

.wrc-admin-cal-editor__field {
	margin: 8px 0;
}

.wrc-admin-cal-editor__field.is-disabled {
	opacity: 0.5;
}

.wrc-admin-cal-editor__message {
	font-size: 12px;
	margin-left: 8px;
}

.wrc-admin-cal-editor__message.is-error {
	color: #c62828;
}

.wrc-admin-cal-editor__orphan {
	color: #b45f06;
	cursor: help;
	border-bottom: 1px dotted #b45f06;
}

/* ===== 管理画面：受注データ編集画面のレンタル予約情報 ===== */
.wrc-order-rental-box {
	margin: 20px 0;
	padding: 16px;
	border: 1px solid #ccd0d4;
	border-radius: 4px;
	background: #fff;
}

.wrc-order-rental-box h3 {
	margin-top: 0;
}

.wrc-order-rental-table th,
.wrc-order-rental-table td {
	padding: 8px 10px;
	vertical-align: middle;
}

.wrc-order-rental-message {
	font-size: 12px;
	margin-left: 8px;
}

.wrc-order-rental-message.is-error {
	color: #c62828;
}

.wrc-order-rental-options {
	min-width: 160px;
}

.wrc-order-rental-option-group {
	margin-bottom: 8px;
}

.wrc-order-rental-option-group:last-child {
	margin-bottom: 0;
}

.wrc-order-rental-option-label {
	display: block;
	font-size: 11px;
	color: #666;
	margin-bottom: 2px;
}

.wrc-order-rental-option-required {
	color: #c62828;
	margin-left: 2px;
}

.wrc-order-rental-option-choice {
	display: block;
	font-size: 12px;
}

.wrc-order-rental-assets {
	min-width: 220px;
	max-width: 320px;
}

/**
 * 品番が多い（20個等）場合でも縦に長くならないよう、
 * 複数列のグリッド表示＋一定の高さでスクロールするコンテナにする。
 */
.wrc-order-rental-asset-list {
	display: grid;
	grid-template-columns: repeat(2, minmax(90px, 1fr));
	gap: 2px 8px;
	max-height: 140px;
	overflow-y: auto;
	padding: 4px;
	border: 1px solid #dcdcde;
	border-radius: 3px;
	background: #fff;
	margin-bottom: 6px;
}

.wrc-order-rental-asset-choice {
	display: flex;
	align-items: center;
	gap: 3px;
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	cursor: pointer;
}

.wrc-order-rental-asset-label {
	overflow: hidden;
	text-overflow: ellipsis;
}

.wrc-order-rental-asset-choice.is-taken {
	color: #999;
	cursor: not-allowed;
}

.wrc-order-rental-asset-choice.is-taken .wrc-order-rental-asset-label {
	text-decoration: line-through;
}

.wrc-order-rental-assets-message {
	display: block;
	font-size: 12px;
	margin-top: 4px;
}

.wrc-order-rental-assets-message.is-error {
	color: #c62828;
}

.wrc-admin-cart-inline-info {
	margin-top: 4px;
	font-size: 11px;
	color: #555;
	line-height: 1.6;
}

.wrc-admin-cart-inline-info__option {
	color: #2271b1;
}

/* ===== フロント：配達日固定表示 ===== */
/* ===== フロント：カート・確認画面のレンタル情報表示 ===== */
.wrc-rental-info {
	display: inline-block;
	font-size: 12px;
	color: #555;
	margin-top: 2px;
}

.wrc-fixed-delivery-date {
	font-weight: bold;
	font-size: 14px;
}

.wrc-fixed-delivery-note {
	font-size: 12px;
	color: #b45f06;
	margin-top: 4px;
}

/* ===== 管理画面：受注リストのレンタル期間列 ===== */
.wrc-orderlist-rental {
	font-size: 12px;
	white-space: nowrap;
}

.wrc-orderlist-assets {
	font-size: 12px;
	white-space: nowrap;
}

/* ===== フロント：商品詳細ページの「ご利用料金について」料金早見表 ===== */
.rental-charge-info {
	max-width: 480px;
	margin: 16px 0;
	border: 1px solid #ddd;
	border-radius: 6px;
	padding: 16px;
	box-sizing: border-box;
	font-size: 14px;
}

.rental-charge-info * {
	box-sizing: border-box;
}

.rental-charge-info .confirm-table-h3 {
	font-size: 16px;
	margin: 0 0 8px;
}

.rental-charge-info__graph {
	overflow-x: auto;
}

.rental-charge-info__graph h4.shippingfree {
	font-size: 13px;
	font-weight: normal;
	margin: 0 0 10px;
}

/* 送料無料になる金額そのものを赤字で強調する */
.shippingfree__amount {
	color: #c62828;
	font-weight: bold;
}

.rental-charge-info__graph h4.shippingfree span {
	font-weight: bold;
}

.rental-charge-info__graph table {
	width: 100%;
	border-collapse: collapse;
}

.rental-charge-info__graph th,
.rental-charge-info__graph td {
	border-bottom: 1px solid #eee;
	padding: 6px 8px;
	font-size: 13px;
	text-align: left;
}

.rental-charge-info__graph td.graph {
	position: relative;
	min-width: 90px;
}

.rental-charge-info__graph td.graph strong {
	display: block;
	font-size: 14px;
}

.rental-charge-info__graph td.graph strong small {
	font-size: 10px;
	font-weight: normal;
	margin-left: 2px;
}

/* 価格に比例した棒グラフ（inline styleでwidth%が指定される） */
.rental-charge-info__graph .graph__bar {
	display: block;
	height: 6px;
	margin-top: 4px;
	background: linear-gradient(90deg, #ffb74d, #ff8f00);
	border-radius: 3px;
	min-width: 2px;
}

.rental-charge-info__graph td.graph__price {
	white-space: nowrap;
	font-weight: bold;
}

/* 送料無料になる金額に到達している期間の価格を赤字で強調する */
.rental-charge-info__graph td.graph__price.is-free-shipping {
	color: #c62828;
}

.rental-charge-info__attention {
	font-size: 11px;
	color: #666;
	margin-top: 8px;
}
