.subscription-plan-outer {
  backdrop-filter: blur(20px);

  .subscription-plan-container {
    padding-block: 120px;

    @media screen and (max-width: 768px) {
      padding-block: 100px;
    }

    .plan-grid {
      display: grid;
      grid-template-columns: repeat(4, 1fr); /* PCは4列 */
      gap: 20px;
      align-items: start;

      @media screen and (max-width: 990px) {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
      }

      @media screen and (max-width: 768px) {
        display: flex;
        grid-template-columns: unset;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 12px;
        padding-bottom: 6px;
        scrollbar-width: none;

        &::-webkit-scrollbar {
          display: none;
        }
      }

      .plan-card {
        background: #fff;
        border: 1px solid #e0e0e0; /* 通常の枠線 */
        border-radius: 8px;
        padding: 30px 15px;
        position: relative;
        text-align: center;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
        min-width: 0; /* グリッドアイテムの暗黙のmin-width:autoでカードが本来の1fr幅より広がるのを防ぐ */

        @media screen and (max-width: 768px) {
          padding: 12px;
          flex: 0 0 calc(50% - 6px);
          scroll-snap-align: start;
        }
      }
    }

    .plan-grid-wrapper {
      position: relative;
    }

    .plan-scroll-arrow {
      display: none;

      @media screen and (max-width: 768px) {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 30px;
        height: 30px;
        background: rgba(30, 20, 10, 0.55);
        border: none;
        border-radius: 50%;
        padding: 0;
        cursor: pointer;
        z-index: 2;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease;

        &.is-visible {
          opacity: 1;
          pointer-events: auto;
        }

        svg {
          width: 10px;
          height: 15px;
        }
      }
    }

    .plan-scroll-arrow--prev {
      left: 6px;
    }

    .plan-scroll-arrow--next {
      right: 6px;
    }

    /* おすすめプラン (Standard) のスタイル */

    .plan-card.recommended {
      background-color: #FFFAE8;
      border: 3px solid #e87a41; /* オレンジの太い枠 */
      box-shadow: 0 4px 15px rgba(232, 122, 65, 0.2);
      z-index: 1; /* 重なり順を上へ */
      transform: scale(1.02); /* 少し大きく強調 */

      .plan-btn {
        background-color: #FF6D2C;
      }
    }

    /* おすすめバッジ */

    .badge-recommended {
      position: absolute;
      top: -15px;
      left: -15px;
      background-color: #e87a41;
      color: white;
      width: 60px;
      height: 60px;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      transform: rotate(-15deg);
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      z-index: 2;

      & > svg {
        width: 100%;
      }
    }

    .plan-header {
      margin-bottom: 16px;

      @media screen and (max-width: 768px) {
        margin-bottom: 8px;
      }
    }

    .plan-name-en {
      font-size: 28px;
      font-weight: 900;
      margin: 0 0 5px 0;
      color: #333;
      display: inline-block;
      padding: 0 5px;

      @media screen and (max-width: 768px) {
        font-size: 20px;
      }
    }

    .plan-name-jp {
      font-size: 18px;
      font-weight: bold;
      color: #666;
      margin: 0;

      @media screen and (max-width: 768px) {
        font-size: 12px;
      }
    }

    .plan-divider {
      border: none;
      border-top: 1px solid #eee;
      margin: 16px 0;
      width: 100%;

      @media screen and (max-width: 768px) {
        margin: 8px 0;
      }
    }

    /* 価格エリア */

    .plan-price {
      font-size: 42px;
      font-weight: bold;
      color: #333;
      line-height: 1;
      margin-bottom: 5px;

      @media screen and (max-width: 768px) {
        font-size: 32px;
      }

      .currency {
        font-size: 40px;
        vertical-align: top;
        margin-right: 2px;

        @media screen and (max-width: 768px) {
          font-size: 24px;
        }
      }
    }

    .plan-price .tax {
      font-size: 12px;
      color: #333;
      font-weight: normal;
      margin-left: 5px;
    }

    .plan-discount {
      font-size: 16px;
      color: #FF0505; /* 赤文字 */
      margin-bottom: 4px;
      font-weight: normal;

      @media screen and (max-width: 768px) {
        font-size: 11px;
        white-space: nowrap;
      }

      .plan-discount-amount {
        font-size: 22px;
        font-weight: 900;

        @media screen and (max-width: 768px) {
          font-size: 13px;
        }
      }
    }

    .plan-discount-note {
      font-size: 11px;
      color: #999;
      font-weight: normal;
      margin: 0 0 15px;

      @media screen and (max-width: 768px) {
        font-size: 9px;
      }
    }

    .plan-tags {
      display: flex;
      justify-content: center;
      gap: 4px;
      flex-wrap: wrap;
      margin-bottom: 10px;
    }

    .tag-green {
      width: fit-content;
      height: 42px;

      & > svg {
        width: 100%;
        height: 100%;
      }

      @media screen and (max-width: 768px) {
        height: 38px;
      }

      @media screen and (max-width: 480px) {
        height: 30px;
      }
    }

    .tag-green--text {
      background-color: #3e913f;
      color: #fff;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 9999px;
      padding: 0 14px;
      font-size: 11px;
      font-weight: bold;
      line-height: 1.3;
      text-align: center;
      font-family: Hiragino Kaku Gothic ProN, 'Meiryo', sans-serif;

      @media screen and (max-width: 768px) {
        height: auto;
        background-color: #34A853;
        font-size: 10px;
        padding: 6px 10px;
        white-space: nowrap;
        align-items: baseline;
        box-shadow: 0 2px 6px rgba(52, 168, 83, 0.35);
      }

      @media screen and (min-width: 769px) {
        height: auto;
        background-color: #34A853;
        font-size: 13px;
        padding: 9px 14px;
        white-space: nowrap;
        align-items: baseline;
        box-shadow: 0 3px 10px rgba(52, 168, 83, 0.35);
      }

      .tag-green-amount {
        font-weight: 900;

        @media screen and (max-width: 768px) {
          font-size: 13px;
          color: #FFD873;
        }

        @media screen and (min-width: 769px) {
          font-size: 16px;
          color: #FFD873;
        }
      }
    }

    /* スペック表 */

    .plan-specs {
      text-align: left;
      margin-bottom: 16px;

      @media screen and (max-width: 768px) {
        margin-bottom: 8px;
      }
    }

    .spec-row {
      display: flex;
      justify-content: space-between;
      align-items: center;
      font-size: 14px;
      padding: 6px 10px;
      border-bottom: 1px dotted #eee;
      font-family: Hiragino Kaku Gothic ProN, 'Meiryo', sans-serif;

      @media screen and (max-width: 768px) {
        font-size: 9px;
        padding: 5px 2px;
        gap: 3px;
      }
    }

    .spec-row:last-child {
      border-bottom: none;
    }

    .spec-label {
      color: #888;
      white-space: nowrap;
    }

    .spec-value {
      font-weight: bold;
      color: #333;
      white-space: nowrap;

      @media screen and (max-width: 768px) {
        font-size: 9px;
      }
    }

    /* 特典リボンエリア */

    .plan-benefit-ribbon {
      margin: 10px -15px; /* カードのパディングを相殺して横幅いっぱいに */
      text-align: center;
    }

    .ribbon-shape {
      background-color: #bfa875; /* ゴールド */
      color: white;
      font-size: 14px;
      font-weight: bold;
      display: inline-block;
      padding: 2px 40px;
      position: relative;
      margin-bottom: 6px;

      /* リボンの端を尖らせる処理 */
      clip-path: polygon(100% 0, 96% 50%, 100% 100%, 0% 100%, 4% 50%, 0% 0%);
      width: 80%;
    }

    .benefit-text {
      font-size: 14px;
      color: #bfa875;
      line-height: 1.4;
      padding: 0 10px;
      font-weight: bold;
      font-family: Hiragino Kaku Gothic ProN, 'Meiryo', sans-serif;
      word-break: keep-all;
      overflow-wrap: break-word;

      @media screen and (max-width: 768px) {
        font-size: 12px;
        margin: 6px 0;

        > br {
          padding-block: 10px;
        }
      }

      .benefit-highlight {
        font-size: 19px;
        font-weight: 900;
        color: #FF0505;

        @media screen and (max-width: 768px) {
          font-size: 15px;
        }
      }

      .sp-break {
        display: none;

        @media screen and (max-width: 768px) {
          display: inline;
        }
      }
    }

    /* 初回セット内容 */

    .contents-title {
      font-size: 14px;
      font-weight: bold;
      margin-bottom: 10px;
      color: #333;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: space-between;

      @media screen and (max-width: 768px) {
        margin-top: 10px;
      }

      .content-title-caret-wrapper {
        display: flex;
        justify-content: center;
        align-items: center;
        transform: rotate(-90deg);
        transform-origin: center;
        width: 20px;
        height: 20px;
        background-color: black;
        border-radius: 50%;

        > svg {
          color: white;
          display: block;
          width: 12px;
          height: 12px;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
        }
      }
    }

    details[open] > .contents-title .content-title-caret-wrapper {
      transform: rotate(0deg);
    }

    .plan-contents {
      text-align: left;
      padding: 0 10px;
      flex-grow: 1; /* 高さを揃えるための余白調整 */
      margin-bottom: 20px;

      @media screen and (max-width: 768px) {
        margin-bottom: 0;
      }
    }

    .plan-contents-image {
      margin-bottom: 12px;
      border-radius: 8px;
      overflow: hidden;

      img {
        display: block;
        width: 100%;
        aspect-ratio: 4 / 3;
        object-fit: cover;
      }
    }

    .contents-list {
      list-style: none;
      padding: 0;
      margin: 0;

      .contents-item {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 14px;
        margin-bottom: 6px;
        color: #333;
        font-weight: bold;

        @media screen and (max-width: 768px) {
          font-size: 12px;
        }

        .check-icon {
          width: 20px;
          height: 20px;

          & > svg {
            width: 100%;
            height: 100%;
          }
        }
      }
    }


    .check-icon {
      flex-shrink: 0;
    }

    /* ボタン */

    .plan-btn {
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 10px;
      background-color: #000;
      color: #fff;
      text-decoration: none;
      border-radius: 50px;
      font-size: 16px;
      font-weight: bold;
      transition: opacity 0.3s;
      width: 100%;
      height: 64px;
      margin-top: auto; /* 一番下に配置 */

      @media screen and (max-width: 768px) {
        font-size: 12px;
        border-radius: 32px;
        height: 48px;
      }
    }

    .plan-btn:hover {
      opacity: 0.8;
    }

    @media (max-width: 767px) {
      .plan-heading {
        font-size: 36px;
        margin-bottom: 40px;
      }

      .plan-card.recommended {
        transform: none; /* スマホでは拡大しない */
      }
    }
  }
}