/**
 * Product PDP — mobile app UI (≤991px)
 */

@media (max-width: 991.98px) {
  .page-product #main-content {
    padding-top: 0;
  }

  .page-product {
    background: #fef9eb;
  }

  .page-product .pdp-tsc {
    padding: 0 0 calc(76px + env(safe-area-inset-bottom, 0px));
    background: #fef9eb;
  }

  .page-product .container-pdp {
    padding: 0;
    max-width: 100%;
  }

  .page-product .pdp-breadcrumb--desktop,
  .page-product .pdp-fab-rail {
    display: none;
  }

  .page-product .pdp-hero-shell {
    padding: 0;
    margin: 0;
  }

  .page-product .pdp-showcase {
    margin: 0 !important;
  }

  /* —— Gallery —— */
  .pdp-showcase {
    margin: 0;
  }

  .pdp-gallery-col {
    padding: 0;
  }

  .pdp-main-frame,
  .page-product .image-showcase.pdp-main-frame {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
  }

  .pdp-gallery-stage {
    position: relative !important;
    min-height: 0 !important;
    height: auto !important;
    aspect-ratio: unset !important;
    padding-bottom: 0;
    box-sizing: border-box;
    border-radius: 0 !important;
    overflow: visible;
    background: #fef9eb !important;
    box-shadow: none !important;
  }

  .pdp-zoom-stage {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    min-height: 0 !important;
    aspect-ratio: unset !important;
    height: auto;
    max-height: min(72vw, 360px);
    background: #fef9eb !important;
    display: block;
    padding: 8px 12px 0;
    overflow: hidden;
    cursor: pointer;
  }

  .pdp-zoom-stage .pdp-main-img,
  .pdp-zoom-stage .page-product .pdp-main-img {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(72vw, 360px);
    object-fit: contain !important;
    object-position: top center;
    border-radius: 8px;
  }

  .pdp-thumbs-on-image.pdp-thumbs-grid {
    position: static;
    left: auto;
    right: auto;
    bottom: auto;
    transform: none;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    padding: 6px 12px 8px;
    background: #fef9eb;
    border-radius: 0;
    box-shadow: none;
    z-index: 5;
    pointer-events: auto;
    touch-action: manipulation;
    box-sizing: border-box;
  }

  .pdp-thumb-grid {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 8px rgba(74, 63, 26, 0.08);
    -webkit-overflow-scrolling: touch;
    pointer-events: auto;
    scrollbar-width: none;
  }

  .pdp-thumb-grid::-webkit-scrollbar {
    display: none;
  }

  .pdp-thumb {
    flex: 0 0 54px;
    width: 54px;
    height: 42px;
    border-radius: 8px;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 2;
  }

  /* Buy sheet — must not block thumbs */
  .pdp-buy-col--overlay,
  .page-product .pdp-buy-col--overlay {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    z-index: 10;
    pointer-events: none;
  }

  .pdp-buy-col--overlay .pdp-buy-scroll,
  .page-product .pdp-buy-scroll {
    max-height: none !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
    background: #fff;
    pointer-events: auto;
    border: none !important;
  }

  .page-product .pdp-gallery-frame,
  .page-product .pdp-main-frame {
    background: #fef9eb !important;
  }

  .pdp-buy-body {
    /*padding: 0 14px 16px !important;*/
  }

  .pdp-buy-scroll:has(.pdp-highlights-gold) .pdp-buy-body {
    padding-top: 12px !important;
  }

  /* Golden highlights — gap above bar, rounded like reference */
  .pdp-highlights-gold {
    margin: 0 -14px 0 !important;
    border-radius: 14px !important;
  }

  .pdp-hi-cell {
    padding: 6px 6px 8px !important;
    gap: 4px !important;
    min-width: 88px;
  }

  .pdp-hi-cell-icon .pdp-ico {
    width: 34px;
    height: 34px;
  }

  .pdp-hi-cell-icon .pdp-ico svg {
    width: 17px;
    height: 17px;
  }

  .pdp-hi-cell-l1 {
    font-size: 0.68rem;
  }

  .pdp-hi-cell-l2 {
    font-size: 0.58rem;
  }

  .pdp-highlights-gold + .pdp-title-row {
    margin-top: 16px !important;
    padding-top: 6px !important;
  }

  /* Hide duplicate extra-feature icon row on mobile */
  .pdp-icon-strip--row {
    display: none !important;
  }

  .pdp-below-hero {
    padding: 4px 12px 32px !important;
    margin-top: 0;
  }

  .pdp-subnav-wrap {
    top: 52px !important;
    margin-bottom: 6px !important;
    margin-top: 8px !important;
    padding: 3px !important;
    border-radius: 14px !important;
    box-shadow: 0 2px 12px rgba(74, 63, 26, 0.08) !important;
  }

  .pdp-highlights-bar--in-scroll {
    margin: 0 -14px 0 !important;
    padding: 10px 8px !important;
    border-radius: 18px 18px 0 0 !important;
    background: #faecd0 !important;
    color: #5c4f20 !important;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-icon {
    color: #5c4f20;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-icon {
    width: 44px;
    height: 44px;
    background: #fff;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-icon .pdp-ico {
    width: 100%;
    height: 100%;
    background: transparent;
    box-shadow: none;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-icon .pdp-ico svg {
    stroke: #5c4f20 !important;
    width: 20px;
    height: 20px;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-l1 {
    font-size: 0.58rem;
    color: #fff;
  }

  .pdp-highlights-bar--in-scroll .pdp-highlight-l2 {
    font-size: 0.55rem;
    color: rgba(255, 255, 255, 0.9);
  }

  .pdp-highlights-bar--in-scroll + .pdp-title-row {
    padding-top: 10px;
  }

  .pdp-title {
    font-size: 1.12rem;
    line-height: 1.3;
    margin-top: 0;
  }

  .pdp-buy-marquee {
    margin-bottom: 6px;
  }

  .pdp-price-block {
    padding: 8px 0;
    margin: 2px 0 8px;
  }

  .pdp-order-block {
    margin-bottom: 8px;
  }

  .pdp-offers {
    padding: 10px;
    margin-bottom: 8px;
  }

  .pdp-subnav-btn {
    padding: 8px 4px !important;
    font-size: 11px !important;
  }

  .pdp-tab-panel {
    padding: 4px 0 10px !important;
  }

  .pdp-section-title {
    font-size: 0.98rem !important;
    margin-bottom: 8px !important;
  }

  .pdp-feature-blocks {
    gap: 8px !important;
  }

  .pdp-feature-block {
    padding: 8px !important;
    gap: 8px !important;
  }

  .pdp-feature-block-media {
    max-height: 160px;
  }

  .pdp-mobile-bar {
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 24px rgba(74, 63, 26, 0.12);
    background: #fff;
  }
}

@media (max-width: 991.98px) and (min-width: 520px) {
  .page-product .pdp-trust-bar--tsc {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }

  .pdp-trust-item:nth-child(2n) {
    border-right: 1px solid #faf6ed;
  }

  .pdp-trust-item:last-child {
    border-right: none;
  }
}
