/* Slab inventory tab (partials/product/inventory-tab.php) */

.slab-inventory {
  text-align: left;
  padding: 10px 0 40px;
}

.slab-inventory-summary {
  color: #353535;
  font-size: 15px;
  line-height: 1.6;
  margin: 0 0 24px;
}

.slab-inventory-updated {
  display: block;
  color: #717171;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-top: 6px;
}

/* Location sections */

.slab-location {
  border-top: 1px solid #c7c7c7;
}

.slab-location:last-of-type {
  border-bottom: 1px solid #c7c7c7;
}

.slab-location summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}

.slab-location summary::-webkit-details-marker {
  display: none;
}

.slab-location summary:hover .slab-location-name,
.slab-location summary:focus-visible .slab-location-name {
  color: #b90210;
}

.slab-location summary:focus-visible {
  outline: 2px solid #b90210;
  outline-offset: 2px;
}

.slab-location-name {
  flex: 0 0 auto;
  color: #000;
  font-size: 18px;
  font-weight: 600;
  transition: color 0.15s ease;
}

/* The location picked in the shop filter, listed first */
.slab-location-picked {
  display: inline-block;
  margin-left: 10px;
  padding: 4px 7px 3px;
  border: 1px solid currentColor;
  color: #b90210;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: 3px;
}

.slab-location-meta {
  flex: 1 1 auto;
  color: #717171;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.slab-location-meta .sep {
  color: #c7c7c7;
  margin: 0 8px;
}

.slab-location-toggle {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-right: 2px solid #353535;
  border-bottom: 2px solid #353535;
  transform: rotate(45deg) translate(-3px, -3px);
  transition: transform 0.2s ease;
}

.slab-location[open] .slab-location-toggle {
  transform: rotate(-135deg) translate(-3px, -3px);
}

.slab-location-body {
  padding: 4px 0 28px;
}

/* Slab table */

.slab-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.slab-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #353535;
  font-variant-numeric: tabular-nums;
}

.slab-table th {
  color: #717171;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  text-align: left;
  padding: 10px;
  background: #f7f7f7;
  border-bottom: 1px solid #e9ecef;
}

.slab-table td {
  padding: 12px 10px;
  border-bottom: 1px solid #e9ecef;
  white-space: nowrap;
  vertical-align: middle;
}

.slab-table tbody tr:hover {
  background: #fafafa;
}

.slab-table .num {
  text-align: right;
}

.slab-table .center {
  text-align: center;
}

.slab-table .serial {
  color: #000;
  font-weight: 600;
}

.slab-table .seq {
  color: #717171;
}

.slab-table tr.slab-block-total td {
  color: #000;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #f7f7f7;
  border-bottom: 1px solid #c7c7c7;
}

.slab-table tr.slab-block-total td.num {
  font-size: 14px;
  letter-spacing: 0;
}

.slab-table tbody tr.slab-block-total:hover {
  background: none;
}

.slab-status {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 2px;
}

.slab-status-instock {
  color: #3f5a41;
  background: #e8efe8;
}

.slab-status-onhold {
  color: #856404;
  background: #fff3cd;
}

/* Photo column: the slab's own photo, else its bundle's shared photo, labeled. */

.slab-table td.photo-cell {
  padding-top: 6px;
  padding-bottom: 6px;
}

.slab-photo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #353535;
  text-decoration: none;
}

.slab-photo img {
  display: block;
  width: 48px;
  height: 36px;
  object-fit: cover;
  background: #f7f7f7;
  border: 1px solid #e9ecef;
  transition: border-color 0.15s ease;
}

.slab-photo-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: 1.3;
  text-transform: uppercase;
  white-space: normal;
  max-width: 104px;
}

.slab-photo.is-shared .slab-photo-label,
.slab-photo-inline.is-shared {
  color: #717171;
}

/* "12 photos" under the label when SPS has more than one */
.slab-photo-count {
  display: block;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: #717171;
}

.slab-photo:hover,
.slab-photo:focus-visible,
.slab-photo:hover .slab-photo-label,
.slab-photo:focus-visible .slab-photo-label {
  color: #b90210;
  text-decoration: none;
}

.slab-photo:hover img,
.slab-photo:focus-visible img {
  border-color: #b90210;
}

.slab-no-photo {
  color: #c7c7c7;
}

/* Photo URL that doesn't load: drop the link, show the dash. */
.slab-photo-missing .slab-photo,
.slab-photo-missing .slab-photo-inline {
  display: none;
}

.slab-photo-missing .photo-cell::after {
  content: "\2013";
  color: #c7c7c7;
}

.slab-photo-inline {
  display: none;
}

@media (max-width: 575.98px) {
  .slab-location summary {
    flex-wrap: wrap;
    gap: 4px 12px;
  }

  .slab-location-name {
    flex-basis: calc(100% - 30px);
  }

  .slab-location-toggle {
    order: 2;
  }

  .slab-location-meta {
    order: 3;
    flex-basis: 100%;
  }

  .slab-table {
    font-size: 13px;
  }

  .slab-table th,
  .slab-table td {
    padding: 10px 6px;
  }

  /* Thickness is in the product info above; the block is rarely mixed. */
  .slab-table .hide-sm {
    display: none;
  }

  .slab-status {
    font-size: 12px;
    letter-spacing: 0;
    text-transform: none;
    padding: 0;
    background: none;
  }

  /* The Photo column is hidden here; the photo link sits under the serial. */
  .slab-photo-inline {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    min-width: 92px;
    color: #353535;
    font-size: 10px;
    font-weight: 400;
    line-height: 1.3;
    white-space: normal;
    text-decoration: none;
  }

  .slab-photo-inline svg {
    flex: 0 0 auto;
  }

  .slab-photo-inline:hover,
  .slab-photo-inline:focus-visible {
    color: #b90210;
    text-decoration: none;
  }
}
