/* ═══════════════════════════════════════════════════════════════════════════
   HalfPrice AU — site stylesheet
   Mobile-first: the base rules target small screens, media queries scale up.
   ═══════════════════════════════════════════════════════════════════════════ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --coles:   #e01b22;
  --wool:    #008a00;
  --indigo:  #4f46e5;
  --bg:      #f3f4f6;
  --card:    #ffffff;
  --text:    #1f2937;
  --muted:   #6b7280;
  --border:  #e5e7eb;
  --radius:  10px;
  --shadow:  0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.06);
  --wrap:    1280px;
  --pad:     1rem;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: #fff; color: var(--indigo); padding: .6rem 1rem; font-weight: 700;
}
.skip-link:focus { left: .5rem; top: .5rem; }

:focus-visible { outline: 2px solid var(--indigo); outline-offset: 2px; }

/* ── Header ────────────────────────────────────────────────────────────────── */
.site-header {
  background: #fff; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}
.header-inner {
  max-width: var(--wrap); margin: auto; padding: .55rem var(--pad);
  display: flex; align-items: center; gap: .6rem; flex-wrap: wrap;
}

.logo {
  font-size: 1.2rem; font-weight: 800;
  display: flex; align-items: center; gap: .25rem;
  white-space: nowrap; flex-shrink: 0;
}
.logo-half  { color: var(--coles); }
.logo-price { color: var(--wool); }
.logo-tag {
  font-size: .65rem; font-weight: 700; color: var(--muted);
  background: var(--bg); padding: .1rem .35rem; border-radius: 4px;
}

.search-form { flex: 1 1 160px; min-width: 0; order: 3; }
.search-wrap { position: relative; }
.search-input {
  width: 100%; padding: .5rem 2.4rem .5rem .8rem;
  border: 1.5px solid var(--border); border-radius: 8px;
  font-size: 16px; /* prevents iOS zoom-on-focus */
  background: var(--bg); outline: none;
  transition: border-color .2s, background .2s;
}
.search-input:focus { border-color: var(--indigo); background: #fff; }
.search-btn {
  position: absolute; right: .2rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); line-height: 0;
}

.nav-toggle {
  margin-left: auto; order: 2;
  width: 40px; height: 36px; border: 1.5px solid var(--border); border-radius: 8px;
  background: #fff; cursor: pointer;
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px;
}
.nav-toggle span { display: block; width: 17px; height: 2px; background: var(--text); border-radius: 2px; }

.site-nav {
  order: 4; width: 100%;
  display: none; flex-direction: column; gap: .1rem;
  padding: .4rem 0 .2rem;
  border-top: 1px solid var(--border); margin-top: .5rem;
}
.site-nav.open { display: flex; }
.site-nav a {
  padding: .55rem .3rem; font-size: .92rem; font-weight: 600;
  border-radius: 6px;
}
.site-nav a:hover { color: var(--indigo); }

@media (min-width: 860px) {
  .header-inner { flex-wrap: nowrap; gap: 1rem; padding: 0 var(--pad); height: 62px; }
  .search-form { order: 2; max-width: 380px; }
  .nav-toggle { display: none; }
  .site-nav {
    order: 3; width: auto; display: flex; flex-direction: row; gap: .2rem;
    border: none; margin: 0; padding: 0; margin-left: auto;
  }
  .site-nav a { padding: .4rem .6rem; font-size: .87rem; white-space: nowrap; }
}

/* ── Breadcrumb ────────────────────────────────────────────────────────────── */
.breadcrumb {
  max-width: var(--wrap); margin: .75rem auto .1rem; padding: 0 var(--pad);
  display: flex; gap: .3rem; align-items: center; flex-wrap: wrap;
  font-size: .76rem; color: var(--muted);
}
.breadcrumb a { color: var(--indigo); }
.breadcrumb a:hover { text-decoration: underline; }

/* ── Generic layout blocks ─────────────────────────────────────────────────── */
.wrap { max-width: var(--wrap); margin: auto; padding: 0 var(--pad); }
.wrap-narrow { max-width: 760px; margin: auto; padding: 0 var(--pad); }

.page-hero { max-width: var(--wrap); margin: .6rem auto .9rem; padding: 0 var(--pad); }
.page-hero h1 { font-size: clamp(1.3rem, 4.5vw, 1.9rem); font-weight: 800; line-height: 1.25; }
.page-hero .sub { font-size: .88rem; color: var(--muted); margin-top: .4rem; max-width: 70ch; }

.section { margin: 2rem 0; }
.section > h2 { font-size: 1.15rem; font-weight: 800; margin-bottom: .8rem; }

.intro-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem 1.2rem; margin: 0 auto 1.4rem; max-width: var(--wrap);
  box-shadow: var(--shadow);
}
.intro-card p + p { margin-top: .7rem; }
.intro-card p { font-size: .92rem; }

/* ── Filter chips ──────────────────────────────────────────────────────────── */
.chip-bar { max-width: var(--wrap); margin: 0 auto .9rem; padding: 0 var(--pad); }
.chip-scroll {
  display: flex; gap: .4rem; overflow-x: auto; padding-bottom: .3rem;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: .3rem .8rem; border-radius: 20px;
  font-size: .78rem; font-weight: 600;
  border: 1.5px solid var(--border); background: #fff;
  white-space: nowrap; transition: border-color .15s, color .15s, background .15s;
}
.chip:hover { border-color: var(--indigo); color: var(--indigo); }
.chip.active   { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.chip-all.active   { background: var(--text);  border-color: var(--text);  color: #fff; }
.chip-coles.active { background: var(--coles); border-color: var(--coles); color: #fff; }
.chip-wool.active  { background: var(--wool);  border-color: var(--wool);  color: #fff; }

.results-bar {
  max-width: var(--wrap); margin: 0 auto .7rem; padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: .5rem; font-size: .82rem; color: var(--muted);
}
.clear-btn { color: var(--indigo); font-weight: 600; padding: .3rem 0; }
.clear-btn:hover { text-decoration: underline; }

/* ── Deal grid ─────────────────────────────────────────────────────────────── */
.grid-wrap { max-width: var(--wrap); margin: auto; padding: 0 var(--pad) 2rem; }
.deals-grid {
  display: grid; list-style: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .65rem;
}
@media (min-width: 640px) { .deals-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1rem; } }
@media (min-width: 1024px) { .deals-grid { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); } }

.deal-card {
  background: var(--card); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .15s, box-shadow .15s;
}
.deal-card:hover { transform: translateY(-3px); box-shadow: 0 6px 24px rgba(0,0,0,.11); }

.card-img {
  display: block; position: relative;
  aspect-ratio: 1/1; background: #f9fafb; overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: .6rem; transition: transform .2s; }
.deal-card:hover .card-img img { transform: scale(1.04); }
.img-fallback {
  display: flex; align-items: center; justify-content: center;
  height: 100%; font-size: 2.4rem;
}
.disc-badge {
  position: absolute; top: .4rem; left: .4rem;
  background: var(--coles); color: #fff;
  font-size: .66rem; font-weight: 800; padding: .16rem .4rem; border-radius: 5px; line-height: 1.3;
}
.store-dot {
  position: absolute; bottom: .4rem; right: .4rem; width: 22px; height: 22px;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: .64rem; font-weight: 800; color: #fff;
}
.dot-coles { background: var(--coles); }
.dot-wool  { background: var(--wool); }

.card-body { padding: .55rem .7rem; flex: 1; display: flex; flex-direction: column; gap: .2rem; }
.cat-tag {
  align-self: flex-start;
  font-size: .66rem; color: var(--muted); background: var(--bg);
  padding: .28rem .45rem; border-radius: 4px;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cat-tag:hover { color: var(--indigo); }
.card-name {
  font-size: .82rem; font-weight: 600; line-height: 1.35; margin-top: .15rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card-brand { font-size: .7rem; color: var(--muted); }
.card-prices { display: flex; align-items: baseline; gap: .4rem; margin-top: auto; padding-top: .3rem; flex-wrap: wrap; }
.price-now { font-size: 1.02rem; font-weight: 800; color: #dc2626; }
.price-was { font-size: .75rem; color: var(--muted); text-decoration: line-through; }

.card-cta {
  display: block; text-align: center; padding: .5rem .5rem;
  font-size: .76rem; font-weight: 700; border-top: 1px solid var(--border);
  transition: background .15s, color .15s;
}
.cta-coles { color: var(--coles); }
.cta-coles:hover { background: var(--coles); color: #fff; }
.cta-wool { color: var(--wool); }
.cta-wool:hover { background: var(--wool); color: #fff; }

/* ── Deal detail ───────────────────────────────────────────────────────────── */
.deal-detail {
  max-width: var(--wrap); margin: .5rem auto 0; padding: 0 var(--pad);
  display: grid; gap: 1.2rem;
}
@media (min-width: 820px) { .deal-detail { grid-template-columns: minmax(0, 400px) minmax(0, 1fr); gap: 2rem; align-items: start; } }

.deal-photo {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem; position: relative; box-shadow: var(--shadow);
}
.deal-photo img { width: 100%; height: auto; aspect-ratio: 1/1; object-fit: contain; }
.deal-photo .img-fallback { font-size: 4rem; aspect-ratio: 1/1; }

.deal-info h1 { font-size: clamp(1.25rem, 4vw, 1.7rem); font-weight: 800; line-height: 1.3; }
.deal-meta { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .9rem; }
.pill {
  font-size: .72rem; font-weight: 700; padding: .2rem .6rem; border-radius: 20px;
  background: var(--bg); color: var(--muted); border: 1px solid var(--border);
}
.pill-coles { background: var(--coles); color: #fff; border-color: var(--coles); }
.pill-wool  { background: var(--wool);  color: #fff; border-color: var(--wool); }

.price-block {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.price-row { display: flex; align-items: baseline; gap: .7rem; flex-wrap: wrap; }
.price-row .now { font-size: 2rem; font-weight: 800; color: #dc2626; line-height: 1.1; }
.price-row .was { font-size: 1rem; color: var(--muted); text-decoration: line-through; }
.price-row .off {
  font-size: .78rem; font-weight: 800; color: #fff; background: var(--coles);
  padding: .18rem .5rem; border-radius: 5px;
}
.save-line { margin-top: .5rem; font-size: .92rem; }
.save-line strong { color: var(--wool); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  padding: .75rem 1.3rem; border-radius: 8px; font-weight: 700; font-size: .92rem;
  transition: opacity .15s, background .15s, color .15s;
}
.btn:hover { opacity: .88; }
.btn-coles { background: var(--coles); color: #fff; }
.btn-wool  { background: var(--wool);  color: #fff; }
.btn-outline { border: 1.5px solid var(--indigo); color: var(--indigo); }
.btn-outline:hover { background: var(--indigo); color: #fff; opacity: 1; }
.btn-block { display: flex; width: 100%; margin-top: .9rem; }

.fact-table { width: 100%; border-collapse: collapse; font-size: .88rem; margin-top: .5rem; }
.fact-table th, .fact-table td { text-align: left; padding: .55rem .2rem; border-bottom: 1px solid var(--border); }
.fact-table th { color: var(--muted); font-weight: 600; width: 42%; }

/* ── Prose (guides, legal pages) ───────────────────────────────────────────── */
.prose { max-width: 72ch; margin: 0 auto; padding: 0 var(--pad) 2.5rem; font-size: 1rem; }
.prose h2 { font-size: 1.25rem; font-weight: 800; margin: 2rem 0 .6rem; line-height: 1.3; }
.prose h3 { font-size: 1.05rem; font-weight: 700; margin: 1.4rem 0 .4rem; }
.prose p  { margin-bottom: .9rem; }
.prose ul, .prose ol { margin: 0 0 1rem 1.2rem; }
.prose li { margin-bottom: .4rem; }
.prose a { color: var(--indigo); text-decoration: underline; }
.prose strong { font-weight: 700; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9rem; margin: 1rem 0; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--border); padding: .5rem .6rem; text-align: left; }
.prose th { background: #fff; font-weight: 700; }
.prose blockquote {
  border-left: 3px solid var(--indigo); padding: .3rem 0 .3rem 1rem;
  color: var(--muted); margin: 1rem 0; font-style: italic;
}
.prose .callout {
  background: #fff; border: 1px solid var(--border); border-left: 4px solid var(--indigo);
  border-radius: 8px; padding: .9rem 1rem; margin: 1.2rem 0; font-size: .93rem;
}
.prose .callout p:last-child { margin-bottom: 0; }

.article-meta { font-size: .8rem; color: var(--muted); margin-top: .5rem; }

/* ── Card lists (guides index, category index) ─────────────────────────────── */
.card-list { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; }
@media (min-width: 620px) { .card-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .card-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.list-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .4rem;
  transition: transform .15s, box-shadow .15s;
}
.list-card:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(0,0,0,.1); }
.list-card h2, .list-card h3 { font-size: 1rem; font-weight: 700; line-height: 1.35; }
.list-card p { font-size: .87rem; color: var(--muted); }
.list-card .meta { font-size: .74rem; color: var(--muted); margin-top: auto; padding-top: .5rem; }

/* ── Stat tiles ────────────────────────────────────────────────────────────── */
.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .7rem; list-style: none; }
@media (min-width: 720px) { .stat-grid { grid-template-columns: repeat(4, minmax(0,1fr)); } }
.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: .9rem 1rem; box-shadow: var(--shadow);
}
.stat .val { font-size: 1.5rem; font-weight: 800; line-height: 1.15; color: var(--indigo); }
.stat .lbl { font-size: .76rem; color: var(--muted); margin-top: .2rem; }

/* ── Empty state / pagination ──────────────────────────────────────────────── */
.empty { text-align: center; padding: 3.5rem 1rem; color: var(--muted); }
.empty h2 { font-size: 1.1rem; margin-bottom: .5rem; color: var(--text); }

.pagination {
  display: flex; gap: .35rem; justify-content: center; align-items: center;
  flex-wrap: wrap; margin: 1.6rem 0 .5rem; list-style: none;
}
.pagination a, .pagination span {
  min-width: 38px; padding: .45rem .6rem; text-align: center;
  border: 1.5px solid var(--border); border-radius: 8px; background: #fff;
  font-size: .85rem; font-weight: 600;
}
.pagination a:hover { border-color: var(--indigo); color: var(--indigo); }
.pagination .current { background: var(--indigo); border-color: var(--indigo); color: #fff; }
.pagination .gap { border: none; background: none; }

/* ── App promotion ─────────────────────────────────────────────────────────── */
/* Site furniture, not an ad unit: no border box, no "sponsored" styling, and
   never rendered next to an .ad-inline slot. */

.store-badges { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.store-badges img { height: 40px; width: auto; }

/* Sits inside a .wrap, so it inherits the page gutter rather than setting one. */
.app-band {
  background: linear-gradient(135deg, #111827 0%, #1f2937 60%, #312e81 100%);
  color: #e5e7eb;
  margin: 1.2rem 0 1.6rem;
  border-radius: var(--radius);
}
.app-band-inner {
  padding: 1.3rem 1.15rem;
  display: flex; flex-direction: column; gap: 1.1rem;
}
.app-band-kicker {
  font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #a5b4fc; margin-bottom: .35rem;
}
.app-band h2 { font-size: clamp(1.1rem, 3.6vw, 1.4rem); font-weight: 800; color: #fff; line-height: 1.3; }
.app-band p { font-size: .9rem; margin-top: .45rem; max-width: 60ch; }
.app-band .app-band-kicker { margin-top: 0; }

@media (min-width: 780px) {
  .app-band-inner {
    flex-direction: row; align-items: center; justify-content: space-between;
    gap: 2.5rem; padding: 1.6rem 2rem;
  }
  .app-band-badges { flex-shrink: 0; flex-direction: column; align-items: flex-start; gap: .6rem; }
}

.app-compact {
  margin: 1.5rem 0; padding: 1rem 1.1rem;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: .8rem;
}
.app-compact strong { display: block; font-size: .95rem; }
.app-compact span { font-size: .87rem; color: var(--muted); }
@media (min-width: 700px) {
  .app-compact { flex-direction: row; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 1.25rem; }
  .app-compact .store-badges { flex-shrink: 0; }
}

.nav-app { color: var(--indigo); font-weight: 700 !important; }
@media (min-width: 860px) {
  .nav-app {
    border: 1.5px solid var(--indigo); border-radius: 20px; padding: .3rem .8rem !important;
  }
  .nav-app:hover { background: var(--indigo); color: #fff; }
}

.footer-app p { margin-bottom: .7rem; }
.footer-app a { color: #a5b4fc; text-decoration: underline; }

.app-features { display: grid; gap: 1rem; grid-template-columns: 1fr; list-style: none; margin: 1.2rem 0; }
@media (min-width: 620px) { .app-features { grid-template-columns: repeat(2, minmax(0,1fr)); } }
.app-features li {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1rem 1.1rem; box-shadow: var(--shadow);
}
.app-features h3 { font-size: .98rem; font-weight: 700; margin-bottom: .3rem; }
.app-features p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ── Ads ───────────────────────────────────────────────────────────────────── */
.ad-inline, .ad-rail { margin: 1.5rem auto; max-width: var(--wrap); padding: 0 var(--pad); min-height: 90px; }
.ad-label {
  display: block; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted); margin-bottom: .25rem;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.site-footer { background: #111827; color: #9ca3af; margin-top: 2.5rem; font-size: .85rem; }
.footer-grid {
  max-width: var(--wrap); margin: auto; padding: 2rem var(--pad) 1.4rem;
  display: grid; gap: 1.6rem; grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2rem; } }
@media (min-width: 1040px) { .footer-grid { grid-template-columns: 1.7fr 1fr 1fr 1fr 1.2fr; } }

.footer-col h3 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: #f3f4f6; margin-bottom: .6rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: .35rem; }
.footer-col a:hover { color: #a5b4fc; text-decoration: underline; }
.footer-about p { margin-bottom: .7rem; line-height: 1.65; }
.logo-footer { margin-bottom: .6rem; }
.logo-footer .logo-tag { background: #1f2937; color: #9ca3af; }
.footer-note { font-size: .78rem; color: #6b7280; }

.footer-bottom {
  border-top: 1px solid #1f2937; max-width: var(--wrap); margin: auto;
  padding: 1rem var(--pad) 1.8rem; font-size: .76rem; color: #6b7280; text-align: center;
}
.footer-bottom p + p { margin-top: .5rem; }

/* ── Cookie notice ─────────────────────────────────────────────────────────── */
.cookie-notice {
  position: fixed; left: .6rem; right: .6rem; bottom: .6rem; z-index: 200;
  background: #111827; color: #e5e7eb; border-radius: 10px;
  padding: .9rem 1rem; box-shadow: 0 8px 30px rgba(0,0,0,.3);
  display: flex; flex-direction: column; gap: .7rem; font-size: .82rem;
}
.cookie-notice[hidden] { display: none; }
.cookie-notice a { color: #a5b4fc; text-decoration: underline; }
.cookie-notice button {
  background: var(--indigo); color: #fff; border: none; border-radius: 7px;
  padding: .5rem 1.2rem; font-weight: 700; cursor: pointer; align-self: flex-start;
}
@media (min-width: 700px) {
  .cookie-notice {
    left: auto; right: 1rem; bottom: 1rem; max-width: 420px;
  }
}

/* ── Infinite scroll spinner ───────────────────────────────────────────────── */
.load-spinner {
  display: none; justify-content: center; align-items: center;
  gap: .6rem; padding: 2rem; color: var(--muted); font-size: .85rem;
}
.load-spinner.active { display: flex; }
.spinner-ring {
  width: 22px; height: 22px; border: 2.5px solid var(--border);
  border-top-color: var(--indigo); border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
