/* お気に入り一覧ページ */
#favorite-page .favorite-page-wrap {
  width: min(1160px, calc(100% - 32px));
  margin: 38px auto 90px;
}
#favorite-page .favorite-page-wrap h1 {
  font-size: 28px;
  margin: 0 0 12px;
  text-align: left;
}
#favorite-page .favorite-page-heading {
  margin-bottom: 28px;
  text-align: left;
}
#favorite-page .favorite-page-heading p {
  margin: 0 0 8px;
}
#favorite-page .favorite-page-wrap strong {
  font-weight: bold !important;
}
#favorite-page .favorite-demo-note {
  font-size: 1.3rem;
  color: #697579;
}
#favorite-page .favorite-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 36px;
  background-color: inherit;
  border-bottom: none;
}
#favorite-page .favorite-tab {
  appearance: none;
  cursor: pointer;
  border: 1px solid #ddd;
  background: #f6f7f8;
  padding: 12px 24px;
  font-size: 15px;
  color: #40515b;
  border-radius: 23px;
}
#favorite-page .favorite-tab[aria-selected="true"] {
  background: #263f50;
  border-color: #263f50;
  color: #fff;
  font-weight: bold !important;
}
#favorite-page .favorite-tab span {
  font-weight: bold !important;
}
#favorite-page .favorite-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 285px;
  gap: 28px;
  align-items: start;
}
#favorite-page .favorite-main {
  min-width: 0;
}
#favorite-page .favorite-panel[hidden] {
  display: none;
}
#favorite-page .favorite-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 1.3rem;
}
#favorite-page .favorite-panel-heading h2,
#favorite-page .favorite-panel h2 {
  margin: 0 0 12px;
  font-size: 2rem;
  border-bottom: 3px solid #3fab7c;
}
#favorite-page .favorite-search-link {
  font-size: 13px;
}
#favorite-page .favorite-case-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px 16px;
}
#favorite-page .favorite-case-card {
  position: relative;
  min-width: 0;
  border: 1px solid #e0e5e7;
  border-radius: 4px;
  padding: 10px;
  text-align: left;
}
#favorite-page .favorite-case-link {
  display: block;
  text-decoration: none;
}
#favorite-page .favorite-case-image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #f1f1f1;
}
#favorite-page .favorite-case-title {
  display: block;
  padding: 9px 0 5px;
  font-size: 1.5rem;
  line-height: 1.5;
  color: #333;
}

#favorite-page a:hover .favorite-case-title {
  color: #66737a;
}

#favorite-page .favorite-corp-name {
  font-size: 1.3rem;
  color: #66737a;
  margin: 0 0 41px;
}
#favorite-page .favorite-remove {
  position: absolute;
  bottom: 10px;
  cursor: pointer;
  border: 1px solid #cfd9de;
  background: #fff;
  border-radius: 3px;
  padding: 6px 8px;
  font-size: 1.3rem;
  color: #e95479;
}

#favorite-page .favorite-remove span {
  color: #66737a;
}

#favorite-page .favorite-remove {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

#favorite-page .favorite-heart-icon {
  width: 15px;
  height: 15px;
  color: #e95479;
  flex-shrink: 0;
}

/* =========================================
   会社お気に入り：corp_list.php 準拠の横長レイアウト
   ========================================= */
#favorite-page .favorite-company-list {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#favorite-page .favorite-company-list-card {
  position: relative;
  min-width: 0;
  background: #f1f1f1;
  border-radius: 3px;
  padding: 18px 18px;
  text-align: left;
}

#favorite-page .favorite-company-heading {
  font-size: 1.7rem;
  font-weight: normal;
  margin: 0 0 16px;
  border-left: 5px solid #3fab7c;
  padding: 3px 150px 3px 12px;
}

#favorite-page .favorite-company-body {
  display: grid;
  grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

#favorite-page .favorite-company-list-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

#favorite-page .favorite-company-detail {
  min-width: 0;
}
#favorite-page .favorite-company-location {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  font-size: 1.4rem;
}
#favorite-page .favorite-company-type {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 2px;
  background: #333;
  color: #fff;
  font-size: 1.4rem;
}

#favorite-page .favorite-company-type.type-ko {
  background: #ca5858;
}

#favorite-page .favorite-company-type.type-hm {
  background: #518abd;
}

#favorite-page .favorite-company-type.type-ke {
  background: #845dcb;
}

#favorite-page .favorite-company-specs {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 8px;
}
#favorite-page .favorite-company-evaluation {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 0;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 8px;
}
#favorite-page .favorite-company-spec-label {
  display: block;
  width: 100%;
  padding: 4px;
  border-radius: 2px;
  background: #333;
  color: white;
  text-align: center;
  font-size: 1.4rem;
}
#favorite-page .favorite-company-score {
  font-size: 2.6rem;
  font-weight: normal;
  line-height: 1.2;
  margin-top: 6px;
}
#favorite-page .favorite-company-stars {
  max-width: 100%;
  height: auto;
  margin: 2px auto 8px;
}
#favorite-page .favorite-company-price {
  width: 100%;
  border-top: 1px solid #ccc;
  padding-top: 8px;
  margin-top: auto;
  text-align: center;
}
#favorite-page .favorite-company-price-value {
  display: block;
  padding: 8px 0 2px;
  font-size: 1.5rem;
  font-weight: normal;
}
#favorite-page .favorite-company-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  margin: 0;
  background: #fff;
  border: 1px solid #aaa;
  border-radius: 3px;
  padding: 6px;
  font-size: 1.5rem;
}
#favorite-page .favorite-company-summary dt,
#favorite-page .favorite-company-summary dd {
  min-width: 0;
  margin: 0;
  padding: 8px 2px;
  border-bottom: 1px dashed #ccc;
}
#favorite-page .favorite-company-summary dt:nth-last-child(2),
#favorite-page .favorite-company-summary dd:last-child {
  border-bottom: 0;
}
#favorite-page .favorite-company-summary dd {
  text-align: right;
}

#favorite-page .favorite-company-catch-copy {
  margin: 14px 0 0;
  font-size: 1.4rem;
  line-height: 1.65;
  white-space: pre-line;
}
#favorite-page .favorite-company-list-card .favorite-request-unavailable {
  margin: 10px 0 0;
  color: #777;
  font-size: 1.3rem;
}
#favorite-page .favorite-company-remove {
  height: 33px;
  right: 18px;
  top: 16px;
}
@media (max-width: 960px) {
  #favorite-page .favorite-company-body {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 767px) {
  #favorite-page .favorite-company-heading {
    padding-right: 0;
  }
  #favorite-page .favorite-company-list-card {
    padding: 14px 12px 62px;
  }
  #favorite-page .favorite-company-body {
    gap: 12px;
  }
  #favorite-page .favorite-company-specs {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  #favorite-page .favorite-company-remove {
    left: 12px;
    bottom: 18px;
    top: auto;
  }
}
@media (max-width: 420px) {
  #favorite-page .favorite-company-specs {
    grid-template-columns: 1fr;
  }
}

/* 坪単価のコメントは文字数があるため折り返して表示 */
#favorite-page .favorite-company-score {
  overflow-wrap: anywhere;
  text-align: center;
  font-size: 1.75rem;
  line-height: 1.45;
  margin: 10px 0 8px;
}
#favorite-page .favorite-company-stars {
  width: 120px;
  height: 20px;
  object-fit: contain;
}

/* 写真のお気に入り：画像下のカテゴリラベル */
#favorite-page .favorite-photo-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
#favorite-page .favorite-photo-categories:empty {
  display: none;
}
#favorite-page .favorite-photo-category {
  display: inline-block;
  padding: 3px 7px;
  border-radius: 3px;
  background: #f1f3f4;
  color: #58666d;
  font-size: 1.3rem;
  line-height: 1.4;
}

#favorite-page .favorite-request-area {
  position: sticky;
  top: 72px;
  align-self: start;
}

#favorite-page .favorite-request-area h2 {
  padding: 8px 0;
  color: #fff;
  background: #3fab7c;
  font-size: 1.7rem;
  border-radius: 5px 5px 0 0;
}

#favorite-page .favorite-request-box {
  max-height: calc(100vh - 90px);
  overflow-y: auto;
  padding: 10px 18px 20px;
  background: #f7fafb;
  border-radius: 0 0 5px 5px;
  text-align: left;
}
#favorite-page .favorite-request-box p {
  font-size: 1.3rem;
  line-height: 1.6;
}
#favorite-page #favorite-corp-options {
  margin-top: 20px;
}
#favorite-page .favorite-company-choice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid #e1e8eb;
  font-size: 1.5rem;
  cursor: pointer;
}
#favorite-page .favorite-company-choice input {
  margin-top: 3px;
}
#favorite-page .favorite-request-count {
  margin: 5px 0;
  text-align: right;
  font-size: 1.4rem !important;
}
#favorite-page #favorite-request-button {
  display: block;
  width: 100%;
  padding: 13px 7px;
  border: 0;
  background: #b65b37;
  color: white;
  font-weight: bold;
  cursor: pointer;
  font-size: 1.5rem;
}
#favorite-page #favorite-request-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
#favorite-page .favorite-form-note {
  color: #737e83;
}
@media (max-width: 960px) {
  #favorite-page .favorite-layout {
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 18px;
  }
  #favorite-page .favorite-case-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 767px) {
  #favorite-page .favorite-page-wrap {
    width: calc(100% - 24px);
    margin-top: 62px;
  }
  #favorite-page .favorite-layout {
    display: block;
  }
  #favorite-page .favorite-request-area {
    margin-top: 30px;
  }
  #favorite-page .favorite-request-area {
    position: static;
  }
  #favorite-page .favorite-request-box {
    max-height: none;
  }
  #favorite-page .favorite-tabs {
    gap: 3px;
  }
  #favorite-page .favorite-tab {
    flex: 1;
    padding: 12px 4px;
    font-size: 13px;
  }
  #favorite-page .favorite-case-grid {
    gap: 12px;
  }
  #favorite-page .favorite-panel-heading {
    flex-direction: column;
  }
#favorite-page #copyright {
    margin-bottom: 0;
}
}


/* お気に入りバー */

#header-area {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

#header-area #logo {
  margin-top: 15px;
}

#header-menu {
  margin-top: 55px;
}

#favorite-bar {
  position: fixed;
  width: fit-content;
  top: 0;
  right: 0;
  z-index: 1000;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

#favorite-bar .favorite-info {
  position: absolute;
  top: 11px;
  left: -13em;
  padding: 0 5px 0 10px;
  border: 1px solid #ccc;
  background: #fff;
  text-align: right;
}

#favorite-bar .favorite-info::before {
  content: "";
  position: absolute;
  top: 50%;
  right: -9px;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left: 5px solid #FFF;
  z-index: 2;
}

#favorite-bar .favorite-info::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -10px;
  margin-top: -5px;
  border: 5px solid transparent;
  border-left: 5px solid #ccc;
  z-index: 1;
}

#favorite-bar .favorite-info p{
  font-size: 1.1rem;
}

.favorite-bar-link {
  display: flex;
  width: auto;
  align-items: center;
  justify-content: flex-end;
  gap: 24px;
  min-height: 46px;
  padding: 8px 30px;
  color: #333 !important;
  font-size: 1.6rem;
}

.favorite-bar-title {
  font-weight: bold;
}

.favorite-bar-title span {
  color: #e95479; /* ハートの色 */
}

.favorite-bar-link a {
  text-decoration: none;
  color: #333;
}

.favorite-bar-link a:hover {
  background: rgba(0, 0, 0, 0.08);
}

.favorite-bar-link a div{
  display: inline;
  color: #00c!important;
  text-decoration: underline!important;
}

.favorite-bar-link strong {
  font-size: 1.8rem;
  font-weight: bold;
}

.favorite-bar-arrow {
  font-size: 13px;
}

/* スマートフォン */
@media (max-width: 767px) {
  #header-area {
    display: block;
  }
  #header-area #logo {
    margin-top: 0;
  }
  #favorite-bar {
    top: 48px;
    width: 100%;
  }

#favorite-bar .favorite-info {
  top: 3.7em;
  left: auto;
  right: 17.5em;
}

#favorite-bar .favorite-info::before {
  right: auto;
  left: 50%;
  top: -5px;
  margin-top: -5px;
  border: 5px solid transparent;
  border-bottom: 5px solid #FFF;
  z-index: 2;
}

#favorite-bar .favorite-info::after {
  right: auto;
  left: 50%;
  top: -6px;
  margin-top: -5px;
  border: 5px solid transparent;
  border-bottom: 5px solid #ccc;
  z-index: 1;
}
  .favorite-bar-link {
    gap: 12px;
    min-height: 42px;
    padding: 8px;
    font-size: 13px;
  }

  .favorite-bar-arrow {
    display: none;
  }
  #container{
    margin-top: 113px;
  }
  .dl-menuwrapper button{
    margin-top: -39px!important;
  }
}

/* =========================================
   お気に入り飛行アニメーション
========================================= */

/* 飛んでいくハート */
.favorite-flying-heart {
  position: fixed;
  z-index: 99999;
  pointer-events: none;
  color: #e95479;
  font-size: 32px;
  font-family: Arial, sans-serif;
  line-height: 1;
  text-shadow: 0 2px 8px rgba(233, 84, 121, 0.3);
  will-change: transform, opacity;
}

/* 到着時のポンッ！ */
.favorite-pop {
  display: inline-block;
  text-decoration: underline;
  animation: favorite-pop 0.5s ease-out;
  transform-origin: center center;
}

@keyframes favorite-pop {
  0% {
    transform: scale(1);
    color: inherit;
  }
  35% {
    transform: scale(1.8);
    color: #e95479;
  }
  65% {
    transform: scale(0.9);
    color: #e95479;
  }
  100% {
    transform: scale(1);
    color: inherit;
  }
}

/* アニメーションを減らす設定への対応 */
@media (prefers-reduced-motion: reduce) {
  /*  .favorite-pop {
        animation: none;
    } */
}

/* =========================================
   お気に入り登録・削除アイコン
========================================= */

button.favorite-case-button {
  border: none;
  background: none;
  height: 20px;
}
button.favorite-case-button img {
  margin: 0;
  border: none;
}

.corplist li {
  position: relative;
}

.corplist li h2 {
  padding-right: 190px;
}

.corplist li .js-favorite-company {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  right: 10px;
  top: 10px;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 5px 10px;
}


/* 会社詳細：旧ボタンと同じ3列・同じ高さに統一 */
.corp-spec .corp-action-buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    width: min(100%, 440px);
    align-items: stretch;
}

/* common.css のフォーム幅指定を上書き */
.corp-spec .corp-action-buttons > .favorite-company-detail,
.corp-spec .corp-action-buttons > form {
    float: none;
    display: block;
    width: 100%;
    min-width: 0;
    height: 90px;
    margin: 0 !important;
    padding: 0;
    box-sizing: border-box;
}

/* 既存の資料請求・相談ボタン */
.corp-spec .corp-action-buttons .btn-mail,
.corp-spec .corp-action-buttons .btn-meet {
    display: block;
    float: none;
    width: 100%;
    height: 90px;
    box-sizing: border-box;
    margin: 0 !important;
    background-repeat: no-repeat;
    background-position: center top;
}

/* お気に入りボタン */
.corp-spec .corp-action-buttons .favorite-company-button {
    display: flex;
    float: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    height: 90px;
    min-height: 0;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    background: #fff;
    border: 1px solid #cfd9de;
    border-radius: 4px;
    color: #66737a;
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1.3;
}

.corp-spec .corp-action-buttons .favorite-heart-icon {
    width: 23px;
    height: 23px;
    color: #e95479;
    flex-shrink: 0;
}

/* スマートフォン */
@media (max-width: 767px) {
    .corp-spec .corp-action-buttons {
        width: 100%;
        gap: 2%;
    }

    .corp-spec .corp-action-buttons > .favorite-company-detail,
    .corp-spec .corp-action-buttons > form,
    .corp-spec .corp-action-buttons .btn-mail,
    .corp-spec .corp-action-buttons .btn-meet,
    .corp-spec .corp-action-buttons .favorite-company-button {
        height: 72px;
    }

    .corp-spec .corp-action-buttons form button.btn-mail,
    .corp-spec .corp-action-buttons form button.btn-meet {
        width: 100%;
        height: 72px;
        margin: 0 !important;
        background-size: 100% auto;
        background-position: center top;
        box-sizing: border-box;
    }

    .corp-spec .corp-action-buttons form button.btn-mail {
        display: flex;
        align-items: flex-end;
        justify-content: center;
        padding: 0 2px 8px;
        white-space: nowrap;
    }

    .corp-spec .corp-action-buttons form button.btn-meet {
        padding: 35px 0 0;
    }

    .corp-spec .corp-action-buttons .favorite-company-button {
        padding: 0;
        font-size: 1.1rem !important;
    }

    .corp-spec .corp-action-buttons .favorite-heart-icon {
        width: 19px;
        height: 19px;
    }

    .corp-spec .corp-action-buttons form {
        width: 100% !important;
        min-width: 0;
        margin: 0 !important;
    }

    .corp-spec .corp-action-buttons button.btn-mail,
    .corp-spec .corp-action-buttons button.btn-meet {
        float: none;
        display: block;
        width: 100% !important;
        height: 72px;
        margin: 0 !important;
        box-sizing: border-box;
    } 
    
    
  .corplist li {
    padding-bottom: 50px;
  }
  .corplist li h2 {
    padding-right: 0;
  }

  .corplist li .js-favorite-company {
    right: auto;
    left: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
  }    
}


.js-favorite-company .favorite-heart-icon {
  width: 15px;
  height: 15px;
  color: #e95479;
  flex-shrink: 0;
}

/* corp_case.php：施工事例一覧のハート */
.corp-case li {
    position: relative;
}
.corp-case li > .favorite-case-button {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    padding: 3px;
    width: auto;
    height: auto;
    background: rgba(255, 255, 255, 0.95);
    border: 0;
    border-radius: 3px;
    cursor: pointer;
}
.corp-case li > .favorite-case-button img {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
}

/* photo_detail.php：タイトル・関連写真の小さなハート */
#photo_detail .favorite-photo-icon-button {
    display: inline-block;
    vertical-align: middle;
    position: relative;
    z-index: 100;
    padding: 0 3px;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 1;
}
#photo_detail .favorite-photo-icon-button img {
    display: inline-block;
    width: auto;
    height: auto;
    vertical-align: middle;
    border: 0;
}

/* photo_detail.php：資料請求の隣にある写真お気に入りボタン */
#photo_detail .btn-box .favorite-photo-text-button {
    width: 100%;
    height: 100%;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    cursor: pointer;
}
#photo_detail .btn-box .favorite-photo-text-button img,
#photo_detail .btn-box .favorite-photo-text-button span {
    display: none;
}
#photo_detail .btn-box .favorite-photo-text-button::after {
    content: "写真をお気に入り登録";
}
#photo_detail .btn-box .favorite-photo-text-button[aria-pressed="true"]::after {
    content: "写真をお気に入り解除";
}

/* case_detail.php: 事例詳細のお気に入りボタン */
#case_detail .corp-action-buttons .favorite-company-button {
    text-align: center;
}
#case_detail .corp-action-buttons .favorite-company-button > img {
    display: block;
    max-width: 22px;
    max-height: 22px;
    margin: 0 auto;
    border: 0;
}

/* 施工事例詳細：スマホのお気に入りボタン */
@media (max-width: 767px) {
    #case_detail .corp-spec .corp-action-buttons button.favorite-company-button {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        width: 100%;
        height: 72px;
        margin: 0;
        padding: 0;
        box-sizing: border-box;
        background: #fff;
        border: 1px solid #cfd9de;
        color: #66737a;
        font-size: 1.2rem !important;
        line-height: 1.3;
    }
}

/* JS が aria-pressed を切り替えたら文言も変える */
#case_detail .corp-action-buttons .favorite-case-label {
    font-size: 0;
}
#case_detail .corp-action-buttons .favorite-case-label::after {
    content: 'お気に入りに追加';
    font-size: 1.2rem;
}
#case_detail .corp-action-buttons .favorite-company-button[aria-pressed="true"] .favorite-case-label::after {
    content: 'お気に入り解除';
}

/* 事例内の写真ギャラリー：サムネイル右上にハート */
#case_detail .photo-list li {
    position: relative;
}
#case_detail .photo-list .favorite-photo-icon-button {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 2;
    display: block;
    padding: 3px;
    background: rgba(255, 255, 255, 0.95);
    border: 0;
    border-radius: 3px;
    cursor: pointer;
}
#case_detail .favorite-photo-icon-button img {
    display: block;
    width: auto;
    height: auto;
    margin: 0;
    border: 0;
}
/* スマホ：スライダー内の写真お気に入りボタン */
#case_detail .swiper-slide .favorite-photo-icon-button {
    display: inline-block;
    vertical-align: middle;
    padding: 0 5px 0 0;
    background: transparent;
    border: 0;
    cursor: pointer;
}
#case_detail .swiper-slide .favorite-photo-icon-button img {
    display: inline-block;
    vertical-align: middle;
}
@media (max-width: 767px) {
    #case_detail .corp-action-buttons .favorite-case-label::after {
        font-size: 1.1rem;
    }
}

