/* 🔹 assets/css/style.css */

/* Reset */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  }

/* スムーズスクロールを有効にする */
html {
  scroll-behavior: smooth;
}

body {
font-family: 'Noto Sans JP', 'Helvetica Neue', Arial, sans-serif;
line-height: 1.5;
background-color: #f4f6f8; /* Brighter and cleaner background */
color: #111; /* Darker text for readability */
display: flex;
flex-direction: column;
min-height: 100vh;
}

/* メインコンテンツエリアが残りのスペースを埋めるようにする */
main {
  flex-grow: 1;
}

h1, h2, h3 { /* Apply to h3 as well for consistency */
margin-bottom: 15px;
color: #111;
}

a {
color: #007185; /* Amazon blue for links */
text-decoration: none;
}
a:hover {
  color: #FF9900; /* ホバー時にオレンジ色に変化 */
  text-decoration: none; /* 下線を非表示に */
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 30px;
  display: flex;
  flex-direction: column;
}

.product-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 20px;
}

.product-item {
background-color: #fff; /* White background for cards */
border: 1px solid #e9ecef; /* Lighter border */
border-radius: 8px;
padding: 15px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Softer shadow */
transition: transform 0.2s;
display: flex;
flex-direction: column;
height: 100%; /* 親要素の高さに合わせる */
}

.product-item h3 {
  flex-grow: 1; /* ボタンを一番下に配置するために高さを可変にする */
  font-size: 0.9rem; /* 商品名のフォントサイズをさらに調整 */
}

.product-item:hover {
transform: translateY(-5px);
}

.product-item img {
max-width: 100%;
height: auto;
margin-bottom: 15px;
}

.product-item-button {
  margin-top: 15px;
  width: 100%;
}

form label {
  display: block;
  margin-bottom: 5px;
  font-weight: 500;
}

form input[type="text"],
form input[type="email"],
form input[type="password"],
form input[type="number"],
form textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

/* General Button Styles */
.button, .button-secondary {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: bold;
  font-size: 1rem; /* ボタンのフォントサイズを統一 */
  text-align: center;
  cursor: pointer; /* ボタンであることを示すカーソル */
  transition: background-color 0.2s, color 0.2s;
}

.button,
form button.button { /* フォーム内のボタンにも適用 */
  background-color: #FF9900; /* Amazon orange */
  color: #111; /* Black text on orange button */
  border: none;
}

.button-secondary,
form button.button-secondary { /* フォーム内のボタンにも適用 */
  background-color: #6c757d;
  color: #fff;
  border: none;
}

.button-secondary:hover {
  background-color: #5a6268; /* Darker grey on hover */
  color: #fff;
  text-decoration: none;
}

.button:hover {
  background-color: #F7CA88; /* Lighter orange on hover */
  color: #111;
}

form input:focus,
form textarea:focus,
form select:focus { /* Add select for consistency */
  outline: none;
  border-color: #007BFF;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* 汎用ボタンのマージンをリセット */
.button, .button-secondary {
  margin-top: 0;
  margin-bottom: 0;
}

/* Small button modifier */
.button-sm {
  padding: 6px 12px;
  font-size: 0.9rem;
}

/* Danger button modifier */
.button-danger {
  background-color: #dc3545; /* Red for danger/delete */
  color: #fff;
  border: none;
}

.button-danger:hover {
  background-color: #c82333; /* Darker red on hover */
  color: #fff;
}

/* Card Style */
.card {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.text-center {
  text-align: center;
}

table {
width: 100%;
border-collapse: collapse;
margin-top: 20px;
}

table th, table td {
border: 1px solid #ddd;
padding: 8px;
text-align: left;
}

table th {
background-color: #f8f9fa;
}

header {
  background-color: #131921; /* Amazon dark header */
  padding: 15px 30px;
  border-bottom: none; /* No border for dark header */
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2); /* More pronounced shadow */
}
  
header h1 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
  color: #fff; /* White text for header title */
}

/* ロゴのリンクスタイルを調整 */
header h1 a {
  color: inherit; /* 親要素(h1)の色を継承 */
  text-decoration: none;
}

header nav a {
  display: inline-flex; /* アイコンとテキストを横並びにする */
  align-items: center; /* アイコンとテキストを中央揃えにする */
  gap: 6px; /* アイコンとテキストの間の余白 */
  margin-left: 20px;
  font-weight: 500;
  color: #fff; /* White links in header */
  transition: color 0.2s;
  padding: 5px 0; /* クリック領域を少し広げる */
}

header nav a.active {
  color: #FF9900; /* Amazon orange for active link */
  font-weight: 600;
}

/* カートリンクとバッジ */
.cart-link {
  position: relative;
}

.cart-badge {
  position: absolute;
  top: -2px;
  right: -8px;
  background-color: #d9534f; /* Red badge */
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  font-size: 12px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  line-height: 1;
  border: 2px solid #131921; /* ヘッダー背景色で縁取り */
}

/* --- ヘッダーのドロップダウン --- */
.nav-dropdown {
  position: relative;
  display: inline-block;
}

.nav-dropdown .dropdown-toggle {
  cursor: pointer;
}

.nav-dropdown:hover .dropdown-menu {
  display: block; /* ホバー時に表示 */
}

.dropdown-item {
  display: block;
  padding: 10px 20px;
  color: #333; /* 文字色を黒に */
  font-weight: 500;
}

.dropdown-item:hover {
  background-color: #f4f6f8; /* ホバー時の背景色 */
  color: #007185; /* ホバー時の文字色 */
}

/* --- ハンバーガーメニュー --- */
.hamburger-menu {
  display: none; /* デフォルトでは非表示 */
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1002; /* ナビゲーションパネルより手前に */
  margin: 0;
}

.hamburger-menu span {
  display: block;
  width: 24px;
  height: 3px;
  background-color: #fff;
  margin: 5px 0;
  transition: all 0.3s;
}

/* メニューオープン時のハンバーガーアイコン（×印に変化） */
.hamburger-menu.open span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.hamburger-menu.open span:nth-child(2) {
  opacity: 0;
}
.hamburger-menu.open span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* --- フィルターバー --- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 30px;
  align-items: flex-end; /* ラベルとフォーム部品の底を揃える */
  background-color: #fff;
  padding: 20px 25px;
  border-radius: 8px;
  margin-bottom: 40px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05); /* Softer shadow */
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-group label {
  font-size: 0.9rem;
  font-weight: 500;
  color: #555;
}

.search-form-inline {
  display: flex;
}
.search-form-inline input[type="search"] {
  min-width: 250px;
  border-radius: 4px 0 0 4px;
  border-right: none;
}
.search-form-inline button {
  margin-top: 0;
  border-radius: 0 4px 4px 0;
  background-color: #007185;
  border: none;
  white-space: nowrap;
}

#category-select {
  min-width: 250px;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 1rem;
  cursor: pointer;
}

/* --- カテゴリーボタン --- */
.category-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.category-button {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid #ddd;
  border-radius: 8px; /* Sharper corners */
  background-color: #f8f9fa;
  color: #333;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s;
}

.category-button:hover,
.category-button.active {
  background-color: #007185; /* Amazon Blue */
  color: #fff;
  border-color: #007185;
  text-decoration: none;
}

ul {
list-style: none;
margin-top: 10px;
}

ul li {
margin-bottom: 5px;
}

/* Product Detail Page */
.product-detail {
  display: flex;
  gap: 40px;
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  align-items: flex-start; /* 高さが異なる場合に上端で揃える */
  position: relative; /* ズーム表示エリアの配置基準 */
}

.product-detail-info h2 {
  margin-top: 0;
  font-size: 1.5rem; /* 商品詳細のタイトルサイズをさらに調整 */
}

.product-detail-info .price {
  font-size: 1.5rem;
  font-weight: 600;
  color: #B12704; /* Amazon red for price */
  margin: 20px 0;
}

.product-detail-info .description {
  margin-top: 30px;
  margin-bottom: 30px;
}

.share-buttons {
  margin-top: 20px;
  border-top: 1px solid #eee;
  padding-top: 20px;
}

.button-x {
  display: inline-block;
  padding: 8px 16px;
  background-color: #14171A; /* X (Twitter) Black */
  color: #fff;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.9em;
  text-decoration: none;
  transition: background-color 0.2s;
}

/* Cart Page */
.cart-table {
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.cart-table thead th {
  background-color: #f8f9fa;
  padding: 15px;
}

.cart-table tbody td {
  padding: 15px;
  vertical-align: middle;
}

.cart-item-image img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 4px;
}

.cart-item-details {
  display: flex;
  align-items: center;
  gap: 15px;
}

.qty-input {
  /* !important を使わずにセレクタの具体性を高めてスタイルを優先させる */
  width: 90px !important; /* フォーム全体のスタイルを上書きするため */
  text-align: center;
  flex-grow: 0; /* フォーム内で不必要に拡大しないようにする */
}

.cart-summary {
  margin-top: 30px;
  padding: 20px;
  background-color: #f8f9fa;
  border-radius: 8px;
  text-align: right;
}

.cart-total {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 20px;
}

.cart-total span {
  color: #d9534f;
  color: #B12704; /* Amazon red for total */
}

.cart-total-details {
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e7e7e7;
}

.free-shipping-notice {
  font-size: 0.9em;
  color: #007185;
  font-weight: 500;
}

.cart-actions {
  display: flex;
  justify-content: flex-end;
  gap: 15px;
  align-items: center;
}

/* カートアクション内のボタンのマージンをリセット */
.cart-actions > .button,
.cart-actions > .button-secondary {
  margin-top: 0;
}

.cart-item-remove {
  text-align: center;
}

.button-remove {
  display: inline-block;
  width: 28px;
  height: 28px;
  line-height: 28px;
  text-align: center;
  background-color: #e0e0e0;
  color: #555;
  border-radius: 50%;
  font-weight: bold;
  font-size: 1.2rem;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
}

.button-remove:hover {
  background-color: #d9534f;
  color: #fff;
  text-decoration: none;
}

/* Footer */
footer { /* Amazon dark footer */
  background-color: #232F3E;
  color: #ccc;
  text-align: center;
  padding: 25px 30px;
  margin-top: 40px;
}

footer p {
  margin: 0;
}

.footer-nav {
  margin-bottom: 15px;
}

.footer-nav a {
  color: #ccc;
  margin: 0 10px;
  font-size: 0.9em;
}

.footer-nav a:hover {
  color: #fff;
}

.info-table {
  border: none;
}
.info-table th, .info-table td {
  border: 1px solid #eee;
  padding: 15px;
  vertical-align: top;
}

/* Order Page */
.order-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
}

.order-form-container {
  flex: 1.5;
  min-width: 320px;
}

.order-summary-container {
  flex: 1;
  min-width: 300px;
  background-color: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  align-self: flex-start; /* 高さを揃える */
}

.order-form-container h3, .order-summary-container h3 {
  margin-top: 0;
  border-bottom: 2px solid #eee;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.required {
  color: #d9534f;
  font-size: 0.9em;
  margin-left: 4px;
}

.order-summary-item {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e7e7e7;
}

.order-summary-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.order-summary-item img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.order-summary-item .item-info {
  flex-grow: 1;
}

.order-summary-item .item-subtotal {
  font-weight: bold;
}

.order-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 1.3rem;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 2px solid #ddd;
}

.order-summary-total > div {
  flex: 1;
}

.order-summary-total .grand-total {
  text-align: right;
  font-size: 1.3rem;
}

.order-summary-total .grand-total strong {
  margin-right: 10px;
}

/* Stripe Elements */
.StripeElement {
  background-color: white;
  padding: 10px 12px;
  border-radius: 4px;
  border: 1px solid #ccc;
  box-shadow: 0 1px 3px 0 #e6ebf1;
  transition: box-shadow 150ms ease;
}

.StripeElement--focus {
  box-shadow: 0 1px 3px 0 #cfd7df;
}

.StripeElement--invalid {
  border-color: #fa755a;
}

#card-errors {
  color: #fa755a;
  margin-top: 10px;
  font-size: 0.9em;
}

.spinner, .spinner:before, .spinner:after { display: none; }
.spinner.hidden { display: none; }
#submit-button.hidden { display: none; }

/* Admin Dashboard */
.order-group {
  margin-bottom: 30px;
  padding: 20px;
}

.order-group-header {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 10px 20px;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #eee;
}

.order-group-header .price {
  font-weight: bold;
  color: #d9534f;
}

.order-group-header .payment-id {
  font-size: 0.9em;
  color: #666;
  word-break: break-all;
  grid-column: 1 / -1; /* 常に全幅 */
}

.order-group-header .customer-address {
  grid-column: 1 / -1; /* 常に全幅を占めるようにする */
  word-break: break-all;
}

.admin-actions-bar {
  margin-bottom: 20px;
  text-align: right;
}

.admin-actions-bar .button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.admin-actions-bar .icon-download {
  position: relative;
  top: -1px;
}
.filter-controls {
  margin-bottom: 20px;
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.filter-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.date-filter-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.date-filter-form .filter-group {
  display: flex;
  align-items: center;
  flex-direction: row; /* ラベルと入力欄を横並びにする */
  gap: 5px;
}
.date-filter-form label {
  margin-bottom: 0;
  /* 汎用のform labelスタイルを上書き */
  font-weight: normal;
  font-size: 1rem;
  color: #111;
  margin-right: 5px;
}

.date-input-wrapper {
  position: relative;
  display: inline-block;
}

.date-input-wrapper input[type="date"] {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 6px 10px;
  font-size: 0.9rem;
  color: #333;
  /* アイコン分のスペースを確保 */
  padding-right: 30px;
  /* デフォルトの矢印やカレンダーアイコンを非表示にする */
  -webkit-appearance: none;
  -moz-appearance: textfield; /* Firefoxでのスタイルをリセット */
  appearance: none; /* Safari/Chromeでのスタイルをリセット */
}

/* Chrome, Edge, Safari */
.date-input-wrapper input[type="date"]::-webkit-calendar-picker-indicator {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  opacity: 0; /* ネイティブのアイコンを透明にする */
  cursor: pointer;
}

.date-input-wrapper .icon-calendar {
  position: absolute;
  top: 50%;
  right: 8px;
  transform: translateY(-50%);
  color: #6c757d;
  pointer-events: none; /* アイコンをクリックしても入力欄が反応するように */
}

.filter-nav a {
  display: inline-block;
  padding: 8px 15px;
  margin-right: 10px;
  border-radius: 20px;
  background-color: #f0f0f0;
  color: #555;
}

.status-badge {
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.9em;
  color: #fff;
  font-weight: bold;
}
.status-未注文 {
  background-color: #FF9900; /* Amazon orange */
  color: #111; /* Black text */
}
.status-注文済み {
  background-color: #28a745; /* Success */
}
.status-キャンセル {
  background-color: #6c757d; /* Secondary */
}

.order-group-footer {
  margin-top: 20px;
  text-align: right;
}

.status-update-form {
  display: inline-flex;
  gap: 10px;
  align-items: center;
}

.status-update-form select {
  padding: 8px;
  border-radius: 4px;
}

.pagination {
  margin-top: 30px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination a {
  display: inline-block;
  padding: 8px 12px;
  margin: 0 2px;
  margin: 0 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 4px;
  color: #007BFF;
  text-decoration: none;
  transition: background-color 0.2s, color 0.2s;
  font-weight: 500;
}

.pagination a:hover {
  background-color: #e9ecef;
  border-color: #ddd;
  text-decoration: none;
}

.pagination a.active {
  background-color: #FF9900; /* Amazon orange */
  color: #111; /* Black text */
  border-color: #FF9900;
  cursor: default;
  font-weight: bold;
}

.pagination a.active:hover {
  background-color: #FF9900; /* Keep orange on hover for active */
}
/* Admin Login Page */
.login-page-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: #f4f4f4;
}

.login-main {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.login-container {
  width: 100%;
  max-width: 400px;
  padding: 40px;
  background-color: #fff;
  border-radius: 8px;
  border: 1px solid #e0e0e0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* .login-container h2 is removed from HTML, so this rule is no longer needed */
/* .login-container h2 {
  text-align: center;
  margin-bottom: 30px;
} */

.login-container .button {
  width: 100%;
}

.error-message {
  color: #d9534f;
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 15px;
  text-align: center;
}

.form-group {
  margin-bottom: 20px;
}
/* style.css に追加 */
.status-visible {
    color: #28a745;
    font-weight: bold;
}

.status-hidden {
    color: #dc3545;
    font-weight: bold;
}

/* Admin button layout */
.admin-button-group {
    display: flex;
    gap: 5px;
    align-items: stretch; /* ボタンの高さを強制的に揃える */
}

.admin-button-group > a,
.admin-button-group > form {
    margin: 0;
    flex: 1; /* 各フォームが均等にスペースを分け合う */
    display: flex; /* 中の要素を伸縮させるため */
}

.admin-button-group .button-secondary {
    width: 100%;
    height: 100%; /* 親要素の高さに合わせる */
    /* <a>と<button>の両方をFlexコンテナにして中央揃え */
    display: flex;
    justify-content: center;
    align-items: center;
    white-space: nowrap; /* テキストの折り返しを禁止 */
    padding: 8px 10px; /* パディングを調整 */
    margin-top: 0; /* 汎用スタイルを上書き */
}

/* フォーム内のボタン配置用 */
.form-actions {
    display: flex;
    justify-content: space-between; /* 要素を両端に配置 */
    align-items: center;
    margin-top: 20px;
}

/* .form-actions 内のボタンは汎用のマージンをリセット */
.form-actions > .button,
.form-actions > .button-secondary {
    margin-top: 0;
}

/* .form-actions 内のボタンは幅を自動調整させる */
/* 以前の flex: 1 や flex-basis の指定を打ち消す */
.form-actions > .button, .form-actions > .button-secondary { flex: 0 1 auto; }
.product-gallery-wrapper {
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-basis: 400px; /* 幅を固定 */
  flex-shrink: 0; /* 縮まないようにする */
  /* スクロール追随のためのスタイル */
  position: sticky;
  top: 85px; /* ヘッダーの高さ分（約65px）+ 少し余白 */
  align-self: flex-start; /* stickyが正しく動作するために必要 */
}

.product-thumbnails {
  display: flex;
  gap: 10px;
  max-width: 400px; /* 親要素の幅を超えないようにし、flex-wrapが正しく機能するようにする */
  flex-wrap: wrap;
}

.thumbnail-item {
  width: 80px;
  height: 80px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color 0.2s;
}
.thumbnail-item.active, .thumbnail-item:hover {
  border-color: #FF9900;
}
.thumbnail-item img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 画像の比率を保ったまま、要素全体を埋める */
  display: block;
  border-radius: 2px; /* サムネイル画像にも少し角丸を適用 */
}

.product-main-image {
  cursor: crosshair;
}

.product-main-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 8px;
}

#zoom-result-pane {
  display: none; /* 初期状態では非表示 */
  position: fixed; /* スクロールに追従しないようにfixedに変更 */
  /* top, left はJavaScriptで動的に設定 */
  width: 400px;
  height: 400px;
  border: 1px solid #ddd;
  background-repeat: no-repeat;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  z-index: 10;
  pointer-events: none; /* ズームペイン自体はマウスイベントを受け取らない */
}

/* 画面幅が狭い場合はズーム表示を隠す (任意) */
@media (max-width: 992px) {
  #zoom-result-pane {
    display: none !important;
  }

  .product-gallery {
    position: static; /* スマホではスクロール固定を解除 */
    top: auto; /* top指定もリセット */
    align-self: auto; /* align-selfもリセット */
  }

  .product-main-image {
    cursor: default;
  }

  /* 商品詳細ページを縦並びにする */
  .product-detail {
    flex-direction: column;
    gap: 20px;
    position: static; /* ズームペインがはみ出さないように static に戻す */
  }

  .product-main-image {
    max-width: 100%; /* 横幅の制限を解除 */
  }

  /* 商品一覧を2列にする */
  .product-list {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ヒーローエリアのレイアウトを調整 */
  .hero-area {
    padding: 60px 20px; /* 上下の余白を狭くする */
    min-height: 300px; /* 最小の高さを低くする */
  }

  /* 768px以下でハンバーガーメニューを適用 */
  header nav {
    position: fixed;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background-color: #232F3E; /* フッターと同じ背景色 */
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px 30px;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    z-index: 1001;
  }

  header nav.open {
    transform: translateX(0);
  }

  header nav a,
  header nav .nav-dropdown {
    margin-left: 0;
    width: 100%;
    padding: 15px 0;
    border-bottom: 1px solid #3a4553;
  }

  .hamburger-menu {
    display: block;
  }

  /* --- モバイル用ドロップダウンメニュー（アコーディオン） --- */
  /* カテゴリーボタンのスタイル調整 */
  .nav-dropdown .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
  }

  /* 閉じてるときの矢印 */
  .nav-dropdown .dropdown-toggle::after {
    content: '▼';
    font-size: 10px;
    transition: transform 0.3s;
  }

  /* 開いてるときの矢印 */
  .nav-dropdown.open .dropdown-toggle::after {
    transform: rotate(180deg);
  }

  .dropdown-menu {
    position: static;
    box-shadow: none;
    border: none;
    background-color: transparent;
    padding: 0 0 0 20px; /* 左にインデント */
    max-height: 0; /* 初期状態では非表示 */
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .nav-dropdown.open .dropdown-menu {
    max-height: 500px; /* 十分な高さを確保 */
    padding-top: 10px;
  }

  .dropdown-item {
    padding: 12px 0;
    color: #ddd; /* 文字色を調整 */
  }

  .dropdown-item:hover {
    background-color: transparent;
    color: #FF9900; /* ホバー色をアクセントカラーに */
  }

  /* --- カートテーブルのレスポンシブ対応 --- */
  .cart-table {
    border: none;
    box-shadow: none;
  }
  .cart-table thead {
    display: none; /* ヘッダーを非表示に */
  }
  .cart-table tr {
    display: block;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    padding: 15px;
  }
  .cart-table td {
    display: flex; /* ラベルと値を横並びにする */
    justify-content: space-between; /* ラベルと値を両端に配置 */
    align-items: center;
    padding: 12px 0;
    border: none;
    border-bottom: 1px solid #f0f0f0;
    flex-direction: column; /* ラベルと値を縦並びにする */
    align-items: flex-start; /* 縦並びにしたアイテムを左揃えにする */
    text-align: left; /* テキストを左寄せに */
    padding: 12px 15px; /* 左右のパディングを追加 */
  }
  .cart-table td:last-child {
    border-bottom: none;
  }
  .cart-table td::before {
    content: attr(data-label); /* data-label属性の値を表示 */
    font-weight: bold;
    text-align: left;
    margin-right: 0; /* 縦並びなので右マージンは不要 */
    margin-bottom: 5px; /* ラベルと値の間に少しスペース */
  }
  /* cart.phpのHTML変更に伴い、.cart-item-detailsクラスは<td>に直接適用されなくなりました。
     もし他の場所でこのクラスが使われる可能性を考慮し、flex-directionをcolumnに調整しますが、
     現在のcart.phpのカートテーブルには直接影響しません。
     主な調整は.cart-table tdに適用されます。
  */
  .cart-table .cart-item-details {
    display: flex;
    flex-direction: column; /* 画像とテキストを縦並び */
    align-items: center;
    padding-bottom: 15px;
    gap: 15px;
    padding-left: 0; /* tdのpaddingが優先されるため、ここではリセット */
    padding-right: 0; /* tdのpaddingが優先されるため、ここではリセット */
  }
  .cart-table .cart-item-details::before {
    display: none; /* 商品セルのラベルは非表示 */
  }
  .cart-table .cart-item-details img {
    width: 60px;
    height: 60px;
  }
  .cart-table .cart-item-details a,
  .cart-table .cart-item-name a { /* .cart-item-nameのaタグも調整 */
    text-align: left;
    word-break: break-word; /* 長い商品名がはみ出さないように */
    width: 100%; /* リンクが親の幅いっぱいに広がるように */
  }
  /* 個別の商品画像セルと商品名セルへの調整 */
  .cart-table .cart-item-image {
    align-items: flex-start; /* 画像セルも左揃え */
  }
  .cart-table .cart-item-image img {
    margin-top: 5px; /* ラベルとの間に少しスペース */
  }
  .cart-table .cart-item-name {
    align-items: flex-start; /* 商品名セルも左揃え */
  }
  .cart-table .qty-input {
    width: 80px !important;
    padding: 8px;
    margin-right: 0; /* 右側の余白を削除 */
    text-align: left; /* 数量入力も左揃え */
  }
  .cart-summary {
    text-align: left; /* 合計金額も左寄せ */
  }
  .cart-actions {
    justify-content: flex-start; /* ボタンも左寄せ */
  }

  .announcement-bar .icon-info {
    width: 20px; /* アイコンの幅を小さくする */
    height: 20px; /* アイコンの高さを小さくする */
  }

  /* --- お知らせバーのレスポンシブ調整 --- */
  .announcement-bar {
    flex-direction: column; /* 縦並びにする */
    align-items: flex-start; /* アイテムをコンテナの始点（左）に揃える */
    padding: 15px; /* 内側の余白を調整 */
    gap: 8px; /* アイコンとテキストの間の余白を狭くする */
  }
  .announcement-icon-label {
    font-size: 0.8rem; /* ラベルのフォントサイズを小さくする */
    letter-spacing: 0.5px; /* 文字間隔を少し狭くする */
    width: 100%; /* 幅を100%に広げる */
    justify-content: flex-start; /* 中の要素を左寄せにする */
  }
  .announcement-text-wrapper {
    width: 100%; /* コンテナの幅を親要素に合わせる */
  }
}

/* PC表示用のドロップダウンメニューのスタイル */
@media (min-width: 993px) {
  .dropdown-menu {
    display: none; /* 初期状態では非表示 */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 101;
    border-radius: 0 0 8px 8px;
    padding: 10px 0;
    border-top: 3px solid #FF9900;
  }

  /* PCではホバーで表示 */
  .nav-dropdown:hover .dropdown-menu {
    display: block;
  }
}

/* --- ヒーローエリア --- */
.hero-area {
  position: relative;
  /* 背景画像は assets/images/hero-background.jpg に配置してください */
  background-image: url('../images/hero-background.png');
  background-size: cover;
  background-position: center;
  color: #fff;
  padding: 100px 20px;
  text-align: center;
  border-radius: 8px;
  margin-bottom: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 400px;
  overflow: hidden; /* 角丸を有効にするため */
}

/* 背景画像の上にオーバーレイを追加してテキストを読みやすくする */
.hero-area::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5); /* 黒の半透明オーバーレイ */
}

.hero-content {
  position: relative; /* オーバーレイの上に表示するため */
  z-index: 1;
  max-width: 600px;
}

.hero-content h1 {
  /* 画面幅に応じて文字サイズを調整 (最小1.6rem, 基本5vw, 最大2.8rem) */
  font-size: clamp(1.2rem, 5vw, 2.8rem);
  margin-bottom: 15px;
  color: #fff;
  font-weight: 600;
  word-break: keep-all; /* 日本語の不自然な改行を防ぐ */
}

.hero-content p {
  /* 画面幅に応じて文字サイズを調整 (最小0.9rem, 基本2.5vw, 最大1.2rem) */
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  margin-bottom: 30px;
}

/* --- ポップアップメッセージ --- */
.popup-message {
  position: fixed;
  bottom: -100px; /* 初期状態では画面外 */
  left: 50%;
  transform: translateX(-50%);
  background-color: #28a745; /* Success green */
  color: #fff;
  padding: 15px 25px;
  border-radius: 8px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
  z-index: 1001;
  transition: bottom 0.5s ease-in-out;
  font-weight: 500;
}

.popup-message.show {
  bottom: 30px; /* 表示位置 */
}

.popup-message.error {
  background-color: #d9534f; /* Error red */
}

/* --- お知らせバー --- */
.announcement-bar {
  display: flex;
  align-items: center;
  gap: 15px;
  background: linear-gradient(135deg, #e6f3f5, #ffffff); /* グラデーション背景 */
  color: #004f5a;
  padding: 16px 25px;
  margin-bottom: 40px;
  border-radius: 12px; /* 角をより丸く */
  border: 1px solid #d0e8ec;
  box-shadow: 0 4px 15px rgba(0, 113, 133, 0.08); /* 影を調整 */
  overflow: hidden; /* テキストがはみ出ないようにする */
  cursor: pointer; /* ホバーで止まることがわかるようにカーソルを変更 */
}

.announcement-icon-label {
  display: flex;
  align-items: center;
  gap: 6px; /* アイコンと文字の間の余白を少し詰める */
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem; /* 文字サイズを少し小さくする */
}

.announcement-bar .icon-info {
  flex-shrink: 0;
  color: #007185;
}

.announcement-text-wrapper {
  flex-grow: 1; /* 残りのスペースを埋める */
  overflow: hidden; /* はみ出したテキストを隠す */
}
.announcement-text {
  margin: 0;
  font-weight: 500;
  white-space: nowrap; /* テキストを折り返さない */
  display: inline-block; /* アニメーションのためにインラインブロック要素にする */
  padding-left: 100%; /* 右端からスタートさせるためのパディング */
  animation: marquee 15s linear infinite;
}

/* ホバー時にアニメーションを一時停止 */
.announcement-bar:hover .announcement-text {
  animation-play-state: paused;
}

/* 右から左へ流れるアニメーション */
@keyframes marquee {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

/* index.phpのキーワード検索ボタンの色をカテゴリーボタンのアクティブ色に合わせる */
.filter-bar .search-form-inline button.button {
  background-color: #007185; /* Amazon Blue */
  color: #fff;
}
.filter-bar .search-form-inline button.button:hover {
  background-color: #005f70; /* 少し暗い青 */
  color: #fff;
}

/* --- おすすめ商品セクション --- */
.recommend-section {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  margin-bottom: 40px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.recommend-section h2 {
  position: relative;
  text-align: center;
  padding-bottom: 15px; /* 下線のためのスペース */
  margin-bottom: 30px;
  font-size: 1.8rem;
  font-weight: 600;
  letter-spacing: 2px; /* 文字間隔を少し広げる */
  padding-top: 15px; /* 上の罫線とのスペース */
  border-top: 1px solid #eee; /* 上に細い線を追加 */
}

/* タイトル下のアクセントライン */
.recommend-section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px; /* 線の長さ */
  height: 3px; /* 線の太さ */
  background-color: #FF9900; /* サイトのアクセントカラー */
  border-radius: 2px;
}

/* --- Swiper Slider for Recommended Products --- */
.recommend-swiper,
.related-swiper {
  padding: 10px 0; /* 上下に少し余白を追加 */
  position: relative;
}

.recommend-swiper .swiper-slide,
.related-swiper .swiper-slide {
  height: auto; /* 高さを自動調整 */
  align-self: stretch; /* Flexboxコンテナ内で高さを揃える */
}

/* スライダーのナビゲーションボタンのスタイル */
.recommend-swiper .swiper-button-prev,
.recommend-swiper .swiper-button-next,
.related-swiper .swiper-button-prev,
.related-swiper .swiper-button-next {
  color: #FF9900; /* ボタンの色をアクセントカラーに */
  background-color: rgba(255, 255, 255, 0.8); /* 半透明の背景 */
  width: 40px;
  height: 40px;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}
.recommend-swiper .swiper-button-prev::after,
.recommend-swiper .swiper-button-next::after {
  font-size: 18px; /* アイコンのサイズを調整 */
  font-weight: bold;
}

/* --- 検索結果タイトル --- */
.search-result-title {
  background-color: #fff;
  padding: 15px 20px;
  border-radius: 8px;
  border-left: 5px solid #FF9900; /* アクセントカラーのボーダー */
  margin-bottom: 30px;
  font-size: 1.2rem;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  font-weight: 500;
}

.search-result-title .highlight {
  color: #007185; /* サイトの別のキーカラー */
  font-weight: bold;
  margin: 0 0.2em; /* 強調部分の左右に少し余白 */
}

/* --- ページネーション (管理者画面と共通) --- */
.pagination {
  margin-top: 40px;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.pagination a {
  display: inline-block;
  padding: 8px 16px;
  margin: 0 4px;
  border: 1px solid #ddd;
  background-color: #fff;
  border-radius: 4px;
  color: #007185;
  text-decoration: none;
  transition: all 0.2s;
  font-weight: 500;
}

.pagination a:hover {
  background-color: #f4f6f8;
  border-color: #ddd;
  text-decoration: none;
}

.pagination a.active {
  background-color: #007185;
  color: #fff;
  border-color: #007185;
  cursor: default;
}

/* --- パンくずリスト --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  padding: 10px 15px; /* パディングを追加 */
  margin-bottom: 2rem;
  list-style: none;
  background-color: #fff; /* 背景色を白に */
  border-radius: 4px; /* 角を丸くする */
  box-shadow: 0 1px 2px rgba(0,0,0,0.05); /* わずかな影を追加 */
  font-size: 0.9rem; /* フォントサイズを少し小さく */
}

.breadcrumb-item {
  display: flex;
  align-items: center;
}

.breadcrumb-item a {
  color: #007185; /* リンク色をサイト標準に */
  font-weight: 500;
}

.breadcrumb-item + .breadcrumb-item::before {
  content: '›'; /* 区切り文字を変更 */
  display: inline-block;
  padding: 0 0.75rem; /* 余白を調整 */
  color: #6c757d;
  font-weight: bold;
}

.breadcrumb-item.active {
  color: #343a40; /* 現在地の文字を少し濃くする */
  font-weight: 500;
}

/* --- 売上グラフ --- */
.chart-controls {
  margin-bottom: 20px;
  display: flex;
  gap: 10px;
}

.chart-controls .button-sm.active {
  background-color: #007185;
  color: #fff;
  font-weight: bold;
}

.chart-container {
  position: relative;
  height: 350px;
}

/* --- 売上サマリーボックス --- */
.summary-boxes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.summary-box {
  padding: 25px;
  text-align: left;
}

.summary-box h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 1.1rem;
  color: #555;
}

.summary-value {
  font-size: 2rem;
  font-weight: bold;
  color: #111;
  margin-bottom: 5px;
}

.summary-sub-value {
  font-size: 1rem;
  color: #6c757d;
}

/* --- 商品別ランキングテーブル --- */
.ranking-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.ranking-table th,
.ranking-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #e9ecef;
  vertical-align: middle;
}

.ranking-table thead th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
}

.ranking-table tbody tr:hover {
  background-color: #f8f9fa;
}

.ranking-table .rank-col {
  width: 80px;
  text-align: center;
  font-weight: bold;
  font-size: 1.2rem;
}

.ranking-table .product-image-col {
  width: 70px;
  padding-right: 0;
}

.ranking-table .product-image-col img {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.ranking-table .product-name-col a {
  font-weight: 500;
  color: #007185;
}

.ranking-table .quantity-col {
  width: 120px;
  text-align: right;
}

.ranking-table .sales-col {
  width: 180px;
  text-align: right;
  font-weight: bold;
}

.rank-badge {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 32px;
  border-radius: 50%;
  color: #fff;
  background-color: #6c757d; /* 4位以下 */
}
.rank-1 { background-color: #ffd700; color: #333; } /* Gold */
.rank-2 { background-color: #c0c0c0; color: #333; } /* Silver */
.rank-3 { background-color: #cd7f32; } /* Bronze */

@media (max-width: 768px) {
  .ranking-table .quantity-col,
  .ranking-table .sales-col {
    width: auto;
    text-align: left;
  }
}

/* --- Admin Product Form Image Management --- */
.image-upload-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.image-upload-item {
    background-color: #f9f9f9;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
}

.image-upload-item > label {
    font-weight: bold;
    display: block;
    margin-bottom: 10px;
}

.image-preview-wrapper {
    position: relative;
    margin-bottom: 10px;
}

.image-preview {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.image-delete-checkbox {
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 画像削除チェックボックスのスタイルをリセット */
.image-delete-checkbox input[type="checkbox"] {
    opacity: 1; /* チェックボックスを強制的に表示 */
    position: static; /* 位置をリセット */
    width: auto;
    height: auto;
}
.image-delete-checkbox label::before,
.image-delete-checkbox label::after {
    display: none; /* カスタムチェックボックスの見た目を削除 */
}

/* --- カスタムチェックボックス --- */
.form-group-checkbox {
  margin-top: 10px;
}

.form-group-checkbox label {
  position: relative;
  padding-left: 30px; /* チェックボックスのスペース */
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  height: 20px;
  user-select: none; /* テキスト選択を無効化 */
}

/* 元のチェックボックスを隠す */
.form-group-checkbox input[type="checkbox"] {
  opacity: 0;
  position: absolute;
  width: 0;
  height: 0;
}

/* チェックボックスの見た目を作成 */
.form-group-checkbox label::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: 20px;
  height: 20px;
  border: 2px solid #ccc;
  background-color: #fff;
  border-radius: 4px;
  transition: all 0.2s;
}

/* チェックされたときのスタイル */
.form-group-checkbox input[type="checkbox"]:checked + label::before {
  background-color: #007185;
  border-color: #007185;
}

.form-group-checkbox input[type="checkbox"]:checked + label::after {
  content: '✔';
  position: absolute;
  left: 4px;
  top: 0px;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
}
/* --- モーダルウィンドウ --- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1050;
}

.modal-content {
  background-color: #fff;
  padding: 30px;
  border-radius: 8px;
  width: 90%;
  max-width: 600px;
  max-height: 80vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 15px;
  background: none;
  border: none;
  font-size: 2rem;
  color: #888;
  cursor: pointer;
  line-height: 1;
}

.csv-columns-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin: 20px 0;
  padding: 15px;
  background-color: #f9f9f9;
  border: 1px solid #eee;
  border-radius: 4px;
}

.csv-column-item {
  display: flex;
  align-items: center;
  gap: 8px;
}
.note ul {
    margin-top: 10px;
    padding-left: 20px;
    list-style: disc;
}