/* AffLife Coupon Theme — v1.6.0
   Base CSS uses CSS variables so presets in presets.css can re-skin the entire site.
   Default values below match the original "Modern Green" look (preset-01). */
:root {
    --bg:           #f5f7f4;
    --text:         #1d2939;
    --heading:      #1a2a3a;
    --muted:        #4b5563;
    --primary:      #1565c0;
    --primary-dark: #0f4e96;
    --accent:       #e91e63;       /* offer-tag pink */
    --section-bg:   #b7d2ad;
    --card-bg:      #ffffff;
    --card-border:  transparent;
    --card-shadow:  0 1px 3px rgba(0,0,0,0.08);
    --card-radius:  10px;
    --hero-bg:      linear-gradient(135deg, #a8c9a0 0%, #7fa882 100%);
    --hero-text:    #ffffff;
    --hero-cta-bg:  #14532d;
    --hero-cta-text:#ffffff;
    --header-bg:    #ffffff;
    --header-text:  #334155;
    --brand-color:  #14532d;
    --footer-bg:    #1a2a3a;
    --footer-text:  #cbd5e1;
    --footer-link:  #cbd5e1;
    --offer-big:    #1565c0;
    --offer-tag:    #e91e63;
    --brand-text:   #1565c0;
    --btn-bg:       #1d8cf8;
    --btn-bg-hover: #1567c4;
    --btn-text:     #ffffff;
    --font-base:    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    --font-heading: inherit;
    --font-display: inherit;
    --container-max:1180px;
    --section-radius:8px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; font-family: var(--font-base); color: var(--text); background: var(--bg); line-height: 1.55; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; font-family: var(--font-heading); }
.container { max-width: var(--container-max); margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { background: var(--header-bg); border-bottom: 1px solid #e5e7eb; position: sticky; top: 0; z-index: 100; }
.header-inner { display: flex; align-items: center; gap: 16px; padding: 12px 0; flex-wrap: wrap; }
.site-brand { font-size: 22px; font-weight: 700; color: var(--brand-color); }
.site-logo { max-height: 40px; }
.site-nav { display: flex; gap: 14px; margin-left: auto; flex-wrap: wrap; }
.site-nav a { color: var(--header-text); font-weight: 500; font-size: 15px; }
.site-search { display: flex; gap: 6px; }
.site-search input { padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; min-width: 200px; font-size: 14px; font-family: inherit; }
.site-search button { padding: 8px 16px; background: var(--primary); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 500; font-family: inherit; }
@media (max-width: 820px) {
    .header-inner { gap: 8px; padding: 10px 0; }
    .site-brand { font-size: 18px; }
    .site-nav { width: 100%; order: 3; gap: 12px; justify-content: center; font-size: 13px; }
    .site-search { width: 100%; order: 2; }
    .site-search input { min-width: 0; flex: 1; }
}

/* Hero */
.hero { background: var(--hero-bg); padding: 56px 0; text-align: center; color: var(--hero-text); }
.hero h1 { font-size: 2.4rem; margin: 0 0 12px; color: var(--hero-text); font-family: var(--font-display); }
.hero p { font-size: 1.1rem; margin: 0 auto 24px; max-width: 700px; }
.hero-search { display: flex; gap: 8px; max-width: 500px; margin: 0 auto; }
.hero-search input { flex: 1; padding: 12px 16px; border: none; border-radius: 6px; font-size: 16px; font-family: inherit; }
.hero-search button { padding: 12px 24px; background: var(--hero-cta-bg); color: var(--hero-cta-text); border: none; border-radius: 6px; cursor: pointer; font-weight: 600; white-space: nowrap; font-family: inherit; }
@media (max-width: 540px) {
    .hero { padding: 40px 0; }
    .hero h1 { font-size: 1.7rem; }
    .hero p { font-size: 1rem; }
}

/* Sections */
.section { background: var(--section-bg); padding: 24px 18px; margin: 20px 0; border-radius: var(--section-radius); }
.section h2 { text-align: center; margin: 0 0 6px; color: var(--heading); font-size: 1.4rem; }
.section-subtitle { text-align: center; color: var(--muted); margin: 0 0 18px; font-size: 0.95rem; }

/* Store grid */
.store-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
@media (max-width: 1024px) { .store-grid { grid-template-columns: repeat(5, 1fr); } }
@media (max-width: 860px)  { .store-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 640px)  { .store-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 420px)  { .store-grid { grid-template-columns: repeat(2, 1fr); } }

.store-card { background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--card-radius); padding: 14px 8px; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: space-between; min-height: 130px; box-shadow: var(--card-shadow); color: var(--heading); transition: transform .15s ease, box-shadow .15s ease; }
.store-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(0,0,0,0.12); text-decoration: none; }
.store-card-logo { display: flex; align-items: center; justify-content: center; height: 64px; width: 100%; }
.store-card-logo img { max-height: 58px; max-width: 100%; object-fit: contain; }
.store-card-text { font-weight: 600; font-size: 14px; color: #334155; }
.store-card-name { font-size: 11px; color: #64748b; margin-top: 6px; line-height: 1.3; }

/* Alphabet filter */
.alphabet-filter { display: flex; flex-wrap: wrap; gap: 5px; justify-content: center; margin: 12px 0 18px; }
.alphabet-filter a { padding: 4px 9px; background: #fff; border-radius: 4px; color: #334155; font-size: 13px; min-width: 26px; text-align: center; }
.alphabet-filter a.active { background: #1565c0; color: #fff; }

/* ============================================================
 * Coupon card — 4-column desktop layout matching the screenshot
 * Logo | Big offer text | Brand+title+desc | Get Code
 * ============================================================ */
.coupon-list { display: flex; flex-direction: column; gap: 14px; }

.coupon-card {
    display: grid;
    grid-template-columns: 140px 200px 1fr 180px;
    grid-template-areas: "logo offer body action";
    gap: 0;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--card-radius);
    padding: 20px;
    box-shadow: var(--card-shadow);
    align-items: center;
}
.coupon-card .coupon-logo   { grid-area: logo;   }
.coupon-card .coupon-offer-big { grid-area: offer; }
.coupon-card .coupon-body   { grid-area: body;   }
.coupon-card .coupon-action { grid-area: action; }

/* Logo column */
.coupon-card .coupon-logo {
    border-right: 2px dashed #d4d4d8;
    padding: 0 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100px;
}
.coupon-card .coupon-logo img      { max-height: 80px; max-width: 100%; object-fit: contain; }
.coupon-card .coupon-logo-text     { font-weight: 700; font-size: 1.05rem; color: #1f2937; text-align: center; }

/* Big-offer middle column (large blue text) */
.coupon-card .coupon-offer-big {
    border-right: 2px dashed #d4d4d8;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--offer-big);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.25;
}

/* Body column */
.coupon-card .coupon-body { padding: 0 22px; display: flex; flex-direction: column; justify-content: center; }
.coupon-eyebrow { display: block; margin-bottom: 4px; line-height: 1.3; font-size: 1rem; }
.coupon-brand { color: var(--brand-text); font-weight: 700; }
.coupon-brand:hover { text-decoration: none; }
.coupon-eyebrow-dash { color: #475569; margin: 0 4px; }
.coupon-offer-tag { color: var(--offer-tag); font-weight: 700; }
.coupon-title { margin: 6px 0 8px; font-size: 1.15rem; color: var(--heading); font-weight: 700; }
.coupon-desc { color: var(--muted); font-size: 0.92rem; margin: 0; line-height: 1.5; }

/* Action column */
.coupon-card .coupon-action { padding: 0 8px; display: flex; align-items: center; justify-content: center; }
.btn { display: inline-block; padding: 12px 24px; border: none; border-radius: 6px; font-weight: 600; cursor: pointer; font-size: 1rem; transition: background .15s ease; text-align: center; font-family: inherit; }
.btn-code { background: var(--btn-bg); color: var(--btn-text); }
.btn-code:hover { background: var(--btn-bg-hover); color: var(--btn-text); }
.coupon-btn { padding: 14px 32px; min-width: 140px; }

/* Tablet: drop the big-offer middle column, stack content vertically next to logo */
@media (max-width: 1024px) {
    .coupon-card {
        grid-template-columns: 130px 1fr;
        grid-template-areas:
            "logo body"
            "logo action";
        padding: 18px;
    }
    .coupon-card .coupon-offer-big { display: none; }
    .coupon-card .coupon-logo { padding: 0 16px 0 4px; }
    .coupon-card .coupon-body { padding: 0 0 0 18px; }
    .coupon-card .coupon-action { padding: 12px 0 0 18px; justify-content: flex-start; }
    .coupon-btn { width: 100%; max-width: 280px; }
}

/* Mobile: full vertical stack */
@media (max-width: 480px) {
    .coupon-card {
        grid-template-columns: 1fr;
        grid-template-areas:
            "logo"
            "body"
            "action";
        padding: 16px;
        gap: 14px;
        text-align: center;
    }
    .coupon-card .coupon-logo {
        border-right: none;
        border-bottom: 2px dashed #d4d4d8;
        padding: 0 0 14px;
        min-height: auto;
    }
    .coupon-card .coupon-body, .coupon-card .coupon-action { padding: 0; }
    .coupon-card .coupon-action { justify-content: center; }
    .coupon-btn { width: 100%; max-width: none; }
}

/* Single store hero */
.store-hero { background: #fff; padding: 28px 0; border-bottom: 1px solid #e5e7eb; }
.store-hero-inner { display: flex; gap: 24px; align-items: center; flex-wrap: wrap; }
.store-hero-logo img { max-height: 90px; max-width: 180px; object-fit: contain; }
.store-hero-info h1 { margin: 0 0 8px; font-size: 1.8rem; }
.store-hero-info p { color: #4b5563; margin: 0 0 6px; }
.store-hero-info a.store-link { color: #1565c0; font-weight: 500; }
.store-hero-info .store-breadcrumb { font-size: 13px; color: #64748b; margin-bottom: 8px; }
.store-hero-info .store-breadcrumb a { color: #475569; }
.store-hero-info .store-hero-meta { margin: 6px 0 0; font-size: 14px; }
.store-content { padding: 28px 0; }
.store-content > section + section { margin-top: 20px; }
.store-content .review { background: #fff; padding: 24px; border-radius: 8px; }
.store-content .review h2 { margin-top: 0; }
.store-content .review-main { padding: 32px; }
.store-content .review-main h2:first-child { margin-top: 0; }
@media (max-width: 540px) {
    .store-hero { padding: 22px 0; }
    .store-hero-info h1 { font-size: 1.4rem; }
    .store-content .review { padding: 18px; }
    .store-content .review-main { padding: 22px; }
}

/* Static page articles */
.page-article { background: var(--card-bg); padding: 32px; margin: 24px 0; border-radius: var(--card-radius); box-shadow: var(--card-shadow); border: 1px solid var(--card-border); }
.page-article h1 { margin-top: 0; }
.page-article h2 { margin-top: 1.6em; }
.page-article h3 { margin-top: 1.4em; }
.page-article h4 { margin-top: 1.2em; }
.page-article ul, .page-article ol { padding-left: 1.4em; }
.page-article li { margin: 6px 0; }
@media (max-width: 540px) { .page-article { padding: 20px; } }

/* Pagination */
.afflife-pagination ul { display: flex; justify-content: center; flex-wrap: wrap; gap: 4px; padding: 0; list-style: none; margin: 24px 0; }
.afflife-pagination a, .afflife-pagination span { display: inline-block; padding: 6px 12px; background: #fff; border-radius: 4px; color: #334155; min-width: 32px; text-align: center; font-size: 14px; }
.afflife-pagination li.active a { background: #1565c0; color: #fff; }

/* Footer */
.site-footer { background: var(--footer-bg); color: var(--footer-text); margin-top: 40px; padding: 40px 0 24px; }
.site-footer h2 { color: #fff; margin-top: 0; }
.site-footer h3, .site-footer h4 { color: #fff; }
.site-footer a { color: var(--footer-link); }
.site-footer a:hover { color: #fff; }
.footer-about { margin-bottom: 24px; max-width: 900px; }
.footer-about .tagline { color: #94a3b8; font-style: italic; }
.footer-stores { margin: 24px 0; padding: 16px 0; border-top: 1px solid #334155; border-bottom: 1px solid #334155; }
.footer-store-list { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 0; list-style: none; margin: 0; }
.footer-store-list li { font-size: 13px; }
.footer-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin: 24px 0; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
.footer-grid h4 { margin: 0 0 8px; font-size: 14px; text-transform: uppercase; letter-spacing: 0.04em; }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin: 6px 0; font-size: 14px; }
.footer-longtext { padding: 24px 0; border-top: 1px solid #334155; }
.footer-longtext .long-block { margin: 16px 0; font-size: 13px; line-height: 1.7; color: #94a3b8; }
.footer-bottom { border-top: 1px solid #334155; padding-top: 16px; font-size: 12px; color: #64748b; }
.footer-bottom .disclaimer { margin-top: 8px; }

/* ============================================================
 * Get Code modal — matches the screenshot
 * ============================================================ */
body.afflife-modal-open { overflow: hidden; }
.code-modal { position: fixed; inset: 0; background: rgba(15,23,42,0.55); display: none; align-items: center; justify-content: center; z-index: 1000; padding: 16px; }
.code-modal.open { display: flex; }
.code-modal-box {
    background: #fff;
    padding: 32px 28px 24px;
    border-radius: 14px;
    max-width: 380px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.25);
}
.code-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: transparent;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px 8px;
}
.code-modal-close:hover { color: #1a2a3a; }

.code-modal-logo {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    font-weight: 700;
    color: #1a2a3a;
}
.code-modal-logo img { max-height: 70px; max-width: 80%; object-fit: contain; }

.code-modal-title {
    margin: 4px 0 6px;
    font-size: 1.2rem;
    color: #1a2a3a;
    font-weight: 700;
}
.code-modal-instructions { margin: 0 0 18px; color: #4b5563; font-size: 0.95rem; }

.code-modal-row {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: stretch;
    gap: 0;
    margin: 0 0 16px;
    border: 1px solid #cfe8f6;
    border-radius: 8px;
    overflow: hidden;
    background: #ecf6fc;
}
.code-modal-code {
    font-family: "SFMono-Regular", Consolas, "Courier New", monospace;
    font-size: 1.1rem;
    font-weight: 600;
    color: #1a2a3a;
    padding: 12px 16px;
    user-select: all;
    cursor: text;
    word-break: break-all;
    text-align: center;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    justify-content: center;
}
.code-modal-copy {
    background: #20a7a3;
    color: #fff;
    border: none;
    padding: 0 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background .15s ease;
}
.code-modal-copy:hover { background: #168a87; }
.code-modal-copy.copied { background: #14532d; }

.code-modal-redeem {
    display: block;
    background: #1565c0;
    color: #fff !important;
    text-decoration: none;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    transition: background .15s ease;
}
.code-modal-redeem:hover { background: #0f4e96; color: #fff !important; text-decoration: none; }
.code-modal-redeem .link-icon { margin-right: 6px; }

.code-modal-foot {
    margin: 18px 0 0;
    font-size: 11px;
    color: #94a3b8;
    line-height: 1.4;
}
