/*
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-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* Shared button sizing */
:root{
  --btn-y: .8rem;
  --btn-x: 2.5rem;
}

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



.btn:hover {
    background: #cc4a00;
}

.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;
}

/* NEW – green coupon button */
.btn-coupon {
    background: #009204;
    transition: background 0.2s ease;
}

.btn-coupon:hover {
    background: #007a03;
}


/* NEW – code teaser (markup, not CSS content) */
.code-teaser{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: calc(2 * var(--btn-y) + 1em); /* matches .btn */
  padding: 0 12px;                      /* only horizontal */
  box-sizing: border-box;
  border:1px dashed #ff5900;
  border-radius:8px;
  background:#fff;
  font-weight:700;
  font-size:0.95rem;                     /* match button text size */
  color:#333;
}


/* Stack nicely on mobile */
@media (max-width: 640px){
  .coupon-inner{flex-direction:column; align-items:flex-start;}
  .coupon-cta{width:100%;}
}


.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 #ff5900; 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:#ff5900; 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;
    }
}

