/* Shortlisted — reusable components: buttons, cards, notices, offers, tables, ad slots. */

.button {
  display: inline-block; background: var(--coral); color: var(--white); border: 0; border-radius: 999px;
  padding: 0.65rem 1.3rem; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.button:hover { background: var(--coral-dark); }

/* Search form */
.search-form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-block: 1.25rem; max-width: 36rem; }
.search-form label:not(.visually-hidden) { width: 100%; font-weight: 600; }
.search-form input {
  flex: 1 1 14rem; font: inherit; padding: 0.6rem 1rem; border: 1px solid var(--ink-muted);
  border-radius: 999px; background: var(--white); color: var(--ink);
}

/* Cards */
.card-grid { list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); }
.card-grid li + li, .card-list li + li { margin-top: 0; }
.card-list { list-style: none; padding: 0; display: grid; gap: 1rem; }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card-link { display: block; padding: 1.1rem 1.25rem; color: inherit; text-decoration: none; height: 100%; }
.card-link:hover h3 { color: var(--coral-dark); text-decoration: underline; }
.card h3 { margin: 0 0 0.35rem; font-size: 1.15rem; }
.card p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; }

/* Steps */
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); padding-left: 1.2rem; }
.steps li { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin: 0; }
.steps h3 { margin-top: 0; }

/* Notices and empty states */
.notice { background: var(--mint); border-left: 4px solid var(--forest); padding: 0.75rem 1rem; border-radius: 0.5rem; }
.empty { color: var(--ink-muted); font-style: italic; }

/* Evidence labels */
.evidence { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.15rem 0.6rem; border-radius: 999px; }
.evidence-tested { background: var(--mint); color: var(--forest); }
.evidence-researched { background: var(--sand); color: var(--ink-soft); }

/* Affiliate disclosure and "Ad" label (ASA: label must be clear and upfront) */
.affiliate-notice p { margin: 0; }
.affiliate-notice { margin-block: 1rem 1.25rem; display: flex; gap: 0.75rem; align-items: flex-start; background: var(--white); border: 1px solid var(--line); border-radius: 0.75rem; padding: 0.75rem 1rem; font-size: 0.9rem; color: var(--ink-soft); }
.ad-label { display: inline-block; background: var(--ink); color: var(--paper); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; padding: 0.1rem 0.45rem; border-radius: 0.3rem; vertical-align: middle; }

/* Offers block: UK retailers only */
.offers { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; margin-block: 1.5rem; }
.offers h3 { margin-top: 0; }
.offer-list { list-style: none; padding: 0; margin: 0; }
.offer { display: grid; gap: 0.25rem 1rem; grid-template-columns: 1fr auto; align-items: center; padding-block: 0.75rem; border-top: 1px solid var(--line); }
.offer:first-child { border-top: 0; }
.offer-retailer { font-weight: 600; }
.offer-price { font-weight: 700; font-size: 1.1rem; }
.offer-meta { grid-column: 1 / -1; font-size: 0.85rem; color: var(--ink-muted); }
.offer-button { justify-self: end; }
.offers-unavailable { color: var(--ink-muted); }

/* Tables scroll inside their own box on small screens */
.table-wrap:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }
.table-wrap { overflow-x: auto; contain: paint; margin-block: 1rem; border: 1px solid var(--line); border-radius: 0.75rem; background: var(--white); }
table { border-collapse: collapse; width: 100%; min-width: 32rem; }
caption { text-align: left; font-weight: 600; padding: 0.75rem 1rem; }
th, td { text-align: left; padding: 0.6rem 1rem; border-top: 1px solid var(--line); vertical-align: top; }
thead th { background: var(--sand); }
/* Keep the row labels visible while a wide table scrolls sideways */
.table-wrap tbody th[scope="row"], .table-wrap thead th:first-child { position: sticky; left: 0; z-index: 1; }
.table-wrap tbody th[scope="row"] { background: var(--white); box-shadow: 1px 0 0 var(--line); }
.table-wrap thead th:first-child { background: var(--sand); box-shadow: 1px 0 0 var(--line); }
.table-hint { display: none; font-size: 0.85rem; color: var(--ink-muted); margin: -0.5rem 0 1rem; }
@media (max-width: 40rem) { .table-hint { display: block; } }

/* Pros and cons */
.pros-cons { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }

/* Table of contents */
.toc ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.toc li + li { margin-top: 0; }
.toc a { display: inline-block; padding: 0.3rem 0.8rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); text-decoration: none; font-size: 0.9rem; }
.category-section { scroll-margin-top: 1rem; }

/* Listing controls (shown by filters.js only when there is something to filter) */
.list-controls { display: flex; flex-wrap: wrap; gap: 0.5rem 1rem; align-items: center; margin-block: 1rem; }
.list-controls select { font: inherit; padding: 0.4rem 0.7rem; border: 1px solid var(--ink-muted); border-radius: 0.5rem; background: var(--white); }

/* Search results */
.result-list { list-style: none; padding: 0; }
.result-list li { padding-block: 0.75rem; border-bottom: 1px solid var(--line); }

/* Ad slots: empty until AdSense is approved. Hidden while empty so there's no blank space. */
.ad-slot { display: none; }
.ad-slot.is-filled { display: block; margin-block: 2rem; text-align: center; }
.ad-slot-label { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--ink-muted); }
