/* =========================================================
   人気商品セクション
========================================================= */
.top-products,
.top-products *,
.top-products *::before,
.top-products *::after {
  box-sizing: border-box;
}

.top-products {
  color: #222222;
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  margin-block: 0;
  padding: 0 20px;
}

.top-products__inner {
  container-type: inline-size;
  max-width: 1900px;
  margin: 0 auto;
}

/* Product card rows
   PCでは1段目2列、2段目3列で固定。狭い親コンテナでは1列へ落とす。 */
.top-products__grid {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-content: flex-start;
  gap: 24px 20px;
  margin-top: 34px;
  margin-bottom: 0;
}

.top-products__row {
  display: grid;
  align-items: start;
  align-content: start;
  justify-items: center;
  justify-content: center;
  gap: 24px 20px;
  width: 100%;
}

.top-products__row--primary {
  grid-template-columns: repeat(2, 562px);
  max-width: 1144px;
}

.top-products__row--secondary {
  grid-template-columns: repeat(3, 562px);
  max-width: 1726px;
}

/* Card base
   メーカー名から付与する modifier クラスで --top-product-main / --top-product-soft を切り替える。 */
.top-product-card {
  --top-product-main: #cf2b2b;
  --top-product-soft: #fdeceb;
  position: relative;
  align-self: start;
  width: 100%;
  max-width: 562px;
  height: auto;
  background: transparent;
}

/* Manufacturer title band */
.top-product-card__brand {
  padding: 12px 16px 11px;
  background: var(--top-product-main);
  color: #ffffff;
  text-align: center;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
}

.top-product-card__body {
  position: relative;
  margin-top: 25px;
  padding: 0;
  width: 562px;
  max-width: 100%;
  overflow: hidden;
  background: #ffffff;
}

/* Model/spec header inside each card */
.top-product-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 73px;
  padding: 18px 12px 16px;
  background: var(--top-product-main);
}

.top-product-card__main {
  position: relative;
  display: grid;
  grid-template-columns: 313px calc(562px - 24px - 313px - 12px);
  gap: 12px;
  align-items: stretch;
  width: 562px;
  max-width: 100%;
  height: auto;
  min-height: 510px;
  padding: 14px 12px 8px;
  border: 2px solid var(--top-product-main);
  border-top: 0;
  background: #ffffff;
}

.top-product-card__meta {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  min-width: 0;
}

.top-product-card__head-info {
  display: contents;
}

.top-product-card__maker,
.top-product-card__model {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1;
  border-radius: 0;
}

.top-product-card__maker {
  background: #ffffff;
  color: var(--top-product-main);
  justify-content: center;
  width: 58px;
}

.top-product-card__maker img {
  display: block;
  max-width: 100%;
  max-height: 20px;
  object-fit: contain;
}

.top-product-card__model {
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 22px;
  padding: 0;
}

.top-product-card__specs {
  display: flex;
  gap: 6px;
  margin: 0 0 0 auto;
  padding: 0;
  list-style: none;
  flex-shrink: 0;
}

.top-product-card__specs li {
  min-width: 88px;
  max-width: 120px;
  min-height: 32px;
  padding: 3px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.15;
  border: 0;
  background: #ffffff;
  color: #222222;
  white-space: normal;
}

.top-product-card__specs li.top-product-card__spec--small {
  font-size: 13px;
  line-height: 1.1;
}

/* Left-side product information */
.top-product-card__content {
  position: relative;
  z-index: 2;
  align-self: center;
  display: flex;
  flex-direction: column;
  width: 313px;
  max-width: 100%;
  min-width: 0;
}

.top-product-card__warranty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 54px;
  margin-bottom: 9px;
  padding: 0 13px;
  border: 0.5px solid #d6ccbf;
  background: linear-gradient(162deg, rgba(214, 204, 191, 0.7) 3%, rgba(247, 245, 242, 0.7) 46%, rgba(215, 205, 192, 0.7) 72%, rgba(246, 241, 239, 0.7) 96%);
  color: #926b29;
  font-size: 23px;
  font-weight: 500;
  line-height: 1;
  white-space: nowrap;
}

.top-product-card__warranty::before,
.top-product-card__warranty::after {
  content: "";
  display: block;
  width: 25.5px;
  height: 40px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}

.top-product-card__warranty::before {
  background-image: url("https://vaxal-kyutooki.com/wp-content/uploads/product-label-left.png");
}

.top-product-card__warranty::after {
  background-image: url("https://vaxal-kyutooki.com/wp-content/uploads/product-label-right.png");
}

.top-product-card__warranty span {
  font-family: "Times New Roman", serif;
  font-size: 35px;
  font-weight: 700;
}

.top-product-card__series {
  width: 100%;
  height: 47px;
  margin: 0 0 9px;
  padding: 0 5px;
  background: var(--top-product-soft);
  color: var(--top-product-main);
  font-size: 16px;
  font-weight: 700;
  line-height: normal;
  text-align: center;
  white-space: nowrap;
  display: flex;
  align-items: center;
  justify-content: center;
}

.top-product-card__series + .top-product-card__series {
  margin-bottom: 14px;
}

/* Price area */
.top-product-card__pricing {
  margin-top: 0;
  text-align: center;
}

.top-product-card__list-price {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: flex-start;
  gap: 6.75px;
  margin: 0 0 14px;
  width: 100%;
  color: #222222;
  font-size: 24px;
  font-weight: 700;
  white-space: nowrap;
}

.top-product-card__list-price--plain {
  justify-content: center;
}

.top-product-card__list-price-value {
  position: relative;
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 34px;
  font-weight: 600;
  line-height: 1;
}

.top-product-card__list-price-value::after {
  content: "";
  position: absolute;
  left: -4px;
  right: -4px;
  top: 50%;
  height: 3px;
  background: #ee1d23;
  transform: rotate(9.84deg) skewX(-2.97deg);
  transform-origin: center;
}

.top-product-card__list-price-value--plain {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", sans-serif;
  font-size: 28px;
}

.top-product-card__list-price small {
  font-size: 17px;
  font-weight: 700;
}

.top-product-card__price-label {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 34px;
  margin: 0 0 2px;
  padding: 0 14px;
  background: var(--top-product-main);
  color: #ffffff;
  font-size: 22px;
  font-weight: 700;
  text-align: center;
}

.top-product-card__price {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  margin: 0;
  color: var(--top-product-main);
  font-family: "Roboto", "Arial", sans-serif;
  font-size: 45px;
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: 0;
  white-space: nowrap;
}

.top-product-card__price span {
  align-self: flex-end;
  padding-bottom: 6px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0;
}

.top-product-card__price--open {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", sans-serif;
  font-size: 28px;
  letter-spacing: 0;
}

/* Product image area */
.top-product-card__visual {
  position: relative;
  z-index: 1;
  display: flex;
  align-self: stretch;
  align-items: flex-end;
  justify-content: flex-end;
  width: 100%;
  height: auto;
  min-height: 0;
  pointer-events: none;
}

.top-product-card__image {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 488px;
  object-fit: contain;
  object-position: right bottom;
}

/* Sales copy band */
.top-product-card__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  height: 108px;
  margin-top: 14px;
  padding: 14px 12px;
  background: var(--top-product-main);
  color: #ffffff;
}

.top-product-card__footer-icon {
  width: 30px;
  height: 50px;
  flex-shrink: 0;
  object-fit: contain;
}

.top-product-card__footer-text {
  min-width: 0;
}

.top-product-card__footer p {
  margin: 0;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.3;
}

/* Manufacturer color modifiers
   WordPress側でメーカー名に応じて該当クラスを出力する。 */
.top-product-card--mitsubishi {
  --top-product-main: #f01f23;
  --top-product-soft: #fde8e9;
}

.top-product-card--corona {
  --top-product-main: #173f83;
  --top-product-soft: #eef3fd;
}

.top-product-card--hitachi {
  --top-product-main: #b61118;
  --top-product-soft: #fff0f1;
}

.top-product-card--panasonic {
  --top-product-main: #1149c5;
  --top-product-soft: #edf4ff;
}

.top-product-card--daikin {
  --top-product-main: #1696e6;
  --top-product-soft: #edf9ff;
}

/* Medium screens: keep the top row at 2 columns and allow the lower row to become 2 + 1. */
@media (min-width: 1176px) and (max-width: 1765px) {
  .top-products__row--primary,
  .top-products__row--secondary {
    grid-template-columns: repeat(2, minmax(0, 562px));
    max-width: 1144px;
  }
}

/* Single-column layout */
@media (max-width: 1175px) {
  .top-products {
    padding: 0 20px;
  }

  .top-products__inner,
  .top-products__row,
  .top-products__row--primary,
  .top-products__row--secondary {
    width: 100%;
    max-width: 562px;
  }

  .top-products__row,
  .top-products__row--primary,
  .top-products__row--secondary {
    grid-template-columns: minmax(0, 1fr);
  }

  .top-product-card {
    max-width: 562px;
  }

  .top-product-card__brand {
    font-size: 24px;
  }

  .top-product-card__body {
    width: 100%;
    height: auto;
  }

  .top-product-card__main {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    height: auto;
    min-height: 0;
    padding-bottom: 16px;
  }

  .top-product-card__head {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 10px;
    height: 73px;
    min-height: 73px;
    padding: 11px 14px 10px;
  }

  .top-product-card__meta {
    width: 100%;
    flex-wrap: nowrap;
    gap: 10px;
  }

  .top-product-card__head-info {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    justify-content: center;
    gap: 2px;
    height: 53px;
    min-width: 0;
  }

  .top-product-card__maker {
    width: 60px;
    height: 31px;
    min-height: 31px;
  }

  .top-product-card__model {
    width: 100%;
    font-size: 20px;
  }

  .top-product-card__specs {
    gap: 6px;
    width: 100%;
    margin-left: 0;
  }

  .top-product-card__specs li {
    display: flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    min-width: 0;
    height: 22px;
    padding: 0 6px;
    font-size: 16px;
    line-height: 1;
  }

  .top-product-card__specs li.top-product-card__spec--small {
    font-size: 13px;
    line-height: 1.05;
  }

  .top-product-card__content {
    width: 100%;
    max-width: 100%;
    justify-self: center;
  }

  .top-product-card__visual {
    position: static;
    align-self: auto;
    justify-self: center;
    width: 240px;
    max-width: 80%;
    height: auto;
    margin-top: 18px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
  }

  .top-product-card__image {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
    object-position: center;
  }

  .top-product-card__price {
    font-size: 45px;
    text-align: center;
  }

  .top-product-card__price span {
    font-size: 18px;
  }
}

/* Smartphone tuning */
@media (max-width: 560px) {
  .top-products {
    padding: 0 12px;
  }

  .top-products__grid {
    gap: 18px;
    margin-top: 26px;
  }

  .top-product-card__brand {
    padding: 10px 12px;
    font-size: 24px;
  }

  .top-product-card__main {
    padding: 16px 16px 0;
  }

  .top-product-card__content {
    max-width: none;
    padding-right: 0;
  }

  .top-product-card__warranty {
    gap: 5px;
    height: 54px;
    min-height: 54px;
    margin-bottom: 9px;
    padding: 0 13px;
    font-size: 16px;
  }

  .top-product-card__warranty::before,
  .top-product-card__warranty::after {
    width: 25.5px;
    height: 40px;
  }

  .top-product-card__warranty span {
    font-size: 24px;
  }

  .top-product-card__series {
    height: 47px;
    min-height: 47px;
    margin-bottom: 9px;
    padding: 0 5px;
    font-size: 16px;
    white-space: nowrap;
  }

  .top-product-card__series + .top-product-card__series {
    margin-bottom: 19px;
  }

  .top-product-card__list-price {
    gap: 6.75px;
    margin-bottom: 10px;
    font-size: 24px;
  }

  .top-product-card__list-price-value {
    font-size: 34px;
  }

  .top-product-card__list-price small {
    font-size: 17px;
  }

  .top-product-card__price-label {
    height: auto;
    min-height: 32px;
    margin-bottom: 14px;
    padding: 4px 10px 5px;
    font-size: 16px;
  }

  .top-product-card__specs li {
    padding: 0 4px;
    font-size: 14px;
    line-height: 1.05;
  }

  .top-product-card__specs li.top-product-card__spec--small {
    font-size: 12px;
    line-height: 1.05;
  }

  .top-product-card__visual {
    margin-top: 10px;
    margin-bottom: 0;
  }

  .top-product-card__footer {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 75px;
    margin-top: 16px;
    padding: 14px 12px;
    gap: 20px;
  }

  .top-product-card__footer-icon {
    width: 26px;
    height: 26px;
  }

  .top-product-card__footer p {
    font-size: 16px;
  }
}
