/*
Theme Name: CouponDeals Pro
Theme URI: https://example.com/coupon-deals-pro
Author: Claude
Description: قالب احترافي لمواقع الكوبونات وأكواد الخصم ومقارنة الأسعار - دعم كامل للعربية RTL
Version: 1.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: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: coupon-deals
Tags: coupons, deals, rtl-language, custom-colors, custom-logo, custom-menu, price-comparison, featured-images, translation-ready
*/

/* ============================================================
   CSS VARIABLES & RESET
============================================================ */
:root {
  --red:        #e8192c;
  --red-dark:   #b5111f;
  --red-light:  #fff0f1;
  --orange:     #ff6b00;
  --orange-lt:  #fff4eb;
  --green:      #00a651;
  --green-lt:   #ebfaf2;
  --yellow:     #ffb800;
  --yellow-lt:  #fffbeb;
  --blue:       #0066ff;
  --blue-lt:    #ebf2ff;
  --ink:        #0d0d0d;
  --ink-60:     #595959;
  --ink-30:     #ababab;
  --ink-10:     #f0f0f0;
  --surface:    #fafafa;
  --white:      #ffffff;
  --border:     #e8e8e8;
  --radius-sm:  6px;
  --radius:     12px;
  --radius-lg:  20px;
  --shadow-xs:  0 1px 3px rgba(0,0,0,.07);
  --shadow-sm:  0 2px 8px rgba(0,0,0,.08);
  --shadow-md:  0 6px 20px rgba(0,0,0,.10);
  --shadow-lg:  0 12px 40px rgba(0,0,0,.13);
  --shadow-red: 0 6px 20px rgba(232,25,44,.25);
  --font-head:  'Cairo', 'Noto Kufi Arabic', Tahoma, sans-serif;
  --font-body:  'Cairo', 'Noto Kufi Arabic', Tahoma, sans-serif;
  --fw-regular: 400;
  --fw-medium:  600;
  --fw-bold:    700;
  --fw-black:   800;
  --transition: .22s cubic-bezier(.4,0,.2,1);
  --header-h:   68px;
  --container:  1240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--surface);
  direction: rtl;
  text-align: right;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; transition: var(--transition); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: var(--font-body); font-size: 1rem; }

/* ============================================================
   LAYOUT UTILS
============================================================ */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  width: 100%;
}
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2,1fr); }
.grid-3 { grid-template-columns: repeat(3,1fr); }
.grid-4 { grid-template-columns: repeat(4,1fr); }
.grid-5 { grid-template-columns: repeat(5,1fr); }

/* Section Header */
.sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 10px;
}
.sec-head h2 {
  font-size: 1.45rem;
  font-weight: var(--fw-black);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 10px;
}
.sec-head h2 .icon { font-size: 1.5rem; }
.see-all {
  font-size: .875rem;
  font-weight: var(--fw-medium);
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.see-all:hover { color: var(--red-dark); }

/* ============================================================
   TYPOGRAPHY
============================================================ */
h1 { font-size: clamp(1.6rem,4vw,2.4rem); font-weight: var(--fw-black); }
h2 { font-size: clamp(1.3rem,3vw,1.8rem); font-weight: var(--fw-black); }
h3 { font-size: 1.1rem; font-weight: var(--fw-bold); }
h4 { font-size: 1rem; font-weight: var(--fw-bold); }
p  { margin-bottom: .75rem; }

/* ============================================================
   BADGES & TAGS
============================================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 50px;
  font-size: .72rem;
  font-weight: var(--fw-bold);
  letter-spacing: .3px;
  white-space: nowrap;
}
.badge-red    { background: var(--red);    color: #fff; }
.badge-orange { background: var(--orange); color: #fff; }
.badge-green  { background: var(--green);  color: #fff; }
.badge-yellow { background: var(--yellow); color: var(--ink); }
.badge-blue   { background: var(--blue);   color: #fff; }
.badge-ghost  { background: var(--ink-10); color: var(--ink-60); }
.badge-outline-red { border: 1.5px solid var(--red); color: var(--red); background: var(--red-light); }

/* ============================================================
   BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: .65rem 1.5rem;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-bold);
  font-size: .9375rem;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
  line-height: 1.2;
  white-space: nowrap;
}
.btn-primary { background: var(--red); color: #fff; border-color: var(--red); }
.btn-primary:hover { background: var(--red-dark); border-color: var(--red-dark); color: #fff; transform: translateY(-1px); box-shadow: var(--shadow-red); }
.btn-green   { background: var(--green); color: #fff; border-color: var(--green); }
.btn-green:hover { background: #007a3d; border-color: #007a3d; color: #fff; transform: translateY(-1px); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--border); }
.btn-outline:hover { border-color: var(--red); color: var(--red); }
.btn-sm { padding: .45rem 1rem; font-size: .8125rem; }
.btn-lg { padding: .85rem 2rem; font-size: 1rem; }
.btn-full { width: 100%; }

/* Coupon Copy Button */
.btn-copy {
  position: relative;
  background: var(--green);
  color: #fff;
  border: 2px dashed rgba(255,255,255,.6);
  border-radius: var(--radius-sm);
  padding: .6rem 1.25rem;
  font-weight: var(--fw-bold);
  font-size: .875rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
  letter-spacing: .5px;
}
.btn-copy:hover { background: #007a3d; transform: translateY(-1px); }
.btn-copy.copied { background: var(--ink); }

/* ============================================================
   TOP BAR
============================================================ */
.topbar {
  background: var(--ink);
  color: rgba(255,255,255,.75);
  font-size: .8125rem;
  padding: 7px 0;
  direction: rtl;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-right a {
  color: rgba(255,255,255,.7);
  display: flex;
  align-items: center;
  gap: 5px;
}
.topbar-right a:hover { color: #fff; }
.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.topbar-alert {
  background: var(--red);
  color: #fff;
  padding: 2px 10px;
  border-radius: 50px;
  font-weight: var(--fw-bold);
  font-size: .72rem;
  animation: pulse-badge 2s infinite;
}
@keyframes pulse-badge {
  0%,100% { opacity:1; } 50% { opacity:.7; }
}

/* ============================================================
   HEADER
============================================================ */
#masthead {
  position: sticky;
  top: 0;
  z-index: 900;
  background: #fff;
  box-shadow: var(--shadow-sm);
  height: var(--header-h);
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 20px;
  height: var(--header-h);
}

/* Logo */
.site-branding { flex-shrink: 0; }
.site-logo-text {
  font-size: 1.5rem;
  font-weight: var(--fw-black);
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.site-logo-text .logo-icon {
  background: var(--red);
  color: #fff;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}
.site-logo-text span { color: var(--red); }
.custom-logo { height: 44px; width: auto; }

/* Search Bar */
.header-search {
  flex: 1;
  max-width: 520px;
  position: relative;
}
.header-search input {
  width: 100%;
  padding: .6rem 1rem .6rem 3rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: .9375rem;
  outline: none;
  transition: var(--transition);
}
.header-search input:focus { border-color: var(--red); background: #fff; box-shadow: 0 0 0 3px rgba(232,25,44,.1); }
.header-search input::placeholder { color: var(--ink-30); }
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-30);
  pointer-events: none;
  font-size: .95rem;
}
.search-submit-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: .35rem .9rem;
  font-size: .8125rem;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: var(--transition);
}
.search-submit-btn:hover { background: var(--red-dark); }

/* Nav */
.header-nav { display: flex; align-items: center; gap: 4px; }
.header-nav a {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: .45rem .9rem;
  border-radius: var(--radius-sm);
  font-weight: var(--fw-medium);
  font-size: .9rem;
  color: var(--ink);
  white-space: nowrap;
}
.header-nav a:hover { background: var(--red-light); color: var(--red); }
.header-nav a.active { color: var(--red); }
.header-nav a .nav-badge {
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: var(--fw-black);
  padding: 1px 5px;
  border-radius: 50px;
  line-height: 1.4;
}

/* Header Actions */
.header-actions { margin-right: auto; display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Mobile Toggle */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink);
  font-size: 1.3rem;
  padding: 6px;
}

/* ============================================================
   CATEGORY NAV BAR
============================================================ */
.cat-nav-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-nav-bar::-webkit-scrollbar { display: none; }
.cat-nav-inner {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 20px;
  min-width: max-content;
}
.cat-nav-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 12px 14px;
  font-size: .85rem;
  font-weight: var(--fw-medium);
  color: var(--ink-60);
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
  cursor: pointer;
}
.cat-nav-item:hover { color: var(--red); border-bottom-color: var(--red); }
.cat-nav-item.active { color: var(--red); border-bottom-color: var(--red); font-weight: var(--fw-bold); }
.cat-nav-item .cat-icon { font-size: 1.1rem; }

/* ============================================================
   HERO / BANNER SLIDER
============================================================ */
.hero-section {
  background: linear-gradient(135deg, #0d0d0d 0%, #1a0000 60%, #2d0a0a 100%);
  padding: 0;
  overflow: hidden;
  position: relative;
}
.hero-inner {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 0;
  min-height: 340px;
}
.hero-content {
  padding: 48px 40px 48px 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  z-index: 2;
}
.hero-content .badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.hero-content h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3.5vw, 2.6rem);
  line-height: 1.25;
  margin-bottom: 14px;
}
.hero-content h1 .highlight {
  color: var(--yellow);
  position: relative;
}
.hero-content p {
  color: rgba(255,255,255,.7);
  font-size: 1rem;
  margin-bottom: 24px;
  max-width: 500px;
}
.hero-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.hero-side {
  background: rgba(255,255,255,.04);
  border-right: 1px solid rgba(255,255,255,.08);
  padding: 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.hero-side-title {
  font-size: .8125rem;
  color: rgba(255,255,255,.5);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 4px;
}

/* Featured Store Mini Cards */
.store-mini-card {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: var(--transition);
  cursor: pointer;
}
.store-mini-card:hover { background: rgba(255,255,255,.13); border-color: rgba(255,255,255,.2); }
.store-mini-left { display: flex; align-items: center; gap: 8px; }
.store-mini-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.store-mini-name { font-size: .875rem; font-weight: var(--fw-bold); color: #fff; }
.store-mini-count { font-size: .72rem; color: rgba(255,255,255,.5); }
.store-mini-discount {
  background: var(--red);
  color: #fff;
  font-size: .72rem;
  font-weight: var(--fw-black);
  padding: 3px 8px;
  border-radius: 50px;
  flex-shrink: 0;
}

/* ============================================================
   STATS BAR
============================================================ */
.stats-bar {
  background: #fff;
  border-bottom: 1px solid var(--border);
  padding: 16px 0;
}
.stats-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 16px;
}
.stat-item {
  display: flex;
  align-items: center;
  gap: 10px;
}
.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.stat-icon.red    { background: var(--red-light);    color: var(--red); }
.stat-icon.green  { background: var(--green-lt);     color: var(--green); }
.stat-icon.orange { background: var(--orange-lt);    color: var(--orange); }
.stat-icon.yellow { background: var(--yellow-lt);    color: var(--yellow); }
.stat-info .num   { font-size: 1.1rem; font-weight: var(--fw-black); color: var(--ink); line-height: 1; }
.stat-info .lbl   { font-size: .75rem; color: var(--ink-60); }

/* ============================================================
   COUPON CARD
============================================================ */
.coupon-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  position: relative;
}
.coupon-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #ddd; }
.coupon-card.featured {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(232,25,44,.12);
}

/* Ribbon */
.coupon-ribbon {
  position: absolute;
  top: 14px;
  left: 0;
  background: var(--red);
  color: #fff;
  font-size: .7rem;
  font-weight: var(--fw-black);
  padding: 4px 10px 4px 14px;
  clip-path: polygon(0 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 0 100%);
  z-index: 2;
  letter-spacing: .5px;
}

/* Store Logo Area */
.coupon-store {
  padding: 16px 16px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.coupon-store-logo {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  overflow: hidden;
}
.coupon-store-logo img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.coupon-store-name { font-weight: var(--fw-bold); font-size: .9rem; color: var(--ink); }
.coupon-store-cat  { font-size: .75rem; color: var(--ink-60); }

/* Coupon Body */
.coupon-body { padding: 14px 16px; flex: 1; }
.coupon-title {
  font-size: .9375rem;
  font-weight: var(--fw-bold);
  color: var(--ink);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.coupon-discount {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
}
.coupon-pct {
  font-size: 2rem;
  font-weight: var(--fw-black);
  color: var(--red);
  line-height: 1;
}
.coupon-pct-off { font-size: .8rem; color: var(--red); font-weight: var(--fw-bold); align-self: flex-end; margin-bottom: 4px; }
.coupon-or-price { font-size: .8rem; color: var(--ink-60); align-self: flex-end; margin-bottom: 4px; }

/* Code Box */
.coupon-code-wrap {
  padding: 10px 16px 14px;
  border-top: 1px dashed var(--border);
}
.coupon-code-inner {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1.5px dashed var(--green);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.coupon-code-text {
  flex: 1;
  padding: .5rem .75rem;
  font-family: 'Courier New', monospace;
  font-size: .875rem;
  font-weight: var(--fw-black);
  color: var(--green);
  letter-spacing: 1.5px;
  background: var(--green-lt);
  text-align: center;
}
.coupon-code-btn {
  background: var(--green);
  color: #fff;
  border: none;
  padding: .5rem .9rem;
  font-size: .8125rem;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
}
.coupon-code-btn:hover { background: #007a3d; }
.coupon-code-btn.copied { background: var(--ink); }

/* No-code deal */
.coupon-deal-btn {
  padding: 10px 16px 14px;
}

/* Coupon Footer */
.coupon-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--ink-10);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .75rem;
  color: var(--ink-60);
  background: var(--surface);
  flex-wrap: wrap;
  gap: 6px;
}
.coupon-expiry.urgent { color: var(--red); font-weight: var(--fw-bold); }
.coupon-used { display: flex; align-items: center; gap: 4px; }

/* ============================================================
   DEAL CARD (Sale / Offer)
============================================================ */
.deal-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.deal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }
.deal-thumb {
  position: relative;
  height: 160px;
  overflow: hidden;
  background: var(--ink-10);
}
.deal-thumb img { width: 100%; height: 100%; object-fit: cover; transition: var(--transition); }
.deal-card:hover .deal-thumb img { transform: scale(1.05); }
.deal-thumb-placeholder {
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--red-light), var(--orange-lt));
  color: var(--red);
}
.deal-badge-abs {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.deal-save-abs {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--yellow);
  color: var(--ink);
  font-size: .72rem;
  font-weight: var(--fw-black);
  padding: 3px 8px;
  border-radius: 50px;
}
.deal-body { padding: 14px; flex: 1; }
.deal-title {
  font-size: .9rem;
  font-weight: var(--fw-bold);
  color: var(--ink);
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}
.deal-price-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.deal-price-new { font-size: 1.2rem; font-weight: var(--fw-black); color: var(--red); }
.deal-price-old { font-size: .875rem; color: var(--ink-30); text-decoration: line-through; }
.deal-price-save { font-size: .75rem; font-weight: var(--fw-bold); color: var(--green); }
.deal-footer { padding: 10px 14px; border-top: 1px solid var(--ink-10); background: var(--surface); }

/* ============================================================
   STORE CARD
============================================================ */
.store-card {
  background: #fff;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  transition: var(--transition);
  cursor: pointer;
  gap: 10px;
}
.store-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); border-color: #ddd; }
.store-card-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  background: var(--surface);
  overflow: hidden;
}
.store-card-logo img { width: 100%; height: 100%; object-fit: contain; padding: 8px; }
.store-card-name { font-weight: var(--fw-bold); font-size: .95rem; color: var(--ink); }
.store-card-count { font-size: .78rem; color: var(--ink-60); }
.store-card-max-off {
  background: var(--red-light);
  color: var(--red);
  font-size: .8rem;
  font-weight: var(--fw-black);
  padding: 4px 12px;
  border-radius: 50px;
  width: 100%;
  text-align: center;
}

/* ============================================================
   PRICE COMPARISON TABLE
============================================================ */
.compare-section {
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.compare-header {
  background: linear-gradient(135deg, var(--ink) 0%, #2d1818 100%);
  padding: 28px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.compare-header h2 { color: #fff; margin: 0; display: flex; align-items: center; gap: 10px; }
.compare-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  border-radius: var(--radius-sm);
  padding: .45rem 1rem;
  flex: 1;
  max-width: 320px;
}
.compare-search input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  flex: 1;
  font-size: .875rem;
}
.compare-search input::placeholder { color: rgba(255,255,255,.4); }
.compare-search i { color: rgba(255,255,255,.5); }

/* Table */
.compare-table-wrap { overflow-x: auto; }
.compare-table { width: 100%; border-collapse: collapse; min-width: 600px; }
.compare-table thead tr { background: var(--ink-10); }
.compare-table th {
  padding: 13px 18px;
  font-size: .82rem;
  font-weight: var(--fw-bold);
  color: var(--ink-60);
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.compare-table th:first-child { padding-right: 24px; }
.compare-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--ink-10);
  vertical-align: middle;
  font-size: .9rem;
}
.compare-table td:first-child { padding-right: 24px; }
.compare-table tbody tr { transition: var(--transition); }
.compare-table tbody tr:hover { background: var(--surface); }
.compare-table tbody tr.best-price { background: var(--green-lt); }
.compare-table tbody tr:last-child td { border-bottom: none; }

/* Table specific cells */
.ct-product { display: flex; align-items: center; gap: 12px; }
.ct-product-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
  overflow: hidden;
}
.ct-product-name { font-weight: var(--fw-bold); font-size: .875rem; color: var(--ink); }
.ct-product-sku  { font-size: .72rem; color: var(--ink-60); }
.ct-store { display: flex; align-items: center; gap: 6px; font-size: .875rem; font-weight: var(--fw-medium); }
.ct-store-icon { width: 24px; height: 24px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.ct-price-new { font-weight: var(--fw-black); font-size: 1rem; color: var(--ink); }
.ct-price-new.lowest { color: var(--green); }
.ct-price-old { font-size: .75rem; color: var(--ink-30); text-decoration: line-through; }
.ct-discount { font-size: .8rem; font-weight: var(--fw-bold); }
.ct-discount.high { color: var(--red); }
.ct-discount.mid  { color: var(--orange); }
.ct-discount.low  { color: var(--ink-60); }
.best-badge-cell { display: flex; align-items: center; gap: 6px; }
.best-price-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--green);
  color: #fff;
  font-size: .7rem;
  font-weight: var(--fw-black);
  padding: 3px 8px;
  border-radius: 50px;
}

/* Compare Footer */
.compare-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--surface);
}
.compare-meta { font-size: .8125rem; color: var(--ink-60); display: flex; align-items: center; gap: 6px; }

/* ============================================================
   ALERT DEAL BANNER
============================================================ */
.alert-banner {
  background: linear-gradient(135deg, var(--red) 0%, var(--orange) 100%);
  border-radius: var(--radius);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.alert-banner-icon { font-size: 2rem; flex-shrink: 0; }
.alert-banner-text h3 { color: #fff; margin-bottom: 4px; font-size: 1.05rem; }
.alert-banner-text p  { color: rgba(255,255,255,.85); font-size: .875rem; margin: 0; }
.alert-banner-action { margin-right: auto; flex-shrink: 0; }
.btn-alert { background: #fff; color: var(--red); font-weight: var(--fw-black); }
.btn-alert:hover { background: var(--yellow); color: var(--ink); }

/* Countdown Timer */
.countdown {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,.2);
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  flex-shrink: 0;
}
.countdown-unit { text-align: center; }
.countdown-num {
  font-size: 1.3rem;
  font-weight: var(--fw-black);
  color: #fff;
  line-height: 1;
  font-family: 'Courier New', monospace;
  min-width: 2ch;
}
.countdown-lbl { font-size: .6rem; color: rgba(255,255,255,.7); }
.countdown-sep { color: rgba(255,255,255,.6); font-size: 1.1rem; font-weight: var(--fw-black); align-self: flex-start; margin-top: 3px; }

/* ============================================================
   FILTER BAR
============================================================ */
.filter-bar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.filter-label { font-size: .8125rem; font-weight: var(--fw-bold); color: var(--ink-60); white-space: nowrap; }
.filter-pills { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; flex: 1; }
.filter-pill {
  padding: 5px 14px;
  border-radius: 50px;
  font-size: .8125rem;
  font-weight: var(--fw-medium);
  cursor: pointer;
  border: 1.5px solid var(--border);
  color: var(--ink-60);
  background: #fff;
  transition: var(--transition);
  white-space: nowrap;
}
.filter-pill:hover { border-color: var(--red); color: var(--red); }
.filter-pill.active { background: var(--red); border-color: var(--red); color: #fff; }
.filter-sort {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-right: auto;
}
.filter-sort select {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .4rem .75rem;
  font-size: .8125rem;
  color: var(--ink);
  outline: none;
  cursor: pointer;
  background: #fff;
}
.filter-sort select:focus { border-color: var(--red); }

/* ============================================================
   NEWSLETTER SECTION
============================================================ */
.newsletter-section {
  background: linear-gradient(135deg, var(--ink) 0%, #1a0000 100%);
  border-radius: var(--radius-lg);
  padding: 48px 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.newsletter-section::before {
  content: '🎁';
  position: absolute;
  font-size: 10rem;
  opacity: .04;
  top: -20px;
  left: 40px;
  pointer-events: none;
}
.newsletter-section h2 { color: #fff; margin-bottom: 10px; }
.newsletter-section p  { color: rgba(255,255,255,.65); max-width: 500px; margin: 0 auto 28px; }
.newsletter-form {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 440px;
  margin: 0 auto;
  border: 1.5px solid rgba(255,255,255,.15);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(255,255,255,.07);
}
.newsletter-form input {
  flex: 1;
  padding: .75rem 1.1rem;
  background: none;
  border: none;
  outline: none;
  color: #fff;
  font-size: .9375rem;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,.35); }
.newsletter-form button {
  padding: .75rem 1.4rem;
  background: var(--red);
  color: #fff;
  border: none;
  font-weight: var(--fw-bold);
  font-size: .875rem;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.newsletter-form button:hover { background: var(--red-dark); }

/* ============================================================
   FOOTER
============================================================ */
#colophon {
  background: #111;
  color: rgba(255,255,255,.7);
  margin-top: 0;
}
.footer-top { padding: 56px 0 40px; border-bottom: 1px solid rgba(255,255,255,.08); }
.footer-grid { display: grid; grid-template-columns: 1.8fr 1fr 1fr 1fr; gap: 40px; }
.footer-brand { }
.footer-logo-text {
  font-size: 1.4rem;
  font-weight: var(--fw-black);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.footer-logo-text .logo-icon {
  background: var(--red);
  color: #fff;
  width: 32px;
  height: 32px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .95rem;
}
.footer-brand p { font-size: .875rem; line-height: 1.75; margin-bottom: 18px; opacity: .65; }
.footer-social { display: flex; gap: 8px; }
.footer-social-link {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.07);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,.65);
  font-size: .9rem;
  transition: var(--transition);
}
.footer-social-link:hover { background: var(--red); color: #fff; }
.footer-col h4 { color: #fff; font-size: .85rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 16px; }
.footer-links { display: flex; flex-direction: column; gap: 8px; }
.footer-links a {
  font-size: .875rem;
  color: rgba(255,255,255,.55);
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}
.footer-links a:hover { color: #fff; padding-right: 4px; }
.footer-links a i { font-size: .7rem; color: var(--red); }
.footer-bottom {
  padding: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: .8125rem;
  color: rgba(255,255,255,.35);
}
.footer-bottom-links { display: flex; gap: 16px; }
.footer-bottom-links a { color: rgba(255,255,255,.35); }
.footer-bottom-links a:hover { color: rgba(255,255,255,.7); }

/* ============================================================
   INNER PAGE LAYOUTS
============================================================ */
.page-banner {
  background: linear-gradient(135deg, var(--ink) 0%, #2d0a0a 100%);
  padding: 36px 0;
}
.page-banner h1 { color: #fff; font-size: 1.6rem; }
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8125rem;
  color: rgba(255,255,255,.5);
  margin-top: 8px;
  flex-wrap: wrap;
}
.breadcrumb a { color: rgba(255,255,255,.6); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: .4; }

.layout-sidebar {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 24px;
  align-items: start;
}
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.sidebar-widget {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-widget-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-bold);
  font-size: .9375rem;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
.sidebar-widget-body { padding: 14px 18px; }

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.pagination .page-numbers {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .875rem;
  font-weight: var(--fw-medium);
  border: 1.5px solid var(--border);
  color: var(--ink);
  background: #fff;
  transition: var(--transition);
}
.pagination .page-numbers:hover { border-color: var(--red); color: var(--red); }
.pagination .page-numbers.current { background: var(--red); border-color: var(--red); color: #fff; }
.pagination .page-numbers.dots { border-color: transparent; background: none; }

/* ============================================================
   UTILITIES
============================================================ */
.text-red    { color: var(--red); }
.text-green  { color: var(--green); }
.text-muted  { color: var(--ink-60); }
.fw-black    { font-weight: var(--fw-black); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .hero-inner  { grid-template-columns: 1fr; }
  .hero-side   { display: none; }
  .hero-content { padding: 40px 20px; }
  .layout-sidebar { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .menu-toggle { display: flex; }
  .header-nav  { display: none; }
  .header-nav.open { display: flex; flex-direction: column; position: fixed; top: var(--header-h); right: 0; left: 0; background: #fff; padding: 16px; box-shadow: var(--shadow-lg); border-top: 1px solid var(--border); z-index: 800; }
  .header-actions { display: none; }
  .header-search { max-width: 100%; }
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: repeat(2,1fr); }
  .stats-bar-inner { justify-content: flex-start; gap: 12px; }
  .newsletter-section { padding: 36px 20px; }
  .compare-header { padding: 20px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  .footer-top  { padding: 36px 0 24px; }
  .filter-sort { margin-right: 0; width: 100%; }
  .topbar { display: none; }
}
@media (max-width: 480px) {
  .grid-2, .grid-3, .grid-4, .grid-5 { grid-template-columns: 1fr; }
  .alert-banner { flex-direction: column; text-align: center; }
  .alert-banner-action { margin-right: 0; }
  .hero-actions { flex-direction: column; }
  .btn { width: 100%; justify-content: center; }
}

/* ============================================================
   v2.0 ADDITIONS
============================================================ */

/* Live Search Dropdown */
#search-dropdown a:first-child { border-radius: var(--radius) var(--radius) 0 0; }
#search-dropdown a:last-child  { border-radius: 0 0 var(--radius) var(--radius); }

/* Header active nav */
.header-nav a.active { color: var(--red); background: var(--red-light); }

/* Deal page image */
.single-deal .page-banner h1 { font-size: 1.3rem; }

/* Price compare single */
.single-price-compare .compare-section { margin-top: 0; }

/* Image sizes reminder (admin only) */
.cd-image-hint { font-size: 11px; color: #888; font-style: italic; }

/* ============================================================
   v3 MOBILE FIXES
   1. Hamburger menu
   2. Single store layout on mobile
   3. Coupon grid on mobile
   4. Header search on mobile
   5. Various inline style overrides for mobile
============================================================ */

/* ── Header mobile layout ── */
@media (max-width: 768px) {
  /* Header inner: logo | search | hamburger */
  .header-inner {
    flex-wrap: nowrap;
    gap: 10px;
  }

  /* Search bar shrinks but stays visible */
  .header-search {
    flex: 1;
    min-width: 0;
    max-width: 100%;
  }
  .header-search input {
    font-size: 14px;
    padding: .55rem .75rem .55rem 2.5rem;
  }
  .search-submit-btn {
    display: none; /* hide text button on mobile, use Enter */
  }

  /* Hamburger MUST be visible */
  .menu-toggle {
    display: flex !important;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--ink-10);
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    color: var(--ink);
  }

  /* Mobile nav overlay — FIXED: position was blocking clicks */
  .header-nav {
    display: none !important;
  }
  .header-nav.open {
    display: flex !important;
    flex-direction: column;
    position: fixed !important;
    top: var(--header-h) !important;
    right: 0 !important;
    left: 0 !important;
    bottom: 0;
    background: #fff;
    padding: 20px 16px;
    box-shadow: var(--shadow-lg);
    border-top: 1px solid var(--border);
    z-index: 9999 !important;
    overflow-y: auto;
    gap: 4px;
  }
  .header-nav.open a {
    padding: 14px 16px;
    font-size: 1rem;
    font-weight: var(--fw-bold);
    border-radius: var(--radius-sm);
    border-bottom: 1px solid var(--ink-10);
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .header-nav.open a:hover,
  .header-nav.open a.active {
    background: var(--red-light);
    color: var(--red);
  }
  .header-nav.open a .nav-badge {
    margin-right: auto;
  }

  /* Cat nav on mobile: smaller + scrollable */
  .cat-nav-item {
    padding: 10px 10px;
    font-size: .78rem;
  }
  .cat-nav-item .cat-icon {
    font-size: .95rem;
  }

  /* ── Store page: stack sidebar below coupons on mobile ── */
  .single-store .layout-col-2,
  div[style*="grid-template-columns:1fr 320px"],
  div[style*="grid-template-columns: 1fr 320px"],
  div[style*="grid-template-columns:1fr 380px"],
  div[style*="grid-template-columns: 1fr 380px"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── Coupon grid in store page: 1 column on mobile ── */
  .single-store .grid-2,
  div[style*="grid-template-columns:repeat(2,1fr)"],
  div[style*="grid-template-columns: repeat(2,1fr)"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  /* ── Single deal/compare: stack on mobile ── */
  .single-deal div[style*="grid-template-columns"],
  .single-price-compare div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
  }

  /* ── Section padding ── */
  .section { padding: 40px 0; }
  .section-sm { padding: 28px 0; }

  /* ── Coupon card code text ── */
  .coupon-code-text {
    font-size: .75rem;
    letter-spacing: 1px;
  }

  /* ── Deal price row ── */
  .deal-price-new { font-size: 1rem; }
  .deal-price-old { font-size: .8rem; }

  /* ── Compare table: allow horizontal scroll ── */
  .compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare-table { min-width: 500px; font-size: .8125rem; }
  .compare-table th,
  .compare-table td { padding: 10px 12px; }

  /* ── Filter bar ── */
  .filter-bar { flex-wrap: wrap; gap: 8px; padding: 12px; }
  .filter-pills { gap: 5px; }
  .filter-pill  { padding: 4px 10px; font-size: .75rem; }

  /* ── Page banner ── */
  .page-banner { padding: 28px 0; }
  .page-banner h1 { font-size: 1.25rem; }

  /* ── Hero ── */
  .hero-content { padding: 32px 16px; }
  .hero-content h1 { font-size: 1.6rem; }

  /* ── Buttons full width in some contexts ── */
  .coupon-deal-btn .btn { font-size: .875rem; }
}

/* ── Extra small (under 420px) ── */
@media (max-width: 420px) {
  .header-search input { font-size: 13px; }

  /* 1 column everywhere */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr !important;
  }

  /* Stats bar: 2×2 grid */
  .stats-bar-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  /* Store mini cards in hero */
  .store-mini-card { padding: 8px 10px; }
  .store-mini-name { font-size: .8rem; }
  .store-mini-count { font-size: .7rem; }

  /* Coupon code smaller */
  .coupon-code-text { font-size: .7rem; letter-spacing: .5px; }
  .coupon-code-btn  { padding: .5rem .65rem; font-size: .75rem; }

  /* Page banner compact */
  .page-banner h1 { font-size: 1.1rem; line-height: 1.3; }

  /* Newsletter compact */
  .newsletter-form { flex-direction: column; border-radius: var(--radius-sm); }
  .newsletter-form input { border-radius: var(--radius-sm) var(--radius-sm) 0 0; padding: .65rem 1rem; }
  .newsletter-form button { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }

  /* Coupon deal btn */
  .coupon-deal-btn .btn, .coupon-code-btn { font-size: .8125rem; }

  /* Footer grid */
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .footer-social { flex-wrap: wrap; }
}

/* ── Cat nav always scrollable ── */
.cat-nav-bar {
  -webkit-overflow-scrolling: touch;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav-bar::-webkit-scrollbar { display: none; }

/* ── Inline grid overrides: any div with style="display:grid;grid-template-columns:1fr Xpx" ── */
/* This targets the store/deal/compare sidebar layouts written as inline styles */
@media (max-width: 768px) {
  /* Force any inline-styled 2-col grids to stack */
  .container > div[style*="display:grid"],
  .container > section > div > div[style*="display:grid"],
  section .container > div > div[style*="grid-template-columns"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }
}

/* ── Layout classes (replacing inline styles) ── */
.cd-store-layout,
.cd-deal-layout,
.cd-compare-layout {
  display: grid;
  gap: 28px;
  align-items: start;
}
.cd-store-layout   { grid-template-columns: 1fr 320px; }
.cd-deal-layout    { grid-template-columns: 1fr 380px; }
.cd-compare-layout { grid-template-columns: 1fr 280px; }

.cd-coupon-grid { grid-template-columns: repeat(2,1fr); gap: 16px; }

@media (max-width: 900px) {
  .cd-store-layout,
  .cd-deal-layout,
  .cd-compare-layout {
    grid-template-columns: 1fr !important;
  }
  .cd-coupon-grid { grid-template-columns: 1fr !important; }
}

/* ============================================================
   MOBILE FIXES v3.2 — HAMBURGER + LAYOUT
============================================================ */

/* Search dropdown */
#search-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 9999;
  max-height: 400px;
  overflow-y: auto;
}

/* Body lock */
body.cd-nav-open { overflow: hidden; }

@media (max-width: 900px) {

  /* ── Header layout on mobile ── */
  .header-inner {
    flex-wrap: nowrap;
    gap: 10px;
    height: auto;
    min-height: var(--header-h);
    padding: 10px 0;
  }

  /* ── Hamburger ── */
  .menu-toggle {
    display: flex !important;
    order: -1;                    /* appears first (right side in RTL) */
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    align-items: center;
    justify-content: center;
    background: var(--ink-10);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.15rem;
    color: var(--ink);
    z-index: 1001;
  }

  /* ── Logo ── */
  .site-branding { flex-shrink: 0; }
  .site-logo-text { font-size: 1.1rem; gap: 6px; }
  .site-logo-text .logo-icon { width: 30px; height: 30px; font-size: .9rem; }
  .custom-logo { height: 34px; }

  /* ── Search ── */
  .header-search {
    flex: 1;
    min-width: 0;
    position: relative;
  }
  .header-search input {
    font-size: 13px;
    padding: .5rem .75rem .5rem 2.2rem;
  }
  .search-submit-btn { display: none; }

  /* ── Desktop nav: HIDDEN by default on mobile ── */
  .header-nav {
    display: none;        /* NO !important — JS adds .cd-open to show it */
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    background: #fff;
    z-index: 1000;
    flex-direction: column;
    gap: 0;
    padding: 70px 0 20px; /* leave room for header */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Nav OPEN state ── */
  .header-nav.cd-open {
    display: flex !important;
  }

  .header-nav a {
    padding: 16px 20px;
    font-size: 1rem;
    font-weight: 700;
    border-bottom: 1px solid var(--ink-10);
    color: var(--ink);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .header-nav a:hover,
  .header-nav a.active {
    background: var(--red-light);
    color: var(--red);
  }
  .header-nav a .nav-badge { margin-right: auto; }

  /* ── Top bar hidden on mobile ── */
  .topbar { display: none; }

  /* ── Hero section stack ── */
  .hero-inner {
    grid-template-columns: 1fr !important;
    min-height: auto;
  }
  .hero-side { display: none; }
  .hero-content { padding: 32px 16px; }
  .hero-content h1 { font-size: clamp(1.4rem, 5vw, 2rem); }

  /* ── Stats bar wrap ── */
  .stats-bar-inner { flex-wrap: wrap; gap: 10px; justify-content: flex-start; }
  .stat-item { flex: 1 1 calc(50% - 10px); min-width: 120px; }
  .stat-icon { width: 36px; height: 36px; font-size: .95rem; }

  /* ── CRITICAL: All grids → 1 column on mobile ── */
  .grid-2, .grid-3, .grid-4, .grid-5 {
    grid-template-columns: 1fr !important;
  }

  /* ── Store page: sidebar below content ── */
  .single-store section .container > div,
  .single-deal section .container > div,
  .single-price-compare section .container > div {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  /* ── Inline grid overrides (targeting all inline style grids) ── */
  [style*="grid-template-columns:1fr 320px"],
  [style*="grid-template-columns: 1fr 320px"],
  [style*="grid-template-columns:1fr 380px"],
  [style*="grid-template-columns: 1fr 380px"],
  [style*="grid-template-columns:1fr 280px"],
  [style*="grid-template-columns: 1fr 280px"] {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
  }

  [style*="grid-template-columns:repeat(2,1fr)"],
  [style*="grid-template-columns: repeat(2,1fr)"],
  [style*="grid-template-columns:1fr 1fr"],
  [style*="grid-template-columns: 1fr 1fr"] {
    display: grid !important;
    grid-template-columns: 1fr !important;
  }

  /* ── Coupon grid in store page ── */
  .cd-coupon-grid,
  .grid.grid-2[style*="repeat(2"] {
    grid-template-columns: 1fr !important;
  }

  /* ── Compare table scroll ── */
  .compare-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .compare-table { min-width: 520px; font-size: .8rem; }
  .compare-table th, .compare-table td { padding: 9px 10px; }

  /* ── Sections ── */
  .section { padding: 40px 0; }
  .section-sm { padding: 24px 0; }

  /* ── Page banner ── */
  .page-banner { padding: 24px 0; }
  .page-banner h1 { font-size: 1.2rem; line-height: 1.35; }

  /* ── Footer ── */
  .footer-grid { grid-template-columns: 1fr !important; gap: 24px; }
  .footer-bottom { flex-direction: column; text-align: center; }

  /* ── Newsletter ── */
  .newsletter-section { padding: 36px 20px; }

  /* ── Filter bar ── */
  .filter-bar { flex-wrap: wrap; padding: 12px; gap: 8px; }
  .filter-pill { padding: 4px 10px; font-size: .75rem; }
  .filter-sort { width: 100%; }

  /* ── Cat nav ── */
  .cat-nav-item { padding: 10px 10px; font-size: .78rem; }
  .cat-nav-item .cat-icon { font-size: .95rem; }

  /* ── Hero actions ── */
  .hero-actions { flex-direction: column; }
  .hero-actions .btn { width: 100%; justify-content: center; }

  /* ── Coupon code ── */
  .coupon-code-text { font-size: .75rem; letter-spacing: 1px; }
}

@media (max-width: 480px) {
  .coupon-code-text { font-size: .7rem; letter-spacing: .5px; }
  .coupon-code-btn  { padding: .5rem .65rem; font-size: .75rem; }
  .page-banner h1   { font-size: 1.05rem; }
  .stat-item        { flex: 1 1 calc(50% - 5px); }
  /* Newsletter inline → stacked */
  .newsletter-form { flex-direction: column; }
  .newsletter-form input  { border-radius: var(--radius-sm) var(--radius-sm) 0 0; }
  .newsletter-form button { border-radius: 0 0 var(--radius-sm) var(--radius-sm); }
  .footer-social { flex-wrap: wrap; }
}

/* ============================================================
   STORE PAGE — v3.3 (mobile-first, no inline styles)
============================================================ */

/* Wrapper */
.store-page-wrap { padding: 32px 0 60px; }

/* ── Banner head ── */
.store-banner-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.store-banner-logo {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(255,255,255,.25);
  flex-shrink: 0;
}
.store-banner-logo img {
  width: 100%; height: 100%; object-fit: contain; padding: 6px;
}
.store-banner-head h1 { margin: 0 0 4px; font-size: clamp(1rem, 4vw, 1.5rem); }

/* ── Info card ── */
.store-info-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.store-info-left { display: flex; align-items: flex-start; gap: 14px; flex: 1; min-width: 0; }
.store-info-logo { width: 64px; height: 64px; border-radius: 12px; overflow: hidden; border: 1px solid var(--border); flex-shrink: 0; background: var(--surface); }
.store-info-logo img { width: 100%; height: 100%; object-fit: contain; padding: 7px; }
.store-info-name { font-size: 1.15rem; font-weight: var(--fw-black); color: var(--ink); margin-bottom: 6px; }
.store-info-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.store-coupon-count { font-size: .8125rem; color: var(--ink-60); display: flex; align-items: center; gap: 4px; }
.store-coupon-count i { color: var(--red); }
.store-info-desc { font-size: .875rem; color: var(--ink-60); line-height: 1.65; margin: 0; }
.store-info-card > .btn { flex-shrink: 0; align-self: flex-start; }

/* ── Default codes box ── */
.store-codes-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.store-codes-head {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: var(--fw-bold);
  font-size: .9375rem;
  background: var(--surface);
}
.store-codes-grid {
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.store-code-row {
  display: flex;
  align-items: stretch;
  border: 1.5px dashed var(--green);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.store-code-text {
  flex: 1;
  padding: .6rem .75rem;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: .9rem;
  color: var(--green);
  background: var(--green-lt);
  text-align: center;
  letter-spacing: 2px;
  word-break: break-all;
}
.store-code-copy {
  background: var(--green);
  color: #fff;
  border: none;
  padding: .6rem 1rem;
  font-size: .8125rem;
  font-weight: var(--fw-bold);
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
}
.store-code-copy:hover { background: #007a3d; }
.store-code-copy.copied { background: var(--ink); }

/* ── Section head ── */
.store-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.store-section-head h2 {
  font-size: 1.1rem;
  font-weight: var(--fw-black);
  margin: 0;
}

/* ── Coupons grid: 3 columns desktop, 1 mobile ── */
.store-coupons-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* ── No coupons ── */
.store-no-coupons {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--ink-60);
  margin-bottom: 28px;
}

/* ── Store article ── */
.store-article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.store-article-title {
  font-size: 1.05rem;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.store-article-body {
  line-height: 1.85;
  color: var(--ink);
  font-size: .9375rem;
}
.store-article-body h2, .store-article-body h3 { margin-top: 1.5rem; }
.store-article-body p { margin-bottom: .875rem; }
.store-article-body ul, .store-article-body ol { padding-right: 1.25rem; margin-bottom: .875rem; }
.store-article-body li { margin-bottom: .4rem; }
.store-article-body strong { color: var(--ink); }
.store-article-body a { color: var(--red); text-decoration: underline; }

/* ── Share bar ── */
.store-share-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.store-share-label { font-size: .875rem; font-weight: var(--fw-bold); color: var(--ink-60); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: .45rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .8125rem;
  font-weight: var(--fw-bold);
  color: #fff;
  text-decoration: none;
  transition: var(--transition);
}
.share-btn:hover { opacity: .88; color: #fff; transform: translateY(-1px); }
.share-wa { background: #25d366; }
.share-tg { background: #0088cc; }
.share-tw { background: #1da1f2; }

/* ── MOBILE overrides for store page ── */
@media (max-width: 768px) {
  .store-page-wrap { padding: 20px 0 40px; }

  /* Info card: stack vertically */
  .store-info-card { flex-direction: column; gap: 14px; }
  .store-info-card > .btn { width: 100%; justify-content: center; }
  .store-info-left { flex-direction: column; align-items: flex-start; gap: 10px; }
  .store-info-logo { width: 52px; height: 52px; }
  .store-info-name { font-size: 1rem; }

  /* Codes: single column always */
  .store-codes-grid { gap: 8px; padding: 12px; }
  .store-code-text { font-size: .8rem; letter-spacing: 1px; padding: .55rem .6rem; }
  .store-code-copy { padding: .55rem .75rem; font-size: .75rem; }

  /* Coupons: 1 column on mobile */
  .store-coupons-grid { grid-template-columns: 1fr; gap: 12px; }

  /* Article padding */
  .store-article { padding: 16px; }
  .store-article-title { font-size: .9375rem; }
  .store-article-body { font-size: .875rem; }

  /* Share bar */
  .share-btn { flex: 1; justify-content: center; }

  /* Banner logo smaller */
  .store-banner-logo { width: 48px; height: 48px; border-radius: 8px; }

  /* Section head */
  .store-section-head h2 { font-size: 1rem; }
  .store-codes-head { font-size: .875rem; padding: 11px 14px; }
}

@media (max-width: 480px) {
  .store-coupons-grid { grid-template-columns: 1fr; }
  .store-share-bar { gap: 7px; }
  .share-btn { font-size: .75rem; padding: .4rem .75rem; }
}

/* ============================================================
   GLOBAL MOBILE LAYOUT FIX — content shift correction
============================================================ */

/* Ensure container never overflows on mobile */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

.container {
  /* Safe padding on all sides for mobile */
  padding-right: max(16px, env(safe-area-inset-right));
  padding-left:  max(16px, env(safe-area-inset-left));
  width: 100%;
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}

/* Prevent any child from causing overflow */
.container > * { min-width: 0; }

/* Ensure all images don't overflow */
img { max-width: 100%; height: auto; }

/* Fix potential RTL margin collapse */
@media (max-width: 768px) {
  .container { padding-right: 14px; padding-left: 14px; }

  /* Header container specifically */
  #masthead .container { padding-right: 12px; padding-left: 12px; }

  /* Header inner: tight on mobile */
  .header-inner { gap: 8px; }

  /* Search full width when needed */
  .header-search { min-width: 0; }

  /* Cat nav: prevent overflow */
  .cat-nav-bar { overflow-x: auto; overflow-y: hidden; }
  .cat-nav-inner { padding: 0 14px; }

  /* Coupon code: prevent horizontal overflow */
  .coupon-code-inner { min-width: 0; }
  .coupon-code-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

  /* Section — safe padding */
  .section, .section-sm { padding-left: 0; padding-right: 0; }

  /* Grid override: always respect container */
  .grid, .store-coupons-grid {
    width: 100%;
    box-sizing: border-box;
  }
}

/* ============================================================
   STORE PAGE v3.4 — Clean, centered, no duplicate logo
============================================================ */

/* ── Hero ── */
.s-hero {
  background: linear-gradient(135deg, #0d0d0d 0%, #2d0a0a 100%);
  padding: 36px 0 28px;
}
.s-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}
.s-hero-text { flex: 1; min-width: 0; }
.s-hero-label {
  font-size: .78rem;
  font-weight: 700;
  color: rgba(255,255,255,.55);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 6px;
}
.s-hero-title {
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 900;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.25;
}
.s-hero-desc {
  color: rgba(255,255,255,.7);
  font-size: .9375rem;
  line-height: 1.65;
  margin: 0 0 12px;
  max-width: 540px;
}
.s-hero-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.s-hero-badge {
  background: var(--red);
  color: #fff;
  font-size: .78rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 50px;
}
.s-hero-cat {
  background: rgba(255,255,255,.12);
  color: rgba(255,255,255,.8);
  font-size: .78rem;
  padding: 3px 10px;
  border-radius: 50px;
}
.s-hero-btn { flex-shrink: 0; }
.s-breadcrumb {
  margin-top: 18px;
  color: rgba(255,255,255,.45);
  font-size: .8rem;
}
.s-breadcrumb a { color: rgba(255,255,255,.55); }
.s-breadcrumb a:hover { color: #fff; }
.s-breadcrumb .sep { margin: 0 5px; opacity: .4; }

/* ── Body wrapper ── */
.s-body { padding: 28px 0 60px; }

/* ── Default codes — horizontal pills ── */
.s-codes {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 24px;
}
.s-codes-label {
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink-60);
  margin-bottom: 12px;
}
.s-codes-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.s-code-item {
  display: flex;
  align-items: stretch;
  border: 1.5px dashed var(--green);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--green-lt);
}
.s-code-val {
  padding: 7px 12px;
  font-family: 'Courier New', monospace;
  font-weight: 900;
  font-size: .875rem;
  color: var(--green);
  letter-spacing: 1.5px;
  white-space: nowrap;
}
.s-code-copy {
  background: var(--green);
  color: #fff;
  border: none;
  padding: 7px 12px;
  font-size: .8rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.s-code-copy:hover  { background: #007a3d; }
.s-code-copy.copied { background: var(--ink); }

/* ── Section head ── */
.s-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.s-section-head h2 {
  font-size: 1.05rem;
  font-weight: 800;
  margin: 0;
}

/* ── Coupons grid — 3 cols desktop ── */
.s-coupons {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

/* ── No coupons ── */
.s-empty {
  text-align: center;
  padding: 40px 20px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--ink-60);
  margin-bottom: 24px;
}
.s-empty-icon { font-size: 2.5rem; margin-bottom: 10px; }

/* ── Article — logo small + centered ── */
.s-article {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  text-align: center;
}
.s-article-logo {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  margin: 0 auto 16px;
  background: var(--surface);
}
.s-article-logo img {
  width: 100%; height: 100%; object-fit: contain; padding: 8px;
}
.s-article-title {
  font-size: 1.05rem;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.s-article-title i { color: var(--red); }
.s-article-body {
  text-align: right;
  line-height: 1.85;
  color: var(--ink);
  font-size: .9375rem;
  max-width: 680px;
  margin: 0 auto;
}
.s-article-body h2, .s-article-body h3 { margin-top: 1.5rem; font-size: 1rem; }
.s-article-body p  { margin-bottom: .875rem; }
.s-article-body ul, .s-article-body ol { padding-right: 1.25rem; margin-bottom: .875rem; }
.s-article-body li { margin-bottom: .4rem; }
.s-article-body a  { color: var(--red); text-decoration: underline; }

/* ── Share ── */
.s-share {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ink-60);
}

/* ════════════════════════════════
   MOBILE OVERRIDES — store page
════════════════════════════════ */
@media (max-width: 768px) {
  /* Hero */
  .s-hero { padding: 24px 0 20px; }
  .s-hero-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .s-hero-title { font-size: 1.35rem; }
  .s-hero-desc  { font-size: .875rem; }
  .s-hero-btn   { width: 100%; justify-content: center; }

  /* Codes: wrap naturally, smaller pills */
  .s-codes { padding: 14px; }
  .s-codes-row { gap: 8px; }
  .s-code-val  { font-size: .8rem; padding: 6px 10px; letter-spacing: 1px; }
  .s-code-copy { padding: 6px 10px; font-size: .75rem; }

  /* Coupons: 1 column on mobile */
  .s-coupons { grid-template-columns: 1fr; gap: 12px; }

  /* Article */
  .s-article { padding: 20px 16px; }
  .s-article-logo { width: 64px; height: 64px; }
  .s-article-title { font-size: .9375rem; }
  .s-article-body { font-size: .875rem; }

  /* Share */
  .s-share { gap: 7px; }
  .share-btn { flex: 1; justify-content: center; min-width: 100px; }

  /* Body padding */
  .s-body { padding: 20px 0 40px; }
}

@media (max-width: 480px) {
  .s-hero-title { font-size: 1.2rem; }
  .s-coupons    { gap: 10px; }
  .s-codes-row  { flex-direction: column; }
  .s-code-item  { width: 100%; }
}
