/* FITFREK_PRICES_DEALS_UI_POLISH_V1_4 */

/* Match the shared desktop navigation shell. Mobile/tablet width is untouched. */
@media (min-width:1000px){
  #ff-tools{
    box-sizing:border-box!important;
    width:min(960px,calc(100% - 32px))!important;
    max-width:960px!important;
    margin-left:auto!important;
    margin-right:auto!important;
  }
}

/* ================================================================
   SHARED PRICE DETAIL — Prices + Deals, US + UK
   ================================================================ */
#ff-tools #ff-product-dialog .sh-body,
#ff-tools #ff-initial-detail{
  display:grid!important;
  grid-template-columns:minmax(0,1fr) minmax(118px,34%)!important;
  align-items:stretch!important;
}
#ff-tools #ff-product-dialog .sh-body>*,
#ff-tools #ff-initial-detail>*{
  grid-column:1/-1;
  min-width:0;
}
#ff-tools #ff-product-dialog .sh-body>.pd-hd,
#ff-tools #ff-initial-detail>.pd-hd{
  grid-column:1;
  grid-row:1;
  margin:0!important;
  padding-right:12px!important;
  border-bottom:1px solid var(--line,#2c2d35)!important;
  overflow:hidden;
}
#ff-tools #ff-product-dialog .pd-hd .pd-identity,
#ff-tools #ff-initial-detail .pd-hd .pd-identity{
  min-width:0;
}
#ff-tools #ff-product-dialog .pd-hd .pd-name,
#ff-tools #ff-initial-detail .pd-hd .pd-name{
  max-width:100%;
  overflow-wrap:anywhere;
  word-break:break-word;
}

/* Price is a centered block inside the upper-right column. */
#ff-tools #ff-product-dialog .sh-body>.pd-price,
#ff-tools #ff-initial-detail>.pd-price{
  grid-column:2;
  grid-row:1;
  display:flex!important;
  flex-direction:column;
  justify-content:flex-start;
  align-items:center;
  margin:0!important;
  padding:19px 14px 16px!important;
  border-top:0!important;
  border-left:1px solid var(--line,#2c2d35)!important;
  border-bottom:1px solid var(--line,#2c2d35)!important;
  text-align:center!important;
}
#ff-tools #ff-product-dialog .pd-price .pd-k,
#ff-tools #ff-product-dialog .pd-price .pd-row,
#ff-tools #ff-product-dialog .pd-price .pd-verdict,
#ff-tools #ff-initial-detail .pd-price .pd-k,
#ff-tools #ff-initial-detail .pd-price .pd-row,
#ff-tools #ff-initial-detail .pd-price .pd-verdict{
  width:100%;
  margin-left:0!important;
  margin-right:0!important;
  text-align:center!important;
}
#ff-tools #ff-product-dialog .pd-price .pd-row,
#ff-tools #ff-initial-detail .pd-price .pd-row{
  display:flex!important;
  align-items:baseline!important;
  justify-content:center!important;
  gap:0!important;
}
#ff-tools #ff-product-dialog .pd-price .pd-k,
#ff-tools #ff-initial-detail .pd-price .pd-k{
  margin-top:0!important;
  margin-bottom:7px!important;
  font-size:11.5px!important;
  line-height:1.15!important;
  letter-spacing:.055em!important;
  white-space:normal;
}
#ff-tools #ff-product-dialog .pd-price .pd-now,
#ff-tools #ff-initial-detail .pd-price .pd-now{
  display:block;
  margin:0 auto!important;
  font-size:clamp(32px,6vw,41px)!important;
  line-height:.95!important;
  white-space:nowrap;
  text-align:center!important;
}
#ff-tools #ff-product-dialog .pd-price .pd-verdict,
#ff-tools #ff-initial-detail .pd-price .pd-verdict{
  max-width:180px;
  margin-top:8px!important;
  font-size:12px!important;
  line-height:1.3!important;
  color:var(--muted,#9b9ba7)!important;
  text-wrap:balance;
}

/* Compact visual review chip with an expanded invisible touch area. */
#ff-tools #ff-product-dialog .pd-hd .pd-sig .sig,
#ff-tools #ff-initial-detail .pd-hd .pd-sig .sig{
  position:relative!important;
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:auto!important;
  max-width:100%!important;
  min-height:24px!important;
  height:24px!important;
  padding:0 7px!important;
  border-radius:5px!important;
  font-size:10.5px!important;
  line-height:1!important;
  white-space:nowrap!important;
}
#ff-tools #ff-product-dialog .pd-hd .pd-sig .sig::before,
#ff-tools #ff-initial-detail .pd-hd .pd-sig .sig::before{
  content:"";
  position:absolute;
  inset:-10px -6px;
}

/* Enlarge only the visible X; preserve its button box and header spacing. */
#ff-tools .sh-x{
  font-size:0!important;
}
#ff-tools .sh-x::before{
  content:"×";
  display:block;
  font-size:20px;
  line-height:1;
  transform:scale(1.1);
  transform-origin:center;
}

/* ================================================================
   PRICE HISTORY
   Internal legacy/canonical source choice is not a public control.
   The script chooses the strongest canonical series; visitors choose range.
   ================================================================ */
#ff-tools [data-ff-history-internal-source="1"]{
  display:none!important;
}
#ff-tools .ff-history-toolbar-polished.ff-history-source-hidden{
  display:grid!important;
  grid-template-columns:repeat(var(--ff-history-range-count,4),minmax(0,1fr))!important;
  gap:2px!important;
  width:100%!important;
  max-width:none!important;
  align-items:stretch!important;
}
#ff-tools .ff-history-toolbar-polished>*{
  min-width:0!important;
  margin:0!important;
}
#ff-tools .ff-history-toolbar-polished button,
#ff-tools .ff-history-toolbar-polished [role="button"]{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  width:100%!important;
  min-width:0!important;
  min-height:36px!important;
  height:36px!important;
  margin:0!important;
  padding:0 3px!important;
  border-radius:6px!important;
  font-size:12px!important;
  line-height:1!important;
  text-align:center!important;
  white-space:nowrap!important;
  overflow:hidden;
  text-overflow:ellipsis;
}
#ff-tools .ff-history-toolbar-polished>.ff-history-range-slot{
  display:block!important;
  min-width:0!important;
  width:100%!important;
  margin:0!important;
}
#ff-tools .ff-history-toolbar-polished>.ff-history-range-slot>.ff-history-range-control{
  width:100%!important;
}
#ff-tools .ff-polish-history-current-duplicate{
  display:none!important;
}

/* Tight, equal rhythm around the two explanatory links. */
#ff-tools .ff-polish-history-links{
  display:flex!important;
  align-items:center!important;
  flex-wrap:wrap!important;
  gap:6px 20px!important;
  margin:8px 0 0!important;
  padding:0!important;
  line-height:1.2!important;
}
#ff-tools .ff-polish-history-links a{
  margin:0!important;
  padding:0!important;
  font-size:12px!important;
  line-height:1.2!important;
}
#ff-tools .ff-history:has(.ff-polish-history-links),
#ff-tools [data-price-history]:has(.ff-polish-history-links){
  padding-bottom:8px!important;
}

/* No-offer / out-of-stock detail state: full-width identity, compact neutral status row. */
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer{
  grid-template-columns:minmax(0,1fr)!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-hd,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-hd{
  grid-column:1!important;
  grid-row:1!important;
  padding-right:14px!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price{
  grid-column:1!important;
  grid-row:2!important;
  min-height:0!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  padding:10px 14px!important;
  border-left:0!important;
  border-top:0!important;
  text-align:left!important;
  background:rgba(255,255,255,.015)!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price .pd-k,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price .pd-k{
  display:none!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price .pd-row,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price .pd-row{
  justify-content:flex-start!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price .pd-now,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price .pd-now,
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price .pd-verdict,
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price .pd-verdict{
  max-width:none!important;
  margin:0!important;
  font-family:var(--ff-body,"Barlow",Arial,sans-serif)!important;
  font-size:12px!important;
  font-weight:600!important;
  line-height:1.35!important;
  white-space:normal!important;
  color:var(--muted,#9b9ba7)!important;
  text-align:left!important;
}
#ff-tools #ff-product-dialog .sh-body.ff-detail-no-current-offer>.pd-price .pd-verdict:not(:first-child),
#ff-tools #ff-initial-detail.ff-detail-no-current-offer>.pd-price .pd-verdict:not(:first-child){
  margin-left:6px!important;
}

/* ================================================================
   GENERAL DEAL ALERTS — site-wide shared component
   ================================================================ */
[data-ff-deal-alerts] [hidden],
.ff-polish-alert-collapsed[hidden],
.ff-polish-alert-expanded[hidden]{
  display:none!important;
}
.ff-polish-alert-section,
.ff-polish-alert-section .ff-da__form{
  text-align:center!important;
}
.ff-polish-alert-section .ff-da__eyebrow,
.ff-polish-alert-section>h1,
.ff-polish-alert-section>h2,
.ff-polish-alert-section>h3,
.ff-polish-alert-section h2,
.ff-polish-alert-section .alert-title,
.ff-polish-alert-section .alert-sub{
  text-align:center!important;
}
.ff-polish-alert-section .ff-da__eyebrow,
.ff-polish-alert-section>h3,
.ff-polish-alert-section .alert-title{
  margin-top:0!important;
  margin-bottom:12px!important;
}
.ff-polish-alert-section h2,
.ff-polish-alert-section .alert-sub{
  margin-top:0!important;
  margin-bottom:12px!important;
}
.ff-polish-alert-collapsed,
.ff-polish-alert-section .ff-da__collapsed{
  display:grid!important;
  gap:12px!important;
  margin-top:0!important;
}
.ff-polish-alert-section .ff-da__primary,
.ff-polish-alert-trigger{
  box-sizing:border-box!important;
  display:flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:50px!important;
  border:1px solid var(--red,#ef402f)!important;
  border-radius:10px!important;
  background:var(--red,#ef402f)!important;
  color:#fff!important;
  text-align:center!important;
}
.ff-polish-alert-trigger{
  width:100%!important;
  padding:0 16px!important;
  font:800 17px/1 var(--ff-condensed,"Barlow Condensed",Arial,sans-serif)!important;
  letter-spacing:.015em!important;
  cursor:pointer;
}
.ff-polish-alert-section .ff-da__primary:hover,
.ff-polish-alert-trigger:hover{
  filter:brightness(1.06);
}
.ff-polish-alert-section .ff-da__primary:active,
.ff-polish-alert-trigger:active{
  transform:scale(.99);
}
.ff-polish-alert-note,
.ff-polish-alert-section .ff-da__note{
  margin:0!important;
  color:var(--muted,#a9a9b2)!important;
  font-size:12.5px!important;
  line-height:1.3!important;
  text-align:center!important;
}
.ff-polish-alert-expanded,
.ff-polish-alert-section .ff-da__expanded{
  margin-top:0!important;
  text-align:left!important;
}
/* Hidden state must outrank the shared display:grid rules above. */
.ff-polish-alert-section .ff-polish-alert-collapsed[hidden],
.ff-polish-alert-section .ff-polish-alert-expanded[hidden],
[data-ff-deal-alerts] [data-ff-da-collapsed][hidden],
[data-ff-deal-alerts] [data-ff-da-expanded][hidden]{
  display:none!important;
}

@media (max-width:700px){
  /* Keep the zero baseline. Remove only the redundant upper chart price and
     the mobile corner price already stated in the header. */
  #ff-tools .ff-polish-history-axis,
  #ff-tools .ff-polish-history-corner-price{
    display:none!important;
  }
}

@media (max-width:430px){
  #ff-tools #ff-product-dialog .sh-body,
  #ff-tools #ff-initial-detail{
    grid-template-columns:minmax(0,1fr) minmax(108px,36%)!important;
  }
  #ff-tools #ff-product-dialog .sh-body>.pd-hd,
  #ff-tools #ff-initial-detail>.pd-hd{
    padding:15px 8px 15px 14px!important;
    gap:10px!important;
  }
  #ff-tools #ff-product-dialog .sh-body>.pd-hd .pd-img,
  #ff-tools #ff-initial-detail>.pd-hd .pd-img{
    width:62px!important;
    height:62px!important;
    flex:0 0 62px!important;
  }
  #ff-tools #ff-product-dialog .pd-hd .pd-brand,
  #ff-tools #ff-initial-detail .pd-hd .pd-brand{
    font-size:10.5px!important;
    line-height:1.15!important;
  }
  #ff-tools #ff-product-dialog .pd-hd .pd-name,
  #ff-tools #ff-initial-detail .pd-hd .pd-name{
    margin-top:3px!important;
    margin-bottom:7px!important;
    font-size:21px!important;
    line-height:1.02!important;
    overflow-wrap:break-word;
    word-break:normal;
  }
  #ff-tools #ff-product-dialog .sh-body>.pd-price,
  #ff-tools #ff-initial-detail>.pd-price{
    padding:15px 10px 13px!important;
  }
  #ff-tools #ff-product-dialog .pd-price .pd-k,
  #ff-tools #ff-initial-detail .pd-price .pd-k{
    margin-bottom:6px!important;
    font-size:10.5px!important;
  }
  #ff-tools #ff-product-dialog .pd-price .pd-now,
  #ff-tools #ff-initial-detail .pd-price .pd-now{
    font-size:29px!important;
  }
  #ff-tools #ff-product-dialog .pd-price .pd-verdict,
  #ff-tools #ff-initial-detail .pd-price .pd-verdict{
    max-width:142px;
    margin-top:7px!important;
    font-size:11.25px!important;
    line-height:1.28!important;
  }
  #ff-tools .ff-history-toolbar-polished.ff-history-source-hidden{
    gap:2px!important;
  }
  #ff-tools .ff-history-toolbar-polished button,
  #ff-tools .ff-history-toolbar-polished [role="button"]{
    min-height:36px!important;
    height:36px!important;
    padding:0 2px!important;
    font-size:12px!important;
  }
  #ff-tools .ff-polish-history-links{
    gap:6px 18px!important;
    margin-top:7px!important;
  }
  #ff-tools .ff-history:has(.ff-polish-history-links),
  #ff-tools [data-price-history]:has(.ff-polish-history-links){
    padding-bottom:7px!important;
  }
}

@media (max-width:350px){
  #ff-tools #ff-product-dialog .sh-body,
  #ff-tools #ff-initial-detail{
    grid-template-columns:minmax(0,1fr) minmax(100px,37%)!important;
  }
  #ff-tools #ff-product-dialog .sh-body>.pd-hd .pd-img,
  #ff-tools #ff-initial-detail>.pd-hd .pd-img{
    width:54px!important;
    height:54px!important;
    flex-basis:54px!important;
  }
  #ff-tools #ff-product-dialog .pd-hd .pd-name,
  #ff-tools #ff-initial-detail .pd-hd .pd-name{
    font-size:19px!important;
    overflow-wrap:anywhere;
  }
  #ff-tools #ff-product-dialog .pd-price .pd-now,
  #ff-tools #ff-initial-detail .pd-price .pd-now{
    font-size:26px!important;
  }
  #ff-tools #ff-product-dialog .pd-price .pd-verdict,
  #ff-tools #ff-initial-detail .pd-price .pd-verdict{
    font-size:10.75px!important;
  }
  #ff-tools .ff-history-toolbar-polished button,
  #ff-tools .ff-history-toolbar-polished [role="button"]{
    font-size:12px!important;
  }
}
