/* MYPC UX-01 v0.1.2-rc3 — scoped mobile contact bar and category first-screen. */
.mypc-ux01-contact-bar[hidden],
.mypc-ux01-read-more[hidden],
.mypc-ux01-guide-link[hidden] { display: none !important; }
.mypc-ux01-contact-bar { display: none; }

@media screen and (max-width: 849px) {
  /* Legacy contact controls overlap product prices, filters and cart actions.
     Only hide the exact known floating container and R1-03 bottom bar. */
  /* RC2: live MYPC markup uses <body> > .devvn_toolbar for the floating
     Facebook/Zalo/phone stack (not .contact-box-bottom as the RC1 fixture).
     Scope to enabled UX-01 and mobile; preserve unrelated desktop widgets. */
  body.mypc-ux01-contact-on > .devvn_toolbar,
  body.mypc-ux01-contact-on .contact-box-bottom.animate__backInRight,
  body.mypc-ux01-contact-on .mypc-r1-mobile-contact {
    display: none !important;
  }

  /* Cancel padding left by R1-03, and restore only on pages with our own bar. */
  body.mypc-ux01-contact-on { padding-bottom: 0 !important; }
  body.mypc-ux01-contact-bar-on {
    padding-bottom: calc(70px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.mypc-ux01-contact-bar-on .mypc-ux01-contact-bar {
    box-sizing: border-box;
    /* Stronger than legacy theme/footer display rules, only when enabled. */
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    gap: 10px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 12000; /* RC3: higher than category/product layers; modal guard hides bar when overlays are open. */
    min-height: 62px;
    padding: 7px max(12px, env(safe-area-inset-left, 0px)) calc(7px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-right, 0px));
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    box-shadow: 0 -3px 15px rgba(0, 0, 0, .08);
  }
  /* Keep simple selectors separate: unsupported :has() must not invalidate the
     .mypc-ux01-overlay-open fallback on older Safari/Chromium releases. */
  body.mypc-ux01-contact-bar-on.mypc-ux01-overlay-open .mypc-ux01-contact-bar,
  body.mypc-ux01-contact-bar-on.has-off-canvas .mypc-ux01-contact-bar,
  body.mypc-ux01-contact-bar-on.mfp-zoom-out-cur .mypc-ux01-contact-bar {
    display: none !important;
  }

  /* Modern browsers can hide the bar immediately when Flatsome/Popup Maker opens. */
  @supports selector(body:has(.mfp-wrap.mfp-ready)) {
    body.mypc-ux01-contact-bar-on:has(.mfp-wrap.mfp-ready) .mypc-ux01-contact-bar,
    body.mypc-ux01-contact-bar-on:has(.mfp-bg.mfp-ready) .mypc-ux01-contact-bar,
    body.mypc-ux01-contact-bar-on:has(.pum.pum-active) .mypc-ux01-contact-bar {
      display: none !important;
    }
  }

  .mypc-ux01-contact-bar a {
    box-sizing: border-box;
    display: inline-flex;
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 9px 10px;
    border-radius: 9px;
    border: 1px solid #111111;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0;
    white-space: nowrap;
    color: #111111 !important;
    background: #ffffff;
  }
  .mypc-ux01-contact-bar a.mypc-ux01-contact-call {
    color: #111111 !important;
    background: #fed100;
    border-color: #fed100;
  }
  .mypc-ux01-contact-bar a:focus-visible,
  .mypc-ux01-category-on .mypc-ux01-read-more:focus-visible,
  .mypc-ux01-category-on .mypc-ux01-guide-link:focus-visible {
    outline: 3px solid #164c9e;
    outline-offset: 2px;
  }
  .mypc-ux01-contact-bar svg {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Category first-screen: preserve banner and H1 while reducing vertical waste. */
  body.mypc-ux01-category-on .term-description > img:first-child,
  body.mypc-ux01-category-on .term-description > p:first-child > img {
    display: block;
    width: 100%;
    max-height: 145px !important;
    height: auto !important;
    object-fit: contain !important;
    margin: 0 0 8px !important;
  }
  body.mypc-ux01-category-on .term-description .mypc-pillar-header,
  body.mypc-ux01-category-on .term-description > blockquote {
    box-sizing: border-box;
    margin: 8px 0 10px !important;
    padding: 12px 13px !important;
    background: #fbfbfd !important;
    border: 1px solid #e5e7eb !important;
    border-left: 3px solid #fed100 !important;
    border-radius: 8px !important;
    box-shadow: none !important;
  }
  body.mypc-ux01-category-on .term-description .mypc-pillar-header h1,
  body.mypc-ux01-category-on .term-description > blockquote h1 {
    color: #111111 !important;
    font-size: 19px !important;
    line-height: 1.32 !important;
    margin: 0 0 6px !important;
    font-weight: 750 !important;
    overflow-wrap: break-word;
  }
  body.mypc-ux01-category-on .term-description .mypc-pillar-header p,
  body.mypc-ux01-category-on .term-description > blockquote p {
    font-size: 13.5px !important;
    line-height: 1.45 !important;
    margin: 0 !important;
    color: #343a40 !important;
  }
  body.mypc-ux01-category-on .mypc-ux01-clamp-ready:not(.mypc-ux01-expanded) {
    display: -webkit-box !important;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
  }
  body.mypc-ux01-category-on .mypc-ux01-read-more,
  body.mypc-ux01-category-on .mypc-ux01-guide-link {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 5px 2px;
    margin: 4px 12px 0 0;
    border: 0;
    background: transparent;
    color: #171717;
    font-size: 13px;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
  }
  body.mypc-ux01-category-on .mypc-ux01-guide {
    box-sizing: border-box;
    width: 100%;
    margin: 24px 0;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
    clear: both;
  }
  body.mypc-ux01-category-on .mypc-ux01-guide details {
    width: 100%;
    margin: 0 !important;
  }
  body.mypc-ux01-category-on .mypc-ux01-guide summary {
    padding: 10px 4px;
    min-height: 44px;
    color: #111 !important;
    font-weight: 700;
  }
  /* RC2: no height override for Flatsome's absolute-positioned mobile
     a.filter-button. On the live site, its parent uses line-height:0 and
     the custom filter button sits at top:18px; forcing min-height:44px
     in RC1 made 'Lọc' overlap the following category banner. */
}

@media (prefers-reduced-motion: reduce) {
  .mypc-ux01-contact-bar *,
  .mypc-ux01-guide * { scroll-behavior: auto !important; transition: none !important; }
}
