/* G65B – Desktop-only visual exploration.
   All rules for existing UI are restricted to min-width:1200px.
   No changes to mobile/tablet, price semantics, SEO or backend. */

/* New controls do not appear on mobile and tablet. */
.lp65-gift-nav,
.lp65-results-tools { display: none; }

@media (min-width:1200px) {
  /* Desktop content rhythm: match wide homepage, not the narrower
     legacy 900px list or 1120px inner shell. */
  body .shell.main-content.simple-page.offers-page,
  body .shell.main-content.simple-page.gratis-page {
    width: min(calc(100% - 64px), 1280px);
    max-width: 1280px;
  }
  .offers-page .page-intro,
  .gratis-page .page-intro {
    max-width: 850px;
  }
  .offers-page .latest-catalog-section,
  .gratis-page .gratis-catalog-section { width: 100%; }

  /* The old 900px / single-column overrides are intentional on
     smaller viewports but should not constrain large desktop. */
  .offers-page .latest-catalog-section .offer-feed,
  .gratis-page .gratis-catalog-section .offer-feed,
  .home-v4 .home-editorial-category .offer-feed,
  .home-v4 .feed-section-v4:not(.gratis-highlight-section) > .offer-feed {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    max-width: 1280px;
    gap: 20px;
    margin-inline: auto;
    align-items: stretch;
  }

  .offers-page .offer-feed > .offer-card,
  .gratis-page .gratis-catalog-section .offer-feed > .offer-card,
  .home-v4 .home-editorial-category .offer-feed > .offer-card,
  .home-v4 .feed-section-v4:not(.gratis-highlight-section) > .offer-feed > .offer-card {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: 100%;
    grid-template-columns: 126px minmax(0,1fr);
    gap: 13px;
    padding: 14px;
    border-radius: 22px;
    box-shadow: 0 9px 27px rgba(15,42,67,.07);
  }

  .offers-page .offer-feed .offer-card h3,
  .gratis-page .gratis-catalog-section .offer-card h3,
  .home-v4 .home-editorial-category .offer-card h3,
  .home-v4 .feed-section-v4:not(.gratis-highlight-section) > .offer-feed .offer-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    font-size: .98rem;
    font-weight: 790;
    line-height: 1.31;
    letter-spacing: -.015em;
    margin-block: 7px;
  }

  .offers-page .offer-feed .price-line strong,
  .gratis-page .gratis-catalog-section .price-line strong,
  .home-v4 .home-editorial-category .price-line strong {
    font-size: 1.54rem;
    letter-spacing: -.038em;
  }

  .offers-page .offer-feed .card-bottom,
  .gratis-page .gratis-catalog-section .card-bottom,
  .home-v4 .home-editorial-category .card-bottom {
    gap: 6px;
    margin-top: 8px;
  }
  .offers-page .offer-feed .offer-cta,
  .gratis-page .gratis-catalog-section .offer-cta,
  .home-v4 .home-editorial-category .offer-cta {
    min-height: 44px;
    border-radius: 12px;
  }

  /* The historical observation remains distinct from merchant
     promotions. These are presentation-only: values and labels stay. */
  .offers-page .offer-card .lp-previous-observed-v1,
  .gratis-page .offer-card .lp-previous-observed-v1,
  .home-v4 .offer-card .lp-previous-observed-v1 {
    color: #64788a;
    line-height: 1.45;
    font-size: .76rem;
  }
  .offers-page .offer-card .signal-badge,
  .gratis-page .offer-card .signal-badge,
  .home-v4 .home-editorial-category .offer-card .signal-badge {
    font-weight: 750;
  }

  /* Low-noise results toolbar. The existing filter dialog is reused.
     /oferty has no newly invented sorting behavior. */
  .lp65-results-tools {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
    margin: -2px 0 16px;
  }
  .lp65-results-sort {
    color: #647587;
    font-size: 13px;
    font-weight: 550;
  }
  .lp65-results-sort strong { color: #263b32; font-weight: 750; }
  .lp65-sort-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    min-height: 39px;
    padding: 8px 13px;
    border: 1px solid #d0ded6;
    border-radius: 11px;
    background: #fff;
    color: #216845;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
  }
  .lp65-sort-button:hover { background: #ecf7ef; }
  .lp65-sort-button:focus-visible,
  .lp65-gift-arrow:focus-visible {
    outline: 3px solid #5aa77c;
    outline-offset: 2px;
  }

  /* Homepage editorial offers should use the large available shell. */
  .home-v4 .home-editorial-category .offer-feed { max-width: 1280px; }

  /* The homepage gift carousel: readable cards, three across,
     discreet arrow controls and no persistent grey scrollbar. */
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .lp65-gift-nav {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: flex-end;
    padding: 1px 4px 12px;
  }
  .home-v4 .lp65-gift-nav-label {
    color: #667c85;
    font-size: 12px;
    margin-right: 6px;
  }
  .home-v4 .lp65-gift-arrow {
    display: grid;
    place-items: center;
    box-sizing: border-box;
    width: 40px;
    height: 36px;
    border: 1px solid #d4e0d8;
    border-radius: 10px;
    background: #fff;
    color: #216845;
    font: inherit;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
    transition: background 140ms ease, border-color 140ms ease;
  }
  .home-v4 .lp65-gift-arrow:hover:not(:disabled) {
    background: #eaf6ee;
    border-color: #a3c4ae;
  }
  .home-v4 .lp65-gift-arrow:disabled {
    opacity: .35;
    cursor: default;
  }

  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed {
    display: flex;
    flex-wrap: nowrap;
    gap: 17px;
    width: 100%;
    max-width: none;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
    scrollbar-gutter: auto;
    overscroll-behavior-inline: contain;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed::-webkit-scrollbar { display: none; }

  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed > .offer-card {
    box-sizing: border-box;
    flex: 0 0 calc((100% - 34px) / 3);
    min-width: 0;
    display: grid;
    grid-template-columns: 98px minmax(0, 1fr);
    gap: 10px;
    padding: 12px;
    border-radius: 18px;
    scroll-snap-align: start;
    box-shadow: 0 5px 17px rgba(15,42,67,.06);
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .product-visual {
    width: 100%;
    height: 133px;
    min-height: 0;
    border-radius: 12px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .offer-topline {
    min-height: 27px;
    padding-right: 0;
    gap: 5px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .animal-chip {
    min-height: 22px;
    padding: 3px 7px 3px 4px;
    font-size: .62rem;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .animal-chip-image {
    width: 19px;
    height: 19px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .offer-card h3 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    margin: 6px 0 5px;
    font-size: .87rem;
    font-weight: 790;
    line-height: 1.26;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .price-line strong {
    font-size: 1.32rem;
    line-height: 1.08;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .best-store {
    font-size: .73rem;
    line-height: 1.24;
    margin-top: 3px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .card-bottom {
    gap: 5px;
    margin-top: 5px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .signal-badge,
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .discount-pill,
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .comparison-pill-v5 {
    min-height: 0;
    padding: 4px 6px;
    font-size: .61rem;
    line-height: 1.18;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .offer-cta {
    min-height: 38px;
    margin-top: auto;
    padding: 8px 9px;
    border-radius: 10px;
    font-size: .73rem;
    line-height: 1.15;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .card-meta-row-v5 {
    gap: 5px;
    margin-top: 5px;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .affiliate-note-v5 {
    font-size: .59rem;
    line-height: 1.3;
  }
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed .card-time { display: none; }
}

@media (min-width:1200px) and (prefers-reduced-motion:reduce) {
  .home-v4 .gratis-highlight-section:not(.category-best-section)
  .gratis-highlight-feed { scroll-behavior: auto; }
  .home-v4 .lp65-gift-arrow { transition: none; }
}

/* G65C: preserve the original 24 visible cards below desktop. */
@media (max-width:1199px) {
  .home-v4 .home-editorial-category .offer-card.lp65-desktop-extra {
    display: none !important;
  }
}
@media (min-width:1200px) {
  .home-v4 .home-editorial-category .offer-feed > .offer-card.lp65-desktop-extra {
    display: grid;
  }
}
