/* =========================================================
   ShyGuitars Inventory Plugin v1.2.5
   Scope: [sg_inventory]
   ========================================================= */

.sginv,
.sginv * {
  box-sizing: border-box;
}

.sg-inventory-page #main > .ct-container-full {
  padding-top: 46px;
}

.sg-inventory-page #main article.page > .hero-section {
  margin-bottom: 28px;
}

.sginv {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 18px 20px 58px;
  color: #24211e;
}

.sginv-intro {
  max-width: 760px;
  margin: 0 0 26px;
}

.sginv-kicker {
  margin-bottom: 10px;
  color: #8a7359;
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.sginv-intro p {
  margin: 0;
  color: #6f6860;
  font-size: 16px;
  line-height: 1.85;
}

.sginv-toolbar {
  display: grid;
  grid-template-columns: max-content max-content minmax(0, 1fr);
  gap: 12px 10px;
  align-items: center;
  margin: 0 0 14px;
  padding: 12px;
  background: #fefbf6;
  border: 1px solid #d8d0c6;
  border-radius: 4px;
}

.sginv-search-wrap {
  grid-column: 1 / -1;
  min-width: 0;
}

.sginv-search {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid #d8d0c6;
  border-radius: 3px;
  background: #fff;
  color: #24211e;
  font-size: 15px;
  line-height: 1.2;
}

.sginv-search:focus {
  outline: 2px solid rgba(138, 115, 89, 0.24);
  border-color: #8a7359;
}

.sginv-filter-row,
.sginv-view-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
}

.sginv-filter-row {
  grid-column: 1;
  grid-row: 2;
  gap: 7px;
  min-width: 0;
}

.sginv-view-row {
  gap: 6px;
}

.sginv-tools-row {
  grid-column: 3;
  grid-row: 2;
  display: flex;
  flex-wrap: nowrap;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.sginv-sort {
  width: 126px;
  flex: 0 0 126px;
  min-height: 34px;
  padding: 6px 30px 6px 10px;
  border: 1px solid #d8d0c6;
  border-radius: 3px;
  background-color: #fff;
  color: #24211e;
  font-size: 13px;
  line-height: 1.2;
}

.sginv-filter,
.sginv-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #d8d0c6;
  border-radius: 999px;
  background: transparent;
  color: #24211e;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sginv-view {
  width: 34px;
  min-width: 34px;
  padding: 0;
  border-radius: 3px;
}

.sginv-view svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.sginv-filter:focus-visible,
.sginv-view:focus-visible,
.sginv-sort:focus-visible {
  outline: 2px solid rgba(138, 115, 89, 0.35);
  outline-offset: 2px;
}

.sginv-filter:hover,
.sginv-view:hover,
.sginv-filter.is-active,
.sginv-view.is-active {
  background: #24211e;
  border-color: #24211e;
  color: #f7f4ee;
}

.sginv-count-line {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  color: #6f6860;
  font-size: 13px;
  line-height: 1.5;
}

.sginv-results {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.sginv-card {
  position: relative;
  overflow: hidden;
  background: #fefbf6;
  border: 1px solid #d8d0c6;
  border-radius: 4px;
  box-shadow: 0 10px 26px rgba(36, 33, 30, 0.055);
}

.sginv-card[hidden] {
  display: none !important;
}

.sginv-card-link {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  color: inherit;
  text-decoration: none;
}

.sginv-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: #eee7dc;
}

.sginv-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center center;
  transition: transform 0.32s ease, opacity 0.32s ease, filter 0.32s ease;
}

.sginv-card:hover .sginv-thumb img {
  transform: scale(1.018);
}

.sginv-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #8a7359;
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sginv-status-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  background: #24211e;
  color: #f7f4ee;
  border-radius: 2px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.sginv-ownership-badge {
  position: absolute;
  z-index: 2;
  top: 42px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 8px;
  border: 1px solid rgba(36, 33, 30, 0.28);
  border-radius: 2px;
  background: rgba(254, 251, 246, 0.94);
  color: #5f5142;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.sginv-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 15px 15px 16px;
}

.sginv-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.48em;
  overflow-wrap: anywhere;
  margin: 0 0 7px;
  color: #24211e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.24;
  font-weight: 500;
}

.sginv-spec,
.sginv-midline {
  color: #6f6860;
  font-size: 13px;
  line-height: 1.48;
}

.sginv-spec {
  min-height: 1.48em;
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sginv-midline {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 20px;
  overflow-wrap: anywhere;
}

.sginv-dot {
  margin: 0 4px;
}

.sginv-bottomline {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(216, 208, 198, 0.75);
}

.sginv-price {
  color: #24211e;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 680;
}

.sginv-cta {
  color: #8a7359;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.sginv-status-available .sginv-status-badge {
  background: #24211e;
  color: #f7f4ee;
}

.sginv-status-hold .sginv-status-badge {
  background: #8a7359;
  color: #f7f4ee;
}

.sginv-status-hold .sginv-price {
  color: #8a7359;
}

.sginv-status-sold .sginv-status-badge {
  background: #6f6860;
  color: #f7f4ee;
}

.sginv-status-sold .sginv-thumb img {
  opacity: 0.68;
  filter: saturate(0.55);
}

.sginv-status-sold .sginv-price {
  color: #6f6860;
}

.sginv-status-archive .sginv-status-badge {
  background: #f7f4ee;
  color: #24211e;
  border: 1px solid #d8d0c6;
}

.sginv-status-archive .sginv-price {
  color: #6f6860;
  font-weight: 520;
}

.sginv-empty {
  margin-top: 20px;
  padding: 18px;
  background: #fefbf6;
  border: 1px solid #d8d0c6;
  color: #6f6860;
  text-align: center;
}

@media (min-width: 701px) {
  .sginv[data-view="list"] .sginv-results {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sginv[data-view="list"] .sginv-card-link {
    grid-template-columns: 180px minmax(0, 1fr);
    grid-template-rows: none;
  }

  .sginv[data-view="list"] .sginv-thumb {
    width: 180px;
  }

  .sginv[data-view="list"] .sginv-body {
    min-height: 180px;
  }

  .sginv[data-view="list"] .sginv-bottomline {
    margin-top: auto;
  }
}

@media (max-width: 1024px) {
  .sginv-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  .sg-inventory-page #main > .ct-container-full {
    padding-top: 36px;
  }

  .sg-inventory-page #main article.page > .hero-section {
    margin-bottom: 28px;
  }

  .sginv {
    padding: 14px 18px 44px;
  }

  .sginv-intro {
    margin-bottom: 20px;
  }

  .sginv-intro p {
    font-size: 15px;
    line-height: 1.75;
  }

  .sginv-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px 8px;
    margin-bottom: 11px;
    padding: 10px;
  }

  .sginv-search {
    min-height: 40px;
    font-size: 16px;
  }

  .sginv-filter-row {
    grid-column: 1 / -1;
    grid-row: 2;
    overflow-x: auto;
    flex-wrap: nowrap;
    gap: 6px;
    padding-bottom: 0;
    -webkit-overflow-scrolling: touch;
  }

  .sginv-filter,
  .sginv-view {
    flex: 0 0 auto;
    min-height: 32px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .sginv-view {
    min-width: 32px;
    width: 32px;
    padding: 0;
  }

  .sginv-tools-row {
    grid-column: 2;
    grid-row: 3;
    gap: 6px;
  }

  .sginv-sort {
    width: 116px;
    flex-basis: 116px;
    min-height: 32px;
    padding-top: 5px;
    padding-bottom: 5px;
    font-size: 12px;
  }

  .sginv-count-line {
    grid-column: 1;
    grid-row: 3;
    margin: 0;
    font-size: 12px;
  }

  /* 手机默认：Reverb / Digimart 接近的一列紧凑列表 */
  .sginv[data-view="list"] .sginv-results {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #d8d0c6;
  }

  .sginv[data-view="list"] .sginv-card {
    border: 0;
    border-bottom: 1px solid #d8d0c6;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
  }

  .sginv[data-view="list"] .sginv-card-link {
    display: grid;
    grid-template-columns: 104px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    min-height: 0;
    padding: 8px 0;
  }

  .sginv[data-view="list"] .sginv-thumb {
    width: 104px;
    aspect-ratio: 1 / 1;
    border: 1px solid #d8d0c6;
    border-radius: 3px;
    background: #fefbf6;
  }

  .sginv[data-view="list"] .sginv-status-badge {
    top: 6px;
    left: 6px;
    min-height: 21px;
    padding: 3px 6px;
    font-size: 10px;
  }

  .sginv[data-view="list"] .sginv-ownership-badge {
    top: 31px;
    left: 6px;
    min-height: 19px;
    padding: 2px 5px;
    font-size: 9px;
  }

  .sginv[data-view="list"] .sginv-body {
    display: grid;
    grid-template-rows: 38.5px 17px 17px minmax(19.8px, 1fr);
    row-gap: 2px;
    height: 104px;
    padding: 0;
  }

  .sginv[data-view="list"] .sginv-title {
    min-height: 2.48em;
    margin: 0;
    font-size: 15.5px;
    line-height: 1.24;
    -webkit-line-clamp: 2;
  }

  .sginv[data-view="list"] .sginv-spec,
  .sginv[data-view="list"] .sginv-midline {
    min-height: 1.42em;
    margin: 0;
    font-size: 12px;
    line-height: 1.42;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .sginv[data-view="list"] .sginv-midline {
    display: block;
    -webkit-line-clamp: 1;
  }

  .sginv[data-view="list"] .sginv-bottomline {
    align-items: center;
    align-self: end;
    margin: 0;
    padding-top: 0;
    border-top: 0;
  }

  .sginv[data-view="list"] .sginv-price {
    font-size: 16.5px;
  }

  .sginv[data-view="list"] .sginv-cta {
    display: none;
  }

  /* 手机双列：接近闲鱼的两列预览 */
  .sginv[data-view="grid"] .sginv-results {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .sginv[data-view="grid"] .sginv-card {
    border-radius: 4px;
  }

  .sginv[data-view="grid"] .sginv-body {
    padding: 10px 10px 11px;
  }

  .sginv[data-view="grid"] .sginv-title {
    font-size: 14.5px;
    line-height: 1.25;
    min-height: 2.5em;
  }

  .sginv[data-view="grid"] .sginv-spec,
  .sginv[data-view="grid"] .sginv-midline {
    font-size: 11.5px;
  }

  .sginv[data-view="grid"] .sginv-midline {
    -webkit-line-clamp: 2;
    min-height: 2.96em;
  }

  .sginv[data-view="grid"] .sginv-bottomline {
    display: block;
    margin-top: 8px;
    padding-top: 8px;
  }

  .sginv[data-view="grid"] .sginv-price {
    display: block;
    margin-bottom: 3px;
    font-size: 15.5px;
  }

  .sginv[data-view="grid"] .sginv-cta {
    display: none;
  }
}

@media (max-width: 390px) {
  .sginv {
    padding-left: 16px;
    padding-right: 16px;
  }

  .sginv[data-view="list"] .sginv-card-link {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 11px;
  }

  .sginv[data-view="list"] .sginv-thumb {
    width: 96px;
  }

  .sginv[data-view="list"] .sginv-title {
    font-size: 15px;
  }

  .sginv[data-view="list"] .sginv-body {
    grid-template-rows: 37.2px 17px 17px minmax(19.8px, 1fr);
    height: 96px;
    row-gap: 1px;
  }
}


/* =========================================================
   ShyGuitars Detail Page Listing Status Bar
   Scope: [sg_inventory_status]
   ========================================================= */

.sginv-statusbar,
.sginv-statusbar * {
  box-sizing: border-box;
}

.sginv-statusbar {
  margin: 22px auto 34px;
  padding: 0;
  color: #24211e;
}

.sginv-statusbar-card {
  display: grid;
  grid-template-columns: minmax(118px, auto) minmax(0, 1fr) auto;
  gap: 18px 28px;
  align-items: center;
  padding: 15px 18px;
  background: #fefbf6;
  border: 1px solid #d8d0c6;
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(36, 33, 30, 0.045);
}

.sginv-statusbar-head {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 112px;
}

.sginv-statusbar-badges {
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.sginv-statusbar-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  background: #24211e;
  color: #f7f4ee;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.sginv-statusbar-ownership {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 28px;
  padding: 5px 8px;
  background: #f7f4ee;
  color: #6f5b46;
  border: 1px solid #d8d0c6;
  border-radius: 2px;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.sginv-statusbar-kicker {
  color: #8a7359;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.sginv-statusbar-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 22px;
  align-items: center;
}

.sginv-statusbar-fact {
  min-width: 0;
}

.sginv-statusbar-label {
  margin-bottom: 4px;
  color: #6f6860;
  font-size: 12px;
  line-height: 1.35;
}

.sginv-statusbar-value {
  overflow-wrap: anywhere;
  color: #24211e;
  font-size: 16px;
  line-height: 1.38;
  font-weight: 650;
}

.sginv-statusbar-actions {
  display: flex;
  flex-direction: column;
  gap: 7px;
  align-items: stretch;
  justify-content: center;
  min-width: 116px;
  white-space: nowrap;
}

.sginv-statusbar-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 9px 13px;
  border: 1px solid #24211e;
  border-radius: 2px;
  color: #24211e;
  background: transparent;
  font-size: 13px;
  line-height: 1;
  text-decoration: none;
}

.sginv-statusbar-button:hover {
  background: #24211e;
  color: #f7f4ee;
}

.sginv-statusbar-button.is-primary {
  background: #24211e;
  color: #f7f4ee;
}

.sginv-statusbar-button.is-primary:hover {
  background: #8a7359;
  border-color: #8a7359;
  color: #f7f4ee;
}

.sginv-statusbar-link {
  color: #8a7359;
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
  text-decoration: none;
}

.sginv-statusbar-link:hover {
  color: #6f5b46;
  text-decoration: underline;
}

.sginv-statusbar-hold .sginv-statusbar-badge {
  background: #8a7359;
}

.sginv-statusbar-sold .sginv-statusbar-badge {
  background: #6f6860;
}

.sginv-statusbar-archive .sginv-statusbar-badge {
  background: #f7f4ee;
  color: #24211e;
  border: 1px solid #d8d0c6;
}

.sginv-statusbar-archive .sginv-statusbar-value,
.sginv-statusbar-sold .sginv-statusbar-value {
  color: #6f6860;
}

.sginv-statusbar-missing {
  padding: 12px 16px;
  background: #fff7e6;
  border: 1px solid #e0c48d;
  border-radius: 4px;
  color: #4d3923;
}

/* Product-page composition. Legacy shortcode layout remains unchanged. */
@media (min-width: 801px) {
  .sginv-statusbar-layout-product {
    width: 100%;
    margin: 0;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: stretch;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-head {
    gap: 8px;
    padding: 17px 0 0;
    border-top: 1px solid #d8d0c6;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-facts {
    width: 100%;
    padding: 18px 0;
    border-bottom: 1px solid #d8d0c6;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-actions {
    width: 100%;
    min-width: 0;
    margin-top: 18px;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-button {
    width: 100%;
    min-height: 44px;
  }

  .sginv-statusbar-layout-product .sginv-statusbar-fact--price .sginv-statusbar-value {
    font-family: Arial, "Microsoft YaHei", sans-serif;
    font-size: 19px;
    font-variant-numeric: tabular-nums;
    font-weight: 600;
  }
}

@media (max-width: 800px) {
  .sginv-statusbar-card {
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 10px 16px;
    align-items: start;
  }

  .sginv-statusbar-head {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
  }

  .sginv-statusbar-facts {
    grid-column: 1 / -1;
    grid-row: 2;
    grid-template-columns: minmax(0, 1fr) 124px;
    gap: 9px 16px;
    align-items: end;
  }

  .sginv-statusbar-actions {
    grid-column: 2;
    grid-row: 1;
    align-self: start;
    width: 124px;
    min-width: 0;
    max-width: none;
  }

  .sginv-statusbar-button {
    min-height: 40px;
    padding: 9px 12px;
  }
}

@media (max-width: 700px) {
  .sginv-statusbar {
    width: 100%;
    max-width: none;
    margin: 18px 0 28px;
  }

  .sginv-statusbar-card {
    padding: 14px;
  }

  .sginv-statusbar-layout-product {
    margin-top: 0;
  }

  .sginv-statusbar-badge,
  .sginv-statusbar-ownership {
    padding-right: 8px;
    padding-left: 8px;
  }

  .sginv-statusbar-fact--price .sginv-statusbar-value {
    font-size: 22px;
    line-height: 1.2;
  }

  .sginv-statusbar-fact--condition .sginv-statusbar-value {
    font-size: 16px;
  }
}

@media (max-width: 390px) {
  .sginv-statusbar-card {
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 9px 11px;
    padding: 13px;
  }

  .sginv-statusbar-facts {
    grid-template-columns: minmax(0, 1fr) 116px;
    gap: 9px 11px;
  }

  .sginv-statusbar-actions {
    width: 116px;
    min-width: 0;
  }

  .sginv-statusbar-button {
    font-size: 12.5px;
    padding-left: 9px;
    padding-right: 9px;
  }
}

/* =========================================================
   ShyGuitars Related SG Records
   Scope: [sg_related_records]
   ========================================================= */

.sginv-related,
.sginv-related * {
  box-sizing: border-box;
}

.sginv-related {
  --sginv-statusbar-max: 1010px;
  --sginv-statusbar-edge: 5vw;
  width: min(calc(100% - var(--sginv-statusbar-edge) - var(--sginv-statusbar-edge)), var(--sginv-statusbar-max));
  max-width: var(--sginv-statusbar-max);
  margin: 0 auto 34px;
  color: #24211e;
}

.sginv-related-details {
  background: #fefbf6;
  border: 1px solid #d8d0c6;
  border-radius: 4px;
  box-shadow: 0 8px 22px rgba(36, 33, 30, 0.035);
}

.sginv-related-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 18px;
  cursor: pointer;
  list-style: none;
}

.sginv-related-summary::-webkit-details-marker {
  display: none;
}

.sginv-related-summary::after {
  content: "+";
  color: #8a7359;
  font-size: 22px;
  line-height: 1;
}

.sginv-related-details[open] .sginv-related-summary::after {
  content: "–";
}

.sginv-related-kicker {
  display: block;
  margin-bottom: 4px;
  color: #8a7359;
  font-size: 10px;
  line-height: 1.3;
  letter-spacing: 0.14em;
}

.sginv-related-title {
  display: block;
  color: #24211e;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  line-height: 1.25;
  font-weight: 500;
}

.sginv-related-count {
  margin-left: auto;
  color: #6f6860;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
}

.sginv-related-body {
  padding: 0 18px 17px;
  border-top: 1px solid rgba(216, 208, 198, 0.72);
}

.sginv-related-list {
  margin: 13px 0 0;
  padding-left: 18px;
  color: #3a3530;
  font-size: 14px;
  line-height: 1.7;
}

.sginv-related-empty {
  margin: 13px 0 0;
  color: #6f6860;
  font-size: 14px;
  line-height: 1.7;
}

@media (max-width: 700px) {
  .sginv-related {
    margin-bottom: 28px;
  }

  .sginv-related-summary {
    padding: 14px;
  }

  .sginv-related-title {
    font-size: 18px;
  }

  .sginv-related-body {
    padding: 0 14px 15px;
  }
}
