/* ---------------------------------------
   Shared Swatch Pages
--------------------------------------- */

.swatch-page {
  padding: 10px;
}

.swatch-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 18px;
  align-items: start;
  padding-top: 40px;
}

.swatch-layout--full {
  grid-template-columns: 1fr;
}

.swatch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 14px;
}

.swatch-card {
  border: 1px solid #eee;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}

.swatch-link {
  display: grid;
  text-decoration: none;
  color: inherit;
}

.swatch-img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  display: block;
}

.swatch-cap {
  padding: 10px 12px 12px;
  text-align: center;
}

.swatch-name {
  font-size: 14px;
}

.swatch-modal[hidden] {
  display: none;
}

.swatch-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
}

.swatch-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
}

.swatch-modal__panel {
  position: relative;
  margin: 4vh auto;
  width: min(920px, 92vw);
  max-height: 92vh;
  overflow: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  padding: 12px 16px 16px;
}

.swatch-modal__header {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
  margin-bottom: 12px;
}

.swatch-modal__title {
  margin: 0;
  text-align: center;
  font-size: 22px;
  line-height: 1.2;
}

.swatch-modal__close {
  border: 0;
  background: #f2f2f2;
  border-radius: 10px;
  width: 38px;
  height: 38px;
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.swatch-modal__img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
}

@media (max-width: 900px) {
  .swatch-layout {
    grid-template-columns: 1fr;
  }

  .tc__media {
    display: none;
  }
}

html.swatch-modal-open,
html.swatch-modal-open body {
  overflow: hidden;
}
