/*
Theme Name: CouponSite
Description: Lightweight, no-frills, mobile-optimized coupon theme.
Version: 1.0
Author: Custom Build
Text Domain: couponsite
*/

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #ffffff;
    color: #333;
    display: flex;
    flex-direction: column;
    align-items: center;
}

main {
    width: 100%;
    max-width: 820px;
    padding: 1rem;
    box-sizing: border-box;
}

a {
    color: #4e4e4e;
    text-decoration: none;
}

header {
    padding: 1rem;
    background: #fff;
    border-bottom: 1px solid #ddd;
    width: 100%;
    max-width: 820px;
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #333;
}

.top-menu {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.top-menu li::after {
    content: "|";
    margin-left: 0.75rem;
    color: #ccc;
}

.top-menu li:last-child::after {
    content: "";
}

.top-menu a {
    color: #333;
    font-weight: normal;
    font-size: 0.95rem;
    text-decoration: none;
}

.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    background: #fff;
}

.store-grid a {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100px; /* Fixed width for the canvas */
    height: 60px; /* Fixed height for the canvas */
    border: 1px solid #eee;
    background: #fff;
    border-radius: 4px;
}

.store-grid img {
    max-width: 90%; /* Allow image to shrink within the canvas */
    max-height: 90%; /* Allow image to shrink within the canvas */
    object-fit: contain;
    padding: 0; /* Remove padding from image itself */
}

.coupons {
}

.coupon {
    background: #fff;
    border: 1px solid #ddd;
    padding: 1rem;
    margin-bottom: 1.5rem;
    border-radius: 4px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.coupon.featured-coupon {
    border-left: 4px solid #f4622a;
    border-top: 1px solid #ddd;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
}

.coupon-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}
.coupon-title a {
    color: #1a1a1a;
    transition: color 0.15s ease;
}
.coupon-title a:hover {
    color: #f4622a;
}

.top-label {
    display: inline-block;
    background: #f4622a;
    color: #fff;
    font-size: 0.6rem;
    font-weight: 700;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.6rem;
}

.coupon-desc {
    font-size: 0.95rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* ============================================================
   BUTTON DESIGN — v1 (original, separate teaser)
   To restore: uncomment this block, comment out v2 below
   ============================================================
:root { --btn-y: .8rem; --btn-x: 2.5rem; }
.btn { display:inline-flex; align-items:center; justify-content:center; background:#f4622a; color:#fff; padding:0 var(--btn-x); height:calc(2 * var(--btn-y) + 1em); line-height:1; border-radius:4px; font-weight:600; font-size:0.95rem; text-align:center; transition:background .2s ease,filter .2s ease; outline:none; border:none; }
.btn:hover { background:#d4551f; }
.btn:focus { outline:none; box-shadow:none; }
.coupon-inner { display:flex; align-items:center; justify-content:space-between; gap:1rem; }
.coupon-main { flex:1; min-width:0; }
.coupon-cta { display:flex; align-items:center; gap:10px; flex-shrink:0; }
.btn-coupon { background:#1b9e5a; transition:background .2s ease; }
.btn-coupon:hover { background:#157a46; }
.code-teaser { display:inline-flex; align-items:center; justify-content:center; height:calc(2 * var(--btn-y) + 1em); padding:0 12px; box-sizing:border-box; border:1px dashed #f4622a; border-radius:8px; background:#fff; font-weight:700; font-size:0.95rem; color:#333; }
@media (max-width:640px) { .coupon-inner { flex-direction:column; align-items:flex-start; } .coupon-cta { width:100%; } }
============================================================ */

/* ============================================================
   BUTTON DESIGN — v2 (coupon ticket: button + teaser joined)
   To revert: comment out this block, uncomment v1 above
   ============================================================ */
:root {
  --btn-y: .8rem;
  --btn-x: 2.2rem;
  --clr-coupon: #1b9e5a;
  --clr-coupon-dark: #157a46;
  --clr-offer: #f4622a;
  --clr-offer-dark: #d4551f;
  --btn-radius: 6px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--clr-offer);
  color: #fff;
  padding: 0 var(--btn-x);
  height: calc(2 * var(--btn-y) + 1em);
  line-height: 1;
  border-radius: var(--btn-radius);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
  transition: background 0.2s ease, filter .2s ease;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

.btn:hover { background: var(--clr-offer-dark); }
.btn:focus { outline: none; }
.btn:focus-visible { outline: 2px solid var(--clr-offer); outline-offset: 2px; }

.coupon-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.coupon-main { flex: 1; min-width: 0; }

.coupon-cta {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
  min-width: 12rem;
}

/* Left half of the coupon ticket */
.btn-coupon {
  flex: 1;
  background: var(--clr-coupon);
  border-radius: var(--btn-radius) 0 0 var(--btn-radius);
  padding-right: 1.4rem;
  transition: background 0.2s ease;
}
.btn-coupon:hover { background: var(--clr-coupon-dark); }
.btn-coupon:focus-visible { outline-color: var(--clr-coupon); }

/* Standalone offer button (no teaser sibling) */
.btn-offer {
  width: 100%;
  border-radius: var(--btn-radius);
}

/* Right half of the coupon ticket */
.code-teaser {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  box-sizing: border-box;
  background: #fff;
  color: #1a1a1a;
  font-family: ui-monospace, 'Courier New', monospace;
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 2px;
  border: 2px dashed var(--clr-coupon);
  border-left: 2px dashed var(--clr-coupon);
  border-radius: 0 var(--btn-radius) var(--btn-radius) 0;
  user-select: none;
}

@media (max-width: 640px) {
  .coupon-inner { flex-direction: column; align-items: flex-start; }
  .coupon-cta { width: 100%; }
  .btn-coupon { flex: 1; }
}


.coupon-expiry {
  font-size: 0.72rem;
  color: #888;
}
.coupon-expiry:not(.coupon-expiry--urgent)::before {
  content: "⏳ ";
}
.coupon-expiry--urgent {
  color: #888;
}
.coupon-expiry--urgent::before {
  content: "▲ ";
  color: #e07b39;
}

.coupon-signals {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
  padding-bottom: 4px;
}
@media (max-width: 640px) {
  .coupon-signals {
    margin-top: 18px;
  }
}
.coupon-signal {
  font-size: 0.72rem;
  color: #888;
}
.coupon-signal--trending {
  color: #888;
}
.coupon-signal--trending::before {
  content: "🔥 ";
}
.coupon-signal--last-used {
  color: #888;
}
.coupon-signal--last-used::before {
  content: "📌 ";
}
.coupon-signal--verified {
  color: #888;
}
.coupon-signal--verified::before {
  content: "✅ ";
}
.coupon-feedback {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #eee;
}
.coupon-feedback__label {
  font-size: 0.85rem;
  color: #666;
}
.thumb-btn {
  background: none;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 8px;
  line-height: 1.4;
  transition: border-color 0.15s;
}
.thumb-btn:hover {
  border-color: #999;
}
.coupon-feedback__thanks {
  font-size: 0.85rem;
  color: #888;
}
.coupon-feedback__thanks--up {
  color: #4caf50;
}

.html-box {
    margin-top: 2rem;
    padding: 2rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #ddd;
    background: #fff;
    flex-wrap: wrap;
}

.footer-bar {
    text-align: right;
    padding: 1rem;
    border-top: 1px solid #ddd;
    width: 100%;
    max-width: 820px;
    box-sizing: border-box;
}

.footer-menu {
    display: flex;
    gap: 0.75rem;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: flex-end; /* Align menu items to the right */
}

.footer-menu a {
    color: #333;
    font-weight: normal;
    font-size: 0.95rem;
    text-decoration: none;
}


.store-logo-canvas {
    width: 96px; /* 20% smaller */
    height: 64px; /* 20% smaller */
    object-fit: contain;
    border: 1px solid #eee;
    background: #fff;
    padding: 5px;
    border-radius: 4px;
}

h1 {
    font-size: 2rem; /* Adjust as needed for desired size */
    font-weight: bold;
    margin-top: 1.5rem;
    margin-bottom: 0.2rem;
}




.homepage-top-section {
    margin-bottom: 5rem; /* Spacing below the H1 and logos */
}

.store-grid {
    margin-top: 1.5rem; /* Spacing between H1 and logos */
}

.coupons h2 {
    margin-top: 2rem; /* Spacing between logos and H2 (Latest Coupons) */
}




.store-header {
    text-align: center;
    padding: 1rem;
}

.store-header-content {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.store-text-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align H1 and H2 to the left within their container */
}

.store-header h2 {
    font-size: 1.1em; /* Specific H2 size for store page */
    margin-top: 0; /* Remove default H2 margin */
    font-weight: normal; /* Make H2 not bold */
}




.footer-menu li::after {
    content: "|";
    margin-left: 0.75rem;
    color: #ccc;
}

.footer-menu li:last-child::after {
    content: "";
}

/* Related coupons – mobile-first table */
.related-coupons { margin-top: 20px; }
.related-coupons h2 { font-size: 1.1rem; margin: 16px 0 10px; }

.rc-table-wrap { 
  width: 100%; 
  overflow-x: auto;
  margin: 0 -10px;
  padding: 0 10px;
}

.related-coupons-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  table-layout: auto;
}

/* Desktop baseline */
.related-coupons-table th,
.related-coupons-table td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: middle;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Column width distribution */
.related-coupons-table th:nth-child(1),
.related-coupons-table td:nth-child(1) {
  width: 15%;
  min-width: 100px;
}

.related-coupons-table th:nth-child(2),
.related-coupons-table td:nth-child(2) {
  width: auto;
  min-width: 200px;
}

.related-coupons-table th:nth-child(3),
.related-coupons-table td:nth-child(3) {
  width: 20%;
  min-width: 100px;
}

.related-coupons-table th:nth-child(4),
.related-coupons-table td:nth-child(4) {
  width: 15%;
  min-width: 80px;
  text-align: center;
}

.related-coupons-table thead th {
  font-weight: 600;
  border-bottom: 1px solid #eee;
}
.related-coupons-table tbody tr:nth-child(odd) { background: #fafafa; }
.related-coupons-table .rc-title { 
  display: inline-block; 
  max-width: 100%; 
  overflow: visible; 
  text-overflow: clip; 
  white-space: normal; 
  line-height: 1.3;
}
.related-coupons-table .btn-visit {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  background: #414140;
  color: #fff;
  white-space: nowrap;
  max-width: 100%;
  box-sizing: border-box;
}

.related-coupons-table .btn-visit:hover {
  background: #555;
  color: #fff;
}

/* Mobile: convert rows to cards */
@media (max-width: 640px) {
  .rc-table-wrap {
    margin: 0;
    padding: 0;
  }
  
  .related-coupons-table {
    table-layout: auto;
  }
  
  .related-coupons-table thead { display: none; }
  .related-coupons-table,
  .related-coupons-table tbody,
  .related-coupons-table tr,
  .related-coupons-table td { display: block; width: 100%; }

  .related-coupons-table tbody tr {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
  }
  .related-coupons-table td {
    padding: 6px 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border: none;
    border-bottom: 1px solid #f0f0f0;
  }
  .related-coupons-table td:last-child {
    border-bottom: 0;
  }
  .related-coupons-table td::before {
    content: attr(data-label) ":";
    font-weight: 600;
    color: #666;
    font-size: 0.85rem;
    margin-bottom: 2px;
  }
  .related-coupons-table .btn-visit {
    align-self: flex-start;
    padding: 8px 16px;
    border-radius: 6px;
    margin-top: 4px;
    font-size: 0.9rem;
  }
  .related-coupons-table .rc-title { 
    max-width: 100%; 
    white-space: normal; 
    overflow: visible;
    text-overflow: clip;
  }
}

/* Related sections styled as html-box */
.html-box-title{margin:0 0 0.75rem 0;font-size:1.05rem;font-weight:600;color:#222;}
.related-stores p{margin:0;font-size:0.95rem;line-height:1.6} .related-stores a{color:#2271b1;text-decoration:none} .related-stores a:hover{text-decoration:underline}

/* ===== Coupon modal (tight, light, aligned with site) ===== */
#coupon-modal{ position:fixed; inset:0; display:none; z-index:9999; background:rgba(0,0,0,.45); -webkit-backdrop-filter:saturate(120%) blur(2px); backdrop-filter:saturate(120%) blur(2px); }
#coupon-modal.is-open{ display:block; }
#coupon-modal .modal-dialog{ position:relative; width:min(560px, calc(100% - 28px)); margin:10vh auto; background:#fff; border:1px solid #eaeaea; border-radius:12px; box-shadow:0 18px 48px rgba(0,0,0,.18); padding:20px 20px 24px; color:#111; transform:translateY(8px) scale(.98); opacity:0; animation:csModalIn .18s ease-out forwards; }
@keyframes csModalIn{ to{ transform:translateY(0) scale(1); opacity:1; } }
@media (prefers-reduced-motion: reduce){ #coupon-modal .modal-dialog{ animation:none; transform:none; opacity:1; } }
#coupon-close{ position:absolute; top:10px; right:10px; border:0; background:transparent; font-size:22px; line-height:1; color:#888; cursor:pointer; padding:6px; border-radius:8px; }
#coupon-close:hover{ background:#f6f6f6; color:#333; }
#coupon-body{ text-align:center; }
#coupon-body h2#coupon-title{ margin:0 0 8px; font-size:20px; font-weight:600; color:#222; }
#coupon-body .coupon-code{ display:inline-flex; align-items:center; gap:8px; font:600 18px/1.2 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; padding:10px 12px; border:1px dashed #f4622a; border-radius:10px; background:#fffdf9; }
#coupon-body .copy-btn{ padding:6px 10px; border:1px solid #ffd9c2; border-radius:8px; cursor:pointer; background:#fff; font-weight:600; }
#coupon-body .copy-btn:hover{ background:#fff4ec; }
#coupon-body .copy-btn.is-copied{ border-color:#b7e2c1; background:#f2fff6; }
#coupon-body .coupon-terms{ margin-top:10px; color:#555; font-size:14px; line-height:1.45; }
#coupon-body .coupon-actions{ margin-top:16px; }
#coupon-body .btn.btn-primary{ display:inline-block; padding:10px 16px; border-radius:10px; background:#f4622a; color:#fff; text-decoration:none; font-weight:700; height: auto; }
#coupon-body .btn.btn-primary:hover{ filter:brightness(.95); }
html.modal-open{ overflow:hidden; }
@media (max-width:480px){ #coupon-modal .modal-dialog{ margin:8vh auto; padding:16px 16px 20px; border-radius:10px; } #coupon-body h2#coupon-title{ font-size:18px; } #coupon-body .coupon-code{ font-size:16px; } }




/* Mobile toggle for coupon descriptions */
.coupon-desc-toggle {
    display: none;
    color: #999;
    font-size: 0.8em;
    cursor: pointer;
    text-decoration: underline;
    margin-bottom: 0.5rem;
}

.coupon-desc-toggle:hover {
    color: #666;
}

@media (max-width: 768px) {
    .coupon-desc {
        display: none;
    }
    
    .coupon-desc.show {
        display: block;
    }
    
    .coupon-desc-toggle {
        display: inline;
    }
}
@media (max-width: 768px) {
    .store-header {
        text-align: left; /* Ensure the container aligns its content to the left */
    }

    .store-header h1 {
        font-size: 1.5rem; /* Reduce h1 font size */
    }
}


