.locations-app {
  width: 100%;
  max-width: 980px;
  background: #fff;
  border-radius: 8px;
  padding: 24px;
  box-sizing: border-box;
  margin: 0 auto;
}

.locations-app * {
  box-sizing: border-box;
}

#locations .info {
  @media (max-width: 768px) {
    width: calc(95% - 16%);
    padding: 8%;
    background-color: #c2dcef;
  }
}

.locations-app h2 {
  color: #04677d;
  font-size: 28px;
  line-height: 1.25;
  margin-bottom: 18px;
  text-align: center;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.locations-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 16px;
}

.locations-field--city {
  flex: 0 0 200px;
}

/* .locations-field--keyword {
  flex: 1 1 260px;
} */

.locations-field select {
  width: 100%;
  min-height: 44px;
  border: 1px solid #b7c9ce;
  border-radius: 8px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2304677d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 16px;
  color: #757575;
  font-size: 16px;
  padding: 8px 40px 8px 16px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.locations-search-group {
  display: flex;
  align-items: stretch;
  border: 1px solid #b7c9ce;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.locations-search-group input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: #1a1a1a;
  font-size: 16px;
  padding: 0 16px;
}

.locations-search-group input:focus {
  outline: none;
}

.locations-search {
  flex: 0 0 auto;
  min-height: 44px;
  border: 0;
  border-left: 1px solid #b7c9ce;
  background: #1f6fb2;
  color: #fff;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 0 24px;
}

.locations-search:hover {
  background: #185a91;
}

.locations-status {
  /* 客戶要求暫時隱藏「共 N 個符合條件」提示，功能保留，日後要恢復顯示移除此行即可 */
  display: none;
  min-height: 24px;
  color: #04677d;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 12px;
}

.locations-status.is-error {
  color: #bf2624;
}

.locations-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid #d7e3e6;
  background-color: #fff;
}

.locations-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
}

.locations-table thead th {
  background: #4a7ba6;
  border-top: 1px solid #CEE0EC;
  border-right: 1px solid #CEE0EC;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
  padding: 12px 16px;
  text-align: center;
}

.locations-table thead th:last-child,
.locations-table tbody td:last-child {
  text-align: center;
}

.locations-table tbody td {
  width: calc(100% - 2rem);
  text-align: center;
  border-top: 1px solid #CEE0EC;
  border-right: 1px solid #CEE0EC;
  color: #1a1a1a;
  font-size: 15px;
  line-height: 1.5;
  padding: 12px 1rem;
  vertical-align: middle;
  word-break: break-word;
}

.locations-table tbody tr:first-child td {
  border-top: 0;
}

.locations-table tbody a {
  color: inherit;
  text-decoration: none;
}

.locations-empty-row td {
  text-align: center;
  color: #58666a;
  padding: 24px 16px;
}

.locations-pagination {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
}

.locations-page-btn {
  width: 2vw;
  height: 2vw;
  min-width: 36px;
  min-height: 36px;
  border: 1px solid #d7e3e6;
  border-radius: 8px;
  background: #fff;
  color: #1a1a1a;
  font-size: 15px;
  cursor: pointer;
}
.locations-page-btn:not(:last-of-type) {
  margin-right: 6px;
}

.locations-page-btn:hover:not(:disabled) {
  background: #eef5f7;
  color: #1a1a1a;
}

.locations-page-btn.is-current {
  background: #6498c9;
  border-color: #6498c9;
  color: #fff;
  cursor: default;
}

.locations-page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.location-map-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-left: 4px;
  background: #fff;
  vertical-align: middle;
  text-decoration: none;
}

.location-map-btn:hover {
  background: #fdf0ef;
}

.location-map-btn img {
  width: 20px;
  height: auto;
}

.location-map-btn__label {
  display: none;
}

@media only screen and (max-width: 768px) {
  .locations-app {
    padding: 16px;
  }

  .locations-app h2 {
    font-size: 22px;
  }

  .locations-filters {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .locations-field--city,
  .locations-field--keyword {
    flex: 1 1 auto;
    max-width: 100%;
  }

  .locations-table-wrap {
    overflow-x: visible;
    border: 0;
    background-color: unset;
    border-radius: 10px;
  }

  .locations-table {
    min-width: 0;
  }

  .locations-table thead {
    display: none;
  }

  .locations-table,
  .locations-table tbody,
  .locations-table tr,
  .locations-table td {
    display: block;
    width: 100%;
  }

  .locations-table tbody tr {
    margin-bottom: 16px;
    border: 1px solid #CEE0EC;
    border-radius: 0px;
    overflow: hidden;
    background-color: #fff;
  }

  .locations-table tbody tr:last-child {
    margin-bottom: 0;
  }

  .locations-table tbody td {
    border-top: 0;
    /* padding: 12px 16px; */
    padding: 0;
    width: 100%;
    text-align: left;
  }
  .locations-table tbody td::before,span {
    padding: 0.5rem;
    display: flex;
    align-items: center;
  }
  .locations-table tbody td::before {
    justify-content: center;
  }

  .locations-table tbody tr:not(.locations-empty-row) td:first-child {
    background: #6498c9;
    text-align: center;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    padding: 0.5rem;
  }
  .location-map-btn__label {
    padding: 0;
  }

  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(2),
  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(3) {
    display: flex;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #CEE0EC;
  }

  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(2)::before,
  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(3)::before {
    flex: 0 0 56px;
    color: #58666a;
    font-weight: 700;
  }

  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(2) > span,
  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(3) > a {
    flex: 1 1 auto;
    align-self: center;
    min-width: 0;
    padding-left: 12px;
    border-left: 1px solid #CEE0EC;
  }

  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(2)::before {
    content: '地址';
  }

  .locations-table tbody tr:not(.locations-empty-row) td:nth-child(3)::before {
    content: '電話';
  }

  .locations-table tbody tr:not(.locations-empty-row) td:last-child {
    text-align: center;
    border-top: 1px solid #CEE0EC;
    background: #f8fbfc;
    padding: 0.25rem 0;
    width: 100%;
  }

  .location-map-btn {
    width: auto;
    height: auto;
    margin-left: 0;
    padding: 8px 16px;
  }

  .location-map-btn__label {
    display: inline-block;
    margin-left: 8px;
    color: #58666a;
    font-weight: 700;
  }
}
