/* MYGEAR Store UI — PDP mobile (≤991px, v2 only) */

@media (max-width: 991px) {
  /* Brand card: hide CTA + description on mobile */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-brand__cta,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-brand__desc {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-brand__logo {
    flex-basis: 80px;
    width: 80px;
    min-width: 80px;
    height: 44px;
    min-height: 44px;
    padding: 6px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-brand__head {
    align-items: center;
  }

  /*
   * Mobile brand order: title → price → brand → meta…
   * Show mobile brand slot; hide desktop brand placements.
   */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-zone--brand-mobile {
    display: block;
    margin: 8px 0 10px;
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp-zone--brand-commerce,
  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp-zone--intro
    > .mg-store-pdp-zone--brand-info {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp {
    padding-bottom: calc(var(--pd-mobile-buy-bar-h, 96px) + 16px);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-block: 4px 8px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__gallery-col {
    order: 1;
    width: calc(100% + 2 * var(--store-gap, 12px));
    max-width: none;
    margin-inline: calc(-1 * var(--store-gap, 12px));
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-trust--gallery {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__info-col {
    order: 2;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__commerce-col {
    order: 3;
  }

  /* Title & meta — compact like FPT */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-meta {
    font-size: 12px;
    gap: 6px 12px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-zone--intro {
    gap: 8px;
    margin-bottom: 4px;
  }

  /* Mobile price hero — inline row under title */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero {
    display: block;
    margin: 2px 0 8px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box {
    padding: 0;
    margin: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box__loyalty,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box__hint,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box__variant-lines,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box__parent-ref,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-price-box__tags {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__label {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__row {
    flex-wrap: nowrap;
    align-items: center;
    gap: 6px 8px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__current,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__current--lg {
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__old {
    font-size: 13px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-price__discount {
    font-size: 12px;
    padding: 1px 5px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-flash-sale {
    margin: 0;
    padding: 0;
    border: 0;
    gap: 6px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-flash-sale__head {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero .mg-store-pdp-flash-sale__price {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__commerce-col .mg-store-pdp-zone--price {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-buy-box {
    display: none;
  }

  /* Gallery — full-bleed, 4:3 stage */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery {
    gap: 8px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__stage {
    border-radius: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__main {
    aspect-ratio: 4 / 3;
    min-height: 240px;
    background: #fff;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__counter {
    position: absolute;
    left: 10px;
    bottom: 10px;
    z-index: 3;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    pointer-events: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__thumbs {
    padding-inline: var(--store-gap, 12px);
    overflow: visible;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery--mobile-strip .mg-store-pdp-gallery__thumb-track {
    gap: 4px;
    width: 100%;
    max-width: 100%;
    transform: none !important;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery--mobile-strip .mg-store-pdp-gallery__thumb-track::-webkit-scrollbar {
    display: none;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery--mobile-strip .mg-store-pdp-gallery__thumb {
    flex: 0 0 48px;
    width: 48px;
    scroll-snap-align: center;
    padding: 2px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__thumb img {
    width: 44px;
    height: 44px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-gallery__nav {
    display: none;
  }

  /* Bottom CTA bar — FPT-style 2-tier (v2 PDP) */
  html:has(.mg-store-pdp) body > .pd-fixed-btn-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10002;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    background: #fff;
    border-top: 0;
    box-shadow:
      0 2px 24px rgba(0, 0, 0, 0.08),
      0 28px 32px 1px rgba(0, 0, 0, 0.12);
    transition:
      box-shadow 0.2s ease,
      transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.22s ease;
    will-change: transform, opacity;
  }

  /* Scrolled past "Có thể bạn quan tâm" — slide CTA off-screen */
  html:has(.mg-store-pdp) body > .pd-fixed-btn-container.is-past-related {
    transform: translate3d(0, 110%, 0);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }

  html:has(.mg-store-pdp) body > .pd-fixed-btn-container.is-estimate-hidden {
    box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.1);
  }

  @media (prefers-reduced-motion: reduce) {
    html:has(.mg-store-pdp) body > .pd-fixed-btn-container {
      transition: none;
    }
  }

  html:has(.mg-store-pdp) body > .pd-fixed-btn-container.is-contact-only {
    display: block;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }

  html:has(.mg-store-pdp) body > .pd-fixed-btn-container.is-contact-only .pd-preorder-box--compact {
    border-top: 0;
    padding: 0;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__estimate {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 6px 12px;
    border-bottom: 1px solid var(--store-border, #e8eaed);
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__summary {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.35;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__reward {
    flex: 1;
    min-width: 0;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__reward:empty {
    display: none;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__summary .pd-loyalty-reward {
    margin: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
    color: #9a7200;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__estimate-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    flex-shrink: 0;
    min-width: 0;
    font-size: inherit;
    font-weight: inherit;
    line-height: inherit;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__estimate-label {
    flex-shrink: 0;
    font-size: inherit;
    font-weight: 500;
    color: var(--store-text-muted, #888);
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__estimate-amount {
    flex-shrink: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--store-price, #d70018);
    white-space: nowrap;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__estimate-amount u {
    font-size: inherit;
    font-weight: inherit;
    vertical-align: baseline;
    text-decoration: underline;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-toggle {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 1px solid var(--store-border, #e5e5e5);
    border-radius: 6px;
    background: #fff;
    color: var(--store-text-muted, #666);
    cursor: pointer;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 2px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    line-height: 1.35;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-label {
    flex-shrink: 0;
    color: var(--store-text-muted, #666);
    font-weight: 500;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-value {
    min-width: 0;
    color: var(--store-text, #111);
    font-weight: 600;
    text-align: right;
    word-break: break-word;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-row.is-discount .pd-fixed-btn-container__breakdown-value {
    color: var(--store-price, #d70018);
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-row.is-total {
    padding-top: 4px;
    border-top: 1px dashed #eee;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-row.is-total .pd-fixed-btn-container__breakdown-label,
  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-row.is-total .pd-fixed-btn-container__breakdown-value {
    font-weight: 700;
    color: var(--store-text, #111);
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__breakdown-value u {
    font-size: 11px;
    vertical-align: super;
    text-decoration: underline;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container__actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-add,
  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-buyNow {
    flex: 1;
    min-height: 44px;
    height: 44px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 0;
    cursor: pointer;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-add {
    background: #fff;
    color: var(--store-brand, #d02915);
    border: 1px solid var(--store-brand, #d02915);
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-buyNow {
    background: var(--store-brand, #d02915);
    color: #fff;
  }

  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-add:disabled,
  html:has(.mg-store-pdp) .pd-fixed-btn-container .pd-btn-buyNow:disabled {
    opacity: 0.6;
    cursor: not-allowed;
  }

  /* Go-top — above buy bar (same floor as contact FAB); below cookie (10050) */
  html[data-pdp-mobile] .global-goTop.is-visible {
    bottom: calc(
      var(--mg-floating-bottom-offset, 16px) + env(safe-area-inset-bottom, 0px)
    );
    z-index: 9990;
    transition:
      opacity 0.2s ease,
      transform 0.2s ease,
      visibility 0.2s ease,
      bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* Contact FAB already uses --mg-floating-bottom-offset; keep in sync with go-top */
  html[data-pdp-mobile] .contact-fab {
    bottom: calc(
      var(--mg-floating-bottom-offset, 16px) + env(safe-area-inset-bottom, 0px)
    );
    transition: bottom 0.28s cubic-bezier(0.22, 1, 0.36, 1);
  }

  /* When buy bar is gone, still keep a safe resting floor */
  html[data-pdp-mobile][data-pdp-buy-bar-visible="false"] .global-goTop.is-visible,
  html[data-pdp-mobile][data-pdp-buy-bar-visible="false"] .contact-fab {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }

  /* Product info — spec outside + mô tả/FAQ tabs */
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__mobile-info {
    display: flex;
    flex-direction: column;
    gap: var(--store-gap, 12px);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-info__block {
    border: 1px solid var(--store-border, #e8e8e8);
    border-radius: var(--store-radius-sm, 8px);
    background: var(--store-bg, #fff);
    overflow: hidden;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-info__block--spec {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
    overflow: hidden;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-spec__head {
    padding: 12px 16px 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-info__title {
    margin: 0;
    padding: 12px 16px;
    border-bottom: 1px solid var(--store-border, #e8e8e8);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--store-text, #212b36);
    background: var(--store-surface, #f9fafb);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-spec__title {
    margin: 0;
    padding: 0;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--store-text, #212b36);
    background: transparent;
    border: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-info__block--spec .mg-store-pdp-spec {
    padding: 0 16px 14px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec--mobile-preview .mg-store-pdp-spec__mobile-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 1px solid var(--store-border, #e8eaed);
    border-radius: var(--store-radius-sm, 8px);
    background: var(--store-bg, #fff);
    overflow: hidden;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-hit {
    position: relative;
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-hit:active {
    background: var(--store-surface, #f9fafb);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-list {
    display: flex;
    flex-direction: column;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-group {
    margin: 0;
    padding: 10px 14px 4px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--store-text, #212b36);
    background: var(--store-surface, #f9fafb);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-group:first-child {
    padding-top: 12px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-row {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 11px 14px;
    border-top: 1px solid var(--store-border, #e8eaed);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-row:first-child,
  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-group + .mg-store-pdp-spec__preview-row {
    border-top: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-label {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.4;
    color: var(--store-text-muted, #637381);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-value {
    font-size: 13px;
    font-weight: 600;
    line-height: 1.4;
    color: var(--store-text, #212b36);
    word-break: break-word;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-more {
    margin: 0;
    padding: 8px 14px 12px;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.35;
    color: var(--store-text-muted, #637381);
    background: linear-gradient(
      180deg,
      transparent 0%,
      var(--store-bg, #fff) 42%
    );
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-fallback {
    position: relative;
    max-height: 220px;
    overflow: hidden;
    padding: 12px 14px 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__preview-fallback::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: linear-gradient(transparent, var(--store-bg, #fff));
    pointer-events: none;
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp-spec__preview-fallback
    .mg-store-pdp-spec__content.mg-rich-content--spec
    table {
    border: 0;
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp-spec__preview-fallback
    .mg-store-pdp-spec__content.mg-rich-content--spec
    table
    th,
  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp-spec__preview-fallback
    .mg-store-pdp-spec__content.mg-rich-content--spec
    table
    td {
    padding: 8px 0;
    border: 0;
    border-bottom: 1px solid var(--store-border, #e8eaed);
    background: transparent;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__actions--mobile {
    justify-content: center;
    padding: 10px 14px 12px;
    border-top: 1px solid var(--store-border, #e8eaed);
    background: var(--store-surface, #f9fafb);
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-spec__sheet-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--store-brand, #d02915);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-tabs--mobile {
    min-width: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-tabs--mobile .mg-store-pdp-tabs__tab {
    font-size: 13px;
    padding: 12px 10px;
    white-space: normal;
    line-height: 1.25;
    text-align: center;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-tabs--mobile .mg-store-pdp-tabs__panels {
    padding: 12px 14px 14px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-tabs--mobile .mg-store-pdp-faq__list {
    gap: 6px;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video) {
    display: grid;
    gap: var(--store-gap, 12px);
    align-items: start;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video) .mg-store-pdp-tabs--mobile {
    display: contents;
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video)
    .mg-store-pdp-tabs--mobile
    .mg-store-pdp-tabs__bar {
    grid-column: 1;
    grid-row: 1;
    border: 1px solid var(--store-border, #e8e8e8);
    border-radius: var(--store-radius-sm, 8px) var(--store-radius-sm, 8px) 0 0;
    background: var(--store-bg, #fff);
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video)
    .mg-store-pdp-tabs--mobile
    .mg-store-pdp-tabs__panels {
    grid-column: 1;
    grid-row: 3;
    border: 1px solid var(--store-border, #e8e8e8);
    border-top: 0;
    border-radius: 0 0 var(--store-radius-sm, 8px) var(--store-radius-sm, 8px);
    background: var(--store-bg, #fff);
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video)
    .mg-store-pdp-tabs--mobile
    .mg-store-pdp-tabs__panels--solo {
    grid-row: 1;
    border-radius: var(--store-radius-sm, 8px);
    border-top: 1px solid var(--store-border, #e8e8e8);
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp__tabs-video--mobile:has(.mg-store-pdp-video)
    .mg-store-pdp-video {
    grid-column: 1;
    grid-row: 2;
    margin-bottom: 0;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp__tabs-video--mobile:not(:has(.mg-store-pdp-video)) .mg-store-pdp-tabs--mobile {
    border: 1px solid var(--store-border, #e8e8e8);
    border-radius: var(--store-radius-sm, 8px);
    background: var(--store-bg, #fff);
    overflow: hidden;
  }

  html:has(.mg-store-pdp)
    .mg-ui-v2
    .mg-store-pdp__tabs-video--mobile:not(:has(.mg-store-pdp-video))
    .mg-store-pdp-tabs--mobile
    .mg-store-pdp-tabs__bar {
    border-bottom: 1px solid var(--store-border, #e8e8e8);
  }

  /* Bottom CTA — ensure actions always visible */
  html:has(.mg-store-pdp) body > .pd-fixed-btn-container.is-estimate-hidden .pd-fixed-btn-container__actions {
    display: flex;
  }
}

@media (min-width: 992px) {
  html:has(.mg-store-pdp) body > .pd-fixed-btn-container {
    display: none !important;
  }

  html:has(.mg-store-pdp) .mg-ui-v2 .mg-store-pdp-mobile-price-hero {
    display: none;
  }
}