/*
Theme Name:        BargainOfTheWeek
Theme URI:         https://bargainoftheweek.com
Author:            BuyForLess
Author URI:        https://buyforless.com
Description:       Clean, fast one-page deals theme for BargainOfTheWeek.com. Works with BuyForLess Finder Pro plugin. Mobile-first, 4-column deals grid, scrolling ticker, blue and green brand identity.
Version:           2.0.0
Requires at least: 5.8
Tested up to:      6.5
Requires PHP:      7.4
License:           GNU General Public License v2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:       bargainoftheweek
Tags:              one-column, custom-logo, custom-colors, e-commerce, affiliate, deals
*/

/* ══ Variables ════════════════════════════════════════════════════════ */
:root {
  --blue:       #2575E8;
  --blue-dark:  #1a5bbf;
  --blue-light: #e8f1fd;
  --green:      #22B033;
  --green-dark: #198a27;
  --green-lt:   #e8f8ea;
  --navy:       #1a1a2e;
  --gray:       #4a4a6a;
  --bg:         #ffffff;
  --border:     #dde8fb;
  --white:      #ffffff;
  --shadow:     0 2px 16px rgba(37,117,232,0.09);
  --shadow-lg:  0 6px 32px rgba(37,117,232,0.16);
}

/* ══ Reset ════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html  { scroll-behavior: smooth; font-size: 16px; }
body  { font-family: 'Source Sans 3','Segoe UI',sans-serif; font-weight: 400; background: #ffffff; color: var(--navy); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img   { max-width: 100%; height: auto; display: block; }
a     { text-decoration: none; color: inherit; }

/* ══ TICKER — top of page ═════════════════════════════════════════════ */
.botw-ticker {
  background: var(--green);
  overflow: hidden;
  white-space: nowrap;
  /* 25% smaller than original 36px = ~27px */
  height: 27px;
  display: flex;
  align-items: center;
}

.botw-ticker-track {
  display: inline-flex;
  animation: botw-ticker 32s linear infinite;
  will-change: transform;
}

.botw-ticker-item {
  font-family: 'Oswald','Arial Narrow',sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--white);
  padding: 0 2rem;
  white-space: nowrap;
}

.botw-ticker-item::before {
  content: '★';
  margin-right: 0.6rem;
  opacity: 0.75;
}

@keyframes botw-ticker {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ══ HEADER ═══════════════════════════════════════════════════════════ */
.botw-header {
  background: var(--white);
  border-bottom: 4px solid var(--green);
  position: sticky;
  top: 0;
  z-index: 200;
  box-shadow: 0 2px 10px rgba(37,117,232,0.08);
}

.botw-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 51px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.botw-logo-wrap       { display: flex; align-items: center; flex-shrink: 0; }
.botw-logo-wrap img   { height: 32px; width: auto; }

.botw-logo-text       { font-family: 'Oswald',sans-serif; font-size: 1.3rem; font-weight: 700; letter-spacing: -0.5px; line-height: 1; }
.botw-logo-text .t-blue  { color: var(--blue); }
.botw-logo-text .t-green { color: var(--green); }
.botw-logo-text .t-dot   { color: #bbb; font-weight: 400; font-size: 1.2rem; }

.botw-header-badge {
  font-family: 'Oswald',sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--white);
  background: var(--green);
  padding: 5px 11px;
  border-radius: 2px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Nav */
.botw-nav         { display: flex; gap: 0; align-items: center; }
.botw-nav-link    { font-family: 'Oswald',sans-serif; font-size: 0.8rem; font-weight: 500; letter-spacing: 1px; text-transform: uppercase; color: var(--gray); padding: 6px 11px; border-radius: 2px; transition: color 0.2s, background 0.2s; white-space: nowrap; }
.botw-nav-link:hover, .botw-nav-link.active { color: var(--blue); background: var(--blue-light); }

/* ══ MAIN ═════════════════════════════════════════════════════════════ */
.botw-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1rem 1.5rem;
}

.botw-no-plugin {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
  background: var(--white);
  border: 1px dashed var(--border);
  border-radius: 6px;
}

/* ══ DEAL GRID OVERRIDES — 4 columns, no stacking on desktop ═════════ */

/* Category header */
.dc-category-header    { border-bottom: 3px solid var(--blue) !important; margin-bottom: 1.2rem !important; padding-bottom: 0.6rem !important; }
.dc-category-title     { font-family: 'Oswald',sans-serif !important; font-size: 1.2rem !important; font-weight: 700 !important; text-transform: uppercase !important; letter-spacing: 1px !important; color: var(--blue) !important; }

/* ── Force 4 equal columns — override plugin at ALL breakpoints ───── */
/* Use body prefix for maximum specificity over plugin stylesheet */
body .dc-product-grid,
body .dc-cols-3,
body .dc-cols-4,
body .dc-product-grid.dc-cols-3,
body .dc-product-grid.dc-cols-4 {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 1rem !important;
}

/* Override plugin's 768px breakpoint that collapses to 2 cols */
@media (max-width: 768px) {
  body .dc-product-grid,
  body .dc-cols-3,
  body .dc-cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 0.6rem !important;
  }
}

/* Cards */
.dc-product-card       { border-radius: 6px !important; box-shadow: var(--shadow) !important; border-color: var(--border) !important; transition: box-shadow 0.2s, transform 0.2s !important; }
.dc-product-card:hover { box-shadow: var(--shadow-lg) !important; transform: translateY(-3px) !important; border-color: var(--blue) !important; }

/* Hero card — full width, horizontal */






/* Labels & badges */

.dc-badge              { background: var(--green) !important; font-family: 'Oswald',sans-serif !important; font-size: 0.65rem !important; letter-spacing: 1.5px !important; border-radius: 0 3px 3px 0 !important; }

/* Prices */
.dc-cur-price          { color: var(--green) !important; font-family: 'Oswald',sans-serif !important; font-size: 1.4rem !important; font-weight: 700 !important; }
.dc-product-name       { font-weight: 600 !important; font-size: 0.83rem !important; }
.dc-savings            { color: var(--green) !important; background: var(--green-lt) !important; border-color: rgba(34,176,51,0.2) !important; font-family: 'Oswald',sans-serif !important; font-size: 0.7rem !important; }
.dc-rating             { color: #f59e0b !important; }

/* Button */
.dc-btn-deal           { background: var(--green) !important; font-family: 'Oswald',sans-serif !important; font-size: 0.88rem !important; font-weight: 600 !important; letter-spacing: 2px !important; border-radius: 0 0 6px 6px !important; padding: 12px 8px !important; transition: background 0.2s !important; }
.dc-product-card:hover .dc-btn-deal { background: var(--green-dark) !important; }
.dc-img-wrap           { background: var(--bg) !important; }

/* ══ HOW IT WORKS — above footer ══════════════════════════════════════ */
.botw-how {
  background: var(--white);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem;
  margin-top: 1rem;
}

.botw-how-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.botw-how-title {
  font-family: 'Oswald',sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--blue);
  margin-bottom: 1.5rem;
}

.botw-steps {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  gap: 2rem;
}

.botw-step             { display: flex; flex-direction: column; gap: 0.35rem; }
.botw-step-num         { font-family: 'Oswald',sans-serif; font-size: 2.2rem; font-weight: 700; color: var(--blue); line-height: 1; opacity: 0.18; }
.botw-step strong      { font-family: 'Oswald',sans-serif; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--navy); }
.botw-step p           { font-size: 0.82rem; color: var(--gray); line-height: 1.5; }

/* ══ FOOTER — white ═══════════════════════════════════════════════════ */
.botw-footer {
  background: var(--white);
  border-top: 4px solid var(--green);
  padding: 2rem 1.5rem;
}

.botw-footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.botw-footer-logo      { font-family: 'Oswald',sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1; flex-shrink: 0; padding-top: 2px; }
.botw-footer-logo .t-blue  { color: var(--blue); }
.botw-footer-logo .t-green { color: var(--green); }
.botw-footer-logo .t-dot   { color: #bbb; font-weight: 400; }

.botw-footer-text {
  font-size: 0.72rem;
  color: #777;
  line-height: 1.75;
  flex: 1;
  min-width: 260px;
  font-style: normal !important;
  font-weight: 400 !important;
}

.botw-footer-text * {
  font-style: normal !important;
}

.botw-footer-text a    { color: var(--blue); }
.botw-footer-text a:hover { text-decoration: underline; }

/* ══ MOBILE FIRST — Responsive ════════════════════════════════════════ */

/* Tablet — keep 4 columns down to 540px, then switch */
@media (max-width: 900px) {
  /* Keep 4 columns — only collapse at true mobile */
  body .dc-product-grid,
  body .dc-cols-3,
  body .dc-cols-4        { grid-template-columns: repeat(4,minmax(0,1fr)) !important; gap: 0.7rem !important; }
  
  
  
  
  
  .botw-steps            { grid-template-columns: repeat(2,1fr); gap: 1.2rem; }
  .botw-nav              { display: none; }
  .botw-header-inner     { padding: 0 1rem; }
}

/* Mobile — 2 columns at 540px (readable on phone, still 4-item row feel) */
@media (max-width: 540px) {
  body .dc-product-grid,
  body .dc-cols-3,
  body .dc-cols-4        { grid-template-columns: repeat(2,minmax(0,1fr)) !important; gap: 0.6rem !important; }

  /* Header */
  .botw-header-inner     { height: 58px; padding: 0 0.8rem; }
  .botw-logo-text        { font-size: 1.3rem; }
  .botw-header-badge     { display: none; }

  /* Ticker */
  .botw-ticker           { height: 24px; }
  .botw-ticker-item      { font-size: 0.62rem; padding: 0 1.2rem; }

  /* Main */
  .botw-main             { padding: 1rem 0.8rem; }

  /* Cards — larger tap targets on mobile */
  .dc-btn-deal           { padding: 14px 8px !important; font-size: 0.95rem !important; }
  .dc-product-img        { height: 160px !important; }
  .dc-cur-price          { font-size: 1.6rem !important; }

  /* How it works */
  .botw-how              { padding: 1.5rem 0.8rem; }
  .botw-steps            { grid-template-columns: 1fr; gap: 1rem; }

  /* Footer */
  .botw-footer           { padding: 1.5rem 0.8rem; }
  .botw-footer-inner     { flex-direction: column; gap: 1rem; }
  .botw-footer-text      { font-size: 0.7rem; }
}

/* Very small phones (320px) */
@media (max-width: 360px) {
  .botw-logo-text        { font-size: 1.1rem; }
  .dc-category-title     { font-size: 1rem !important; }
}

/* ══ Touch optimisation ═══════════════════════════════════════════════ */
@media (hover: none) and (pointer: coarse) {
  /* Larger tap targets on touch devices */
  .dc-btn-deal           { padding: 16px 8px !important; }
  .botw-nav-link         { padding: 10px 12px; }
  /* Remove hover lift on touch — prevents sticky hover states */
  .dc-product-card:hover { transform: none !important; }
}

/* First item gold star — upper right corner, same card size as all others */
.dc-first-star {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 1.1rem;
  z-index: 3;
  filter: drop-shadow(0 1px 3px rgba(0,0,0,0.2));
}
