/* =================================================
   Product Card Base
================================================= */

.item {
  box-sizing: border-box;
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
  box-shadow: 3px 3px 10px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.item img {
  width: 100%;
  height: auto;
  border-radius: 5px;
}

.item p {
  margin: 10px 0;
  text-align: left;
}

/* タイトル */
.item .title {
  font-weight: bold;
  min-height: 60px;
  border-bottom: 1px dotted #999;
  padding-bottom: 3px;
}

/* スペック */
.item .specs {
  flex-grow: 1;
  min-height: 100px;
}

.item .specs p {
  line-height: 1.4;
  border-bottom: 1px dotted #999;
  padding-bottom: 3px;
}

/* 下部 */
.item .bottom {
  min-height: 10px;
}

/* price */
.price {
  font-weight: bold;
  color: red;
}

/* =================================================
   SP：title / specs
================================================= */
@media (max-width: 768px) {
  .item .title {
    font-size: 14px;
  }

  .item .specs p {
    font-size: 12px;
  }
}

/* =================================================
   Products Layout - PC
================================================= */
.image-container.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}


/* =================================================
   Carousel Controls - default
================================================= */
[data-carousel-controls] {
  display: none;
}

/* =================================================
   Carousel Controls - SPのみ表示
================================================= */
@media (max-width: 768px) {
  [data-carousel-controls] {
    position: static;
    margin-bottom: 8px;

    display: flex;
    justify-content: flex-end;
    gap: 6px;
  }
}

/* =================================================
   Carousel Controls - Button Style（共通）
================================================= */

/* ボタン配置（SPのみ表示は既存の指定を利用） */
@media (max-width: 768px) {
  [data-carousel-controls] button {
    width: 32px;
    height: 32px;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #fff;
    border: 1px solid #bbb;
    border-radius: 4px;

    font-size: 14px;
    font-weight: bold;
    color: #000;

    cursor: pointer;
    line-height: 1;
  }

  [data-carousel-controls] button:active {
    background: #f2f2f2;
  }
}

/* 非活性（全ページ共通） */
[data-carousel-controls] button.disabled,
[data-carousel-controls] button:disabled {
  opacity: 0.4;
  cursor: default;
  pointer-events: none;
}

/* =================================================
   Products Layout - SP Carousel
================================================= */
@media (max-width: 768px) {

  .image-container.products[data-carousel] {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0 16px 10px;
  }

  .image-container.products[data-carousel]::-webkit-scrollbar {
    display: none;
  }

  .image-container.products[data-carousel] .item {
    flex: 0 0 75%;
    scroll-snap-align: start;
  }
}


/* =================================================
   トップへ戻る
================================================= */
#back-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background-color: #023F98;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    z-index: 1000;
    text-align: center;
    line-height: 50px;
}

#back-to-top:hover {
    background-color: #005BB5;
}
