/* ==========================================================================
   MONO NAV Product Widget
   Shared affiliate product cards
   ========================================================================== */

.mn-products {
  --mnw-primary: #175d50;
  --mnw-primary-dark: #10483e;
  --mnw-primary-soft: #eaf3f1;

  --mnw-text: #17212b;
  --mnw-text-soft: #65727e;
  --mnw-text-muted: #929ca5;

  --mnw-border: #e0e5e9;
  --mnw-surface: #ffffff;
  --mnw-surface-soft: #f7f9fa;

  display: grid;
  grid-template-columns: repeat(3,
      minmax(0, 1fr));
  gap: 12px;

  width: 100%;
  margin: 0;
  padding: 0;

  box-sizing: border-box;

  color: var(--mnw-text);

  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "Hiragino Kaku Gothic ProN",
    "Hiragino Sans",
    Meiryo,
    sans-serif;
}

.mn-products *,
.mn-products *::before,
.mn-products *::after {
  box-sizing: border-box;
}


/* ==========================================================================
   Product card
   ========================================================================== */

.mn-product {
  display: grid;

  min-width: 0;

  overflow: hidden;

  border: 1px solid var(--mnw-border);
  border-radius: 12px;

  background: var(--mnw-surface);

  box-shadow:
    0 5px 18px rgba(28, 44, 56, 0.05);

  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease;
}

.mn-product:hover {
  border-color: #cdd6dc;

  transform: translateY(-1px);

  box-shadow:
    0 9px 24px rgba(28, 44, 56, 0.09);
}


/* ==========================================================================
   Image
   ========================================================================== */

.mn-product-image {
  position: relative;

  display: flex;

  width: 100%;
  aspect-ratio: 4 / 3;

  align-items: center;
  justify-content: center;

  overflow: hidden;

  border-bottom: 1px solid var(--mnw-border);

  background:
    linear-gradient(180deg,
      #ffffff 0%,
      #fafbfb 100%);

  text-decoration: none;
}

.mn-product-image img {
  display: block;

  width: 100%;
  height: 100%;

  padding: 10px;

  object-fit: contain;

  transition: transform 0.18s ease;
}

.mn-product:hover .mn-product-image img {
  transform: scale(1.015);
}


/* ==========================================================================
   Body
   ========================================================================== */

.mn-product-body {
  display: flex;
  min-width: 0;
  flex-direction: column;

  padding: 12px;
}


/* ==========================================================================
   Source / brand
   ========================================================================== */

.mn-product-meta {
  display: flex;
  min-width: 0;

  align-items: center;

  gap: 7px;

  margin-bottom: 7px;
}

.mn-product-source {
  display: inline-flex;

  flex: 0 0 auto;

  align-items: center;

  padding: 3px 6px;

  border-radius: 999px;

  font-size: 8px;
  font-weight: 800;
  line-height: 1.2;

  letter-spacing: 0.04em;
}

.mn-source-rakuten {
  background: #fdebed;
  color: #b83a48;
}

.mn-source-yahoo {
  background: #f0edfd;
  color: #5944a6;
}

.mn-product-brand {
  display: block;

  min-width: 0;

  overflow: hidden;

  color: var(--mnw-text-muted);

  font-size: 9px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==========================================================================
   Title
   ========================================================================== */

.mn-product-title {
  display: -webkit-box;

  overflow: hidden;

  min-height: 3em;

  margin: 0;

  color: var(--mnw-text);

  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;

  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.mn-product-title a {
  color: inherit;
  text-decoration: none;
}

.mn-product-title a:hover {
  color: var(--mnw-primary);
}


/* ==========================================================================
   Price
   ========================================================================== */

.mn-product-price {
  margin-top: 10px;

  color: #b75138;

  font-size: 17px;
  font-weight: 800;
  line-height: 1.25;
}


/* ==========================================================================
   Review
   ========================================================================== */

.mn-product-review {
  display: flex;

  align-items: center;

  gap: 4px;

  margin-top: 5px;

  color: #a76e22;

  font-size: 9px;
  font-weight: 700;
}

.mn-product-review span {
  color: var(--mnw-text-muted);

  font-weight: 400;
}


/* ==========================================================================
   Shop
   ========================================================================== */

.mn-product-shop {
  margin-top: 6px;

  overflow: hidden;

  color: var(--mnw-text-soft);

  font-size: 9px;

  text-overflow: ellipsis;
  white-space: nowrap;
}


/* ==========================================================================
   CTA
   ========================================================================== */

.mn-product-link {
  display: flex;

  min-height: 35px;

  align-items: center;
  justify-content: center;

  margin-top: 11px;
  padding: 7px 9px;

  border-radius: 7px;

  background: var(--mnw-primary);

  color: #fff;

  font-size: 10px;
  font-weight: 800;

  text-align: center;
  text-decoration: none;

  transition:
    background-color 0.15s ease,
    transform 0.15s ease;
}

.mn-product-link:hover {
  background: var(--mnw-primary-dark);
}


/* ==========================================================================
   Empty
   ========================================================================== */

.mn-products-empty {
  grid-column: 1 / -1;

  padding: 24px 18px;

  border: 1px solid var(--mnw-border);
  border-radius: 10px;

  background: var(--mnw-surface-soft);

  color: var(--mnw-text-muted);

  font-size: 11px;

  text-align: center;
}


/* ==========================================================================
   4-column optional mode
   ========================================================================== */

.mn-products.mn-products-compact {
  grid-template-columns:
    repeat(4,
      minmax(0, 1fr));
}

.mn-products.mn-products-compact .mn-product-title {
  font-size: 11px;
}

.mn-products.mn-products-compact .mn-product-price {
  font-size: 15px;
}


/* ==========================================================================
   Horizontal optional mode
   ========================================================================== */

.mn-products.mn-products-horizontal {
  grid-template-columns: 1fr;
}

.mn-products-horizontal .mn-product {
  grid-template-columns:
    130px minmax(0, 1fr);
}

.mn-products-horizontal .mn-product-image {
  height: 100%;
  aspect-ratio: auto;

  border-right: 1px solid var(--mnw-border);
  border-bottom: 0;
}


/* ==========================================================================
   Tablet
   ========================================================================== */

@media (max-width: 900px) {

  .mn-products,
  .mn-products.mn-products-compact {
    grid-template-columns:
      repeat(2,
        minmax(0, 1fr));
  }
}


/* ==========================================================================
   Mobile
   ========================================================================== */

@media (max-width: 520px) {
  .mn-products {
    gap: 8px;
  }

  .mn-products,
  .mn-products.mn-products-compact {
    grid-template-columns:
      repeat(2,
        minmax(0, 1fr));
  }

  .mn-product {
    border-radius: 9px;
  }

  .mn-product-image {
    aspect-ratio: 1 / 0.9;
  }

  .mn-product-image img {
    padding: 7px;
  }

  .mn-product-body {
    padding: 9px;
  }

  .mn-product-meta {
    margin-bottom: 5px;
  }

  .mn-product-title {
    min-height: 3.15em;

    font-size: 10.5px;
    line-height: 1.5;
  }

  .mn-product-price {
    margin-top: 7px;

    font-size: 14px;
  }

  .mn-product-review {
    font-size: 8px;
  }

  .mn-product-shop {
    font-size: 8px;
  }

  .mn-product-link {
    min-height: 31px;

    margin-top: 8px;

    font-size: 9px;
  }

  .mn-products-horizontal .mn-product {
    grid-template-columns:
      100px minmax(0, 1fr);
  }
}

/* ==========================================================================
   External search links
   ========================================================================== */

.mn-product-search-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 9px;

  width: 100%;
  margin-top: 12px;
}

.mn-product-search-link {
  display: inline-flex;
  min-height: 38px;

  align-items: center;
  justify-content: center;

  padding: 8px 16px;

  border-radius: 8px;

  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;

  text-decoration: none;

  transition:
    opacity 0.15s ease,
    transform 0.15s ease;
}

.mn-product-search-link:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

/* 楽天 */
.mn-product-search-link-rakuten {
  border: 1px solid #bf0000;
  background: #fff;
  color: #bf0000;
}

/* Yahoo!ショッピング */
.mn-product-search-link-yahoo {
  border: 1px solid #ff0033;
  background: #ff0033;
  color: #fff;
}

@media (max-width: 520px) {
  .mn-product-search-links {
    gap: 7px;
    margin-top: 10px;
  }

  .mn-product-search-link {
    flex: 1 1 calc(50% - 4px);

    min-width: 0;
    padding: 7px 9px;

    font-size: 9px;
  }
}

/* ==========================================================================
   Split horizontal scroll
   ========================================================================== */

.mn-split-scroll {
  display: grid;
  gap: 16px;

  width: 100%;
}

.mn-scroll-source {
  min-width: 0;
}

.mn-scroll-source-heading {
  display: flex;
  align-items: center;

  margin-bottom: 7px;
}

.mn-scroll-source-heading h3 {
  margin: 0;

  color: var(--mnw-text, #17212b);

  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
}


/* 横スクロール本体 */

.mn-products-scroll {
  display: flex;

  gap: 9px;

  width: 100%;

  overflow-x: auto;
  overflow-y: hidden;

  padding: 1px 1px 7px;

  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;

  scrollbar-width: thin;
}


/* 通常grid指定を打ち消して横並び固定 */

.mn-products-scroll .mn-product {
  flex: 0 0 180px;

  width: 180px;

  scroll-snap-align: start;
}


/* 縦をなるべく節約 */

.mn-products-scroll .mn-product-image {
  aspect-ratio: 1 / 0.82;
}

.mn-products-scroll .mn-product-image img {
  padding: 7px;
}

.mn-products-scroll .mn-product-body {
  padding: 9px;
}

.mn-products-scroll .mn-product-title {
  min-height: 3em;

  font-size: 10.5px;
}

.mn-products-scroll .mn-product-price {
  margin-top: 6px;

  font-size: 14px;
}

.mn-products-scroll .mn-product-shop {
  margin-top: 4px;

  font-size: 8px;
}


/* もっと探す */

.mn-scroll-more {
  display: flex;
  justify-content: flex-end;

  margin-top: 6px;
}

.mn-scroll-more .mn-product-search-link {
  min-height: 32px;

  padding: 6px 12px;

  font-size: 9px;
}


/* Mobile */

@media (max-width: 520px) {

  .mn-split-scroll {
    gap: 13px;
  }

  .mn-products-scroll {
    gap: 7px;
  }

  .mn-products-scroll .mn-product {
    flex-basis: 145px;

    width: 145px;
  }

  .mn-products-scroll .mn-product-image {
    aspect-ratio: 1 / 0.85;
  }

  .mn-scroll-source-heading h3 {
    font-size: 11px;
  }

  .mn-scroll-more {
    justify-content: stretch;
  }

  .mn-scroll-more .mn-product-search-link {
    width: 100%;
  }
}