/* 1:1 aliases: regenerated WP menu IDs → live-site hard-coded selectors */
.global-nav-list > li.menu-top {
  margin-left: 350px;
}
.footer-nav li.menu-top,
.footer-nav-list > li.menu-top {
  margin-left: 0;
}
.global-nav-list > li.langage img,
.footer-nav-list > li.langage img {
  min-width: 30px;
  max-width: 30px !important;
}

/* Live home pulls the hero under the transparent header */
body.home .lightning_swiper.ltg-slide {
  margin-top: -140px;
  width: 100%;
  max-width: none;
}

/* Hero KV arrows not used — hide completely (not just empty ::after). */
.lightning_swiper .swiper-button-prev,
.lightning_swiper .swiper-button-next,
.ltg-slide-button-prev,
.ltg-slide-button-next {
  display: none !important;
}

/*
 * PRODUCT dropdown caret (角标).
 * Live custom CSS forces border-bottom-color:#fff (visible over dark KV).
 * On a light/white header that makes the hover triangle invisible — use black,
 * and keep white only while the home header is still transparent over the hero.
 */
.global-nav-list > li.menu-item-has-children::after {
  border-bottom-color: #000;
}
body.home:not(.header_scrolled) .global-nav-list > li.menu-item-has-children::after {
  border-bottom-color: #fff;
}

/* Keep empty Lightning site-body from adding gap on the front page */
body.home .site-body {
  display: none;
  padding: 0;
  min-height: 0;
  height: 0;
  margin: 0;
  overflow: hidden;
}

/*
 * Homepage: SNS sits after footer-nav (logo + links), before copyright.
 * site.js moves #sns; these rules collapse the former white gap.
 */
.site-footer > #sns {
  margin-top: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 24px !important;
  width: 100%;
  background: #faf9f7;
}
.site-footer > #sns ul.cols-3 {
  margin-top: 0 !important;
}
.site-footer > #sns ul.cols-3 li {
  padding-top: 0;
  padding-bottom: 0;
}
.footer-nav:has(+ #sns) {
  padding-bottom: 8px !important;
}

@media screen and (max-width: 767px) {
  .footer-nav .langage img,
  .footer-nav-list > li.langage img {
    min-width: 20px !important;
    max-width: 20px !important;
  }
  .global-nav-list > li.menu-top {
    margin-left: 0;
  }
  body.home .lightning_swiper.ltg-slide {
    margin-top: 0;
  }
  /* Mobile: RMP hamburger + centered logo; hide Lightning header chrome. */
  .site-header {
    display: none !important;
  }
  #vk-mobile-nav-menu-btn {
    display: none !important;
  }
  #logo_sp {
    display: block;
    position: relative;
    left: 50%;
    top: 45px;
    transform: translate(-50%, -50%);
    z-index: 99;
    width: 50px;
  }
  #logo_sp img {
    width: 100%;
    height: auto;
    display: block;
  }
  [id^="rmp_menu_trigger-"] {
    display: block !important;
  }
  /*
   * Open panel: match original pharma21.com
   * - whole list sits below the close/hamburger (padding-top 10%)
   * - row dividers + flat current state
   * - hover/active = black bar + white text (must beat default !important)
   */
  [id^="rmp-container-"] {
    padding-top: 10% !important;
  }
  .rmp-menu .menu-logo {
    display: none !important;
  }
  .rmp-menu .langage {
    display: list-item !important;
  }
  /* Full-width row like text items (inline-block only covered the icon). */
  .rmp-menu .langage > .rmp-menu-item-link {
    display: block !important;
    width: 100% !important;
    text-align: center !important;
  }
  .rmp-menu .langage img {
    display: inline-block !important;
    vertical-align: middle;
    max-width: 28px !important;
    min-width: 28px !important;
    width: 28px !important;
    height: auto !important;
    margin: 0 auto;
    /* Dark wire globe — invert to white on black hover bar. */
    transition: filter 0.15s ease;
    filter: none;
  }
  /* Beat plugin ID selectors (#rmp-menu-wrap-N) that zero the divider. */
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item > .rmp-menu-item-link {
    height: 90px !important;
    line-height: 90px !important;
    letter-spacing: 2px !important;
    border-bottom: 1px solid #e8e8e8 !important;
    color: #000000 !important;
    background-color: transparent !important;
    background-image: none !important;
    text-align: center !important;
  }
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-current-item > .rmp-menu-item-link {
    background-color: transparent !important;
    background-image: none !important;
    color: #000000 !important;
    border-bottom-color: #e8e8e8 !important;
  }
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item > .rmp-menu-item-link:hover,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item > .rmp-menu-item-link:focus,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item > .rmp-menu-item-link:active,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-current-item > .rmp-menu-item-link:hover,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-current-item > .rmp-menu-item-link:focus,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-current-item > .rmp-menu-item-link:active {
    color: #ffffff !important;
    background-color: #000000 !important;
    background-image: none !important;
    border-bottom-color: transparent !important;
  }
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item.langage > .rmp-menu-item-link:hover img,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item.langage > .rmp-menu-item-link:focus img,
  [id^="rmp-menu-wrap-"] .rmp-menu > .rmp-menu-item.langage > .rmp-menu-item-link:active img {
    filter: brightness(0) invert(1) !important;
  }
}
@media screen and (min-width: 768px) {
  #logo_sp {
    display: none !important;
  }
}

/*
 * TOPICS — original single-card (narrow cols-3) layout.
 * Full-width topics-featured experiment retired; keep markup class-free.
 */
#topics .topics-single ul.cols-3 {
  justify-content: flex-start;
}
#topics .topics-single ul.cols-3 > li:only-child {
  width: 31.3333%;
  margin-right: 0;
  margin-left: 0;
}
#topics .topics-single img {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}
@media screen and (max-width: 767px) {
  #topics .topics-single ul.cols-3 > li:only-child {
    width: 90% !important;
    margin-left: 5% !important;
  }
}

/* BEST SELLERS: match original containment (no overflow:visible) */
#bestsellers .js-swiper1 {
  overflow: hidden;
}
#bestsellers .js-swiper1 .swiper-wrapper {
  align-items: stretch;
}
#bestsellers .js-swiper1 .swiper-slide {
  height: auto;
  overflow: hidden;
}
#bestsellers .js-swiper1 .swiper-slide h4,
#bestsellers .js-swiper1 .swiper-slide h5 {
  display: block;
  visibility: visible;
}

/*
 * ONLINE SHOP: match live-site logo size inside pill buttons.
 * Original rule is `#shop img { max-height: 20px; width: auto; margin-top: 5px; }`.
 * Do not inflate logos — that made the whole button row taller than the original.
 */
#shop .btn.btn-border {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
}
#shop .btn.btn-border img {
  display: block;
  width: auto !important;
  max-width: 70%;
  height: auto !important;
  max-height: 20px !important;
  object-fit: contain;
  margin: 5px auto 0 !important;
}
/*
 * Qoo10: keep the pill the same size as Rakuten/Amazon (shared max-height 20px
 * box), then scale the mark up so it reads larger without growing the button.
 */
#shop .btn.btn-border img[alt="Qoo10"],
#shop li:nth-child(3) .btn.btn-border img {
  max-height: 20px !important;
  max-width: 70% !important;
  margin-top: 5px !important;
  transform: scale(1.55);
  transform-origin: center center;
}

/*
 * Product detail water plate: force theme gray plate (not stale blue uploads).
 * Relative URL resolves from this CSS file under assets/css/.
 */
body:has(#product_detail) {
  background-color: #f8f8f8 !important;
  background-image: url("../img/bg_water_10.jpg") !important;
  background-size: cover !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
}

/*
 * Contact brand box: hug content width; keep site font (normal), tighten line gap.
 */
.entry-body #contact_inner {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.entry-body #contact_inner .box {
  width: max-content;
  min-width: min(560px, 100%);
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.entry-body #contact_inner .box p {
  font-weight: normal !important; /* match original contact box, not screenshot */
  line-height: 1.7 !important; /* tight within block; not intro 2.5em */
  white-space: normal;
}
/* One blank row before 所在地 (without inheriting huge line-height). */
.entry-body #contact_inner .box .contact-block-gap {
  display: block;
  height: 1.1em;
  margin: 0;
  padding: 0;
}
@media screen and (max-width: 767px) {
  .entry-body #contact_inner .box {
    width: auto;
    min-width: 0;
    max-width: 92%;
  }
}
