﻿@charset "UTF-8";

/*
  ギフトヘッダーリンク
  - PC：ギフトリンクを画面上部に固定し、ヘッダーをその下に表示
  - SP：下スクロール時はヘッダーとともに非表示、上スクロール時はヘッダーとともに再表示
*/
:root {
  --gift-link-height: 36px;
}

/* ==============================
   Base
   ============================== */
.gift-link-wrap {
  display: block;
  width: 100%;
  background: #47BAED;
  position: sticky;
  top: 0;
  z-index: 10001;
  text-align: center;
  color: #fff;
  font-weight: 700;
}

.gift-link-wrap > p {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 2rem 6px;
  font-size: 15px;
  line-height: 1.4;
  text-align: center;
}

.gift-link-wrap a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: opacity 0.35s ease;
}

.gift-link-wrap:hover a {
  opacity: 0.65;
}

.gift-link-text {
  display: inline;
}

.gift-link-emphasis {
  display: inline-block;
  background: #fff;
  padding: 2px 4px;
  border-radius: 4px;
  margin: 0 4px;
  color: #47BAED;
  line-height: 1.2;
}

.gift-link-icon {
  display: inline-block;
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  margin-left: 2px;
  border-radius: 50%;
  background: #fff;
  position: relative;
}

.gift-link-icon::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 47%;
  width: 5px;
  height: 5px;
  border-top: 2px solid #47BAED;
  border-right: 2px solid #47BAED;
  transform: translate(-50%, -50%) rotate(45deg);
}

/* ヘッダーの重なり制御 */
.s-header {
  position: sticky;
  top: var(--gift-link-height);
  z-index: 10000;
}

/* ==============================
   Page adjustment
   ============================== */
.s-header + div {
  margin-top: 4px !important;
}

html.is-gift-link-about-kbp .s-header + div,
html.is-gift-link-category .s-header + div,
html.is-gift-link-feature-recipe .s-header + div,
html.is-gift-link-guide .s-header + div {
  margin-top: 0 !important;
}

html.is-gift-link-feature-list .s-header + div {
  margin-top: -26px !important;
}

.gift-link-wrap + .s-header + .m-homeMainVisual {
  margin-top: 8px !important;
}

/* ==============================
   SP
   ============================== */
@media screen and (max-width: 767px) {
  :root {
    --gift-link-height: 61px;
  }

  #rootTemplate,
  #header .m-homeMainVisual,
  #header #js-homeMV,
  #header .m-homeMainVisual-slider,
  #header .swiper,
  #header .swiper-container {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .gift-link-wrap {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10002;
    transition: transform 0.25s ease;
    will-change: transform;
  }

  .gift-link-wrap.is-scroll:not(.is-show) {
    transform: translateY(-100%);
  }

  .gift-link-wrap.is-scroll.is-show,
  .gift-link-wrap:not(.is-scroll) {
    transform: translateY(0);
  }

  .gift-link-wrap > p {
    padding: 7px 2px 7px 18px;
    font-size: 13px;
    line-height: 1.8;
  }

  /* SPは2区分構成：左＝テキストエリア、右＝アイコンエリア */
  .gift-link-wrap a {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    align-items: center;
    column-gap: 0;
    width: 100%;
    max-width: 100%;
  }

  .gift-link-text {
    display: block;
    overflow-wrap: anywhere;
    word-break: break-word;
    line-break: strict;
    min-width: 0;
    text-align: center;
  }

  .gift-link-emphasis {
    padding: 2px 3px;
    margin: 0 3px;
  }

  .gift-link-icon {
    justify-self: center;
    width: 16px;
    height: 16px;
    margin-left: 0;
  }

  .gift-link-icon::before {
    width: 5px;
    height: 5px;
    border-top-width: 2px;
    border-right-width: 2px;
  }

  .s-header {
    position: sticky;
    top: 0 !important;
    z-index: 10000 !important;
    margin-top: var(--gift-link-height);
    overflow: visible !important;
  }

  .s-header + div {
    margin-top: -37px !important;
  }

  html.is-gift-link-feature-recipe .s-header + div,
  .gift-link-wrap + .s-header + .m-homeMainVisual {
    margin-top: -36px !important;
  }

  html.is-gift-link-category .s-header + div,
  html.is-gift-link-about-kbp .s-header + div,
  html.is-gift-link-guide .s-header + div {
    margin-top: -35px !important;
  }
}