.brand-product-grid > [class*="col-"] {
  display: flex;
}
.brand-product-grid > [class*="col-"] > .product-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
}
.brand-product-grid .product-list > .product-items {
  flex-shrink: 0;
}
.brand-product-grid .product-list > .product-details {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.brand-product-grid .product-details > .rowProduct-btns,
.brand-product-grid .product-details > .product-button {
  margin-top: auto;
  margin-bottom: 0;
}
.brand-product-grid .rowProduct-btns .product-button,
.brand-product-grid .product-button > .btn {
  margin-bottom: 0;
}
@media (min-width: 576px) {
  .brand-product-grid > [class*="col-"] {
    display: flex;
  }
  .brand-product-grid > [class*="col-"] > .product-list {
    width: 100%;
    height: 100%;
  }
  .brand-product-grid .brand-substitute-card,
  .brand-product-grid .brand-substitute-card .product-details,
  .brand-product-grid .brand-substitute-card .substitute-panel {
    display: flex;
    flex-direction: column;
  }
  .brand-product-grid .brand-substitute-card .product-items {
    flex-shrink: 0;
  }
  .brand-product-grid .brand-substitute-card .product-details,
  .brand-product-grid .brand-substitute-card .substitute-panel {
    flex: 1;
  }
  .brand-product-grid .brand-substitute-card .substitute-panel {
    gap: 9px;
  }
  .brand-product-grid .brand-substitute-card .substitute-summary {
    flex: 1;
  }
  .brand-product-grid .brand-substitute-card .substitute-view {
    margin-top: auto;
  }
}
.brand-substitute-card .substitute-status {
  background: #F82643;
  color: #ffffff;
}
.brand-substitute-card .product-items {
  /* height: 190px; */
  padding-top: 30px;
}
/* .brand-substitute-card .product-items img {
  width: 160px !important;
  max-height: 150px;
  object-fit: contain;
} */
.brand-substitute-card .substitute-summary {
  margin-top: 8px;
  padding: 8px;
  background: #fff4df;
  border-radius: 5px;
}
.brand-substitute-card .substitute-summary {
  font-size: 14px;
}
.brand-substitute-card .substitute-summary h6 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 600;
}
.brand-substitute-card .substitute-summary h6 i {
  color: #c77700;
  font-size: 16px;
}
.brand-substitute-card .substitute-preview {
  display: flex;
  align-items: center;
  gap: 10px;
}
.brand-substitute-card .substitute-preview img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  background: white;
  border-radius: 4px;
}
.brand-substitute-card .substitute-preview a,
.brand-substitute-card .substitute-keep {
  color: #006bff;
  font-size: 14px;
}
.brand-substitute-card .substitute-summary p {
  margin: 0;
  color: #6c6c6c;
  font-size: 13px;
  line-height: 20px;
}
.brand-substitute-card .substitute-summary .substitute-note {
  margin-top: 5px;
}
.brand-substitute-card .substitute-view {
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  gap: 16px;
  width: 100%;
  margin-top: 9px;
  margin-bottom: 0px;
  height: 35px;
}
.brand-substitute-card .substitute-keep {
  display: block;
  margin-top: 9px;
  text-align: center;
  text-decoration: underline;
}
.brand-substitute-card .substitute-toggle,
.brand-substitute-card .substitute-pending,
.brand-substitute-card .substitute-close {
  display: none;
}

@media not all and (min-width: 576px) {
  .brand-substitute-card {
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  .brand-substitute-card .product-items {
    flex-shrink: 0;
  }
  .brand-substitute-card .product-details {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .brand-substitute-card .substitute-toggle {
    display: block;
    padding: 8px 0;
    border: 0;
    background: transparent;
    color: #006bff;
    font-size: 13px;
    line-height: 20px;
    text-align: left;
    text-decoration: underline;
    cursor: pointer;
  }
  .brand-substitute-card .substitute-panel {
    position: absolute;
    inset: auto 0 0;
    z-index: 5;
    max-height: 100%;
    overflow-y: auto;
    padding: 36px 5px 12px;
    background: #fff4df;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -4px 16px #0000001f;
    visibility: hidden;
    transform: translateY(100%);
    transition: transform 300ms ease, visibility 300ms;
  }
  .brand-substitute-card .substitute-pending {
    display: block;
    position: relative;
    margin-top: auto;
    padding-top: 9px;
  }
  .brand-substitute-card .substitute-disabled {
    width: 100%;
    min-height: 35px;
    padding: 7px 4px;
    border: 0;
    border-radius: 5px;
    background: #f0f0f2;
    color: #626262;
    font-size: 14px;
    font-weight: 600;
    cursor: help;
  }
  .brand-substitute-card .substitute-hint {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    right: 0;
    z-index: 6;
    padding: 8px;
    border-radius: 5px;
    background: #333;
    color: #fff;
    font-size: 12px;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 2px 8px #00000026;
  }
  .brand-substitute-card .substitute-hint::after {
    content: '';
    position: absolute;
    top: 100%;
    left: calc(50% - 5px);
    border: 5px solid transparent;
    border-top-color: #333;
  }
  .brand-substitute-card.is-substitute-open .substitute-panel {
    visibility: visible;
    transform: translateY(0);
  }
  .brand-substitute-card .substitute-close {
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 2px;
    right: 4px;
    width: 36px;
    height: 36px;
    border: 0;
    background: transparent;
    color: #333;
    font-size: 26px;
    cursor: pointer;
  }
  .brand-substitute-card .substitute-summary {
    margin-top: 0;
    padding: 0;
    text-align: center;
  }
  .brand-substitute-card .substitute-summary h6 {
    justify-content: center;
    gap: 5px;
    font-size: clamp(10px, 3vw, 13px);
    white-space: wrap;
    padding: 0px 10px;
    display: flex;
    text-align: left;
  }
  .brand-substitute-card .substitute-summary h6 i {
    flex-shrink: 0;
    font-size: 15px;
  }
  .brand-substitute-card .substitute-view {
    height: auto;
    min-height: 35px;
    gap: 8px;
  }
  .brand-substitute-card .substitute-view i {
    display: none;
  }
  .brand-substitute-card .substitute-preview {
    flex-direction: column;
    align-items: center;
    gap: 8px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .brand-substitute-card .substitute-panel {
    transition: none;
  }
}
