/* scube-typeA */
.scube-typeA {
  .item {
    @media (min-width: 768px) {
      width: calc((100% - (var(--gap-md) * 3)) / 4);
    }
    
    .comment {
      display: block;
      font-size: var(--text-sm);
      padding-top: var(--p-md);
      margin-top: var(--p-md);
      border-top: 1px solid var(--border-color);
      overflow: hidden;
      display: -webkit-box;
      text-overflow: ellipsis;
      -webkit-box-orient: vertical;
      line-clamp: 3;
      -webkit-line-clamp: 3;
    }
  }
}

/* scube-typeB */
.scube-typeB {
  display: flex;
  
  .item {
    display: flex;
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--contents-bg-color);
    
    &:hover {
      border-color: var(--main-color);
      
      .pic img {
        opacity: 0.7;
      }
    }
  }
  
  .pic {
    width: 120px;
    flex-shrink: 0;
    
    img {
      width: 120px;
      height: 120px;
      aspect-ratio: 1;
      object-fit: cover;
    }
  }
  
  .info {
    width: calc(100% - 120px);
    background-color: var(--contents-bg-color);
    font-size: var(--text-md);
    padding: 0 var(--p-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    
    @media (min-width: 768px) {
      padding-block: var(--gap-md);
    }
  }
  
  .price {
    font-size: var(--text-price);
    font-weight: var(--weight-bold);
    color: var(--price-color);
    
    .unit {
      font-size: 0.7em;
    }
  }
  
  .spec {
    height: calc(var(--line-height-md) * 4em);
    line-height: var(--line-height-md);
    font-size: var(--text-sm);
    
    .rimawari {
      font-weight: var(--weight-bold);
      
      .red {
        color: var(--price-color);
      }
    }
  }
  
  .comment {
    display: none;
  }
  
  .link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  @media (min-width: 768px) {
    flex-wrap: wrap;
    gap: var(--gap-md);
    
    .item {
      width: calc(50% - (var(--gap-md) / 2));
      
      .comment {
        display: block;
        font-size: var(--text-sm);
        padding-top: var(--p-md);
        margin-top: var(--p-md);
        border-top: 1px solid var(--border-color);
        overflow: hidden;
        display: -webkit-box;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        -webkit-line-clamp: 2;
      }
    }
    
    .pic {
      width: 140px;
      
      img {
        width: 100%;
        height: 100%;
      }
    }
    
    .info {
      width: calc(100% - 140px);
    }
  }
  
  @media (min-width: 900px) {
    .item {
      .pic {
        width: 200px;
      }
      
      .info {
        width: calc(100% - 200px);
      }
    }
  }
}

/* scube-typeC */
.scube-typeC {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  padding-inline: 12px;

  @media (min-width: 768px) {
    padding-inline: 0;
  }
  
  .item {
    display: flex;
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--contents-bg-color);
    
    &:hover {
      border-color: var(--main-color);
      
      .pic img {
        opacity: 0.7;
      }
    }
  }
  
  .pic {
    width: 130px;
    height: 130px;
    flex-shrink: 0;
    
    img {
      width: 130px;
      height: 130px;
      aspect-ratio: 1;
      object-fit: cover;
    }
  }
  
  .info {
    background-color: var(--contents-bg-color);
    flex-grow: 1;
    font-size: var(--text-md);
    padding: var(--p-md);
    height: 130px;
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    overflow: hidden;
  }
  
  .price {
    font-size: var(--text-price);
    font-weight: var(--weight-bold);
    color: var(--price-color);
    
    .unit {
      font-size: 0.7em;
    }
  }
  
  .spec {
    font-size: var(--text-sm);
    
    .rimawari {
      font-weight: var(--weight-bold);
      
      .red {
        color: var(--price-color);
      }
    }
  }
  
  .comment {
    display: none;
  }
  
  .link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  @media (min-width: 768px) {
    padding-inline-start: 0;
    padding-inline-end: 0;
    
    .item {
      display: grid;
      grid-template-columns: 200px 1fr;
      
      .comment {
        display: block;
        font-size: var(--text-sm);
        padding-top: var(--p-md);
        margin-top: var(--p-md);
        border-top: 1px solid var(--border-color);
        overflow: hidden;
        display: -webkit-box;
        text-overflow: ellipsis;
        -webkit-box-orient: vertical;
        line-clamp: 2;
        -webkit-line-clamp: 2;
      }
    }
    
    .pic {
      width: 200px;
      height: 200px;
      
      img {
        width: 100%;
        height: 100%;
      }
    }
    
    .info {
      height: auto;
    }
  }
}

/* scube-ranking */
.scube-ranking {
  display: flex;
  flex-direction: column;
  gap: var(--gap-md);
  margin-inline: var(--content-spacing);
  
  .item {
    display: flex;
    position: relative;
    border: 1px solid var(--border-color);
    background: var(--contents-bg-color);
    
    &:hover {
      border-color: var(--main-color);
      
      .pic img {
        opacity: 0.7;
      }
    }
    
    &::after {
      position: absolute;
      top: 0;
      left: 0;
      z-index: 1;
      display: block;
      width: 20px;
      height: 20px;
      text-align: center;
      line-height: 20px;
      font-size: 11px;
      font-weight: bold;
    }
    
    &:nth-child(1)::after {
      content: "1";
      background: #f7d019;
    }
    
    &:nth-child(2)::after {
      content: "2";
      background: #ddd;
    }
    
    &:nth-child(3)::after {
      content: "3";
      background: #854f41;
      color: #fff;
    }
  }
  
  .pic {
    width: 130px;
    flex-shrink: 0;
    
    img {
      width: 130px;
      height: 130px;
      aspect-ratio: 1;
      object-fit: cover;
    }
  }
  
  .info {
    background-color: var(--contents-bg-color);
    flex-grow: 1;
    font-size: var(--text-md);
    padding: var(--p-md);
    height: 130px;
    display: flex;
    flex-direction: column;
    gap: var(--gap-sm);
    overflow: hidden;
  }
  
  .price {
    font-size: var(--text-price);
    font-weight: var(--weight-bold);
    color: var(--price-color);
    
    .unit {
      font-size: 0.7em;
    }
  }
  
  .spec {
    font-size: var(--text-sm);
    
    .rimawari {
      font-weight: var(--weight-bold);
      
      .red {
        color: var(--price-color);
      }
    }
  }
  
  .comment {
    display: none;
  }
  
  .link {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
  }
  
  @media (min-width: 900px) {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--gap-md);
    position: relative;
    margin-inline: 0;
    
    .item {
      display: grid;
      grid-template-columns: 130px 1fr;
    }
    
    .item .pic {
      width: 130px;
      
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
}

/* scube-list */
.scube-list {
  .pic.stage-negotiation {
    position: relative;

    &::after {
      content: '商談中';
      position: absolute;
      top: 50%;
      left: 50%;
      display: block;
      width: 80px;
      height: 20px;
      background: #e0af1b;
      border-radius: 8px;
      color: var(--text-contrast-color);
      font-size: var(--text-sm);
      line-height: 1.3;
      text-align: center;
      translate: -50% -50%
    }
  }

  .price {
    font-size: var(--text-md);
    @media (min-width: 320px) {
      font-size: var(--text-price);
    }
  }
}

/* Swiper carousel styles for scube */
.swiper {
  padding-inline: clamp(0.875rem, -6.5357rem + 37.0536vw, 11.25rem) !important;

  @media (min-width: 769px) {
    padding-inline: 0 !important;
  }

  .swiper-wrapper {
    align-items: stretch;
    
    .swiper-slide {
      margin-right: 8px;
      height: auto;

      @media (min-width: 320px) {
        margin-right: 10px;
      }

      @media (min-width: 769px) {
        margin-right: 0;
      }
    }
  }
}
