/*
Theme Name: CheapHere
Theme URI: https://cheaphere.shop
Author: CheapHere
Description: A simple, fast price-comparison theme for CHEAPHERE.SHOP. Orange accent, white-first, clean design.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: cheaphere
*/

/* ============================
   TOKENS
   ============================ */
:root{
  --white:      #FFFFFF;
  --cream:      #FBFAF7;
  --ink:        #1C1B1A;
  --gray-600:   #57534E;
  --gray-400:   #948E86;
  --gray-200:   #E9E4DC;
  --gray-100:   #F3F0EA;

  --orange:       #FF5A1F;
  --orange-dark:  #C8410C;
  --orange-light: #FFEEE3;
  --orange-wash:  #FFF7F2;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body:    'Inter', system-ui, sans-serif;
  --font-mono:    'IBM Plex Mono', ui-monospace, monospace;

  --radius: 14px;
  --radius-sm: 8px;
  --container: 1180px;
}

*{ box-sizing: border-box; }

html{ scroll-behavior: smooth; }

body{
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display:block; }

a{ color: inherit; text-decoration: none; }

.wrap{
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

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

@media (prefers-reduced-motion: reduce){
  *{ animation: none !important; transition: none !important; }
}

/* ============================
   HEADER
   ============================ */
.site-header{
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: saturate(180%) blur(8px);
  border-bottom: 1px solid var(--gray-200);
}

.header-row{
  display:flex;
  align-items:center;
  gap: 28px;
  padding: 16px 24px;
}

.logo{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.logo span{ color: var(--orange); }

.site-search{
  flex: 1;
  max-width: 480px;
  position: relative;
}
.site-search input{
  width: 100%;
  padding: 11px 16px 11px 40px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: var(--gray-100);
  font-family: var(--font-body);
  font-size: 14.5px;
  color: var(--ink);
}
.site-search input:focus{
  border-color: var(--orange);
  background: var(--white);
}
.site-search svg{
  position:absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px; height:16px;
  color: var(--gray-400);
}

.main-nav{
  display:flex;
  gap: 22px;
  margin-left: auto;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--gray-600);
}
.main-nav a:hover{ color: var(--orange); }

@media (max-width: 780px){
  .header-row{ flex-wrap: wrap; }
  .main-nav{ order: 3; width:100%; justify-content:center; }
  .site-search{ order: 2; }
}

/* ============================
   HERO
   ============================ */
.hero{
  padding: 68px 24px 44px;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}
.hero-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--orange-dark);
  background: var(--orange-light);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 22px;
}
.hero h1{
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(32px, 5vw, 54px);
  letter-spacing: -0.03em;
  margin: 0 0 16px;
  line-height: 1.08;
}
.hero h1 em{
  font-style: normal;
  color: var(--orange);
}
.hero p{
  color: var(--gray-600);
  font-size: 17px;
  max-width: 540px;
  margin: 0 auto 30px;
}

.hero-search{
  max-width: 560px;
  margin: 0 auto;
  display:flex;
  gap:10px;
  background: var(--gray-100);
  padding: 6px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
}
.hero-search input{
  flex:1;
  border:none;
  background:transparent;
  padding: 12px 16px;
  font-size: 15px;
  font-family: var(--font-body);
}
.hero-search input:focus{ outline:none; }
.hero-search button{
  border:none;
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 0 26px;
  border-radius: 999px;
  cursor:pointer;
  transition: background .15s ease;
}
.hero-search button:hover{ background: var(--orange); }

/* ============================
   CATEGORY CHIPS
   ============================ */
.chip-row{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  justify-content:center;
  padding: 28px 24px;
}
.chip{
  font-size: 13.5px;
  font-weight: 500;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-200);
  background: var(--white);
  color: var(--gray-600);
  cursor:pointer;
  transition: all .15s ease;
}
.chip:hover{ border-color: var(--orange); color: var(--orange-dark); }
.chip.active{
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* ============================
   PRODUCT GRID
   ============================ */
.section-title{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  padding: 8px 24px 0;
  max-width: var(--container);
  margin: 0 auto;
}
.section-title h2{
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: -0.01em;
  margin: 18px 0 4px;
}
.section-title span{
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--gray-400);
}

.product-grid{
  display:grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
  padding: 24px;
  max-width: var(--container);
  margin: 0 auto;
}

.card{
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 20px 20px 8px;
  background: var(--white);
  transition: border-color .15s ease, transform .15s ease;
}
.card:hover{
  border-color: var(--orange);
  transform: translateY(-2px);
}

.card-top{
  display:flex;
  gap:14px;
  align-items:center;
  margin-bottom: 16px;
}
.card-thumb{
  width: 52px; height:52px;
  border-radius: var(--radius-sm);
  background: var(--orange-wash);
  display:flex; align-items:center; justify-content:center;
  font-size: 22px;
  flex-shrink:0;
}
.card-top h3{
  font-family: var(--font-display);
  font-size: 16.5px;
  margin: 0 0 3px;
  line-height:1.25;
}
.card-top .card-cat{
  font-size: 12px;
  color: var(--gray-400);
  font-family: var(--font-mono);
}

/* the "price ladder" — signature element */
.ladder{
  list-style:none;
  margin: 0 0 14px;
  padding: 0 0 0 2px;
  border-left: 2px solid var(--gray-200);
}
.ladder li{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding: 9px 0 9px 20px;
  margin-left: -2px;
  border-left: 2px solid transparent;
}
.ladder li::before{
  content:"";
  position:absolute;
  left: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 12px; height:12px;
  border-radius:50%;
  background: var(--white);
  border: 2px solid var(--gray-300, var(--gray-400));
}
.ladder li.best{
  border-left-color: var(--orange);
}
.ladder li.best::before{
  background: var(--orange);
  border-color: var(--orange);
  box-shadow: 0 0 0 4px var(--orange-light);
}
.store-name{
  font-size: 13.5px;
  color: var(--gray-600);
  font-weight: 500;
}
.ladder li.best .store-name{
  color: var(--ink);
  font-weight: 600;
}
.price{
  font-family: var(--font-mono);
  font-size: 14.5px;
  color: var(--gray-400);
  text-decoration: line-through;
}
.ladder li.best .price{
  font-size: 17px;
  color: var(--orange-dark);
  text-decoration: none;
  font-weight: 600;
}

.best-tag{
  display:inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing:.03em;
  background: var(--orange);
  color: var(--white);
  padding: 2px 8px;
  border-radius: 999px;
  margin-right:8px;
  vertical-align: middle;
}

.card-footer{
  display:flex;
  align-items:center;
  justify-content:space-between;
  border-top: 1px solid var(--gray-100);
  padding: 12px 0;
}
.savings{
  font-size: 12.5px;
  color: var(--gray-600);
}
.savings b{ color: var(--orange-dark); }
.buy-btn{
  background: var(--ink);
  color: var(--white);
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: 999px;
  border:none;
  cursor:pointer;
  transition: background .15s ease;
}
.buy-btn:hover{ background: var(--orange); }

.empty-state{
  text-align:center;
  padding: 60px 24px;
  color: var(--gray-400);
  font-family: var(--font-mono);
  font-size: 14px;
  display:none;
}

/* ============================
   AD SLOTS
   ============================ */
.ad-slot{
  max-width: var(--container);
  margin: 30px auto;
  padding: 22px;
  min-height: 90px;
  display:flex;
  align-items:center;
  justify-content:center;
  border: 1.5px dashed var(--gray-200);
  border-radius: var(--radius);
  background: var(--gray-100);
  overflow: hidden;
}
.ad-slot-label{
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--gray-400);
}
/* ads placed inside the grid span the full row */
.product-grid .ad-slot{
  grid-column: 1 / -1;
  margin: 0;
}
.ad-slot--leaderboard{ min-height: 100px; }
.ad-slot--footer{ min-height: 120px; }

/* ============================
   FOOTER
   ============================ */
.site-footer{
  border-top: 1px solid var(--gray-200);
  margin-top: 40px;
  padding: 34px 24px;
}
.footer-row{
  max-width: var(--container);
  margin:0 auto;
  display:flex;
  flex-wrap:wrap;
  gap: 16px;
  align-items:center;
  justify-content:space-between;
  font-size: 13px;
  color: var(--gray-400);
}
.footer-row a{ color: var(--gray-600); }
.footer-row a:hover{ color: var(--orange); }
.footer-links{ display:flex; gap:18px; }

/* ============================
   BASIC BLOG FALLBACK (index.php)
   ============================ */
.blog-wrap{ max-width: 760px; margin: 60px auto; padding: 0 24px; }
.blog-wrap article{ margin-bottom: 40px; border-bottom:1px solid var(--gray-200); padding-bottom:32px; }
.blog-wrap h2{ font-family: var(--font-display); font-size: 24px; }
