/* Mobile-only editorial layout for the Shang Fa homepage. */
@media (max-width: 640px) {
  .sf-home {
    overflow-x: clip;
    --mobile-ink: #152f4c;
    --mobile-muted: #596d81;
    --mobile-gold: #a78642;
  }

  .sf-home #live .sf-collection .sf-brand-carousel {
    padding: 30px 20px 22px;
  }
  .sf-home #live .sf-brand-carousel .sf-stage-copy {
    padding: 0;
  }
  .sf-home #live .sf-brand-carousel .sf-brand-mark {
    width: 66px;
    height: 66px;
  }
  .sf-home #live .sf-brand-name {
    margin: 8px 0 4px;
    font-size: 25px;
  }
  .sf-home #live .sf-collection .sf-brand-carousel h1 {
    font-size: 19px !important;
    letter-spacing: .13em !important;
  }
  .sf-home #live .sf-brand-english {
    margin-top: 7px;
    font-size: 8px;
    letter-spacing: .08em;
  }
  .sf-home #live .sf-brand-contact {
    margin-top: 16px;
  }
  .sf-home #live .sf-brand-store .sf-store-name {
    font-size: 13px;
  }
  .sf-home #live .sf-brand-store .sf-store-phone {
    font-size: 13px;
  }
  .sf-home #live .sf-brand-store .sf-store-address {
    font-size: 10px;
    line-height: 1.45;
  }
  .sf-home #live .sf-brand-social {
    margin-top: 10px;
    gap: 12px;
  }
  .sf-home #live .sf-brand-social a {
    width: 40px;
    height: 40px;
  }

  .sf-home #live .sf-poster-wall {
    display: flex;
    gap: 12px;
    padding: 10px 20px 20px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    border-top: 1px solid #e5e9ed;
  }
  .sf-home #live .sf-poster-wall::-webkit-scrollbar { display: none; }
  .sf-home #live .sf-poster-card,
  .sf-home #live .sf-poster-accessories,
  .sf-home #live .sf-poster-desktop {
    flex: 0 0 min(78vw, 302px);
    width: min(78vw, 302px);
    height: 328px;
    grid-column: auto;
    scroll-snap-align: start;
    border: 1px solid #e2e8ee;
    border-radius: 10px !important;
    overflow: hidden;
  }
  .sf-home #live .sf-poster-copy,
  .sf-home #live .sf-poster-desktop .sf-poster-copy {
    width: 100%;
    padding: 17px 16px 0;
  }
  .sf-home #live .sf-poster-card h3 {
    font-size: 23px;
    margin: 11px 0 4px;
    white-space: normal;
  }
  .sf-home #live .sf-poster-card p {
    font-size: 12px;
    line-height: 1.5;
    max-width: 18em;
  }
  .sf-home #live .sf-poster-card .sf-poster-art,
  .sf-home #live .sf-poster-desktop .sf-poster-art,
  .sf-home #live .sf-poster-accessories .sf-poster-art {
    left: 0;
    right: 0;
    bottom: 22px;
    width: 100%;
    height: 56%;
    object-fit: contain;
    object-position: center bottom;
  }
  .sf-home #live .sf-poster-caption { font-size: 8px; }

  .sf-home #popular-products.sf-product-editorial {
    padding-top: 36px !important;
    padding-bottom: 38px !important;
  }
  .sf-home #popular-products .sp-heading {
    align-items: center;
    gap: 8px;
  }
  .sf-home #popular-products .sp-heading h2 { font-size: 25px; }
  .sf-home #popular-products .sp-controls button {
    min-width: 42px;
    min-height: 42px;
  }

  .sf-home #conversion.sf-services-constellation {
    padding: 40px 20px 42px !important;
  }
  .sf-home #conversion.sf-services-constellation .sf-services-heading {
    text-align: left;
    margin-bottom: 20px !important;
  }
  .sf-home #conversion.sf-services-constellation .sf-services-kicker {
    margin-bottom: 8px !important;
    color: var(--mobile-gold);
  }
  .sf-home #conversion.sf-services-constellation .sf-services-heading h2 {
    font-size: 27px !important;
    line-height: 1.35;
  }
  .sf-home #conversion.sf-services-constellation .sf-services-intro {
    margin-top: 8px !important;
    font-size: 13px !important;
  }
  .sf-home #conversion .sf-constellation-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .sf-home #conversion .sf-service-brand { display: none; }
  .sf-home #conversion.sf-services-constellation .sf-service-card {
    flex: none;
    min-height: 186px;
    padding: 16px !important;
    border: 1px solid #dfe7ee !important;
    border-radius: 10px;
    background: #f8fafb !important;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-index {
    width: 54%;
    margin-bottom: 10px !important;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-recovery .sf-service-index,
  .sf-home #conversion.sf-services-constellation .sf-service-repair .sf-service-index {
    flex-direction: row;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-copy {
    width: 62%;
    min-height: 118px;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-copy h3 {
    font-size: 20px !important;
    margin-bottom: 4px !important;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-detail {
    font-size: 11px !important;
    line-height: 1.5;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-action {
    margin-top: auto !important;
    min-height: 44px;
    font-size: 13px;
  }
  .sf-home #conversion.sf-services-constellation .sf-service-action span {
    width: 34px;
    height: 34px;
  }
  .sf-home #conversion .sf-service-scene {
    right: -5px;
    bottom: 0;
    width: 43%;
    height: 85%;
    object-fit: contain;
    object-position: center bottom;
    opacity: .9;
    mask-image: linear-gradient(to right, transparent, #000 25%);
  }

  .sf-home #live .sf-live-editorial {
    width: calc(100% - 40px);
    margin: 36px 20px 40px;
  }
  .sf-home #live .sf-live-heading { margin-bottom: 18px; }
  .sf-home #live .sf-live-heading h2 { font-size: 28px; }
  .sf-home #live .sf-live-description { margin: 6px 0; font-size: 14px; }
  .sf-home #live .sf-live-schedule { font-size: 13px; }
  .sf-home #live .sf-live-stage { gap: 16px; }
  .sf-home #live .sf-live-player-column { width: 100%; }
  .sf-home #live .sf-live-player {
    aspect-ratio: 4 / 3;
    border-radius: 10px;
  }
  .sf-home #live .sf-live-player > img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 58%;
  }
  .sf-home #live .sf-live-play { width: 62px; height: 62px; }
  .sf-home #live .sf-live-hosts { gap: 8px; }
  .sf-home #live .sf-live-host,
  .sf-home #live .sf-live-host + .sf-live-host {
    min-height: 136px;
    grid-template-columns: 104px minmax(0,1fr);
    gap: 12px;
    border: 1px solid #e0e7ed;
    border-radius: 9px;
    overflow: hidden;
    background: #f8fafb;
  }
  .sf-home #live .sf-live-host-aming .sf-live-host-art { grid-column: 1; grid-row: 1; }
  .sf-home #live .sf-live-host-aming .sf-live-host-copy { grid-column: 2; grid-row: 1; }
  .sf-home #live .sf-live-host-art { height: 136px; align-self: end; }
  .sf-home #live .sf-live-host-art img { width: 120px; max-width: none; }
  .sf-home #live .sf-live-host-copy { padding: 10px 10px 10px 0; }
  .sf-home #live .sf-live-host-copy > p { margin-bottom: 2px; font-size: 11px; }
  .sf-home #live .sf-live-host-copy > p::after { display: none; }
  .sf-home #live .sf-live-host-copy h3 { margin-bottom: 4px; font-size: 21px; }
  .sf-home #live .sf-live-host-copy > div { font-size: 12px; line-height: 1.55; }
  .sf-home #live .sf-live-footer { margin-top: 14px; }
  .sf-home #live .sf-live-footer a { min-height: 50px; font-size: 13px; }

  .sf-home #fulfillment.fabo-standard { padding-top: 42px; padding-bottom: 42px; }
  .sf-home #fulfillment .fabo-standard-art { margin-top: 18px; }
  .sf-home #fulfillment .fabo-standard-illustration img { max-height: 250px; object-fit: contain; }

  .sf-home #component-prices.pc-catalog { padding-top: 40px; padding-bottom: 42px; }
  .sf-home #component-prices .pc-tabs {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
  }
  .sf-home #component-prices .pc-tabs button {
    flex: 0 0 auto;
    min-width: 104px;
    min-height: 48px;
    padding: 8px 12px;
    font-size: 13px;
  }
  .sf-home #component-prices .pc-filters { gap: 12px; }
  .sf-home #component-prices .pc-table-scroll::before {
    content: '表格可左右滑動，查看完整規格';
    display: block;
    padding: 8px 12px;
    color: var(--mobile-muted);
    background: #f3f6f9;
    font-size: 11px;
  }

  .sf-home .home-stores { padding-top: 42px; padding-bottom: 42px; }
  .sf-home .home-stores > header { text-align: left; margin-bottom: 22px; }
  .sf-home .home-store-card iframe { height: 185px; }
  .sf-home .home-store-copy { padding: 18px; }

  /* Keep the assistant button available without covering shopping controls. */
  .sf-home .sf-orb-reminder { display: none !important; }
  .sf-home .sf-contact-dock {
    --sf-orb-size: 52px;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(20px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 360px) {
  .sf-home #live .sf-poster-card,
  .sf-home #live .sf-poster-accessories,
  .sf-home #live .sf-poster-desktop { flex-basis: 82vw; width: 82vw; }
  .sf-home #conversion.sf-services-constellation .sf-service-copy { width: 66%; }
  .sf-home #conversion .sf-service-scene { width: 39%; }
  .sf-home #live .sf-live-host,
  .sf-home #live .sf-live-host + .sf-live-host { grid-template-columns: 92px minmax(0,1fr); }
  .sf-home #live .sf-live-host-art img { width: 105px; }
  .sf-home #component-prices .pc-heading {
    flex-direction: column;
    align-items: flex-start;
  }
  .sf-home #component-prices .pc-summary {
    display: flex;
    align-items: baseline;
    gap: 8px;
    text-align: left;
  }
  .sf-home #component-prices .pc-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}
