/* Brand Colors */
:root {
  --blue-dark: #003049;
  --red: #d62828;
  --orange: #f77f00;
  --yellow: #fcbf49;
  --beige: #eae2b7;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: var(--beige);
  color: var(--blue-dark);
  line-height: 1.5;
}

/* Navbar */
header {
  background: var(--blue-dark);
  color: white;
  padding: 12px 5%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
}
header .logo { font-size: 1.4em; font-weight: bold; }
nav { margin-top: 8px; width: 100%; text-align: center; }
nav a {
  display: inline-block;
  margin: 5px 8px;
  color: white;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95em;
}
nav a:hover { text-decoration: underline; }

/* Hero Section */
.hero {
  text-align: center;
  padding: 40px 20px;
  background: linear-gradient(135deg, var(--blue-dark), var(--orange));
  color: white;
}
.hero h1 { font-size: 1.9em; margin-bottom: 12px; }
.hero p { font-size: 1.05em; margin-bottom: 18px; }
.hero .cta {
  background: var(--yellow);
  color: var(--blue-dark);
  padding: 10px 22px;
  border-radius: 25px;
  font-weight: bold;
  text-decoration: none;
  margin: 6px;
  display: inline-block;
  font-size: 0.95em;
}
.hero .cta:hover { background: #d62828; color: white; }

/* Search Bar */
.search-bar {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.search-bar input, .search-bar select {
  padding: 10px;
  border-radius: 8px;
  border: none;
  font-size: 0.95em;
  width: 90%;
  max-width: 400px;
}
.search-bar button {
  background: var(--yellow);
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 5px;
}
.search-bar button:hover { background: var(--red); color: white; }

/* Sections */
section { padding: 40px 6%; }
section h2 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 1.6em;
  color: var(--blue-dark);
}

/* Voucher & Cashback Grid */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}
.card {
  background: white;
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.card img { width: 70px; margin-bottom: 8px; }
.card h3 { margin: 10px 0; font-size: 1.1em; }
.card p { font-size: 0.95em; margin-bottom: 10px; }
.card button {
  background: var(--orange);
  border: none;
  color: white;
  padding: 9px 16px;
  border-radius: 20px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.9em;
}
.card button:hover { background: var(--red); }

/* Referral Section */
.referral {
  background: var(--yellow);
  border-radius: 12px;
  padding: 25px;
  text-align: center;
  font-size: 1.05em;
}
.referral button {
  margin-top: 12px;
  background: var(--blue-dark);
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 22px;
  cursor: pointer;
  font-weight: bold;
}
.referral button:hover { background: var(--red); }

/* Sell Voucher Form */
.sell-form {
  background: white;
  border-radius: 12px;
  padding: 25px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: auto;
}
.sell-form h2 { margin-bottom: 15px; }
.sell-form input, .sell-form select {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  font-size: 0.95em;
}
.sell-form button {
  margin-top: 12px;
  background: var(--orange);
  color: white;
  border: none;
  padding: 12px 20px;
  border-radius: 22px;
  cursor: pointer;
  font-weight: bold;
  width: 100%;
}
.sell-form button:hover { background: var(--red); }

/* Footer */
footer {
  background: var(--blue-dark);
  color: white;
  text-align: center;
  padding: 20px;
  font-size: 0.9em;
  margin-top: 40px;
}
footer a { color: var(--yellow); margin: 0 6px; text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Responsive */
@media (min-width: 600px) {
  nav { width: auto; margin-top: 0; }
  nav a { margin: 0 10px; }
  .hero h1 { font-size: 2.3em; }
  .grid { grid-template-columns: repeat(2, 1fr); }
  .search-bar { flex-direction: row; }
  .search-bar input, .search-bar select { flex: 1; margin: 0; }
}
@media (min-width: 900px) {
  .hero h1 { font-size: 2.6em; }
  .hero p { font-size: 1.2em; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  nav a { font-size: 1em; }
}
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px; /* space between box and text */
  font-size: 1.25em;
  color: var(--blue-dark);
  margin-top: 10px;
}
.checkbox-label input {
  transform: scale(1.2); /* make checkbox slightly bigger */
  margin-left: -250px;
  cursor: pointer;
}
/* Simple toast styles */
.toast {
  visibility: hidden;
  min-width: 220px;
  margin-left: -110px;
  background-color: #003049; /* VouchOn brand color */
  color: #fff;
  text-align: center;
  border-radius: 8px;
  padding: 12px;
  position: fixed;
  z-index: 1000;
  left: 50%;
  bottom: 30px;
  font-size: 15px;
  opacity: 0;
  transition: opacity 0.5s, bottom 0.5s;
}
.toast.show {
  visibility: visible;
  opacity: 1;
  bottom: 50px;
}
.voucher-grid {
display: flex;
gap: 16px;
overflow-x: auto;
padding: 12px 0;
scroll-behavior: smooth;
}

.voucher-grid::-webkit-scrollbar {
height: 8px;
}

.voucher-grid::-webkit-scrollbar-thumb {
background: #888;
border-radius: 4px;
}

.featured-voucher {
flex: 0 0 250px; /* fixed width */
background: #fff8e7; /* light card background */
border-radius: 12px;
padding: 16px;
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
transition: transform 0.2s ease-in-out;
}

.featured-voucher:hover {
transform: translateY(-5px);
}
.buy-btn {
padding: 0.5rem 1rem;
width:100px;
font-weight: bold;
background-color: red;
color: white;
border: none;
border-radius: 0.5rem;
cursor: pointer;
transition: background-color 0.2s;
}
.buy-btn:hover {
background-color: darkblue;
}
#flashContainer {
display: flex;
gap: 16px;
overflow-x: auto;
scroll-behavior: smooth;
padding: 12px 0;
-webkit-overflow-scrolling: touch; /* smooth on iOS */
}
#flashContainer::-webkit-scrollbar {
height: 6px;
}
#flashContainer::-webkit-scrollbar-thumb {
background: #bbb;
border-radius: 3px;
}
.flash-card {
flex: 0 0 260px; /* fixed width so cards sit side by side */
display: flex;
flex-direction: column;
justify-content: space-between;
height: 420px;
padding: 16px;
border-radius: 12px;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
background: #fff;
}
.flash-card .merchant { font-size: 14px;
font-weight: 600;
text-transform: uppercase;  /* ensures all merchants look same */
margin-bottom: 5px; }
.flash-card img {
width: 100%; height: 160px; object-fit: cover; border-radius: 10px;
}
.flash-card h3 {
font-size: 1.05em;
font-weight: 600;
line-height: 1.3;
min-height: 42px; /* ensures 2-line space reserved */
}
.badge {
display: inline-block;
background: #f77f00;
color: white;
padding: 4px 10px;
border-radius: 999px;
font-size: 0.8em;
font-weight: 700;
}
.countdown {
font-weight: 700;
color: #d62828;
}
.flash-card .grab {
margin-top: 6px;
background: #003049;
color: white;
border: none;
padding: 10px 14px;
border-radius: 10px;
cursor: pointer;
font-weight: 700;
}
.flash-card .grab:hover { background: #d62828; }
.price-line { display:flex; gap:8px; align-items:center; justify-content:center; }
.price-now { font-weight: 800; }
.price-cut { text-decoration: line-through; opacity: 0.7; }
#cashbackContainer {
display: flex;
gap: 16px;
overflow-x: auto;
padding: 12px 0;
-webkit-overflow-scrolling: touch;
}

#cashbackContainer::-webkit-scrollbar {
height: 6px;
}
#cashbackContainer::-webkit-scrollbar-thumb {
background: #bbb;
border-radius: 3px;
}

.cashback-card {
display: flex;
flex-direction: column;
flex: 0 0 220px;
background: #fff;
border-radius: 12px;
padding: 14px;
box-shadow: 0 2px 6px rgba(0,0,0,0.15);
text-align: center;
transition: transform 0.2s ease;
}
.cashback-card:hover { transform: translateY(-4px); }

.cashback-card img {
width: 100px;
margin-bottom: 10px;
}
.cashback-card h3 { font-size: 1.1em; margin: 6px 0; }
.cashback-card p { font-size: 0.95em; margin: 6px 0; }
.cashback-card button {
background: #f77f00;
border: none;
color: white;
padding: 8px 14px;
border-radius: 8px;
cursor: pointer;
font-weight: bold;
}
.cashback-card button:hover { background: #d62828; }
.img-wrapper {
  width: 250px;
  height: 200px;
  overflow: hidden;
  position: relative;
  display: inline-block;
}

.img-wrapper img {
  width: 250px;
  height: 100%;
  object-fit: cover;
  border-radius: 8px; /* optional for smoother look */
}

.brand-overlay {
  position: absolute;
  top: 8px;
  left: 8px;
  background: rgba(0, 48, 73, 0.8); /* dark semi-transparent bg */
  color: #fff;
  font-size: 0.8rem;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
}
#searchResults {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  max-height: 250px;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0;
  display: none; /* hidden by default */
  z-index: 1000;
}

#searchResults li {
  padding: 10px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  color: #333;
}

#searchResults li:hover {
  background: #f5f5f5;
}
