/* FPPro home catalogue proportions. Scope styles to the main listing. */
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid {
  --home-card-ink: #111b24;
  --home-card-muted: #4c5967;
  --home-card-line: #dfe4ea;
  --home-card-blue: #0064bf;
  gap: 14px 12px;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) #store-catalog h2 {
  font-size: 20px;
  line-height: 1.25;
  font-weight: 600;
  letter-spacing: -.035em;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--home-card-line);
  border-radius: 11px;
  background: #fff;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-open {
  position: relative;
  isolation: isolate;
  width: 100%;
  min-width: 0;
  border-radius: inherit;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-open:focus-visible {
  outline: 3px solid var(--home-card-blue);
  outline-offset: -3px;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-image {
  position: relative;
  isolation: isolate;
  aspect-ratio: 3 / 4;
  border-radius: 0;
  background: #f0f1f3;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-image img {
  border-radius: 0;
  transition: none;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-body {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(0, 1fr);
  grid-template-rows: auto auto 1fr;
  align-items: start;
  align-content: start;
  gap: 4px 8px;
  margin: 0;
  padding: 11px 12px 12px;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-title-row { grid-row: 1; grid-column: 1 / -1; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-title-row h3 {
  margin: 0;
  color: var(--home-card-ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.32;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-bottom {
  grid-row: 2;
  grid-column: 1 / -1;
  margin: 0;
  padding: 0;
  border: 0;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-price {
  display: block;
  max-width: 100%;
  white-space: normal;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-price strong {
  color: var(--home-card-ink);
  font-size: 18px;
  font-weight: 700;
  line-height: 1.18;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-price-pending .product-card-price strong {
  color: var(--home-card-ink);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.3;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid :is(.product-card-meta, .card-device-facts) {
  grid-row: 3;
  min-width: 0;
  align-self: start;
  margin: 0;
  padding: 0;
  color: var(--home-card-muted);
  font-size: 11px;
  line-height: 1.4;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-meta { grid-column: 1; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-device-facts { display: block; grid-column: 2; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-body:not(:has(.product-card-meta)) .card-device-facts { grid-column: 1 / -1; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-device-facts:not(:has(.retail-battery-fact)) { display: none; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-device-facts .retail-battery-fact {
  display: inline-flex;
  flex-direction: row;
  align-items: baseline;
  gap: 4px;
  white-space: nowrap;
}
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .retail-battery-fact :is(dt, dd) {
  display: inline;
  max-width: none;
  width: auto;
  height: auto;
  margin: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font-size: inherit;
  line-height: inherit;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .retail-battery-fact dd { font-weight: 650; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid :is(.card-detail-link, .card-photo-count, .card-history, .card-packaging),
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-device-facts > div:not(.retail-battery-fact) { display: none; }

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-favorite {
  top: 4px;
  right: 4px;
  left: auto;
  z-index: 2;
  width: 44px;
  height: 44px;
  background: transparent;
  color: #162430;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-favorite::before {
  content: '';
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: #fffffff5;
}

#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-favorite svg { position: relative; width: 16px; height: 16px; }
#root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-favorite[aria-pressed="true"] { color: var(--home-card-blue); }

@media (min-width: 1280px) {
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid:not(:has(.product-card:only-child)) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 700px) {
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) #store-catalog h2 { font-size: 22px; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) > .storefront-content > #store-catalog { margin-inline: 20px; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) > .storefront-content > .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 12px;
    margin-inline: 20px;
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card {
    width: 100%;
    border: 0;
    border-radius: 28px;
    background: #0a1317;
    box-shadow: 0 6px 16px #14202a24;
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-open { aspect-ratio: 3 / 4; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
    background: #25343c;
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-image img {
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    transform: none;
    object-fit: cover;
    object-position: center 47%;
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-open::after {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 33%, #0a131735 51%, #0a1317ee 81%, #0a1317 100%);
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-body {
    position: absolute;
    z-index: 1;
    inset: auto 0 0;
    min-height: 0;
    gap: 4px 6px;
    padding: 12px clamp(9px, 3.35vw, 16px) 13px;
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-title-row h3 {
    color: #fff;
    font-size: clamp(12px, 3.45vw, 16px);
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-price strong { color: #fff; font-size: 22px; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .card-price-pending .product-card-price strong {
    color: #fff;
    font-size: clamp(11px, 3.2vw, 14px);
  }

  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .product-card-price small { color: #ffe0a3; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid :is(.product-card-meta, .card-device-facts) { color: #ffe0a3; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .stock-chip { display: none; }
  #root .studio-catalog:not(.is-new-devices, .favorites-catalog) .product-grid .demo-chip { z-index: 1; }
}
