/* sample.php 試用包品項卡片，版型與樣式移植自 MY 站 css/sample.css 的 Sample picker 段落。
   只作用在 .sample-picker（成人區與寶寶區的品項區塊），不影響頁面其他表單欄位。 */

.sample-picker .sample-item-list {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 14px;
}

.sample-picker .sample-item {
  position: relative;
  display: flex;
  flex-direction: column;
  background-color: #fff;
  border: 2px solid #e6e6e6;
  border-radius: 8px;
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.sample-picker .sample-item:has(.sample-select:checked) {
  border-color: #004998;
  background-color: #EAF3FB;
  box-shadow: 0 2px 8px 0 rgba(0, 73, 152, 0.18);
}

/* 原生 checkbox 藏起來，改由卡片右上角的圓點顯示勾選狀態 */
.sample-picker .sample-item .sample-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
}

.sample-picker .sample-item-card {
  position: relative;
  order: 1;
  display: flex;
  justify-content: center;
  padding: 14px 14px 0;
  margin: 0;
  cursor: pointer;
}

/* 活動類型 Tag：與右上角勾選圓圈同高，放在卡片左上角 */
.sample-picker .sample-item-card .activity-type-tag {
    top: 14px;
    left: 14px;
}

.sample-picker .sample-item.is-disabled .activity-type-tag {
    background-color: #b5b5b5;
}

.sample-picker .sample-item-card::before {
  content: "";
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  border: 2px solid #c9c9c9;
  border-radius: 50%;
  background-color: #fff;
  box-sizing: border-box;
  transition: border-color .2s ease, background-color .2s ease;
}

.sample-picker .sample-select:checked ~ .sample-item-card::before {
  border-color: #004998;
  background-color: #004998;
}

.sample-picker .sample-item-card::after {
  content: "\f00c";
  font-family: FontAwesome;
  position: absolute;
  top: 14px;
  right: 14px;
  width: 24px;
  height: 24px;
  font-size: 12px;
  line-height: 24px;
  text-align: center;
  color: #fff;
  opacity: 0;
  transition: opacity .2s ease;
}

.sample-picker .sample-select:checked ~ .sample-item-card::after {
  opacity: 1;
}

.sample-picker .sample-item-img {
  width: 150px;
  height: 150px;
  object-fit: contain;
  flex-shrink: 0;
}

.sample-picker .sample-item-name {
  order: 2;
  display: block;
  padding: 10px 14px 14px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #727171;
  line-height: 1.4;
}

/* 不可選（已申請）：圖片與品名變淡，詳情仍可閱讀 */
.sample-picker .sample-item.is-disabled .sample-item-card {
  cursor: not-allowed;
}

.sample-picker .sample-item.is-disabled .sample-item-img,
.sample-picker .sample-item.is-disabled .sample-item-name {
  opacity: .5;
}

.sample-picker .sample-item.is-disabled .sample-item-card::before {
  background-color: #ececec;
  border-color: #d8d8d8;
}

.sample-picker .sample-item-more {
  order: 3;
  border-top: 1px solid #eee;
}

.sample-picker .sample-item-more summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 14px;
  background-color: #F7F9FB;
  font-size: 13px;
  font-weight: bold;
  color: #004998;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: background-color .2s ease;
}

.sample-picker .sample-item-more summary:hover {
  background-color: #EAF3FB;
}

.sample-picker .sample-item-more summary::-webkit-details-marker {
  display: none;
}

.sample-picker .sample-item-more summary::before {
  content: "\f129";
  font-family: FontAwesome;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background-color: #004998;
  color: #fff;
  font-size: 10px;
  flex-shrink: 0;
}

.sample-picker .sample-item-more summary i {
  margin-left: auto;
  transition: transform .2s ease;
}

.sample-picker .sample-item-more[open] summary {
  background-color: #EAF3FB;
  border-bottom: 1px solid #d8e6f3;
}

.sample-picker .sample-item-more[open] summary i {
  transform: rotate(180deg);
}

.sample-picker .sample-item-details {
  padding: 14px;
}

.sample-picker .sample-item-detail-label {
  display: block;
  margin: 10px 0 4px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: .5px;
  color: #004998;
}

.sample-picker .sample-item-detail:first-child .sample-item-detail-label {
  margin-top: 0;
}

.sample-picker .sample-item-detail p,
.sample-picker .sample-item-detail ul {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: #585858;
}

.sample-picker .sample-item-detail ul {
  padding-left: 0;
  list-style-position: inside;
}

/* 不可選的原因（已申請），沒有原因時自動收起 */
.sample-picker .sample_reason {
  order: 4;
  display: block;
  padding: 0 14px 12px;
  color: #b45309;
  font-size: 13px;
  line-height: 1.5;
}

.sample-picker .sample_reason:empty {
  display: none;
}

@media (max-width: 767px) {
  .sample-picker .sample-item-img {
    width: 110px;
    height: 110px;
  }

  .sample-picker .sample-item-card::before,
  .sample-picker .sample-item-card::after {
    width: 28px;
    height: 28px;
  }

  .sample-picker .sample-item-card::after {
    line-height: 28px;
    font-size: 13px;
  }
}

/* 桌機：左欄圖片＋品名，右欄詳情（固定展開，不顯示收合列） */
@media (min-width: 768px) {
  .sample-picker .sample-item-detail-label,
  .sample-picker .sample-item-detail p,
  .sample-picker .sample-item-detail ul {
    font-size: 14px;
  }

  .sample-picker .sample-item-name {
    font-size: 21px;
  }

  /* 左欄上下各留一列彈性空白（1fr），讓圖片＋品名＋原因整組在左欄垂直置中；
     右欄詳情較長時，多出的高度平均分到上下空白列，不會全堆在左欄下方 */
  .sample-picker .sample-item {
    display: grid;
    grid-template-columns: 440px 1fr;
    grid-template-rows: 1fr auto auto auto 1fr;
    grid-template-areas:
      ". details"
      "image details"
      "title details"
      "reason details"
      ". details";
  }

  .sample-picker .sample-item-name {
    grid-area: title;
  }

  .sample-picker .sample-item-card {
    grid-area: image;
    align-items: center;
    /* 縮圖區塊不當定位基準，Tag 與勾選圓圈改以整張卡片定位，固定在左欄頂端，不隨縮圖置中下移 */
    position: static;
  }

  /* 勾選圓圈：左欄右上角（左欄寬 440px − 右邊距 14px − 圓圈 24px） */
  .sample-picker .sample-item-card::before,
  .sample-picker .sample-item-card::after {
    top: 14px;
    right: auto;
    left: 402px;
  }

  .sample-picker .sample-item-img {
    width: 210px;
    height: 210px;
  }

  .sample-picker .sample-item-more {
    grid-area: details;
    align-self: center;
    border-top: none;
  }

  /* 左右欄分隔線：以整張卡片高度畫一條直線，才不會被左欄上下的空白列切斷 */
  .sample-picker .sample-item::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 440px;
    border-left: 1px solid #eee;
    pointer-events: none;
  }

  .sample-picker .sample-item-more summary {
    display: none;
  }

  .sample-picker .sample-item-details {
    padding: 20px 24px;
  }

  .sample-picker .sample_reason {
    grid-area: reason;
    text-align: center;
  }
}

/* 平板寬度左欄縮窄，避免詳情被擠到太窄 */
@media (min-width: 768px) and (max-width: 991px) {
  .sample-picker .sample-item {
    grid-template-columns: 280px 1fr;
  }

  .sample-picker .sample-item::after {
    left: 280px;
  }

  /* 勾選圓圈：左欄寬 280px − 14px − 24px */
  .sample-picker .sample-item-card::before,
  .sample-picker .sample-item-card::after {
    left: 242px;
  }

  .sample-picker .sample-item-img {
    width: 160px;
    height: 160px;
  }
}

/* 活動說明：勾選品項的寄送規則與條款，位於個資同意聲明上方 */
.activity-info .activity-info-item {
  padding: 14px 16px;
  margin-bottom: 12px;
  background-color: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
}

.activity-info .activity-info-name {
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 700;
  color: #004998;
}

.activity-info .activity-info-label {
  display: block;
  margin: 8px 0 4px;
  font-size: 13px;
  font-weight: bold;
  color: #004998;
}

.activity-info p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #585858;
}

/* 出生證明區塊的提示文字 */
.trial-cert .trial-cert-hint,
.trial-proof .trial-cert-hint {
  margin: 0 0 0 8px;
  font-size: 14px;
  color: #b45309;
}

/* 出生證明、發票／匯款證明上傳區：標題與提示同一行，按鈕、檔名、格式說明同一行，縮小版面 */
.trial-cert .form-group > label,
.trial-proof .form-group > label {
  display: inline-block;
  margin: 0 0 8px;
}

.trial-cert .baby_file,
.trial-proof .baby_file {
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 0;
}

.trial-cert .baby_file_btn,
.trial-proof .baby_file_btn {
  height: 36px;
  padding: 0 16px;
}

.trial-cert .baby_file_memo,
.trial-proof .baby_file_memo {
  font-size: 12px;
  line-height: 1.4;
}

.trial-cert .trial-cert-status {
  margin: 0;
  font-size: 14px;
  color: #3c763d;
}

.trial-cert .trial-cert-reason {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.6;
  color: #c00;
}

/* 手機寬度：提示文字（含活動名稱可能較長）獨立一行，避免擠在標題旁換行 */
@media (max-width: 767px) {
  .trial-cert .trial-cert-hint,
  .trial-proof .trial-cert-hint {
    display: block;
    margin: 0 0 6px;
    font-size: 13px;
  }
}
