/* 商品一覧ページ用レスポンシブCSS */

/* 基本的なレスポンシブ対応 */
@media screen and (max-width: 600px) {
  /* 全体の調整 */
  body img {
    max-width: 100%;
  }
  
  body,
  #header,
  #headMenu,
  #container_contents,
  .header-area,
  #footer {
    width: 100%;
    min-width: auto;
    max-width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    display: inline-block;
  }

  /* ドロワーメニュー用のスタイル */
  #drawer {
    position: fixed;
    top: 38px;
    right: 10px;
    z-index: 103;
    background: #fff;
    padding: 7px 5px;
    border-radius: 2px;
    display: block;
  }

  #drawer img {
    height: 22px;
    width: auto;
  }

  #overlay {
    position: fixed;
    width: 100%;
    height: 100%;
    min-width: 100%;
    min-height: 100%;
    background: #666;
    opacity: .7;
    z-index: 101;
    display: none;
    top: 0;
    left: 0;
  }

  #overlay.on {
    display: block;
  }

  /* レフトサイドメニューの非表示と表示 */
  #container_contents #leftSide {
    width: 280px;
    padding: 30px 0 0;
    background: #fff;
    position: fixed;
    top: 0;
    right: -100%;
    height: 100%;
    overflow: auto;
    z-index: 102;
    display: block;
    transition: all .2s;
    text-align: center;
  }

  #container_contents #leftSide.on {
    right: 0;
  }

  #container_contents #leftSide > * {
    width: 200px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
  }

  #container_contents #leftSide > :last-child {
    padding-bottom: 30px;
  }

  /* センターエリアのサイズ調整 */
  #container_contents #centerArea {
    box-sizing: border-box;
    width: calc(100% - 170px);
    padding: 0 10px;
    overflow: hidden;
    float: left;
  }

  /* 商品テーブルのレスポンシブ対応 */
  .contents_table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
  
  /* グローバルナビ */
  #headMenu .global-navi {
    width: 100%;
  }

  #headMenu .global-navi .navi00 {
    display: none;
  }

  #headMenu .global-navi li:nth-child(n+1) {
    width: 12.8vw;
  }

  #headMenu .global-navi li:nth-child(n+12) {
    width: 17.8vw;
  }

  /* ライトサイド */
  #container_contents #rightSide {
    box-sizing: border-box;
    width: 170px;
    padding: 0;
    float: right;
  }

  #container_contents #rightSide > * {
    width: 160px;
    box-sizing: border-box;
  }
}

/* スマホ向けの調整 */
@media screen and (max-width: 480px) {
  /* ヘッダー */
  #header {
    background: none;
    padding: 10px 10px 0;
  }

  #header h1 {
    line-height: 1em;
  }

  #header .shoplogo img {
    height: 40px;
  }

  /* グローバルナビ調整 */
  #headMenu .global-navi {
    width: 100%;
    box-sizing: border-box;
  }

  #headMenu .global-navi li {
    float: left;
  }

  #headMenu .global-navi li {
    width: 27% !important;
  }
  
  #headMenu .global-navi li:nth-child(2) {
    width: 19% !important;
  }
  
  #headMenu .global-navi li:nth-child(n+10) {
    width: calc(100% / 3) !important;
    border-bottom: 1px solid #d1c996;
  }

  /* レイアウト調整 */
  #container_contents #centerArea {
    width: 100%;
    padding: 0 10px;
    float: none;
  }

  #container_contents #rightSide {
    width: 100%;
    padding: 0 10px;
    float: none;
    margin-top: 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  /* ランキングエリア */
  #container_contents #rightSide #ranking-area {
    width: 48%;
  }

  /* その他の右サイドメニュー */
  #container_contents #rightSide .guide-area,
  #container_contents #rightSide .category_award,
  #container_contents #rightSide > .title1 {
    width: 48%;
  }

  /* 商品テーブルのスクロール対応強化 */
  #contents_titleimg {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .contents_table {
    min-width: 600px;
  }
}

/* 商品一覧ページ用 追加デザインCSS */
/* セル内の縦方向中央揃え */
.contents_table th, .contents_table td {
    vertical-align: middle !important;
}

/* 人気商品のハイライトスタイル */
.popular-cell {
    background-color: #fff4e5 !important;
    border: 2px solid #ffb74d !important;
    text-align: center;
}
.popular-cell-no1 {
    background-color: #ffebee !important;
    border: 2px solid #ef5350 !important;
    text-align: center;
}
.popular-label {
    display: block;
    font-size: 0.85em;
    font-weight: bold;
    color: #d32f2f;
    margin-bottom: 2px;
}
.popular-cell a, .popular-cell-no1 a {
    font-weight: bold;
    font-size: 1.1em;
}

/* 表の見出し共通スタイル */
.contents_table_title {
    border-left: 5px solid #ccac30;
    padding-left: 10px;
    margin-top: 40px;
    margin-bottom: 15px;
    font-weight: bold;
    font-size: 18px;
    color: #333;
    clear: both;
}

/* 統合した表のためのセルの結合部のスタイル */
.rowspan-cell {
    background-color: #f9f9f9;
    font-weight: bold;
}

/* ▼ スマホでの表の横スクロールをなくし、1画面に収める設定 ▼ */
@media screen and (max-width: 600px) {
    .contents_table {
        min-width: auto !important; /* 600pxの固定幅を解除 */
        white-space: normal !important; /* 文字の折り返しを許可 */
        table-layout: fixed; /* 列の幅を均等に近づける */
    }
    .contents_table th, 
    .contents_table td {
        padding: 4px 2px !important; /* 左右の余白を極限まで削る */
        font-size: 11px !important; /* スマホ用に文字を小さく最適化 */
        word-wrap: break-word; /* 枠に収まらない文字を改行 */
    }
    /* 1列目（グレード・色）の幅を少し広めに確保 */
    .contents_table th:first-child,
    .contents_table td:first-child {
        width: 25% !important;
    }
    .popular-cell a, .popular-cell-no1 a {
        font-size: 12px !important; /* 価格リンクの文字サイズ調整 */
    }
    .popular-label {
        font-size: 9px !important; /* ★人気ラベルも合わせて縮小 */
    }
}

/* ▼ スマホ用：右サイドをTOPページと同じ2カラムレイアウトにする ▼ */
@media screen and (max-width: 480px) {
    /* 悪さをしているflexレイアウトを解除 */
    #container_contents #rightSide {
        display: block !important;
    }
    #container_contents #rightSide::after {
        content: "";
        display: block;
        clear: both;
    }

    /* 左の列（胡蝶蘭KING） */
    #container_contents #rightSide #ranking-area {
        float: left !important;
        width: 48% !important;
    }

    /* 右の列（ガイド、大賞、メッセージ）を縦に積む */
    #container_contents #rightSide .guide-area,
    #container_contents #rightSide .category_award,
    #container_contents #rightSide #category_messege {
        float: right !important;
        width: 48% !important;
        clear: right !important; /* 前の要素の横ではなく下に配置する魔法のコード */
        margin-bottom: 15px !important;
        box-sizing: border-box !important;
    }
}