:root {
    --primary-color: #228AD9;
    --hover-color: #1f3fe0;
    --active-color: #1a36c2;
    --background-color: #f0f3ff;
    --card-color: #ffffff;
    --text-color: #1d1d1f;
    --subtitle-color: #4a5df0;
    --shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    --info-background: #e6f0ff;
	--border-color: #d2d2d7;
	--green: #34c759;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Zen Maru Gothic', sans-serif;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0px;
    padding-bottom: 80px;
}

.site-header {
  background-color: #FBFCFA;
  color: white;
  padding: 12px 0;
  margin: 0;
  width: 100vw;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  left: 0;
  top: 0;
}
.site-logo {
  height: 50px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

.site-title {
  font-size: 36px;
  font-weight: 600;
  margin: 0;
  letter-spacing: -0.5px;
  color: white;
}

.subtitle {
    font-size: 24px;
    font-weight: 400;
    color: var(--subtitle-color);
    margin-top: 30px;
    margin-bottom: 30px;
    text-align: center;
}

#container {
    padding: 20px;
}
.container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1200px;
}

.room-button {
    background-color: var(--card-color);
    border-radius: 18px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 240px;
}

.room-button:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.15);
}

.room-image {
    height: 65%;
    background-size: cover;
    background-position: center;
}

.room-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 35%;
    background-color: var(--info-background);
    overflow: hidden; /* ← 追加 */
}

.room-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary-color);
}

.room-description {
    font-size: 14px;
    color: var(--subtitle-color);
    white-space: nowrap;        /* ← 追加：1行に固定 */
    overflow: hidden;           /* ← 追加：はみ出し防止 */
    text-overflow: ellipsis;    /* ← 追加：…で省略 */
}

.cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: var(--card-color);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    z-index: 1000;
}

.cart-info {
    display: flex;
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    gap: 4px;
    flex-wrap: wrap;
    font-size: 23px;
    font-family: 'Zen Maru Gothic', sans-serif;
    color: #1d1d1f;
}

.cart-count {
    background-color: transparent;
    color: var(--primary-color);
    border-radius: 0;
    width: auto;
    height: auto;
    display: inline;
    font-size: 23px;
    font-weight: 600;
    margin-left: 10px;
    margin-right: 0;
    line-height: 1;
    font-family: 'Zen Maru Gothic', sans-serif;
}

.cart-text, .cart-label {
    font-size: 23px;
    color: #1d1d1f;
    font-family: 'Zen Maru Gothic', sans-serif;
}

.cart-price {
    font-size: 23px;
    font-weight: 600;
    color: var(--primary-color);
    font-family: 'Zen Maru Gothic', sans-serif;
}

.view-cart-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.view-cart-button:hover {
    background-color: var(--hover-color);
}
/* 戻るボタン（右上固定） */
.back-button {
    position: fixed;
    top: 100px;
    right: 20px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 999px;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow);
    z-index: 2000;
    transition: background-color 0.2s ease;
}

.back-button:hover {
    background-color: var(--hover-color);
}


@media (max-width: 768px) {
    .site-title {
        font-size: 36px;
    }
    .subtitle {
        font-size: 20px;
    }
    .container {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
    .room-button {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .site-title {
        font-size: 28px;
    }
    .site-logo {
        height: 40px;
    }

    .subtitle {
        font-size: 16px;
        padding: 0 12px;
    }

    .container {
        grid-template-columns: 1fr;
        gap: 16px;
        padding: 0 12px;
    }
    .room-button {
        height: auto; /* ← 固定高さを解除し、内容に応じて伸縮 */
        min-height: 200px; /* ← 必要であれば最小高さだけ指定 */
    }

    .room-image {
        height: 150px; /* ← 画像部分は固定にしてバランス調整 */
    }

    .room-info {
        height: auto; /* ← 高さを自動化 */
    }

    .container-item {
        width: 100%;
        padding: 0 12px;
    }

    .form-row {
        flex-direction: column;
        gap: 12px;
    }

    input, select {
        font-size: 14px;
        padding: 10px;
    }

    .confirm-btn,
    .add-new-btn {
        font-size: 14px;
        padding: 10px 16px;
    }

    .result-card {
        padding: 16px;
    }

    .item-title {
        font-size: 16px;
    }

    .item-price {
        font-size: 20px;
    }

    .cart-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 16px;
    }

    .cart-info {
        font-size: 16px;
        flex-wrap: wrap;
        gap: 4px;
    }

    .cart-price,
    .cart-label,
    .cart-text,
    .cart-count {
        font-size: 16px;
    }

    .view-cart-button {
        font-size: 13px;
        padding: 6px 12px;
        width: 100%;
    }

    .back-button {
        position: relative;
        top: auto;
        right: auto;
        display: block;
        margin: 16px auto 32px;
        font-size: 14px;
        padding: 8px 16px;
        border-radius: 12px;
        width: fit-content;
        z-index: 1; /* カートバーより下に */
    }
}



/* 半分サイズのアイテムボタン用 */
.container.half-size {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto; /* 中央寄せに必須 */
    padding: 20px;
}

.item-button {
  background-color: var(--card-color);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: all 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  height: 120px;
}

.item-button:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12);
}

.item-button .room-image {
  height: 60%;
  background-size: cover;
  background-position: center;
}

.item-button .room-info {
  padding: 8px;
  background-color: var(--info-background);
  height: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-button .room-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--primary-color);
  text-align: center;
}

/* 商品情報登録ページ */

.container-item {
	width: 100%;
	max-width: 800px;
}

header {
	text-align: center;
	margin-bottom: 80px;
	width: 100%;
}

h1 {
	font-size: 38px;
	font-weight: 600;
	margin-bottom: 12px;
	letter-spacing: -0.5px;
}

p.subtitle {
	font-size: 20px;
	font-weight: 400;
	color: #6e6e73;
	margin-bottom: 20px;
}

.item-form {
	background-color: var(--card-color);
	border-radius: 16px;
	box-shadow: var(--shadow);
	padding: 24px;
	margin-bottom: 24px;
	transition: all 0.3s ease;
}

.form-row {
	display: flex;
	flex-wrap: wrap;
	margin-bottom: 16px;
	gap: 16px;
}

.form-group {
	flex: 1;
	min-width: 200px;
}

label {
	display: block;
	font-size: 14px;
	font-weight: 500;
	margin-bottom: 6px;
	color: #6e6e73;
}

input, select {
	width: 100%;
	padding: 12px;
	border: 1px solid var(--border-color);
	border-radius: 8px;
	font-size: 16px;
	transition: all 0.2s ease;
}

input:focus, select:focus {
	outline: none;
	border-color: var(--primary-color);
	box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.2);
}

.autocomplete {
	position: relative;
}

.autocomplete-items {
	position: absolute;
	border: 1px solid var(--border-color);
	border-top: none;
	z-index: 99;
	top: 100%;
	left: 0;
	right: 0;
	border-radius: 0 0 8px 8px;
	max-height: 200px;
	overflow-y: auto;
	background-color: #fff;
	box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.autocomplete-items div {
	padding: 10px;
	cursor: pointer;
}

.autocomplete-items div:hover {
	background-color: #f1f1f1;
}

.autocomplete-active {
	background-color: var(--primary-color) !important;
	color: white;
}

.confirm-btn {
	background-color: var(--primary-color);
	color: white;
	border: none;
	border-radius: 20px;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	margin-top: 8px;
}

.confirm-btn:hover {
	background-color: var(--hover-color);
}

.result-card {
	background-color: var(--card-color);
	border-radius: 16px;
	box-shadow: var(--shadow);
	padding: 24px;
	margin-bottom: 24px;
	border-left: 4px solid var(--green);
}

.item-title {
	font-size: 18px;
	font-weight: 600;
	margin-bottom: 8px;
}

.item-detail {
	color: #6e6e73;
	margin-bottom: 12px;
}

.item-price {
	font-size: 24px;
	font-weight: 600;
	color: var(--green);
	margin-top: 12px;
}

.add-new-btn {
	background-color: transparent;
	color: var(--primary-color);
	border: 2px solid var(--primary-color);
	border-radius: 20px;
	padding: 12px 24px;
	font-size: 16px;
	font-weight: 500;
	cursor: pointer;
	transition: all 0.2s ease;
	width: 100%;
	margin-bottom: 24px;
}

.add-new-btn:hover {
	background-color: rgba(0, 113, 227, 0.1);
}

.hidden {
	display: none;
}

@media (max-width: 768px) {
	h1 {
		font-size: 32px;
	}
	p.subtitle {
		font-size: 18px;
	}
	.form-group {
		min-width: 100%;
	}
}

