/* ==========================================================================
 * SALON RAG — Chat Page Styles (scoped to .page-chat-index)
 * ========================================================================== */

/* 1) Tokens */
:root {
  --chatbar-h: 4rem;
  --kb-inset: 0px;
}
body.page-chat-index {
  --send-btn-d: 2rem;
  --send-btn-gap: 0.375rem;
  --send-btn-font: 1.25rem;
  -webkit-text-size-adjust: 100%;
}
@media (max-width: 575.98px) {
  body.page-chat-index {
    --send-btn-d: 2.25rem;
    --send-btn-gap: 0.25rem;
    --send-btn-font: 1.35rem;
  }
}

/* 2) Viewport scaffolding */
body.layout-no-scroll {
  height: 100%;
  overflow: hidden;
}
body.layout-no-scroll .wrapper {
  height: 100svh;
  min-height: 100svh;
  overflow: visible;
}
@supports (height: 100dvh) {
  body.layout-no-scroll .wrapper {
    height: 100dvh;
    min-height: 100dvh;
    overflow: visible;
  }
}
body.layout-no-scroll main.body {
  height: calc(100svh - var(--app-header-h, 56px) - var(--app-footer-h, 0px));
  display: flex;
  flex-direction: column;
  overflow: visible;
  padding-top: 1rem;
  padding-bottom: max(0px, env(safe-area-inset-bottom));
}
@supports (height: 100dvh) {
  body.layout-no-scroll main.body {
    height: calc(100dvh - var(--app-header-h, 56px) - var(--app-footer-h, 0px));
  }
}
@media (max-width: 575.98px) {
  body.page-chat-index main.body,
  body.page-chat-index.layout-no-scroll main.body {
    padding-top: 0 !important;
    padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  }
}

/* 3) Column and window */
.page-chat-index .chat-root,
.page-chat-index .chat-col {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: visible !important;
}
.page-chat-index #chat-window {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  flex: 1 1 0;
  padding-bottom: var(--chatbar-h, 4rem);
}
.page-chat-index #chat-window .chunk {
  white-space: pre-wrap;
  word-break: break-word;
}

/* 4) Status */
.page-chat-index #chat-status {
  position: relative;
  height: 0;
  overflow: visible;
  z-index: 1;
}
.page-chat-index #chat-status > .spinner-border {
  position: absolute;
  top: 0.25rem;
  left: 0.5rem;
  pointer-events: none;
}

/* 5) Chatbar */
.page-chat-index #chatbar {
  position: sticky;
  bottom: 0;
  padding-bottom: max(env(safe-area-inset-bottom, 0px), var(--kb-inset, 0px));
  background-color: var(--bs-body-bg, #fff) !important;
  z-index: 6;
  border-top: 1px solid var(--cui-border-color, #fbf5ed);
  backdrop-filter: none;
}

/* 6) MQ */
.page-chat-index #mq-block {
  background-color: var(--bs-body-bg, #fffcf7) !important;
}
.page-chat-index #mq-bar {
  background-color: #fefaf2 !important;
}
.page-chat-index #mq-toggle.mq-toggle {
  white-space: nowrap;
}
.page-chat-index #mq-collapse {
  background-color: #fffcf7 !important;
}

/* 7) Input */
.page-chat-index .chat-input-bar {
  display: block;
  width: 100%;
  background-color: var(--bs-body-bg, #fffcf7) !important;
}
.page-chat-index .input-with-button {
  position: relative;
  width: 100%;
  background-color: var(--bs-body-bg, #fffcf7) !important;
  --_baseline-h: 2.75rem;
}
.page-chat-index .input-with-button > #chat-input.form-control {
  box-sizing: border-box;
  width: 100%;
  background-color: var(--bs-body-bg, #fffcf7) !important;
  padding-top: 0.625rem;
  padding-bottom: calc(0.625rem + max(0px, (var(--_baseline-h) - 100%) * 0));
  padding-right: calc(var(--send-btn-d) + var(--send-btn-gap) + 0.5rem);
  min-height: 2.75rem;
  line-height: 1.45;
  font-size: 1rem;
  resize: none;
}
.page-chat-index .input-with-button > .btn-send {
  position: absolute;
  right: var(--send-btn-gap);
  bottom: var(--send-btn-gap);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--send-btn-d);
  height: var(--send-btn-d);
  padding: 0;
  border-radius: 50%;
  line-height: 1;
}
.page-chat-index .input-with-button > .btn-send i {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--send-btn-font);
  line-height: 1;
}
.page-chat-index .input-with-button > .btn-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.page-chat-index .input-with-button > .btn-send:focus-visible {
  outline: 2px solid var(--cui-link-color, #0d6efd);
  outline-offset: 2px;
}

/* 8) Empty state */
.page-chat-index #empty-state .card {
  background-color: var(--bs-body-bg, #fffcf7) !important;
  border: 1px solid #fbf5ed !important;
  box-shadow: none;
}
.page-chat-index #empty-state .display-6 i {
  opacity: 0.9;
}
.page-chat-index #empty-lead {
  color: var(--cui-secondary-color, #6c757d) !important;
}

/* 9) Avatars */
.page-chat-index .avatar.avatar-sm {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: transparent !important;
}
.page-chat-index .avatar.avatar-sm i.bi {
  font-size: 1.25rem;
  line-height: 1;
}
@media (max-width: 575.98px) {
  .page-chat-index .avatar.avatar-sm i.bi {
    font-size: 1.35rem;
  }
}

/* 10) Utilities */
.page-chat-index .flex-min-0 {
  min-height: 0 !important;
}
@media (hover: none) {
  .page-chat-index .btn:hover {
    background-color: inherit;
  }
}

/* 11) Theme accents */
.page-chat-index .chat-input-bar,
.page-chat-index .input-with-button,
.page-chat-index .input-with-button > #chat-input.form-control,
.page-chat-index #chatbar {
  background-color: #fffcf7 !important;
}

/* 12) Hooks */
.page-chat-index .msg {
}
.page-chat-index .msg.user {
}
.page-chat-index .msg.ai {
}

/* ==========================================================================
 * 360° Viewer — Base Styles
 * ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

#scene {
  width: 100%;
  height: 100%;
  position: fixed;
  top: 0;
  left: 0;
}

/* ==========================================================================
 * 360° Viewer — Scene Switcher
 * ========================================================================== */
#scene-switcher {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 12px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.scene-btn {
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}

.scene-btn:hover {
  background: rgba(255, 255, 255, 0.35);
}

.scene-btn:active {
  transform: scale(0.96);
}

.scene-btn.active {
  background: #fff;
  color: #333;
}

@media (max-width: 480px) {
  #scene-switcher {
    top: 12px;
    padding: 6px;
    gap: 6px;
  }
  .scene-btn {
    padding: 6px 12px;
    font-size: 13px;
  }
}

/* 11シーン以上の場合はスクロール可能に */
#scene-switcher {
  max-width: 90vw;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#scene-switcher::-webkit-scrollbar {
  height: 4px;
}

#scene-switcher::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 2px;
}

/* ==========================================================================
 * 360° Viewer — Coordinate Helper (開発用)
 * ========================================================================== */
#coordinate-helper {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-family: monospace;
  font-size: 12px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  width: 280px;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
}

#coordinate-helper .coord-label {
  font-size: 10px;
  color: #4fc3f7;
  margin-bottom: 6px;
}

#coordinate-helper .coord-size-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

#coordinate-helper .coord-size-row label {
  font-size: 10px;
  color: #aaa;
  min-width: 70px;
  flex-shrink: 0;
}

#coordinate-helper .coord-size-row input {
  width: 45px;
  padding: 3px 4px;
  border: 1px solid #555;
  border-radius: 3px;
  background: rgba(51, 51, 51, 0.8);
  color: #fff;
  font-size: 11px;
  font-family: monospace;
  flex-shrink: 0;
}

#coordinate-helper .coord-size-row input:focus {
  outline: none;
  border-color: #4fc3f7;
}

#coordinate-helper #product-search {
  width: 100% !important;
  padding: 4px 6px;
  font-size: 10px;
  background: rgba(51, 51, 51, 0.8);
  border: 1px solid #555;
  border-radius: 3px;
  color: #fff;
  box-sizing: border-box;
}

#coordinate-helper #product-search:focus {
  outline: none;
  border-color: #4fc3f7;
}

#coordinate-helper .coord-buttons {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  flex-wrap: wrap;
}

#coordinate-helper .coord-buttons button {
  padding: 4px 8px;
  border: none;
  border-radius: 3px;
  font-size: 10px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
  flex: 1;
  min-width: 0;
}

#coordinate-helper #coord-copy {
  background: #4fc3f7;
  color: #000;
}

#coordinate-helper #coord-copy:hover {
  background: #81d4fa;
}

#coordinate-helper #coord-preview {
  background: #66bb6a;
  color: #000;
}

#coordinate-helper #coord-preview:hover {
  background: #81c784;
}

#coordinate-helper .coord-json {
  font-size: 9px;
  color: #aaa;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 80px;
  overflow-y: auto;
  background: rgba(34, 34, 34, 0.8);
  padding: 6px;
  border-radius: 3px;
  margin-top: 4px;
}

#coordinate-helper .coord-json:empty {
  display: none;
}

#coordinate-helper .coord-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  margin: 8px 0;
}

#coordinate-helper #view-get {
  background: #ab47bc;
  color: #fff;
}

#coordinate-helper #view-get:hover {
  background: #ba68c8;
}

#coordinate-helper #view-copy {
  background: #7e57c2;
  color: #fff;
}

#coordinate-helper #view-copy:hover {
  background: #9575cd;
}

/* 商品選択リスト */
#coordinate-helper .product-select-list {
  max-height: 120px;
  overflow-y: auto;
  background: rgba(34, 34, 34, 0.8);
  border-radius: 3px;
  margin-bottom: 6px;
}

#coordinate-helper .product-item {
  padding: 4px 8px;
  cursor: pointer;
  font-size: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background 0.15s;
}

#coordinate-helper .product-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

#coordinate-helper .product-item.selected {
  background: #4fc3f7;
  color: #000;
}

#coordinate-helper .product-category {
  padding: 3px 8px;
  font-size: 9px;
  color: #888;
  background: rgba(26, 26, 26, 0.9);
  font-weight: bold;
  position: sticky;
  top: 0;
}

#coordinate-helper #hotspot-add {
  background: #ff7043;
  color: #fff;
}

#coordinate-helper #hotspot-add:hover:not(:disabled) {
  background: #ff8a65;
}

#coordinate-helper #hotspot-add:disabled {
  background: rgba(85, 85, 85, 0.8);
  color: #888;
  cursor: not-allowed;
}

/* ホットスポット一覧 */
#coordinate-helper .hotspot-list {
  max-height: 100px;
  overflow-y: auto;
  background: rgba(34, 34, 34, 0.8);
  border-radius: 3px;
  margin-bottom: 6px;
}

#coordinate-helper .hotspot-item {
  padding: 4px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 10px;
}

#coordinate-helper .hotspot-item:hover {
  background: rgba(255, 255, 255, 0.05);
}

#coordinate-helper .hotspot-item-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#coordinate-helper .hotspot-item-actions {
  display: flex;
  gap: 3px;
  margin-left: 6px;
}

#coordinate-helper .hotspot-item-actions button {
  padding: 2px 5px;
  font-size: 9px;
  border-radius: 2px;
  border: none;
  cursor: pointer;
}

#coordinate-helper .hs-edit {
  background: #4caf50;
  color: #fff;
}

#coordinate-helper .hs-edit:hover {
  background: #66bb6a;
}

#coordinate-helper .hs-delete {
  background: #f44336;
  color: #fff;
}

#coordinate-helper .hs-delete:hover {
  background: #ef5350;
}

#coordinate-helper .autosave-status {
  font-size: 9px;
  padding: 4px 0;
  color: #888;
  text-align: center;
}

#coordinate-helper #hotspot-count {
  color: #888;
  font-weight: normal;
}

/* ==========================================================================
 * 360° Viewer — Product Modal (お菓子らしい明るいデザイン)
 * ========================================================================== */

/* モーダル基本スタイル */
#appModal .modal-dialog {
  max-width: 520px;
}

#appModal .modal-content {
  background: linear-gradient(180deg, #fff9f0 0%, #fff5e6 100%);
  border: 3px solid #ffcc66;
  border-radius: 20px;
  box-shadow: 0 10px 40px rgba(255, 150, 50, 0.2);
}

/* ==========================================================================
 * 会社別テーマカラー
 * ========================================================================== */

/* yoshiya - オレンジ/イエロー系（お菓子屋さんの暖かいイメージ） */
#appModal.theme-yoshiya .modal-content {
  background: linear-gradient(180deg, #fff9f0 0%, #fff5e6 100%);
  border-color: #ffcc66;
}
#appModal.theme-yoshiya .product-title { color: #e65c00; }
#appModal.theme-yoshiya .product-price { background: linear-gradient(135deg, #ff9a56 0%, #ff6b35 100%); }
#appModal.theme-yoshiya .product-description { border-left-color: #ffcc66; background: linear-gradient(135deg, #fff8e8 0%, #fff3d6 100%); }
#appModal.theme-yoshiya .product-spec-table { border-color: #ffe4cc; }
#appModal.theme-yoshiya .detail-label { color: #ff8c42; background: #fff8f0; }
#appModal.theme-yoshiya .detail-row { border-color: #ffe4cc; }
#appModal.theme-yoshiya .product-images-container { box-shadow: 0 4px 15px rgba(255, 180, 100, 0.15); }
#appModal.theme-yoshiya .product-img { border-color: #ffe4cc; }
#appModal.theme-yoshiya .btn-brochure { background: linear-gradient(135deg, #ffb347 0%, #ff8c42 100%); }

/* 日清シスコ - ブルー系（企業カラー） */
#appModal.theme-nissin-cisco .modal-content {
  background: linear-gradient(180deg, #f0f7ff 0%, #e6f0ff 100%);
  border-color: #4a90d9;
}
#appModal.theme-nissin-cisco .product-title { color: #1a5aa0; }
#appModal.theme-nissin-cisco .product-price { background: linear-gradient(135deg, #5b9bd5 0%, #2e75b6 100%); }
#appModal.theme-nissin-cisco .product-description { border-left-color: #4a90d9; background: linear-gradient(135deg, #f5f9ff 0%, #e8f2ff 100%); color: #2a4a6a; }
#appModal.theme-nissin-cisco .product-spec-table { border-color: #c5d9f0; }
#appModal.theme-nissin-cisco .detail-label { color: #2e75b6; background: #f0f6ff; }
#appModal.theme-nissin-cisco .detail-row { border-color: #c5d9f0; }
#appModal.theme-nissin-cisco .product-images-container { background: #fff; box-shadow: 0 4px 15px rgba(74, 144, 217, 0.15); }
#appModal.theme-nissin-cisco .product-img { border-color: #c5d9f0; background: #f8fbff; }
#appModal.theme-nissin-cisco .btn-brochure { background: linear-gradient(135deg, #5b9bd5 0%, #2e75b6 100%); }
#appModal.theme-nissin-cisco .modal-header .btn-close { background-color: #4a90d9; }

/* ノーベル製菓 - ピンク/パープル系（グミのカラフルなイメージ） */
#appModal.theme-nobel .modal-content {
  background: linear-gradient(180deg, #fff5f8 0%, #ffe8f0 100%);
  border-color: #e84a8a;
}
#appModal.theme-nobel .product-title { color: #c41e68; }
#appModal.theme-nobel .product-price { background: linear-gradient(135deg, #ff6b9d 0%, #e84a8a 100%); }
#appModal.theme-nobel .product-description { border-left-color: #e84a8a; background: linear-gradient(135deg, #fff5f8 0%, #ffe8f0 100%); color: #6a3050; }
#appModal.theme-nobel .product-spec-table { border-color: #f5c0d5; }
#appModal.theme-nobel .detail-label { color: #e84a8a; background: #fff5f8; }
#appModal.theme-nobel .detail-row { border-color: #f5c0d5; }
#appModal.theme-nobel .product-images-container { background: #fff; box-shadow: 0 4px 15px rgba(232, 74, 138, 0.15); }
#appModal.theme-nobel .product-img { border-color: #f5c0d5; background: #fffafc; }
#appModal.theme-nobel .btn-brochure { background: linear-gradient(135deg, #a855f7 0%, #7c3aed 100%); }
#appModal.theme-nobel .modal-header .btn-close { background-color: #e84a8a; }

/* デフォルトテーマ（yoshiyaと同じ） */
#appModal.theme-default .modal-content {
  background: linear-gradient(180deg, #fff9f0 0%, #fff5e6 100%);
  border-color: #ffcc66;
}

#appModal .modal-header {
  border-bottom: none;
  padding: 12px 16px 0;
}

#appModal .modal-header .btn-close {
  background-color: #333;
  border-radius: 50%;
  opacity: 1;
  padding: 10px;
  filter: invert(1);
}

#appModal .modal-body {
  padding: 0 24px 24px;
}

/* 商品モーダルコンテンツ */
.product-modal-content {
  text-align: center;
}

/* 商品タイトル */
.product-title {
  font-size: 1.4rem;
  font-weight: 800;
  color: #e65c00;
  margin-bottom: 16px;
  line-height: 1.4;
  text-shadow: 1px 1px 0 rgba(255, 200, 100, 0.5);
}

/* 画像コンテナ */
.product-images-container {
  margin-bottom: 16px;
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 4px 15px rgba(255, 180, 100, 0.15);
}

.product-images-grid {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.product-images-grid .product-img {
  max-height: 180px;
  max-width: 45%;
  object-fit: contain;
  border-radius: 12px;
  background: #fffaf5;
  padding: 8px;
  border: 2px solid #ffe4cc;
}

.product-images-grid .product-img.zoomable {
  cursor: zoom-in;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-images-grid .product-img.zoomable:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 15px rgba(255, 150, 50, 0.3);
}

.product-img-single {
  max-height: 200px;
  max-width: 100%;
  object-fit: contain;
  border-radius: 12px;
  background: #fffaf5;
  padding: 8px;
  border: 2px solid #ffe4cc;
}

/* 価格表示 */
.product-price {
  background: linear-gradient(135deg, #ff7eb3 0%, #ff758c 100%);
  border-radius: 30px;
  padding: 10px 24px;
  margin-bottom: 16px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(255, 120, 150, 0.3);
}

.product-price .price-label {
  font-size: 0.85rem;
  color: #fff;
  margin-right: 8px;
}

.product-price .price-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
}

/* 商品説明 */
.product-description {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #5a4a3a;
  text-align: left;
  background: linear-gradient(135deg, #fff8e8 0%, #fff3d6 100%);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  border-left: 4px solid #ffcc66;
}

/* 商品スペック表 */
.product-spec-table {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 20px;
  border: 2px solid #ffe4cc;
}

.detail-row {
  display: flex;
  border-bottom: 1px solid #ffe4cc;
}

.detail-row:last-child {
  border-bottom: none;
}

.detail-label {
  flex: 0 0 110px;
  padding: 12px 16px;
  font-size: 0.85rem;
  font-weight: 700;
  color: #ff8c42;
  background: #fff8f0;
  text-align: left;
  white-space: nowrap;
}

.detail-value {
  flex: 1;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #4a3a2a;
  text-align: left;
  background: #fff;
  word-break: keep-all;
}

/* アクションボタン */
.product-actions {
  margin-top: 8px;
}

.btn-brochure {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #42e695 0%, #3bb2b8 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 30px;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(66, 230, 149, 0.3);
}

.btn-brochure:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(66, 230, 149, 0.4);
}

.btn-brochure i {
  font-size: 1.2rem;
}

/* 動画ボタン */
.btn-video {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}

.btn-video:hover {
  color: #fff;
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(255, 107, 107, 0.4);
}

.btn-video i {
  font-size: 1.2rem;
}

/* 動画ライトボックス */
#video-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, visibility 0.2s;
}

#video-lightbox.active {
  opacity: 1;
  visibility: visible;
}

#video-lightbox .lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
}

#video-lightbox .video-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90vw;
  max-height: 90vh;
}

#video-lightbox .lightbox-video {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

#video-lightbox .lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 8px;
  transition: transform 0.2s;
}

#video-lightbox .lightbox-close:hover {
  transform: scale(1.2);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
  #appModal .modal-body {
    padding: 0 16px 20px;
  }

  .product-title {
    font-size: 1.2rem;
  }

  .product-images-container {
    padding: 12px;
  }

  .product-images-grid .product-img {
    max-height: 140px;
    max-width: 48%;
  }

  .product-price {
    padding: 8px 18px;
  }

  .product-price .price-value {
    font-size: 1.25rem;
  }

  .product-description {
    font-size: 0.9rem;
    padding: 12px;
  }

  .detail-label {
    flex: 0 0 90px;
    padding: 10px 12px;
    font-size: 0.75rem;
  }

  .detail-value {
    padding: 10px 12px;
    font-size: 0.9rem;
  }

  .btn-brochure {
    padding: 12px 22px;
    font-size: 0.95rem;
  }
}

/* ==========================================================================
 * 360° Viewer — Image Lightbox (画像拡大表示)
 * ========================================================================== */
#image-lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}

#image-lightbox.active {
  opacity: 1;
}

#image-lightbox .lightbox-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  cursor: pointer;
}

#image-lightbox .lightbox-content {
  position: relative;
  max-width: 90vw;
  max-height: 90vh;
  z-index: 1;
}

#image-lightbox .lightbox-img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
  background: #fff;
}

#image-lightbox .lightbox-close {
  position: absolute;
  top: -40px;
  right: 0;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  color: #333;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.2s;
}

#image-lightbox .lightbox-close:hover {
  background: #fff;
  transform: scale(1.1);
}

@media (max-width: 480px) {
  #image-lightbox .lightbox-close {
    top: -45px;
    right: 50%;
    transform: translateX(50%);
  }

  #image-lightbox .lightbox-close:hover {
    transform: translateX(50%) scale(1.1);
  }
}
