@charset "utf-8";
/* ============================================ buttonリセット（common.css非読込のページ用。詳細度0のため各クラスの指定が優先される） */
:where(.cookie-consent button) {
  appearance: none;
  vertical-align: middle;
  color: inherit;
  font: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  border-radius: 0;
  text-align: inherit;
  text-transform: inherit;
  white-space: normal;
  outline: none;
  cursor: pointer;
}


/* ============================================ Cookie同意ダイアログ */
.cookie-consent {
  /* 色変数（他サイトで流用する際はここを変更） */
  --main_c: #2c893a;
  --font_c: #2c2c2c;
  --cv_c: #ff552a;
  --line_c: #cccccc;
  position: fixed;
  left: 10px;
  bottom: 10px;
  z-index: 9999;
  width: 560px;
  max-width: calc(100% - 20px);
  line-height: 1.5;
  @media (width <= 896px) {
    left: 0;
    bottom: 0;
    width: 100%;
    max-width: none;
  }
  &[hidden] {
    display: none;
  }
}
.cookie-consent__box {
  max-height: calc(100vh - 20px);
  background: #fff;
  border: 1px solid var(--line_c);
  border-radius: 12px;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);
  padding: 20px;
  display: flex;
  flex-direction: column;
  @media (width <= 896px) {
    padding: 12px 16px;
    border-radius: 12px 12px 0 0;
    border-width: 1px 0 0 0;
  }
}
.cookie-consent__body {
  overflow-y: auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cookie-consent__text {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  a {
    color: var(--main_c);
    text-decoration: underline;
    text-underline-offset: .2em;
  }
}

/* --- カテゴリ設定パネル --- */
.cookie-consent__categories {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #ececec;
  display: flex;
  flex-direction: column;
  gap: 10px;
  &[hidden] {
    display: none;
  }
}
.cookie-consent__category {
  background: rgba(239, 239, 239, 0.5);
  border-radius: 8px;
  overflow: hidden;
}
.cookie-consent__category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
}
.cookie-consent__category-title-btn {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  text-align: left;
  cursor: pointer;
  font: inherit;
}
.cookie-consent__category-title {
  font-size: 13px;
  font-weight: 500;
  color: #222;
}
.cookie-consent__category-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.cookie-consent__category-always {
  font-size: 12px;
  font-weight: 500;
  color: var(--main_c);
  white-space: nowrap;
}
.cookie-consent__category-chevron {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  svg {
    width: 14px;
    height: 14px;
    transition: transform 0.3s ease;
  }
  &[aria-expanded="true"] svg {
    transform: rotate(180deg);
  }
}
.cookie-consent__category-desc {
  margin: 0;
  padding: 0 12px 12px;
  font-size: 12px;
  line-height: 1.6;
  &[hidden] {
    display: none;
  }
}

/* --- トグルスイッチ --- */
.cookie-consent__switch {
  position: relative;
  display: inline-block;
  width: 32px;
  height: 18px;
  flex-shrink: 0;
  input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
    &:checked + .cookie-consent__switch-slider {
      background: var(--cv_c);
      &::before {
        transform: translateX(14px);
      }
    }
    &:focus-visible + .cookie-consent__switch-slider {
      box-shadow: 0 0 0 2px #245fcc;
    }
  }
}
.cookie-consent__switch-slider {
  position: absolute;
  inset: 0;
  background: #898989;
  border-radius: 10px;
  transition: background-color 0.3s ease;
  &::before {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 12px;
    height: 12px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
  }
}

/* --- ボタン --- */
.cookie-consent__buttons {
  width: 100%;
  margin-top: 16px;
  display: flex;
  gap: 8px 10px;
  @media (width <= 480px) {
    flex-direction: column;
  }
}
.cookie-consent__btn {
  position: relative;
  isolation: isolate;
  overflow: clip;
  text-align: center;
  flex: 1;
  padding: 12px;
  border-radius: 9999px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: opacity .2s ease;
  &:hover {
    @media (hover: hover) {
      opacity: .85;
    }
  }
}
.cookie-consent__btn--accept {
  background: var(--main_c);
  color: #fff;
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 9999px;
    background: var(--font_c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease-out;
  }
  &:hover {
    @media (hover: hover) {
      opacity: 1;
      &::before {
        transform: scaleX(1);
      }
    }
  }
}
.cookie-consent__btn--pref,
.cookie-consent__btn--save,
.cookie-consent__btn--deny {
  background: #d9d9d9;
  transition: opacity .2s ease, color 0.3s ease-out;
  &::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    border-radius: 9999px;
    background: var(--font_c);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .3s ease-out;
  }
  &:hover {
    @media (hover: hover) {
      opacity: 1;
      color: #fff;
      &::before {
        transform: scaleX(1);
      }
    }
  }
}
