﻿
#topDetailSearch {
  display: block;
}

#topDetailSearch--button {
  display: none !important;
}
:root {
  --hk-chip-bg: #f7f2ea;
  --hk-chip-text: #222;
  --hk-divider: #8a8a8a;
  --hk-swipe-hint: #8c8c8c;
  --hk-arrow-y-offset: -7px;
}

.hotKeywords {
  padding: 10px 0 18px;
}

.hotKeywords__inner {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 12px;
  max-width: 980px;
  margin: 0 auto;
  padding: 0 15px;
}

.hotKeywords__heading {
  margin: 0;
  padding-top: 10px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.hotKeywords__divider {
  color: var(--hk-divider);
}

.hotKeywords__group {
  min-width: 0;
}

.hotKeywords__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 10px 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.hotKeywords__row > li {
  flex: 0 0 auto;
  width: auto;
  min-width: max-content;
  max-width: none;
  margin: 0;
  padding: 0;
  position: static;
}

.hotKeywords__tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--hk-chip-bg);
  color: var(--hk-chip-text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.hotKeywords__tag:link,
.hotKeywords__tag:visited,
.hotKeywords__tag:active {
  background: var(--hk-chip-bg);
  color: var(--hk-chip-text);
}

@media (min-width: 751px) {
  .searchArea__sec {
    min-height: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  .searchArea__sec .container,
  .searchArea__sec .side__detailSearch {
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
  }

  .searchArea__sec #sds_submit {
    margin-bottom: 0 !important;
  }
}

@media (hover: hover) and (pointer: fine) {
  .hotKeywords__tag:hover {
    background: #fff;
    border-color: var(--hk-chip-bg);
  }
}

@media (hover: none) {
  .hotKeywords__tag:hover {
    background: var(--hk-chip-bg);
    border-color: transparent;
  }
}

@media (max-width: 750px) {
  .hotKeywords__inner {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 36px 14px 12px;
  }

  .hotKeywords__inner::before {
    content: "";
    position: absolute;
    top: 0;
    right: 18px;
    width: 42px;
    height: 100%;
    background: linear-gradient(to left, #fff 20%, rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 3;
  }

  .hotKeywords__inner::after {
    content: "→";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translate(0, calc(-50% + var(--hk-arrow-y-offset)));
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.02em;
    color: var(--hk-swipe-hint);
    pointer-events: none;
    z-index: 4;
    animation: hkSwipeNudge 1.2s ease-in-out 0.3s 1 both;
  }

  .hotKeywords__heading {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    min-height: 36px;
    padding-top: 0;
    font-size: 13px;
  }

  .hotKeywords__group {
    position: relative;
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding-left: 10px;
    padding-right: 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
  }

  .hotKeywords__group::-webkit-scrollbar {
    display: none;
  }

  .hotKeywords__group::before {
    display: none;
  }

  .hotKeywords__group::after {
    display: none;
  }

  .hotKeywords__row {
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
    padding-right: 24px;
    padding-bottom: 2px;
  }

  .hotKeywords__tag {
    min-height: 36px;
    padding: 9px 14px;
    font-size: 13px;
    scroll-snap-align: start;
  }

  /* Mobile priority order: 0歳 / 1歳 / 出産祝い / ファーストトイ */
  .hotKeywords__row > li {
    order: 10;
  }
  .hotKeywords__row > li:nth-child(1) { order: 1; }
  .hotKeywords__row > li:nth-child(2) { order: 2; }
  .hotKeywords__row > li:nth-child(5) { order: 3; }
  .hotKeywords__row > li:nth-child(6) { order: 4; }
  .hotKeywords__row > li:nth-child(3) { order: 5; }
  .hotKeywords__row > li:nth-child(4) { order: 6; }
}

@keyframes hkSwipeNudge {
  0% {
    opacity: 0;
    transform: translate(0, calc(-50% + var(--hk-arrow-y-offset)));
  }
  20% {
    opacity: 1;
    transform: translate(0, calc(-50% + var(--hk-arrow-y-offset)));
  }
  50% {
    transform: translate(6px, calc(-50% + var(--hk-arrow-y-offset)));
  }
  80% {
    transform: translate(0, calc(-50% + var(--hk-arrow-y-offset)));
  }
  100% {
    opacity: 0.85;
    transform: translate(0, calc(-50% + var(--hk-arrow-y-offset)));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hotKeywords__inner::after {
    animation: none;
  }
}

