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

body {
  font-family: 'Open Sans', Arial, sans-serif;
  background-color: #fafafa;
  color: #222;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* HEADER */
.header {
  text-align: center;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fefefe 0%, #f3f8f3 100%);
  border-bottom: 2px solid #e0e0e0;
}
.header-nav {
  text-align: left;
  margin-bottom: 0.5rem;
}
.back-link {
  color: #4681f4;
  text-decoration: none;
  font-weight: 600;
  margin-left: 1rem;
}
.back-link:hover { text-decoration: underline; }

.logo {
  width: 150px;
  height: auto;
}

h1 { font-size: 1.8rem; margin-top: 0.5rem; }
h2 { font-size: 1.5rem; color: #222; margin-top: 0.8rem; }
h3 { font-size: 1.35rem; margin-bottom: 1rem; }

.ad-dates { color: #777; margin-top: 0.3rem; }

/* STORE LIST */
.store-list { max-width: 1000px; margin: 2rem auto; padding: 0 1rem; }
.stores {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}

.store-card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 1rem;
  text-align: center;
  transition: transform 0.2s;
}
.store-card:hover { transform: scale(1.02); background-color: #f7fbf7; }

.store-card h4 { margin-bottom: 0.4rem; color: #2a7a2e; font-size: 1.2rem; font-weight: 700; }
.store-card p { color: #666; font-size: 0.9rem; margin-bottom: 0.8rem; }

.btn, .btn-map {
  display: inline-block;
  background-color: #2a7a2e;
  color: #fff;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  text-decoration: none;
  margin: 0.2rem;
  font-weight: bold;
}
.btn:hover, .btn-map:hover { background-color: #256827; }
.btn-map { background-color: #4681f4; }
.btn-map:hover { background-color: #3467c7; }

/* REWARDS */
.rewards {
  background: #fff;
  margin-top: 2.4rem;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  font-size: 1.1rem;
}

.company-link {
  text-align: center;
  margin-top: 2.8rem;
}
.company-link a {
  color: #2a7a2e;
  font-weight: bold;
  text-decoration: none;
}
.company-link a:hover { text-decoration: underline; }

/* AD GALLERY */
.ad-gallery {
  max-width: 1000px;
  margin: 2rem auto;
  text-align: center;
}

.pdf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
}

.pdf-grid img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}
.pdf-grid img:hover { transform: scale(1.03); }

.pdf-grid a,
.pdf-grid a:hover,
.pdf-grid a:visited {
  text-decoration: none;
  color: inherit;
}

/* PDF OVERLAY */
.pdf-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}
.pdf-container {
  width: 90%;
  height: 90%;
  background: #fff;
  position: relative;
  border-radius: 8px;
  overflow: hidden;
}
#pdf-frame {
  width: 100%;
  height: 100%;
}
.close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: #d12f2f;
  color: #fff;
  border: none;
  padding: 0.7rem 1rem;
  border-radius: 5px;
  cursor: pointer;
  font-weight: bold;
  font-size: 0.95rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.close-btn:hover { background-color: #b81e1e; }

/* FOOTER */
.footer {
  text-align: center;
  padding: 1.5rem;
  background-color: #fff;
  border-top: 2px solid #e0e0e0;
  margin-top: 2rem;
  color: #777;
  font-size: 0.85rem;
}

@media (max-width: 600px) {
  .logo { width: 120px; }
  h1 { font-size: 1.5rem; }
  .stores { grid-template-columns: 1fr; }
}

/* Green back link under dates */
.back-link-green {
  display: inline-block;
  color: #2a7a2e;
  font-weight: 600;
  text-decoration: none;
  font-size: 1rem;
  margin-top: 0.8rem;
}

.back-link-green:hover {
  text-decoration: underline;
}

/* Page label under thumbnails */
.page-label {
  color: #2a7a2e;
  font-weight: 400;
  margin-top: 0.7rem;
  margin-bottom: 1rem;
  font-size: .9rem;
  text-decoration: none;
}

/* QR Section (Desktop only) */
.qr-section {
  background-color: #fff;
  margin: 2.4rem auto;
  padding: 2rem;
  /* max-width: 900px; */
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.qr-content {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.qr-code {
  width: 160px;
  height: auto;
  border-radius: 8px;
  flex-shrink: 0;
}

.qr-text h3 {
  color: #222;
  font-size: 1.35rem;
  margin-bottom: 1rem;
}

.qr-text p {
  font-size: 1rem;
  color: #222;
  line-height: 1.6;
}

/* Responsive: hide QR section layout tweaks */
@media (max-width: 768px) {
  .qr-content {
    flex-direction: column;
    text-align: center;
  }
  .qr-code {
    width: 140px;
  }
}