.teskay-models-grid {
  background: rgb(var(--color-background));
  color: rgb(var(--color-text));
  overflow: hidden;
}

.teskay-models-container {
  padding-top: 58px;
  padding-bottom: 58px;
}

.teskay-models-header {
  max-width: 760px;
  margin: 0 auto 38px;
}

.teskay-models-header.text-left { margin-left: 0; text-align: left; }
.teskay-models-header.text-center { text-align: center; }
.teskay-models-header.text-right { margin-right: 0; text-align: right; }

.teskay-models-heading {
  margin: 0;
  font-size: clamp(34px, 4.2vw, 54px);
  line-height: 1.05;
  letter-spacing: -0.045em;
  font-weight: 800;
  color: #171717;
}

.teskay-models-heading p,
.teskay-models-heading h2 { margin: 0; }
.teskay-models-heading strong { font-weight: 800; color: #0068bf; }

.teskay-models-description {
  margin-top: 18px;
  color: #666666;
  font-size: clamp(16px, 1.6vw, 22px);
  line-height: 1.55;
  font-weight: 400;
}

.teskay-models-description p { margin: 0; }

.teskay-models-grid-wrapper {
  display: grid;
  grid-template-columns: repeat(var(--desktop-columns), minmax(0, 1fr));
  gap: 26px;
}

.teskay-model-item,
.teskay-model-link,
.teskay-model-info,
.teskay-model-name,
.teskay-model-count {
  box-sizing: border-box;
}

.teskay-model-item {
  min-width: 0;
}

.teskay-model-link {
  display: block;
  width: 100%;
  color: inherit;
  text-decoration: none;
}

.teskay-model-image-wrapper {
  position: relative;
  overflow: hidden;
  width: 100%;
  height: clamp(150px, 15vw, 220px);
  min-height: 140px;
  border-radius: 10px;
  background: #f7f7f7;
  box-shadow: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.teskay-model-image-wrapper img,
.teskay-model-image-wrapper svg,
.teskay-model-image {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  display: block;
  object-fit: contain;
  object-position: center center;
  padding: 12px;
  box-sizing: border-box;
  transition: transform 0.35s ease;
}

.teskay-model-link:hover .teskay-model-image { transform: scale(1.04); }

.teskay-model-info {
  padding-top: 22px;
  text-align: center;
}

.teskay-model-name {
  margin: 0;
  font-size: clamp(18px, 1.75vw, 26px);
  line-height: 1.22;
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #222222;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.teskay-model-count {
  margin: 12px 0 0;
  color: #777777;
  font-size: clamp(14px, 1.25vw, 19px);
  line-height: 1.3;
  font-weight: 400;
  word-break: normal;
  overflow-wrap: normal;
  hyphens: none;
}

.teskay-models-scroll-indicator { display: none; }

/* Use a wider breakpoint because some Fashion/SHOPLINE mobile previews still report a viewport close to 980px. */
@media (max-width: 1200px), (max-device-width: 540px) {
  .teskay-models-container {
    padding-top: 34px;
    padding-bottom: 62px;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .teskay-models-header {
    max-width: 460px;
    margin-bottom: 42px;
    padding: 0;
  }

  .teskay-models-heading {
    font-size: clamp(34px, 8.7vw, 44px);
    line-height: 1.05;
    letter-spacing: -0.05em;
  }

  .teskay-models-description {
    margin-top: 22px;
    font-size: clamp(17px, 4vw, 22px);
    line-height: 1.55;
  }

  .teskay-models-grid-wrapper {
    display: grid !important;
    grid-template-columns: none !important;
    grid-auto-flow: column !important;
    grid-auto-columns: calc((100% - 18px) / 2) !important;
    gap: 18px !important;
    width: 100% !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    padding: 0 0 8px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .teskay-models-grid-wrapper::-webkit-scrollbar { display: none; }

  .teskay-model-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    scroll-snap-align: start;
  }

  .teskay-model-image-wrapper {
    width: 100% !important;
    height: clamp(135px, 28vw, 180px) !important;
    min-height: 125px !important;
    border-radius: 8px;
    background: #f7f7f7;
  }

  .teskay-model-image-wrapper img,
  .teskay-model-image-wrapper svg,
  .teskay-model-image {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    padding: 10px !important;
    box-sizing: border-box !important;
  }

  .teskay-model-info {
    padding-top: 22px;
  }

  .teskay-model-name {
    font-size: clamp(22px, 5.6vw, 27px);
    line-height: 1.18;
    font-weight: 800;
  }

  .teskay-model-count {
    margin-top: 14px;
    font-size: clamp(16px, 4vw, 19px);
    line-height: 1.3;
  }

  .teskay-models-scroll-indicator {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 34px;
  }

  .teskay-models-scroll-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #d0d0d0;
    transition: background 0.2s ease, transform 0.2s ease;
    cursor: pointer;
  }

  .teskay-models-scroll-dot.active {
    width: 10px;
    background: #0068bf;
  }
}

@media (max-width: 540px), (max-device-width: 540px) {
  .teskay-models-container {
    padding-top: 26px;
    padding-bottom: 54px;
    padding-left: 16px !important;
    padding-right: 16px !important;
  }

  .teskay-models-header {
    margin-bottom: 36px;
    padding-left: 0;
    padding-right: 0;
  }

  .teskay-models-heading {
    font-size: 34px;
    letter-spacing: -0.04em;
  }

  .teskay-models-description {
    margin-top: 16px;
    font-size: 17px;
    line-height: 1.55;
  }

  .teskay-models-grid-wrapper {
    grid-auto-columns: calc((100% - 18px) / 2) !important;
    gap: 18px !important;
    scroll-padding-left: 0;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  .teskay-model-image-wrapper {
    height: clamp(132px, 34vw, 165px) !important;
    min-height: 128px !important;
  }

  .teskay-model-image-wrapper img,
  .teskay-model-image-wrapper svg,
  .teskay-model-image {
    padding: 8px !important;
  }

  .teskay-model-info {
    padding-top: 18px;
  }

  .teskay-model-name {
    font-size: clamp(21px, 5.8vw, 26px);
    line-height: 1.2;
  }

  .teskay-model-count {
    margin-top: 10px;
    font-size: clamp(16px, 4.2vw, 19px);
  }

  .teskay-models-scroll-indicator {
    margin-top: 26px;
    gap: 8px;
  }

  .teskay-models-scroll-dot,
  .teskay-models-scroll-dot.active {
    width: 8px;
    height: 8px;
  }
}


/* 1:1 image mode for category/trend/carbon sections */
.teskay-card-ratio-square .teskay-model-image-wrapper {
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  min-height: 0 !important;
}

.teskay-card-ratio-square .teskay-model-image-wrapper img,
.teskay-card-ratio-square .teskay-model-image-wrapper .teskay-model-image {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

.teskay-card-ratio-square .teskay-model-image-wrapper svg {
  width: 100% !important;
  height: 100% !important;
  padding: 0 !important;
}

@media (max-width: 1200px), (max-device-width: 540px) {
  .teskay-card-ratio-square .teskay-model-image-wrapper {
    aspect-ratio: 1 / 1 !important;
    height: auto !important;
    min-height: 0 !important;
  }

  .teskay-card-ratio-square .teskay-model-image-wrapper img,
  .teskay-card-ratio-square .teskay-model-image-wrapper .teskay-model-image {
    object-fit: cover !important;
    padding: 0 !important;
  }
}
