/* SFM Home Mockup V4: Mobile-first, Desktop enhanced (A + B) */

:root{
  --bg: #f6f1ea;
  --card: #ffffff;
  --text: #1f1f1f;
  --muted: rgba(0,0,0,.55);
  --line: rgba(0,0,0,.10);
  --accent: #f07a2b;
  --accent2: #ff8a3d;
  --radius: 18px;
}

body{
  background: var(--bg) !important;
}

/* Keep your existing topbar/bottom nav intact; we only style our mock area */
.sfm-home-mock{
  padding: 12px 14px 80px;
}

.home-announce-slot{
  max-width:1100px;
  margin:0 auto 12px;
  padding:0 12px;
}
.home-announce-slot.is-empty{
  display:none;
}
.home-lazy-card{
  content-visibility:auto;
  contain-intrinsic-size:420px;
}

/* HERO */
.hero-mock{
  background: linear-gradient(180deg, rgba(240,122,43,.12), rgba(240,122,43,0));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 22px 18px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.hero-left h1{
  margin: 0;
  font-size: 30px;
  letter-spacing: .5px;
}

.hero-sub{
  font-size: 18px;
  font-weight: 600;
  margin-top: 6px;
}

.hero-desc{
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

/* 強力誘因清單 */
.hero-hooks{
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.hero-hook{
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  background: rgba(255,255,255,.7);
  border: 1px solid rgba(240,122,43,.2);
  border-radius: 12px;
  padding: 9px 14px;
  line-height: 1.4;
}

.hero-actions{
  margin-top: 16px;
  display: grid;
  gap: 10px;
}

.hero-line-note{
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #4d7a4d;
}
.hero-line-note.is-empty{
  display:none;
}
.hero-line-note a{
  color:#06C755;
  font-weight:700;
  text-decoration:none;
}

.hero-confidence-strip{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.hero-confidence-pill{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:7px 11px;
  border-radius:999px;
  border:1px solid rgba(237,212,177,.72);
  background:rgba(255,248,235,.92);
  color:#6d5538;
  font-size:12px;
  font-weight:700;
}
.hero-steps{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:8px;
  margin-top:12px;
}
.hero-step{
  display:flex;
  gap:10px;
  align-items:flex-start;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.72);
  border:1px solid rgba(237,212,177,.62);
}
.hero-step-no{
  width:24px;
  height:24px;
  flex:0 0 24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border-radius:999px;
  background:rgba(240,122,43,.14);
  color:#8c4b00;
  font-size:12px;
  font-weight:900;
}
.hero-step strong{
  display:block;
  font-size:12px;
  color:#6f4c1c;
}
.hero-step span{
  display:block;
  margin-top:2px;
  font-size:12px;
  line-height:1.55;
  color:#7b6956;
}

.btn-mock{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  border-radius: 14px;
  padding: 14px 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--card);
  font-weight: 600;
  cursor: pointer;
  position: relative;
  z-index: 1;
  min-height: 48px;
  touch-action: manipulation;
}

.btn-mock.primary{
  background: linear-gradient(180deg, var(--accent2), var(--accent));
  color: #fff;
  border-color: rgba(0,0,0,.06);
  box-shadow: 0 10px 25px rgba(240,122,43,.22);
}

.btn-mock.ghost{
  background: #fff;
}

.btn-mock.full{ width: 100%; }

.btn-mock.small{
  padding: 10px 12px;
  border-radius: 12px;
  font-size: 13px;
}

/* Hero right plate (desktop visible) */
.hero-right{ display:none; }
.hero-plate{
  height: 220px;
  border-radius: 22px;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 30% 20%, rgba(255,138,61,.22), rgba(255,255,255,0) 55%),
              linear-gradient(180deg, #fff, rgba(255,255,255,.86));
  display:flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}
.hero-plate-badge{
  position:absolute;
  top:14px;
  left:14px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(0,0,0,.62);
  background: rgba(255,255,255,.75);
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 999px;
}
.hero-plate-emoji{ font-size: 64px; }
.hero-plate-caption{
  margin-top: 10px;
  font-size: 13px;
  color: var(--muted);
}

/* CARDS */
.card-mock{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 14px;
  box-shadow: 0 10px 24px rgba(0,0,0,.04);
}

.card-mock.soft{
  background: rgba(255,255,255,.72);
}

.card-hd{
  display:flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.title-row{
  display:flex;
  align-items: center;
  gap: 10px;
}

.title-row h2{
  margin: 0;
  font-size: 18px;
}

.emoji{ font-size: 18px; }

.sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.card-bd{}

.card-actions{ margin-top: 12px; }

/* RECO container: we style common child cards gracefully even if JS renders its own markup */
.reco-grid{
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* Expiring items — 垂直列表，不橫滑 */
.chip-scroll{
  overflow-x: visible;
  padding-bottom: 0;
}
.chip-row{
  display:flex;
  flex-direction: column;
  gap: 8px;
  min-height: 40px;
}

/* urgentBox item 樣式 */
#urgentBox > *{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.78);
  border-radius: 14px;
  padding: 10px 14px;
  font-size: 13px;
  white-space: nowrap;
}

/* Seasonal tags */
.tag-row{
  display:flex;
  flex-wrap: wrap;
  gap: 10px;
}
.tag-row > *{
  border: 1px solid var(--line);
  background: rgba(255,255,255,.85);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
}

/* Desktop enhancement: keep top bar (A) + layout becomes more product-like (B) */
@media (min-width: 1024px){
  .sfm-home-mock{ padding: 18px 18px 80px; }

  .hero-mock{
    grid-template-columns: 1.15fr .85fr;
    align-items: center;
    padding: 26px 22px;
  }

  .hero-left h1{ font-size: 40px; }
  .hero-sub{ font-size: 20px; }
  .hero-actions{ grid-template-columns: minmax(280px, 1fr) 220px; }
  .hero-right{ display:block; }

  /* A+B: Today + Expiring as two main columns */
  .sfm-home-mock{
    max-width: 1200px;
    margin: 0 auto;
  }

  /* Make first two cards sit side-by-side (Today + Expiring) */
  #reco.card-mock{ margin-top: 18px; }
  /* use grid layout by wrapping main cards via :has is not reliable; instead rely on order */
  .sfm-home-mock > .card-mock:nth-of-type(1),
  .sfm-home-mock > .card-mock:nth-of-type(2){
    margin-top: 18px;
  }

  /* Increase recipe grid density */
  .reco-grid{
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── 快速試用區塊 ── */
.quick-try-section{
  border: 1.5px solid rgba(240,122,43,.3);
  background: linear-gradient(135deg, rgba(255,248,235,.9), rgba(255,255,255,.95));
}
.quick-try-chips{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.quick-try-chip{
  font-size: 14px;
  min-height: 38px;
  padding: 7px 14px;
  transition: background .15s, transform .1s;
}
.quick-try-chip.selected{
  background: #ff9d00;
  border-color: #ff9d00;
  color: #241f1b;
  font-weight: 700;
}
.quick-try-chip:active{ transform: scale(.95); }
.quick-try-input-row{
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.quick-try-input{
  flex: 1;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid rgba(233,224,214,.9);
  font-size: 15px;
  background: #fff;
  min-width: 0;
}
.quick-try-input.is-error{
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.quick-try-selected{
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255,248,235,.8);
  border-radius: 14px;
  border: 1px solid rgba(240,122,43,.2);
  margin-bottom: 12px;
}
.quick-try-label{
  font-size: 13px;
  color: var(--muted);
  font-weight: 600;
}
.quick-try-tags{
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.quick-try-tag{
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #ff9d00;
  color: #241f1b;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.quick-try-tag:hover{ background: #e08800; }
#quickTryGo{
  width: 100%;
  min-height: 48px;
  font-size: 15px;
  font-weight: 800;
  justify-content: center;
}
#quickTryGo.is-disabled,
#quickTryAdd.is-disabled{
  opacity: .55;
  cursor: not-allowed;
}
.quick-try-result{
  margin-top: 4px;
}
.quick-try-empty{
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

.quick-try-summary{
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(240,122,43,.22);
  background: linear-gradient(180deg, rgba(255,248,235,.96), #fff);
  margin-bottom: 12px;
}
.quick-try-summary-title{
  font-size: 15px;
  font-weight: 800;
  color: var(--text);
}
.quick-try-summary-sub{
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}
.quick-try-section-group{
  margin-top: 12px;
}
.quick-try-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 8px;
}
.quick-try-group-title{
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
}
.quick-try-group-note{
  font-size: 12px;
  color: var(--muted);
}
.quick-try-result .item{
  margin-bottom: 10px;
}

.quick-try-upsell{
  margin-top: 14px;
  padding: 14px;
  background: rgba(255,248,235,.9);
  border: 1px solid rgba(240,122,43,.2);
  border-radius: 14px;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.quick-try-upsell strong{ color: var(--text); }
.quick-try-upsell a{ color: #a05800; font-weight: 700; text-decoration: none; }


.home-account-card{
  margin-top:12px;
  padding:14px;
  border-radius:18px;
  border:1px solid rgba(237,212,177,.6);
  background:rgba(255,248,235,.88);
  box-shadow:0 8px 22px rgba(114,79,24,.06);
}
.home-account-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
}
.home-account-kicker{
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  color:#8c4b00;
}
.home-account-title{
  margin-top:4px;
  font-size:15px;
  font-weight:800;
  color:#6b4f22;
}
.home-account-desc{
  margin-top:4px;
  font-size:13px;
  line-height:1.75;
  color:#6b5d4f;
}
.home-account-metrics{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  margin-top:12px;
}
.home-account-metric{
  border:1px solid rgba(237,212,177,.58);
  background:rgba(255,255,255,.82);
  border-radius:14px;
  padding:10px 12px;
  min-width:0;
}
.home-account-metric-value{
  font-size:18px;
  font-weight:900;
  color:#442b12;
  line-height:1.15;
}
.home-account-metric-label{
  margin-top:4px;
  font-size:12px;
  font-weight:700;
  color:#7a6248;
}
.home-account-metric-sub{
  margin-top:4px;
  font-size:11px;
  line-height:1.5;
  color:#9a846d;
}
.home-account-tags{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.home-account-highlight{
  margin-top:12px;
  padding:10px 12px;
  border-radius:14px;
  background:rgba(255,255,255,.82);
  border:1px solid rgba(237,212,177,.62);
}
.home-account-highlight-title{
  font-size:12px;
  font-weight:800;
  color:#6f4c1c;
}
.home-account-highlight-text{
  margin-top:4px;
  font-size:12px;
  line-height:1.65;
  color:#7b6956;
}
.home-account-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.home-account-footnote{
  margin-top:10px;
  font-size:12px;
  line-height:1.75;
  color:#8a7b68;
}
.home-account-flow{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:8px;
  margin-top:12px;
}
.home-account-step{
  border:1px solid rgba(237,212,177,.58);
  background:linear-gradient(180deg, rgba(255,255,255,.9), rgba(255,248,235,.86));
  border-radius:14px;
  padding:10px 12px;
  min-width:0;
}
.home-account-step-title{
  font-size:12px;
  font-weight:800;
  color:#6f4c1c;
}
.home-account-step-text{
  margin-top:4px;
  font-size:12px;
  line-height:1.65;
  color:#7b6956;
}
.home-reco-actions{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.home-reco-mini-actions{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:8px;
}
.home-reco-mini-actions button,
.home-reco-mini-actions a{
  border:none;
  background:none;
  padding:0;
  font-size:12px;
  font-weight:700;
  color:#8c4b00;
  text-decoration:none;
}
.home-reco-mini-actions button{ cursor:pointer; }
.home-reco-status{
  display:inline-flex;
  align-items:center;
  padding:4px 9px;
  border-radius:999px;
  background:rgba(240,122,43,.1);
  border:1px solid rgba(240,122,43,.18);
  color:#8c4b00;
  font-size:11px;
  font-weight:800;
}
.home-reco-evidence{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  margin-top:8px;
}
.home-reco-next{
  margin-top:8px;
  font-size:12px;
  line-height:1.65;
  color:#7b6956;
}
.home-reco-evidence-chip{
  display:inline-flex;
  align-items:center;
  padding:4px 8px;
  border-radius:999px;
  background:rgba(255,248,235,.92);
  border:1px solid rgba(237,212,177,.6);
  color:#7b6548;
  font-size:11px;
  font-weight:700;
}
.quick-try-summary-evidence{
  margin-top:10px;
  font-size:12px;
  line-height:1.65;
  color:#8a7258;
}
.quick-try-next-step{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(237,212,177,.58);
  background:rgba(255,255,255,.82);
  font-size:12px;
  line-height:1.65;
  color:#765f44;
}
.quick-try-next-step strong{ color:#6f4c1c; }
@media (max-width: 720px){
  .sfm-home-mock{ padding:10px 12px 88px; }
  .hero-mock{ padding:18px 14px; border-radius:20px; }
  .hero-left h1{ font-size:26px; line-height:1.22; }
  .hero-sub{ font-size:16px; }
  .card-mock{ padding:14px; }
  .card-hd{ flex-wrap:wrap; }
  .card-hd > .btn-mock,
  .card-hd > a.btn-mock,
  .card-hd > button.btn-mock{ width:100%; }
  .quick-try-input-row{ flex-direction:column; }
  .quick-try-input-row > *{ width:100%; }
  .quick-try-chip{ flex:1 1 calc(50% - 8px); justify-content:center; }
  .hero-steps,
  .home-account-metrics,
  .home-account-flow{ grid-template-columns:1fr; }
  .home-account-actions .btn-mock{ width:100%; }
  .home-reco-actions .btn{ width:100%; }
  .home-reco-mini-actions{ flex-direction:column; align-items:flex-start; gap:8px; }
  .home-reco-mini-actions button,
  .home-reco-mini-actions a{ display:block; }
  #urgentBox > *{ white-space:normal; }
}


/* v5.2.34 rollback-stable home refinements */
.hero-desc{max-width:680px;}
#reco .card-bd{min-width:0;}
#recBox, #recBox *{box-sizing:border-box;}
#recBox .item, .quick-try-result .item{min-width:0;max-width:100%;writing-mode:horizontal-tb;white-space:normal;}
#recBox .actions, #recBox .item-actions, #recBox .home-reco-actions, #recBox .home-reco-mini-actions,
.quick-try-result .actions, .quick-try-result .item-actions, .quick-try-result .home-reco-actions, .quick-try-result .home-reco-mini-actions{
  display:flex;flex-wrap:wrap;gap:8px;align-items:center;writing-mode:horizontal-tb;
}
#recBox button, #recBox .btn-mock, .quick-try-result button, .quick-try-result .btn-mock{writing-mode:horizontal-tb;white-space:normal;}
@media (min-width:1024px){
  .hero-hooks{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));}
  .hero-hook{height:100%;align-items:flex-start;}
  .card-mock{padding:18px;}
}


/* v5.2.34 desktop reco final */
@media (min-width: 900px){
  #reco #recBox.reco-grid{
    display:grid !important;
    grid-template-columns:minmax(280px,360px) minmax(0,1fr) !important;
    gap:16px !important;
    align-items:start;
  }
  #reco #recBox > *{min-width:0;}
  #reco #recBox .home-reco-list{width:100%;min-width:0;}
  #reco #recBox .quick-try-section-group{margin-top:0;}
  #reco #recBox .quick-try-group-list{
    display:grid !important;
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    gap:12px !important;
    align-items:start;
  }
}
