
body{font:16px system-ui,Arial;background:#f5f7fa;color:#172033;margin:0}
main{max-width:1100px;margin:50px auto;padding:0 18px}
h1{font-size:30px}
form{display:flex;gap:10px;margin:25px 0}
input{flex:1;padding:14px;border:1px solid #ccd4df;border-radius:9px;font-size:17px;min-width:0}
button{background:#1f65d5;color:white;border:0;padding:14px 25px;border-radius:9px;cursor:pointer}
section{overflow:auto;background:white;border-radius:12px;box-shadow:0 4px 20px #14213d12}
table{width:100%;border-collapse:collapse;min-width:750px}
th,td{text-align:left;padding:14px;border-bottom:1px solid #e8edf4}
th{background:#f0f4fa;cursor:pointer}
small{color:#637085}
#status{margin:15px 0}
#brands{display:flex;flex-wrap:wrap;gap:10px;margin:18px 0}
#brands button{background:white;color:#1f65d5;border:1px solid #ccd4df}
#brands button.active{background:#1f65d5;color:white;border-color:#1f65d5}
#selected{margin:18px 0 12px}
[hidden]{display:none!important}


/* MOBILE OFFERS */
@media(max-width:768px){
  main{
    margin:20px auto;
    padding:0 12px;
  }

  h1{font-size:24px}

  form{gap:8px;margin:18px 0}
  input{padding:12px;font-size:16px}
  form button{padding:12px 16px}

  #brands{gap:8px}
  #brands button{padding:10px 14px}

  #offersSection{
    overflow:visible;
    background:transparent;
    box-shadow:none;
  }

  table,tbody,tr,td{
    display:block;
    width:100%;
    min-width:0;
    box-sizing:border-box;
  }

  thead{display:none}

  tr{
    background:white;
    border:1px solid #e3e9f2;
    border-radius:12px;
    margin-bottom:12px;
    padding:12px 14px;
    box-shadow:0 3px 12px #14213d0c;
  }

  td{
    border:0;
    padding:6px 0;
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    overflow-wrap:anywhere;
    text-align:right;
  }

  td::before{
    content:attr(data-label);
    color:#637085;
    font-size:13px;
    font-weight:400;
    text-align:left;
    flex-shrink:0;
  }

  td:nth-child(1){
    font-weight:700;
    font-size:17px;
    color:#172033;
  }

  td:nth-child(3){
    align-items:flex-start;
  }

  td:nth-child(7){
    border-top:1px solid #e8edf4;
    margin-top:8px;
    padding-top:12px;
    font-size:20px;
    font-weight:700;
    color:#1f65d5;
  }
}


/* MOBILE SORT */
#mobileSort{display:none}
@media(max-width:768px){
  #mobileSort:not([hidden]){
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
    margin:14px 0;
  }
  #mobileSort span{
    color:#637085;
    font-size:14px;
    width:100%;
  }
  #mobileSort button{
    background:white;
    color:#1f65d5;
    border:1px solid #ccd4df;
    padding:10px 14px;
    font-size:14px;
  }
  #mobileSort button.active{
    background:#1f65d5;
    color:white;
    border-color:#1f65d5;
  }
}


/* CARDS: выбор производителя через ABCP */
#brands{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(230px,1fr));
  gap:12px;
}

#brands button.brand-card{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:10px;
  min-height:118px;
  padding:18px;
  text-align:left;
  border:1px solid #d6deea;
  border-radius:12px;
  background:white;
  color:#172033;
  box-shadow:0 3px 12px #14213d0a;
}

#brands .brand-name{
  font-size:18px;
  font-weight:700;
}

#brands .brand-description{
  font-size:14px;
  color:#637085;
}

#brands .brand-count{
  margin-top:auto;
  font-size:13px;
  color:#1f65d5;
}

#brands button.brand-card.active{
  background:#eef5ff;
  color:#172033;
  border:2px solid #1f65d5;
}

#brands button.brand-card.active .brand-description{
  color:#425a7a;
}

#brands button.brand-card:focus-visible{
  outline:3px solid #1f65d5;
  outline-offset:2px;
}

@media(max-width:600px){
  #brands{
    grid-template-columns:1fr;
  }
  #brands button.brand-card{
    min-height:100px;
  }
}

/* Компактный выбор производителя на мобильных устройствах. */
#mobileBrandPicker{
  display:none;
}

#mobileBrandPicker[hidden]{
  display:none !important;
}

@media(max-width:768px){
  #brands{
    display:none;
  }

  #mobileBrandPicker{
    display:block;
    margin:16px 0;
  }

  #mobileBrandPicker label{
    display:block;
    margin-bottom:8px;
    font-weight:600;
    color:#172033;
  }

  #mobileBrandSelect{
    display:block;
    width:100%;
    min-height:48px;
    padding:12px;
    border:1px solid #ccd4df;
    border-radius:10px;
    background:#fff;
    color:#172033;
    font-size:16px;
    box-sizing:border-box;
  }

  #mobileBrandSelect:focus-visible{
    outline:3px solid #1f65d5;
    outline-offset:2px;
  }
}

/* Единый выбор производителя: выпадающий список на ПК. */
@media (min-width:769px) {

  #brands {
    display:none;
  }

  #mobileBrandPicker:not([hidden]) {
    display:block;
    width:100%;
    max-width:520px;
    margin:18px 0;
  }

  #mobileBrandPicker label {
    display:block;
    margin-bottom:8px;
    font-weight:600;
    color:#172033;
  }

  #mobileBrandSelect {
    display:block;
    width:100%;
    min-height:48px;
    padding:12px;
    border:1px solid #ccd4df;
    border-radius:10px;
    background:#fff;
    color:#172033;
    font-size:16px;
    box-sizing:border-box;
  }

  #mobileBrandSelect:focus-visible {
    outline:3px solid #1f65d5;
    outline-offset:2px;
  }
}
