/* Controls Toolbar */
.controls-toolbar {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

/* Data Table Styles */
.company-table-container {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.table thead th {
  background-color: #f1f3f5;
  color: #495057;
  border-bottom: 2px solid #dee2e6;
  font-weight: bold;
  font-size: 0.9rem;
  cursor: pointer; /* Sortable hint */
  white-space: nowrap;
  vertical-align: middle;
}
.table thead th:hover {
  background-color: #e9ecef;
  color: var(--primary-color);
}
.sort-icon {
  font-size: 0.75rem;
  margin-left: 5px;
  color: #adb5bd;
}

.table tbody td {
  vertical-align: middle;
  font-size: 0.95rem;
  padding: .3rem 0.75rem;
}

/* Rank Highlighting */


/* Company Logo Cell */
.company-cell {
  display: flex;
  align-items: center;
  gap: 15px;
}
.company-logo {
  width: 50px;
  height: 50px;
  object-fit: contain;
  background: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 2px;
}

/* Category Badges */
.cat-badge {
  font-size: 0.75rem;
  background: #e9ecef;
  color: #666;
  border: 1px solid #dee2e6;
  margin-right: 4px;
}

.premium-badge {
background: #d97b00;
background: linear-gradient(0deg, rgba(217, 123, 0, 1) 0%, rgba(240, 156, 0, 1) 50%, rgba(255, 166, 0, 1) 100%);
}

/* Product List Toggle Button */
.product-list-link {
  background: none;
  border: none;
  padding: 0;
  color: var(--primary-color);
  font-weight: 500;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.15s ease-in-out, opacity 0.15s ease-in-out;
}
.product-list-link:hover,
.product-list-link:focus {
  opacity: 0.8;
  outline: none;
}
.product-list-link .fa-chevron-down {
  display: inline-block;
  transition: transform 0.3s ease;
}
.product-list-link[aria-expanded="true"] .fa-chevron-down {
  transform: rotate(180deg);
}
@media (max-width: 767.98px) {
    /* スマホ時はテーブルの固定幅を解除 */
    .d-block.d-md-table-cell {
        width: 100% !important;
        border-bottom: 1px solid #eee; /* セルごとの区切り線 */
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    /* 最後のボタンがあるセルは線を消す */
    tr.d-flex:last-child {
        border-bottom: 3px solid #dee2e6; /* 企業ごとの大きな区切り */
    }

    /* 製品一覧のインデント調整 */
    .collapse td {
        padding-left: 15px !important;
    }
    /* SP版でインラインのwidth指定を無効化して縦並びを維持 */
    .collapse table tr td {
        width: 100% !important;
        border-bottom: none !important;
    }
    
    /* バッジが詰まりすぎないよう調整 */
    .cat-badge {
        margin-bottom: 4px;
        display: inline-block;
    }
}