/* chemres.css
   Styles für .chemres Blocks (Filter-Dropdowns + Tabelle)
   Scoped über .chemres / .chemres-wrap, damit es im Shop möglichst wenig kollidiert.
*/

.chemres{
  display:ruby;
}

.chemres .chemres-wrap{
  padding: 0 16px 0 0;
  margin:  0;
  background: #fff;
  font-family: inherit;
}

.chemres .chemres-formula sub {
  font-size: 0.8em;
  line-height: 0;
  vertical-align: sub;
}


.chemres .chemres-synonyms {
  margin-top: 4px;
  line-height: 1.25;
  opacity: 0.9;
}
.chemres .chemres-synonyms em {
  font-style: italic;
}

.chemres .chemres-topbar{
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 8px;
  margin-top: 10px;
}

.chemres .chemres-title{
  font-weight: 700;
  font-size: 14px;
  line-height: 1.2;
  margin-right: auto;
  color:#2F90C9;
}

.chemres .chemres-lang{
  display: inline-flex;
  gap: 6px;
}

.chemres .chemres-lang-btn{
  border: 1px solid rgba(0,0,0,.22);
  background: #fff;
  padding: 6px 10px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.chemres .chemres-lang-btn[aria-pressed="true"]{
  background: rgba(0,0,0,.06);
  border-color: rgba(0,0,0,.35);
}

.chemres .chemres-hint{
  font-size: 13px;
  opacity: .78;
  margin: 8px 0 12px;
}

/* Filters grid */
.chemres .chemres-filters{
  display: grid;
  grid-template-columns: repeat(4, minmax(0px, 1fr));
  gap: 10px;
  margin: 10px 0 12px;
}

@media (max-width: 1000px){
  .chemres .chemres-filters{
    grid-template-columns: repeat(2, minmax(140px, 1fr));
  }
}
@media (max-width: 520px){
  .chemres .chemres-filters{
    grid-template-columns: 1fr;
  }
}

.chemres .chemres-filter{
  position: relative;
}

.chemres .chemres-filter-btn{
  width: 100%;
  text-align: left;
  border: 1px solid rgba(0,0,0,.22);
  background: #fff;
  padding: 9px 10px;
  border-radius: 2px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chemres .chemres-filter-btn .label_op{
  font-weight: 700;
  font-size: 13px;
}

.chemres .chemres-filter-btn .value{
  font-size: 13px;
  opacity: .8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Dropdown menu */
.chemres .chemres-menu{
  position: absolute;
  z-index: 9999;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  border: 1px solid rgba(0,0,0,.22);
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 12px 35px rgba(0,0,0,.12);
  max-height: 280px;
  overflow: auto;
  display: none;
}

.chemres .chemres-menu.open{
  display: block;
}

.chemres .chemres-menu .search{
  position: sticky;
  top: 0;
  background: #fff;
  padding: 8px;
  border-bottom: 1px solid rgba(0,0,0,.10);
  border-radius: 2px 2px 0 0;
}

.chemres .chemres-menu input{
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(0,0,0,.22);
  border-radius: 2px;
  font-size: 13px;
}

.chemres .chemres-menu ul{
  list-style: none;
  margin: 0;
  padding: 6px;
}

.chemres .chemres-menu li{
  margin: 0;
  padding: 0;
}

.chemres .chemres-menu li button{
  width: 100%;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  border-radius: 2px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
}

.chemres .chemres-menu li button:hover{
  background: rgba(0,0,0,.06);
}

/* Actions + status */
.chemres .chemres-actions{
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin: 6px 0 10px;
}

.chemres .chemres-clear,
.chemres .chemres-showall{
  border: 1px solid rgba(0,0,0,.22);
  background: #fff;
  padding: 7px 10px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 13px;
}

.chemres .chemres-clear:hover,
.chemres .chemres-showall:hover{
  background: rgba(0,0,0,.05);
}

.chemres .chemres-count{
  margin-left: auto;
  font-size: 12px;
  opacity: .75;
}

.chemres .chemres-status{
  font-size: 13px;
  opacity: .8;
  padding: 8px 0;
}

/* Table */
.chemres .chemres-tablewrap{
  overflow-x: auto;
}

.chemres .chemres-table{
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 720px; /* keep columns readable */
}

.chemres .chemres-table th,
.chemres .chemres-table td{
  border-top: 1px solid rgba(0,0,0,.12);
  padding: 10px 8px;
  vertical-align: top;
}

.chemres .chemres-table th{
  background: rgba(0,0,0,.035);
  font-weight: 800;
  text-align: left;
}

.chemres .chemres-empty{
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px dashed rgba(0,0,0,.25);
  border-radius: 2px;
  font-size: 13px;
  opacity: .85;
}

/* Small improvements */
.chemres .chemres-filter-btn:focus,
.chemres .chemres-lang-btn:focus,
.chemres .chemres-clear:focus,
.chemres .chemres-showall:focus,
.chemres .chemres-menu input:focus{
  outline: 2px solid rgba(0,0,0,.35);
  outline-offset: 2px;
}
