:root {
    --teal: #0F5257;
    --teal-dark: #0A3B3F;
    --green: #2E933C;
    --green-dark: #22762D;
    --amber: #E8A33D;
    --bg: #F6F7F4;
    --card: #FFFFFF;
    --text: #16231F;
    --text-muted: #55635C;
    --border: #E1E5E0;
    --radius: 10px;
}

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

body {
    font-family: 'Public Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

h1, h2, h3, .brand-word {
    font-family: 'Fraunces', Georgia, serif;
}

a { color: inherit; }

/* ---- Trust strip ---- */
.trust-strip {
    background: var(--teal-dark);
    color: #DCEAE8;
    font-size: 0.82rem;
    padding: 7px 20px;
    display: flex;
    justify-content: center;
    gap: 28px;
    flex-wrap: wrap;
}
.trust-strip span { display: flex; align-items: center; gap: 6px; }

/* ---- Trending strip (top quick-nav) ---- */
.trending-strip {
    background: var(--teal-dark);
    padding: 9px 0;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.trending-strip::-webkit-scrollbar { display: none; }
.trending-strip-inner {
    display: inline-flex;
    gap: 6px;
    padding: 0 16px;
}
.trending-strip-label {
    color: #DCEAE8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: center;
    margin-right: 4px;
    flex-shrink: 0;
}
.trending-pill {
    flex-shrink: 0;
    background: rgba(255,255,255,0.1);
    color: #fff;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 6px 13px;
    border-radius: 999px;
    white-space: nowrap;
}
.trending-pill:hover { background: rgba(255,255,255,0.2); }

/* ---- Header ---- */
.site-header {
    background: var(--teal);
    color: #fff;
    padding: 14px 20px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand .logo-badge {
    background: #F6F7F4;
    border-radius: 10px;
    padding: 6px 12px;
    display: flex;
    align-items: center;
}
.brand .logo-badge img { height: 34px; display: block; }

.affiliate-notice {
    background: #FCF3E2;
    color: #6B4E1A;
    font-size: 0.8rem;
    text-align: center;
    padding: 8px 16px;
    border-bottom: 1px solid #F0DCB0;
}

.back-link {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    text-decoration: none;
    opacity: 0.85;
    font-size: 0.9rem;
}
.back-link:hover { opacity: 1; }

/* ---- Hero with central search ---- */
.hero {
    background: linear-gradient(180deg, var(--teal) 0%, var(--teal-dark) 100%);
    color: #fff;
    padding: 34px 20px 40px;
    text-align: center;
}
.hero h1 {
    font-size: 1.7rem;
    font-weight: 600;
    margin-bottom: 6px;
}
.hero p {
    color: #CFE3E1;
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.hero-search-form {
    max-width: 560px;
    margin: 0 auto;
    display: flex;
    background: #fff;
    border-radius: 999px;
    padding: 5px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}
.hero-search-form input {
    flex: 1;
    border: none;
    outline: none;
    padding: 12px 18px;
    font-size: 1rem;
    border-radius: 999px;
    font-family: inherit;
}
.hero-search-form button {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0 24px;
    font-weight: 700;
    cursor: pointer;
    font-size: 0.95rem;
}
.hero-search-form button:hover { background: var(--green-dark); }

/* ---- Category chips ---- */
.category-strip {
    max-width: 1280px;
    margin: 0 auto;
    padding: 14px 16px 0;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.category-strip::-webkit-scrollbar { display: none; }
.category-chip {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.category-chip:hover { border-color: var(--teal); color: var(--teal); }

/* ---- Retailer logo strip (replaces sidebar) ---- */
.retailer-strip-wrap {
    max-width: 1280px;
    margin: 0 auto;
    padding: 20px 16px 0;
}
.retailer-strip-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}
.retailer-strip-header h2 { font-size: 1.05rem; }
.retailer-strip-header a { font-size: 0.82rem; color: var(--teal); text-decoration: none; font-weight: 600; }
.retailer-strip-header a:hover { text-decoration: underline; }

.retailer-strip {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 4px;
}
.retailer-chip {
    flex: 0 0 auto;
    scroll-snap-align: start;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    text-align: center;
    text-decoration: none;
    color: var(--text);
    min-width: 96px;
}
.retailer-chip img { width: 36px; height: 36px; object-fit: contain; margin: 0 auto 6px; display: block; }
.retailer-chip .rc-name { font-size: 0.78rem; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 88px; margin: 0 auto; }
.retailer-chip .rc-count { font-size: 0.7rem; color: var(--text-muted); }
.retailer-chip:hover { border-color: var(--teal); }

/* ---- Homepage sections (carousel rows) ---- */
.voucher-section { max-width: 1280px; margin: 0 auto; padding: 24px 16px 0; }
.voucher-section-header { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; gap: 12px; }
.voucher-section-header h2 { font-size: 1.2rem; margin-bottom: 2px; }
.voucher-section-header p { font-size: 0.85rem; color: var(--text-muted); }
.voucher-section-header a { font-size: 0.82rem; color: var(--teal); text-decoration: none; font-weight: 600; white-space: nowrap; }
.voucher-section-header a:hover { text-decoration: underline; }
.voucher-section-header.hot h2::before { content: "🔥 "; }
.voucher-section-header.expiring h2::before { content: "⏰ "; }
.voucher-section-header.latest h2::before { content: "🆕 "; }

.carousel-row {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
}
.carousel-row .voucher-card {
    flex: 0 0 250px;
    scroll-snap-align: start;
}

.voucher-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 16px;
}
.voucher-grid.empty-inline { display: block; }

.main-content { max-width: 1280px; margin: 0 auto; padding: 0 16px; }

/* ---- Retailer info panel (retailer page) ---- */
.retailer-hero {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 20px 0;
}
.retailer-hero-banner {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    display: block;
    background: #EFF3F1;
}
.retailer-hero-body { padding: 20px; display: flex; gap: 16px; flex-wrap: wrap; }
.retailer-hero-logo {
    width: 64px;
    height: 64px;
    object-fit: contain;
    background: #F6F7F4;
    border-radius: 10px;
    padding: 8px;
    flex-shrink: 0;
}
.retailer-hero-text { flex: 1; min-width: 220px; }
.retailer-hero-text h1 { font-size: 1.4rem; margin-bottom: 8px; }
.retailer-hero-text p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 10px; }
.retailer-how-to {
    background: #F0F6F5;
    border-left: 3px solid var(--teal);
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--teal-dark);
}
.retailer-how-to strong { display: block; margin-bottom: 4px; }


.voucher-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.voucher-card-header { display: flex; align-items: center; gap: 8px; }
.retailer-logo { width: 28px; height: 28px; object-fit: contain; border-radius: 4px; }
.retailer-name { font-weight: 700; color: var(--teal-dark); text-decoration: none; font-size: 0.95rem; }
.retailer-name:hover { text-decoration: underline; }

.voucher-title { font-size: 1rem; font-weight: 600; }
.voucher-desc { font-size: 0.85rem; color: var(--text-muted); }

.verified-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--green-dark);
    font-weight: 600;
}
.verified-row::before { content: "✓"; }

.voucher-expiry { font-size: 0.8rem; color: var(--text-muted); }

.voucher-code {
    border: 2px dashed var(--teal);
    border-radius: 8px;
    padding: 12px;
    text-align: center;
    cursor: pointer;
    font-weight: 700;
    letter-spacing: 1px;
    background: #F0F6F5;
    color: var(--teal-dark);
}
.voucher-code.no-code {
    border-color: var(--green);
    color: var(--green-dark);
    background: #F1F8F1;
    cursor: default;
}
.copy-hint { display: block; font-size: 0.7rem; font-weight: 400; color: var(--text-muted); margin-top: 3px; }

.voucher-visit-btn {
    display: inline-block;
    text-align: center;
    background: var(--green);
    color: #fff;
    padding: 11px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
}
.voucher-visit-btn:hover { background: var(--green-dark); }

.voucher-votes { display: flex; align-items: center; gap: 10px; font-size: 0.8rem; color: var(--text-muted); flex-wrap: wrap; }
.vote-btn {
    background: #F0F2EF;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 0.82rem;
    cursor: pointer;
    font-family: inherit;
    color: var(--text);
}
.vote-btn:hover:not(:disabled) { background: #E4E8E4; }
.vote-btn:disabled { opacity: 0.5; cursor: default; }
.vote-btn.voted { background: #DCEAE8; border-color: var(--teal); }

.empty-state { grid-column: 1 / -1; text-align: center; padding: 50px 20px; color: var(--text-muted); }

/* ---- Footer ---- */
.site-footer {
    text-align: center;
    padding: 26px 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border);
}
.site-footer .foot-note { margin-top: 4px; font-size: 0.78rem; }
.site-footer .foot-links { margin-top: 6px; font-size: 0.8rem; }
.site-footer .foot-links a { color: var(--teal); text-decoration: none; }
.site-footer .foot-links a:hover { text-decoration: underline; }

/* ---- Cookie consent banner ---- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--teal-dark);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
}
.cookie-banner p { font-size: 0.85rem; max-width: 640px; color: #DCEAE8; }
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-banner .btn-secondary { background: rgba(255,255,255,0.15); color: #fff; }
.cookie-banner .btn-secondary:hover { background: rgba(255,255,255,0.25); }

/* ---- Legal pages ---- */
.legal-page { max-width: 760px; margin: 0 auto; padding: 30px 16px 50px; }
.legal-page h1 { font-size: 1.6rem; margin-bottom: 4px; }
.legal-page h2 { font-size: 1.1rem; margin: 24px 0 8px; }
.legal-page p, .legal-page li { font-size: 0.92rem; color: var(--text-muted); line-height: 1.6; }
.legal-page ul { padding-left: 20px; margin-bottom: 10px; }
.legal-page a { color: var(--teal); }
.legal-updated { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 20px; }
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0 20px; font-size: 0.85rem; }
.legal-table th, .legal-table td { text-align: left; padding: 8px 10px; border: 1px solid var(--border); }
.legal-table th { background: #EFF3F1; }

/* ---- Admin ---- */
.admin-login, .admin-panel { max-width: 900px; margin: 40px auto; padding: 0 16px; }
.admin-login form { display: flex; flex-direction: column; gap: 10px; max-width: 300px; margin-top: 16px; }
.admin-login input, .admin-form input, .admin-form select, .admin-form textarea {
    padding: 10px; border: 1px solid var(--border); border-radius: 8px; width: 100%; font-family: inherit;
}
.admin-form { display: flex; flex-direction: column; gap: 14px; background: var(--card); padding: 22px; border-radius: var(--radius); margin-top: 16px; border: 1px solid var(--border); }
.admin-form label { display: flex; flex-direction: column; gap: 4px; font-size: 0.88rem; font-weight: 600; }
.admin-header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
.btn, .btn-secondary { padding: 9px 16px; border-radius: 8px; text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.btn { background: var(--green); color: #fff; }
.btn:hover { background: var(--green-dark); }
.btn-secondary { background: #E7E9E5; color: var(--text); }
.admin-table { width: 100%; border-collapse: collapse; margin-top: 20px; background: var(--card); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.admin-table th { background: #EFF3F1; text-align: left; padding: 10px; font-size: 0.85rem; }
.admin-table td { text-align: left; padding: 10px; border-top: 1px solid var(--border); font-size: 0.9rem; }
.admin-table a { color: var(--teal); text-decoration: none; }
.admin-table a:hover { text-decoration: underline; }
.error { color: #C0392B; margin: 8px 0; font-size: 0.9rem; }

@media (max-width: 480px) {
    .hero { padding: 26px 14px 30px; }
    .hero h1 { font-size: 1.4rem; }
    .hero-search-form input { padding: 10px 14px; font-size: 0.9rem; }
    .hero-search-form button { padding: 0 16px; font-size: 0.85rem; }
    .trust-strip { gap: 14px; font-size: 0.75rem; }
    .carousel-row .voucher-card { flex-basis: 220px; }
}
