/*
 * Homepage section contrast and refurbished accents.
 * Loaded only on the front page by wp-content/novamira-sandbox/iprestige-homepage-contrast.php.
 */

.ipm-home {
  --ipm-refurb: #087443;
  --ipm-refurb-accent: #11a84f;
  --ipm-refurb-ink: #075d3b;
  --ipm-refurb-soft: #e7f7ed;
  --ipm-refurb-surface: #f4fbf7;
  --ipm-refurb-border: #c4e8d0;
  --ipm-refurb-cta-deep: #06452f;
  --ipm-refurb-cta-bright: #16864b;
}

/* Stronger section changes without changing the homepage structure. */
.ipm-home .ipm-categories {
  border-block: 1px solid var(--light-silver);
  background: var(--white);
}

.ipm-home .ipm-product-shelves {
  --ipm-card-blue: #087cf0;
  --ipm-card-blue-deep: #0873df;
  padding-bottom: clamp(32px, 2.7vw, 42px);
  border-bottom: 1px solid var(--light-silver);
  background: rgba(0, 196, 248, .045);
}

.ipm-home .ipm-featured-products {
  padding-top: clamp(36px, 2.8vw, 44px);
  background: var(--white);
}

.ipm-home .ip-tradein {
  border-block: 1px solid rgba(51, 8, 103, .10);
  background: rgba(51, 8, 103, .065);
}

.ipm-home .ipm-why {
  background: var(--white);
}

.ipm-home .ipm-condition-choice {
  border-block: 1px solid var(--light-silver);
  background: rgba(236, 236, 238, .38);
}

.ipm-home .ipm-reviews {
  border-block: 1px solid rgba(0, 196, 248, .16);
  background: rgba(0, 196, 248, .075);
}

.ipm-home .ipm-blog {
  background: var(--white);
}

/*
 * Product shelves follow the reference hierarchy:
 * neutral containers, semantic badges, dark prices and quiet repeated CTAs.
 */
.ipm-home .ipm-shelf,
.ipm-home .ipm-shelf--used,
.ipm-home .ipm-shelf--new {
  position: relative;
  overflow: visible;
  margin-bottom: 1.25rem;
  padding: 1.5rem 1.4rem 1.1rem;
  border-color: var(--light-silver);
  background: var(--white);
  box-shadow: 0 12px 30px rgba(10, 15, 45, .045);
}

.ipm-home .ipm-shelf__header {
  margin-bottom: 1rem;
}

.ipm-home .ipm-shelf__header h2 {
  font-size: clamp(1.7rem, 2.15vw, 2rem);
}

.ipm-home .ipm-shelf--used .ipm-shelf__eyebrow {
  color: var(--ipm-refurb-accent);
}

.ipm-home .ipm-shelf--used .ipm-shelf__all-link {
  color: var(--ipm-card-blue);
  border-color: var(--light-silver);
}

.ipm-home .ipm-shelf--used .ipm-shelf__all-link:is(:hover, :focus-visible) {
  color: var(--ipm-card-blue-deep);
  border-color: var(--ipm-card-blue);
}

.ipm-home .ipm-shelf-card {
  border-color: var(--light-silver);
  box-shadow: 0 8px 20px rgba(10, 15, 45, .035);
}

.ipm-home .ipm-shelf--used .ipm-shelf-card:hover {
  border-color: rgba(8, 116, 67, .32);
  box-shadow: 0 12px 25px rgba(8, 116, 67, .07);
}

.ipm-home .ipm-shelf--new .ipm-shelf-card:hover {
  border-color: rgba(8, 124, 240, .34);
  box-shadow: 0 12px 25px rgba(8, 124, 240, .07);
}

.ipm-home .ipm-shelf--used .ipm-shelf-card__badge {
  color: var(--white);
  background: var(--ipm-refurb-accent);
}

.ipm-home .ipm-shelf--new .ipm-shelf-card__badge {
  color: var(--white);
  background: var(--ipm-card-blue);
}

.ipm-home .ipm-shelf-card__media {
  min-height: 11.6rem;
  padding: 2rem .75rem .4rem;
  background: var(--white);
}

.ipm-home .ipm-shelf-card__media img {
  width: 9.2rem;
  height: 9.4rem;
  max-width: 9.2rem;
  max-height: 9.4rem;
  object-fit: contain;
  transform: scale(1.08);
  transform-origin: center;
}

.ipm-home .ipm-shelf-card__body {
  padding: .5rem .8rem .75rem;
}

.ipm-home .ipm-shelf-card h3 {
  min-height: 2.5em;
  margin-bottom: .15rem;
}

.ipm-home .ipm-shelf-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ipm-home .ipm-shelf-card__meta {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ipm-home .ipm-shelf-card__chips {
  margin: .45rem 0 .65rem;
}

.ipm-home .ipm-shelf--used .ipm-shelf-card__chips span:first-child {
  color: var(--ipm-refurb-ink);
  background: var(--ipm-refurb-soft);
}

.ipm-home .ipm-shelf--used .ipm-shelf-card__chips span:last-child,
.ipm-home .ipm-shelf--new .ipm-shelf-card__chips span:last-child {
  color: var(--black);
  background: rgba(236, 236, 238, .62);
}

.ipm-home .ipm-shelf--new .ipm-shelf-card__chips span:first-child {
  color: var(--secondary);
  background: rgba(0, 196, 248, .09);
}

body.home .ipm-home .ipm-product-shelves :is(
  .ipm-shelf-card__price,
  .ipm-shelf-card__price .amount
) {
  color: var(--black);
  font-size: clamp(1rem, 1.25vw, 1.2rem);
  line-height: 1.16;
}

.ipm-home .ipm-shelf-card__old-price {
  color: var(--gray);
}

.ipm-home .ipm-shelf-card__price-row {
  align-items: flex-start;
  min-height: 2.7rem;
  margin-bottom: .55rem;
}

.ipm-home .ipm-shelf--used .ipm-shelf-card__saving-badge {
  color: var(--ipm-refurb-ink);
  background: var(--ipm-refurb-soft);
}

.ipm-home .ipm-shelf--new .ipm-shelf-card__saving-badge {
  color: var(--secondary);
  background: rgba(0, 196, 248, .09);
}

/* Compact product CTAs share the hero's iPrestige brand treatment. */
body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button {
  min-height: 2.75rem;
  border: 0;
  border-radius: var(--ip-radius-button, 9px);
  color: var(--white) !important;
  background: linear-gradient(90deg, var(--secondary) 0%, var(--primary) 50%, var(--secondary) 100%);
  background-size: 220% 100%;
  background-position: 0% 50%;
  box-shadow: none;
  font-family: var(--ip-font-heading);
  font-size: .78rem;
  font-weight: 800;
  line-height: 1;
  transition: background-position .7s ease, transform .25s ease, box-shadow .25s ease;
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button:is(:hover, :focus-visible) {
  color: var(--white) !important;
  background-position: 100% 50%;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(0, 196, 248, .22);
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button:active {
  transform: translateY(0);
  box-shadow: none;
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button:focus-visible {
  outline: 3px solid rgba(0, 196, 248, .32);
  outline-offset: 3px;
}

/* A visible forest-to-emerald gradient, scoped to refurbished product CTAs. */
body.home .ipm-home .ipm-product-shelves .ipm-shelf--used .ipm-shelf-card__button {
  background-image: linear-gradient(90deg, var(--ipm-refurb-cta-deep) 0%, var(--ipm-refurb-cta-bright) 50%, var(--ipm-refurb-cta-deep) 100%);
  background-size: 200% 100%;
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf--used .ipm-shelf-card__button:is(:hover, :focus-visible) {
  box-shadow: 0 10px 22px rgba(8, 116, 67, .18);
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf--used .ipm-shelf-card__button:active {
  box-shadow: none;
}

body.home .ipm-home .ipm-product-shelves .ipm-shelf--used .ipm-shelf-card__button:focus-visible {
  outline-color: var(--ipm-refurb);
}

/* Each shelf now closes with its own compact benefit strip. */
.ipm-home .ipm-shelf > .ipm-product-shelves__trust {
  margin: .8rem 0 0;
  padding: .55rem .9rem;
  border-color: var(--light-silver);
  border-radius: .75rem;
  background: rgba(236, 236, 238, .22);
  box-shadow: none;
}

.ipm-home .ipm-shelf > .ipm-product-shelves__trust .ipm-shelf-trust {
  padding-block: .1rem;
}

.ipm-home .ipm-shelf--used > .ipm-product-shelves__trust .ipm-shelf-trust__icon {
  color: var(--ipm-refurb-ink);
  background: var(--ipm-refurb-soft);
}

/* The refurbished comparison option keeps the green semantic treatment. */
.ipm-home .ipm-condition-choice__header h2 span {
  color: var(--ipm-refurb);
}

.ipm-home .ipm-condition-card--refurbished {
  position: relative;
  border-color: var(--ipm-refurb-border);
  background: var(--ipm-refurb-surface);
}

.ipm-home .ipm-condition-card--refurbished::before {
  position: absolute;
  inset: 0 0 auto;
  z-index: 2;
  height: 4px;
  content: "";
  background: var(--ipm-refurb);
}

.ipm-home .ipm-condition-card--refurbished:hover {
  border-color: rgba(8, 116, 67, .46);
  box-shadow: 0 24px 50px rgba(8, 116, 67, .09);
}

body.home .ipm-home .ipm-condition-card--refurbished .ipm-condition-card__icon--purple {
  color: var(--ipm-refurb-ink);
  background: var(--ipm-refurb-soft);
}

.ipm-home .ipm-condition-card--refurbished .ipm-condition-card__benefits li {
  border-color: rgba(8, 116, 67, .18);
}

.ipm-home .ipm-condition-card--refurbished .ipm-condition-card__halo--purple {
  border-color: rgba(8, 116, 67, .12);
  background: radial-gradient(circle, rgba(8, 116, 67, .10), rgba(8, 116, 67, .025) 60%, transparent 61%);
}

@media (max-width: 820px) {
  .ipm-home .ipm-shelf,
  .ipm-home .ipm-shelf--used,
  .ipm-home .ipm-shelf--new {
    padding: 1.3rem 1rem .9rem;
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust {
    margin-top: .65rem;
  }
}

@media (max-width: 520px) {
  .ipm-home .ipm-shelf,
  .ipm-home .ipm-shelf--used,
  .ipm-home .ipm-shelf--new {
    padding: 1rem .75rem .8rem;
  }

  .ipm-home .ipm-shelf-card__media {
    min-height: 12.2rem;
    padding-top: 1.8rem;
  }

  .ipm-home .ipm-shelf-card__media img {
    width: 10rem;
    height: 10.2rem;
    max-width: 10rem;
    max-height: 10.2rem;
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: .35rem .65rem;
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust .ipm-shelf-trust {
    min-height: 58px;
    padding: .35rem .3rem;
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust .ipm-shelf-trust + .ipm-shelf-trust {
    border-top: 0;
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust .ipm-shelf-trust:nth-child(even) {
    border-left: 1px solid var(--light-silver);
  }

  .ipm-home .ipm-shelf > .ipm-product-shelves__trust .ipm-shelf-trust:nth-child(n + 3) {
    border-top: 1px solid var(--light-silver);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button {
    transition: none;
  }

  .ipm-home .ipm-shelf-card:hover,
  .ipm-home .ipm-condition-card--refurbished:hover,
  body.home .ipm-home .ipm-product-shelves .ipm-shelf-card__button:is(:hover, :focus-visible) {
    transform: none;
  }
}
/* The comparison CTA shares the refurbished shelf's existing green gradient. */
body.home .ipm-home .ipm-condition-card--refurbished .ipm-condition-card__button {
  color: var(--white) !important;
  background-image: linear-gradient(90deg, var(--ipm-refurb-cta-deep) 0%, var(--ipm-refurb-cta-bright) 50%, var(--ipm-refurb-cta-deep) 100%) !important;
  background-size: 200% 100% !important;
  background-position: 0% 50% !important;
  box-shadow: 0 10px 22px rgba(8, 116, 67, .18);
  transition: background-position .7s ease, transform .25s ease, box-shadow .25s ease;
}
body.home .ipm-home .ipm-condition-card--refurbished .ipm-condition-card__button:is(:hover, :focus-visible) {
  background-position: 100% 50% !important;
  box-shadow: 0 10px 22px rgba(8, 116, 67, .18);
}
body.home .ipm-home .ipm-condition-card--refurbished .ipm-condition-card__button:focus-visible {
  outline: 3px solid var(--ipm-refurb);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  body.home .ipm-home .ipm-condition-card--refurbished .ipm-condition-card__button {
    transition: none;
    transform: none;
  }
}
