/* オリシャン料金表スタイル */
:root {
  /* 色の定義 */
  --price-table-border: #ddd;
  --price-table-shadow: rgba(0, 0, 0, 0.1);
  --price-table-bg-yellow1: #f8f5c9;
  --price-table-bg-yellow2: #fcf184;
  --price-table-bg-gray: #f5f5f5;
  --price-table-bg-white: #ffffff;
  --price-table-cell-gap: 8px;

  /* サイズの定義 */
  --price-table-cell-width: 100px;
  --price-table-cell-height: 50px;
  --price-table-product-width: 170px;
  --price-table-product-height: 88px;

  /* フォントサイズ */
  --price-table-font-size: 14px;
  --price-table-font-size-small: 11px;

  /* グラデーション色定義 */
  --gradient-sweet-top: #ffebd0;
  --gradient-sweet-bottom: #ffe77e;
  --gradient-dry-top: #ffebd0;
  --gradient-dry-bottom: #f4c295;
  --gradient-rose-top: #fee2dc;
  --gradient-rose-bottom: #f9b4c4;
  --gradient-ice-top: #dae8f8;
  --gradient-ice-bottom: #9fcbef;
  --gradient-muscat-top: #ebf3c5;
  --gradient-muscat-bottom: #d0e370;
  --gradient-peach-top: #ffebd0;
  --gradient-peach-bottom: #f5cb98;
  --gradient-pineapple-top: #fffa9a;
  --gradient-pineapple-bottom: #fbe25b;
  --gradient-raspberry-top: #fbc8ce;
  --gradient-raspberry-bottom: #ed9189;
  --gradient-apple-top: #d4eac4;
  --gradient-apple-bottom: #88c989;
  --gradient-whitegrape-top: #ebf3c5;
  --gradient-whitegrape-bottom: #d9df83;
  --gradient-redgrape-top: #fbc8ce;
  --gradient-redgrape-bottom: #ed9189;
}

/* 基本的なテーブルスタイル */
.orishan-price-table-wrapper {
  margin: 40px 0px -31px 0px;
  max-width: 100%;
}

/* フォーカス時の青い枠線を非表示 */
.orishan-price-table-wrapper:focus {
  outline: none;
}

/* CSSリセット - 他のスタイルの影響を防ぐ */
/* border-collapseとborder-spacingはPC/モバイルで個別設定 */

.orishan-price-table-wrapper table.orishan-price-table,
.orishan-price-table-wrapper table.orishan-price-table * {
  box-sizing: border-box;
}

/* テーブルの基本スタイル */
table.orishan-price-table {
  width: 100%;
  background: transparent;
  font-size: var(--price-table-font-size);
}

/* PC版スタイル */
@media (min-width: 791px) {
  body .orishan-price-table-wrapper table.orishan-price-table.pc-only {
    display: table;
    border-collapse: separate;
    border-spacing: 8px;
  }

  table.orishan-price-table.mobile-only {
    display: none;
  }

  /* 第一テーブルと第二テーブルの間隔 */
  table.orishan-price-table.first-table {
    margin-bottom: 80px;
  }

  /* 共通セルスタイル */
  table.orishan-price-table td {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
    height: var(--price-table-cell-height);
  }

  /* 空セル（左上） */
  table.orishan-price-table td.empty-cell {
    background: #fff;
    border: none;
    margin-top: 31px;
  }

  /* 本数ヘッダーセル */
  table.orishan-price-table td.quantity-header-cell {
    font-weight: bold;
    font-size: 20px;
    width: var(--price-table-cell-width);
  }

  /* 本数ヘッダーの交互パターン - .PricePageの影響を上書き */
  .orishan-price-table-wrapper
    table.orishan-price-table
    td.quantity-header-cell:nth-child(odd) {
    background: #fcf184;
    height: 60px;
    width: 172px;
    border-radius: 8px;
    margin-top: 9px;
    margin-right: 8px;
    padding: 2px 5px;
  }

  .orishan-price-table-wrapper
    table.orishan-price-table
    td.quantity-header-cell:nth-child(even) {
    background: #f8f5c9;
    height: 60px;
    width: 172px;
    margin-top: 9px;
    border-radius: 8px;
    margin-right: 8px;
    padding: 2px 5px;
  }

  /* 商品セル */
  table.orishan-price-table td.product-cell {
    width: 170px;
    height: 88px;
    position: relative;
    padding-left: 2px;
    text-align: left;
    margin: 4px;
    border-radius: 8px 8px 0px 0px;
  }

  .product-info {
    display: inline-block;
    vertical-align: middle;
  }

  .product-name {
    display: block;
    font-weight: bold;
    font-size: 20px;
    margin-bottom: 0;
    line-height: 1.2;
  }

  .alcohol-content {
    display: block;
    font-size: 16px;
    color: #666;
    line-height: 1.2;
  }

  /* ボトル画像 */
  .bottle-image {
    position: absolute;
    left: 91px;
    top: 22%;
    transform: translateY(-50%);
    width: 82px;
    height: auto;
  }

  /* 価格セル */
  .orishan-price-table-wrapper table.orishan-price-table td.price-cell {
    font-weight: bold;
    font-size: 20px;
    white-space: nowrap;
    height: 60px;
    min-height: 60px;
    width: 170px;
  }

  /* 市松模様パターン - .PricePageの影響を上書き */
  .orishan-price-table-wrapper table.orishan-price-table td.price-cell.even {
    background: var(--price-table-bg-gray);
    margin-top: 9px;
    border-radius: 8px;
    padding: 2px 5px;
  }

  .orishan-price-table-wrapper table.orishan-price-table td.price-cell.odd {
    background: var(--price-table-bg-white);
    margin-top: 9px;
    border-radius: 8px;
    padding: 2px 5px;
  }

  .tax-included {
    font-size: 12px;
    font-weight: normal;
    margin-left: 2px;
  }

  /* 各ボトル画像の個別位置調整 */
  /* デスクトップ版のみ適用 */
  .product-sweet .bottle-image {
    left: 88px;
    top: 20%;
  }

  .product-dry .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-rose .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-ice .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-muscat25 .bottle-image {
    left: 91px;
    top: 19%;
    width: 83px;
  }

  .product-muscat65 .bottle-image {
    left: 91px;
    top: 18%;
  }

  .product-peach .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-pineapple .bottle-image {
    left: 91px;
    top: 21%;
    width: 76px;
  }

  .product-raspberry .bottle-image {
    left: 91px;
    top: 19%;
  }

  .product-apple .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-whitegrape .bottle-image {
    left: 91px;
    top: 21%;
  }

  .product-redgrape .bottle-image {
    left: 91px;
    top: 22%;
  }

  /* 個別の商品名位置調整 */
  .product-sweet .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 30px;
  }

  .product-dry .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 32px;
  }

  .product-rose .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 32px;
  }

  .product-ice .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 29px;
  }

  .product-muscat25 .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 5px;
  }

  .product-muscat65 .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 4px;
  }

  .product-peach .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 19px;
  }

  .product-pineapple .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    letter-spacing: -1.5px;
    top: 0px;
    left: 3px;
  }

  .product-raspberry .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 11px;
  }

  .product-apple .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 15px;
  }

  .product-whitegrape .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 14px;
  }

  .product-redgrape .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 15px;
  }

  /* 個別のアルコール度数位置調整 */
  .product-sweet .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 12px;
  }

  .product-dry .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 11px;
  }

  .product-rose .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 8px;
  }

  .product-ice .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 18px;
  }

  .product-muscat25 .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 12px;
  }

  .product-muscat65 .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 12px;
  }

  .product-peach .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 9px;
  }

  .product-pineapple .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 8px;
  }

  .product-raspberry .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 15px;
  }

  .product-apple .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 5px;
    left: 16px;
  }

  .product-whitegrape .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 2px;
    left: 15px;
  }

  .product-redgrape .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 2px;
    left: 14px;
  }
}

/* モバイル版スタイル */
@media (max-width: 790px) {
  /* PC版を非表示 */
  table.orishan-price-table.pc-only {
    display: none;
  }

  /* モバイル版を表示 */
  table.orishan-price-table.mobile-only {
    display: table;
  }

  /* スクロールコンテナ */
  .orishan-price-scroll-container {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    padding: 0 10px;
    box-sizing: border-box;
  }

  /* モバイル版テーブル基本スタイル */
  .orishan-price-scroll-container table.orishan-price-table {
    width: max-content;
    min-width: 100%;
    border-collapse: separate;
    border-spacing: 4px;
    margin-top: 0px;
  }

  /* セルの基本スタイル */
  table.orishan-price-table.mobile-only td {
    text-align: center;
    vertical-align: middle;
    padding: 10px;
  }

  /* 各行の最初のセル（商品列）を固定 */
  table.orishan-price-table.mobile-only td:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background-color: inherit; /* 各商品のグラデーション背景を保持 */
  }

  /* ヘッダー行を上部に固定 */
  table.orishan-price-table.mobile-only .quantity-header-row td {
    position: sticky;
    position: -webkit-sticky;
    top: 4px;
    z-index: 3;
    background-color: inherit;
  }

  /* 左上の空セルは上部と左に固定 */
  table.orishan-price-table.mobile-only .quantity-header-row td.empty-cell {
    position: sticky;
    position: -webkit-sticky;
    left: 0;
    top: 0;
    z-index: 5;
    background: #fff;
    height: 91px;
    margin-top: 4px;
    margin-right: 0;
    padding-left: 5px;
    padding-bottom: 5px;
  }

  /* 本数ヘッダーセルも上部に固定 */
  table.orishan-price-table.mobile-only
    .quantity-header-row
    td.quantity-header-cell {
    background-color: inherit;
  }

  /* 空セル（左上） - 固定列 */
  table.orishan-price-table.mobile-only td.empty-cell {
    background: #fff;
    border: none;
  }

  /* 本数ヘッダーセル */
  table.orishan-price-table.mobile-only td.quantity-header-cell {
    font-weight: bold;
    font-size: 16px;
    height: 50px;
    min-width: 100px;
  }

  /* 本数ヘッダーの交互パターン */
  .orishan-price-table-wrapper
    table.orishan-price-table.mobile-only
    td.quantity-header-cell:nth-child(odd) {
    background: #fcf184;
    border-radius: 8px;
    padding: 1px 5px;
    margin-top: 4px;
    margin-right: 0;
  }

  .orishan-price-table-wrapper
    table.orishan-price-table.mobile-only
    td.quantity-header-cell:nth-child(even) {
    background: #f8f5c9;
    border-radius: 8px;
    padding: 1px 5px;
    margin-top: 4px;
    margin-right: 0;
  }

  /* 商品セル */
  table.orishan-price-table.mobile-only td.product-cell {
    width: 100px;
    height: 60px;
    position: relative;
    padding-left: 2px;
    padding-top: 2px;
    text-align: left;
    border-radius: 8px 8px 0px 0px;
  }

  /* 商品情報 */
  table.orishan-price-table.mobile-only .product-info {
    display: inline-block;
    vertical-align: middle;
  }

  table.orishan-price-table.mobile-only .product-name {
    display: block;
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 0;
    line-height: 1.2;
  }

  table.orishan-price-table.mobile-only .alcohol-content {
    display: block;
    font-size: 10px;
    color: #393939;
    line-height: 1.2;
  }

  /* ボトル画像 */
  table.orishan-price-table.mobile-only .bottle-image {
    position: absolute;
    right: 0;
    top: 36%;
    transform: translateY(-50%);
    width: 42px;
    height: 74px;
  }

  /* 価格セル */
  table.orishan-price-table.mobile-only td.price-cell {
    font-weight: bold;
    font-size: 16px;
    white-space: normal;
    height: 50px;
    width: 100px;
    min-width: 100px;
    line-height: 1.7;
    padding: 10px 5px;
    border-radius: 8px;
  }

  /* 市松模様パターン */
  .orishan-price-table-wrapper
    table.orishan-price-table.mobile-only
    td.price-cell.even {
    background: var(--price-table-bg-gray);
    margin-top: 4px;
    margin-right: 0;
  }

  .orishan-price-table-wrapper
    table.orishan-price-table.mobile-only
    td.price-cell.odd {
    background: var(--price-table-bg-white);
    margin-top: 4px;
    margin-right: 0;
  }

  table.orishan-price-table.mobile-only .tax-included {
    font-size: 11px;
    font-weight: normal;
    margin-left: 0;
    display: block;
    line-height: 1;
    margin-top: -2px;
  }

  /* 左列（商品セルと空セル）を固定 - position: relativeを上書き */
  table.orishan-price-table.mobile-only td.product-cell,
  table.orishan-price-table.mobile-only td.empty-cell {
    position: sticky;
    position: -webkit-sticky; /* Safari対応 */
    left: 0;
    z-index: 2;
    margin-top: 4px;
    margin-right: 0;
  }

  /* 空セルは白背景を保持 */
  table.orishan-price-table.mobile-only td.empty-cell {
    background: #fff;
  }

  /* モバイル版：個別の商品名位置調整 */
  table.orishan-price-table.mobile-only .product-sweet .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 18px;
  }

  table.orishan-price-table.mobile-only .product-dry .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 18px;
  }

  table.orishan-price-table.mobile-only .product-rose .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 21px;
  }

  table.orishan-price-table.mobile-only .product-ice .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 15px;
  }

  table.orishan-price-table.mobile-only .product-muscat25 .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 0px;
  }

  table.orishan-price-table.mobile-only .product-muscat65 .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: -1px;
  }

  table.orishan-price-table.mobile-only .product-peach .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 16px;
  }

  table.orishan-price-table.mobile-only .product-pineapple .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 0px;
    letter-spacing: -2.7px;
  }

  table.orishan-price-table.mobile-only .product-raspberry .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 2px;
  }

  table.orishan-price-table.mobile-only .product-apple .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 6px;
  }

  table.orishan-price-table.mobile-only .product-whitegrape .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 5px;
  }

  table.orishan-price-table.mobile-only .product-redgrape .product-name {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 6px;
  }

  /* モバイル版：個別のアルコール度数位置調整 */
  table.orishan-price-table.mobile-only .product-sweet .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 2px;
    left: 11px;
  }

  table.orishan-price-table.mobile-only .product-dry .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 6px;
  }

  table.orishan-price-table.mobile-only .product-rose .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 7px;
  }

  table.orishan-price-table.mobile-only .product-ice .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 14px;
  }

  table.orishan-price-table.mobile-only .product-muscat25 .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 8px;
  }

  table.orishan-price-table.mobile-only .product-muscat65 .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 10px;
  }

  table.orishan-price-table.mobile-only .product-peach .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 12px;
  }

  table.orishan-price-table.mobile-only .product-pineapple .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 6px;
  }

  table.orishan-price-table.mobile-only .product-raspberry .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 10px;
  }

  table.orishan-price-table.mobile-only .product-apple .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -2px;
    left: 10px;
  }

  table.orishan-price-table.mobile-only .product-whitegrape .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: -3px;
    left: 10px;
  }

  table.orishan-price-table.mobile-only .product-redgrape .alcohol-content {
    position: relative;
    /* top: 0px; left: 0px; で調整可能 */
    top: 0px;
    left: 6px;
  }
}

/* 各商品の背景グラデーション */
td.product-sweet {
  background: linear-gradient(to bottom, #ffebd0 0%, #ffe77e 100%);
}

td.product-dry {
  background: linear-gradient(to bottom, #ffebd0 0%, #f4c295 100%);
}

td.product-rose {
  background: linear-gradient(to bottom, #fee2dc 0%, #f9b4c4 100%);
}

td.product-ice {
  background: linear-gradient(to bottom, #dae8f8 0%, #9fcbef 100%);
}

td.product-muscat65 {
  background: linear-gradient(to bottom, #ebf3c5 0%, #d0e370 100%);
}

td.product-muscat25 {
  background: linear-gradient(to bottom, #ebf3c5 0%, #d0e370 100%);
}

td.product-peach {
  background: linear-gradient(to bottom, #ffebd0 0%, #f5cb98 100%);
}

td.product-pineapple {
  background: linear-gradient(to bottom, #fffa9a 0%, #fbe25b 100%);
}

td.product-raspberry {
  background: linear-gradient(to bottom, #fbc8ce 0%, #ed9189 100%);
}

td.product-apple {
  background: linear-gradient(to bottom, #d4eac4 0%, #88c989 100%);
}

td.product-whitegrape {
  background: linear-gradient(to bottom, #ebf3c5 0%, #d9df83 100%);
}

td.product-redgrape {
  background: linear-gradient(to bottom, #fbc8ce 0%, #ed9189 100%);
}

/* スクロールバーを非表示 */
.orishan-price-scroll-container {
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
}

.orishan-price-scroll-container::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* アクセシビリティ向上 */
table.orishan-price-table:focus-within {
  outline: 2px solid #4a90e2;
  outline-offset: 2px;
}

/* 印刷時のスタイル */
@media print {
  .orishan-price-table-wrapper {
    overflow: visible;
  }

  table.orishan-price-table td.fixed-column {
    position: static;
  }

  table.orishan-price-table {
    font-size: 10px;
  }
}
