/* Consumer Homepage Overrides (v3.0.1)
   This file intentionally overrides earlier CSS layers.
   Load order: reset > base > layout > components > widgets > pages > misc > consumer-home > index.css
*/

/* --- HEADER --- */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: #0f766e;
    border-bottom: none;
    padding: 0;
}

header .header-inner {
    display: flex;
    align-items: center;
    gap: 0;
    height: 60px;
}

header .logo {
    font-size: 1.20rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: normal;
    overflow: visible;
    text-overflow: clip;
    margin-right: auto;
    flex-shrink: 0;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.logo-line1 {
    font-size: 0.78em;
    letter-spacing: 0.16em;
    font-weight: 850;
    color: #fff;
}

.logo-line2 {
    font-size: 0.86em;
    letter-spacing: 0.12em;
    font-weight: 900;
    margin-top: 2px;
    color: #fff;
}

.logo-dotcom {
    margin-left: 3px;
    opacity: 0.96;
}

/* --- HEADER SEARCH (centered) --- */
.header-search {
    flex: 1;
    max-width: 420px;
    margin: 0 24px;
}

.header-search-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.header-search .app-form-input {
    height: 38px;
    border-radius: 999px;
    padding-left: 16px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    color: #fff;
    font-weight: 400;
    font-size: 0.85rem;
    flex: 1;
}

.header-search .app-form-input::placeholder {
    color: rgba(255,255,255,0.72);
}

.header-search .app-form-input:focus {
    border-color: rgba(255,255,255,0.45);
    box-shadow: 0 0 0 3px rgba(255,255,255,0.15);
}

.header-search-btn {
    width: 38px;
    height: 38px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s;
}

.header-search-btn:hover {
    background: rgba(255,255,255,0.14);
    border-color: rgba(255,255,255,0.30);
}

/* --- DESKTOP INLINE NAV --- */
.consumer-nav {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.consumer-nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.consumer-nav-list li a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: rgba(255,255,255,0.88);
    font-weight: 600;
    font-size: 0.82rem;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    border: none;
    background: transparent;
}

.consumer-nav-list li a svg {
    flex-shrink: 0;
    opacity: 0.85;
}

.consumer-nav-list li a:hover,
.consumer-nav-list li a:focus {
    background: rgba(255,255,255,0.12);
    color: #fff;
    text-decoration: none;
    outline: none;
}

.consumer-nav-list li a:visited {
    color: rgba(255,255,255,0.88);
}

.consumer-nav-list li a.nav-signup {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
}

.consumer-nav-list li a.nav-signup:hover {
    background: rgba(255,255,255,0.22);
}

/* --- HAMBURGER (hidden on desktop) --- */
.nav-hamburger {
    display: none;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 8px;
    color: rgba(255,255,255,0.9);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
    margin-left: 8px;
}

.nav-hamburger:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.28);
}

/* --- HERO SEARCH INLINE --- */
.hero-search-inline {
    display: flex;
    gap: 10px;
    max-width: 520px;
    align-items: center;
}

.hero-search-inline .app-form-input.hero-search-input {
    height: 44px;
    border-radius: 999px;
    padding-left: 16px;
    background: rgba(0,0,0,0.25);
    border: 1px solid rgba(255,255,255,0.22);
    color: #fff;
    flex: 1;
}

.hero-search-inline .app-form-input.hero-search-input::placeholder {
    color: rgba(255,255,255,0.72);
}

.hero-search-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.22);
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.95);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s;
}

.hero-search-btn:hover { background: rgba(255,255,255,0.20); }

/* --- COUPON GRID (4 columns desktop) --- */
@media (min-width: 821px) {
    .coupon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 18px;
    }
}

/* --- OFFER CARD ENHANCEMENTS --- */
.coupon-card-wrapper {
    position: relative;
}

.cbc-offer-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.cbc-offer-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 20px 16px 16px;
    margin: -16px -16px 14px -16px;
    background: linear-gradient(135deg, #f0fdfa 0%, #e0f2fe 100%);
    border-bottom: 1px solid #e2e8f0;
    border-radius: 12px 12px 0 0;
    min-height: 100px;
}

.cbc-offer-logo {
    width: 52px;
    height: 52px;
    border-radius: 12px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #e2e8f0;
    padding: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.08);
}

.cbc-offer-brand-name {
    font-size: 0.8rem;
    font-weight: 700;
    color: #475569;
    text-align: center;
    line-height: 1.2;
}

.cbc-offer-top {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.cbc-offer-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 4px;
}

.cbc-offer-badge-code {
    background: #ecfdf5;
    color: #059669;
    border: 1px solid #a7f3d0;
}

.cbc-offer-badge-deal {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.cbc-offer-expiry {
    font-size: 0.75rem;
    color: #94a3b8;
}

.cbc-card-actions {
    margin-top: auto;
    padding-top: 10px;
}

.cbc-reveal-btn,
.cbc-deal-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}

.cbc-reveal-btn {
    background: #059669;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
}

.cbc-reveal-btn:hover {
    background: #047857;
}

.cbc-deal-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
}

.cbc-deal-btn:hover {
    background: #1d4ed8;
}

.cbc-reveal-code {
    letter-spacing: 2px;
    font-family: monospace;
    color: #fff;
}

/* --- FILTER BAR --- */
.cbc-filter-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.cbc-filter-links {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
}

.cbc-filter-links a {
    padding: 6px 12px;
    border-radius: 6px;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: all 0.15s;
}

.cbc-filter-links a:hover {
    color: #1a1a2e;
    background: #f1f5f9;
}

.cbc-filter-links a.active-filter {
    background: #ecfdf5;
    color: #059669;
    border-color: #a7f3d0;
}

.cbc-refresh-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 6px;
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.15s;
}

.cbc-refresh-btn svg {
    width: 16px;
    height: 16px;
}

.cbc-refresh-btn:hover {
    border-color: #0d9488;
    color: #0d9488;
    background: #f1f5f9;
}

/* --- FAVORITES HEART --- */
.heart-toggle {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    background: rgba(255,255,255,0.9);
    border: 1px solid #e2e8f0;
    color: #94a3b8;
    font-size: 1.2rem;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.heart-toggle:hover { color: #ef4444; background: #fff; }

.fav-wish-menu {
    display: none;
    position: absolute;
    top: 42px;
    right: 8px;
    z-index: 10;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.heart-toggle:focus + .fav-wish-menu,
.fav-wish-menu:hover { display: block; }

.fav-menu-btn, .wish-menu-btn {
    display: block;
    width: 100%;
    padding: 8px 14px;
    border: none;
    background: transparent;
    color: #1a1a2e;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    border-radius: 4px;
}

.fav-menu-btn:hover, .wish-menu-btn:hover {
    background: #f1f5f9;
}

.fav-btn {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px;
}

.fav-btn:hover { color: #facc15; }

/* --- OFFER MODAL --- */
.cbc-modal-backdrop {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.cbc-modal {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    max-width: 480px;
    width: 100%;
    padding: 28px;
    position: relative;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.cbc-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 1.6rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.cbc-modal-close:hover { color: #1a1a2e; }

.cbc-modal-store {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.cbc-modal-logo {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 3px;
}

.cbc-modal-store-name {
    font-weight: 700;
    font-size: 1rem;
}

.cbc-modal-title {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 10px;
    line-height: 1.3;
}

.cbc-modal-expiry {
    font-size: 0.85rem;
    color: #94a3b8;
    margin-bottom: 18px;
}

.cbc-modal-code-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #64748b;
    margin-bottom: 8px;
}

.cbc-modal-code-box {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #f0fdf4;
    border: 2px dashed #a7f3d0;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 8px;
}

.cbc-modal-code-text {
    flex: 1;
    font-family: monospace;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #059669;
}

.cbc-modal-copy-btn {
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    background: #059669;
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s;
}

.cbc-modal-copy-btn:hover { background: #047857; }

.cbc-modal-copied-msg {
    font-size: 0.82rem;
    color: #059669;
    font-weight: 600;
    margin-bottom: 8px;
}

.cbc-modal-visit-btn {
    display: block;
    text-align: center;
    padding: 14px;
    border-radius: 10px;
    background: #0d9488;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    margin-top: 16px;
    transition: background 0.15s;
}

.cbc-modal-visit-btn:hover { background: #0f766e; color: #fff; }

/* --- SEARCH PAGE --- */
.cbc-search-section { max-width: 900px; margin: 0 auto; }

.cbc-filter-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.cbc-filter-tab {
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    color: #64748b;
    border: 1px solid #e2e8f0;
    background: #fff;
    transition: all 0.15s;
}

.cbc-filter-tab:hover { color: #1a1a2e; border-color: #cbd5e1; background: #f1f5f9; }
.cbc-filter-tab.is-active { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }

.cbc-search-store-card {
    display: flex;
    gap: 16px;
    align-items: center;
    padding: 16px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.cbc-search-store-logo img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    object-fit: contain;
    background: #fff;
    padding: 4px;
}

.cbc-search-result {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid #e2e8f0;
    align-items: flex-start;
}

.cbc-sr-logo img {
    width: 36px;
    height: 36px;
    border-radius: 6px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
}

.cbc-sr-title {
    font-weight: 700;
    font-size: 1rem;
    color: #1a1a2e;
    display: block;
    margin-bottom: 4px;
}

.cbc-sr-meta {
    font-size: 0.82rem;
    color: #64748b;
    margin-bottom: 8px;
}

.cbc-sr-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.cbc-sr-actions .app-btn {
    font-size: 0.8rem;
    padding: 6px 12px;
}

.app-btn-secondary {
    background: #fff;
    border-color: #e2e8f0;
    color: #64748b;
}

.app-btn-ghost {
    background: transparent;
    border-color: transparent;
    color: #94a3b8;
}

.app-btn-ghost:hover { color: #1a1a2e; }

.cbc-search-empty {
    text-align: center;
    padding: 40px 20px;
    color: #94a3b8;
    font-size: 1rem;
}

.cbc-search-subhead {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: #475569;
}

.cbc-search-pagination { margin-bottom: 20px; }

/* --- ACCOUNT PAGE --- */
.account-dashboard {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.account-dashboard-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: flex-start;
    margin-bottom: 16px;
}

.account-meta {
    flex: 1;
    min-width: 200px;
}

.meta-item { margin-bottom: 8px; }
.meta-label { font-size: 0.78rem; color: #94a3b8; text-transform: uppercase; display: block; }
.meta-value { font-weight: 600; }

.account-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.stat-card {
    background: #f8f9fb;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    text-align: center;
    min-width: 90px;
}

.stat-num { font-size: 1.5rem; font-weight: 800; }
.stat-label { font-size: 0.75rem; color: #64748b; margin-top: 4px; }

.account-quicklinks {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.dash-link {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s;
}

.dash-link:hover { background: #f1f5f9; color: #0d9488; }
.dash-link-muted { color: #94a3b8; }

.account-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 16px;
    border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #64748b;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.15s;
}

.tab-btn[aria-selected="true"] {
    color: #0d9488;
    border-bottom-color: #0d9488;
}

.tab-btn:hover { color: #1a1a2e; }

.account-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}

.account-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
}

.account-card h4 { font-size: 1rem; margin-bottom: 4px; }
.account-card h4 a { color: #0d9488; }
.account-card .code { font-family: monospace; color: #059669; font-weight: 700; }

.action-links {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.action-links a, .action-links button {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    text-decoration: none;
    cursor: pointer;
    font-weight: 600;
}

.action-links a:hover, .action-links button:hover {
    background: #f1f5f9;
    color: #0d9488;
}

/* --- AUTH PAGES --- */
.auth-links {
    display: flex;
    gap: 12px;
    margin-bottom: 18px;
}

.auth-link {
    color: #64748b;
    font-size: 0.88rem;
    font-weight: 600;
}

.auth-link:hover { color: #0d9488; }

.auth-form .form-row { margin-bottom: 16px; }

.form-actions-single { margin-top: 20px; }

.lost-password-wrapper {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    background-color: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 2.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

/* --- FOOTER (consumer) --- */
.consumer-footer {
    background: #0f766e;
    border-top: none;
    padding: 40px 0 30px;
    margin-top: auto;
    text-align: left;
}

.footer-brand { font-size: 1.3rem; font-weight: 800; margin-bottom: 8px; color: #fff; }
.footer-tagline { color: rgba(255,255,255,0.55); margin-bottom: 16px; line-height: 1.5; }

.footer-links {
    margin-bottom: 14px;
}

.footer-links a {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255,255,255,0.7);
}

.footer-links a:hover { color: #fff; }
.footer-sep { margin: 0 8px; color: rgba(255,255,255,0.25); }
.footer-meta { font-size: 0.82rem; color: rgba(255,255,255,0.35); font-weight: 500; }

/* --- RESPONSIVE: collapse nav to hamburger --- */
@media (max-width: 960px) {
    .consumer-nav {
        display: none;
        position: absolute;
        top: 60px;
        right: 12px;
        left: auto;
        width: min(300px, calc(100vw - 24px));
        max-height: calc(100vh - 76px);
        overflow: auto;
        z-index: 200;
        background: #fff;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    }
    .consumer-nav.active { display: block; }

    .consumer-nav-list {
        flex-direction: column;
        gap: 4px;
        padding: 10px;
    }
    .consumer-nav-list li a {
        color: #1a1a2e;
        font-size: 0.88rem;
        padding: 10px 12px;
        border-radius: 8px;
        width: 100%;
        border: 1px solid #e2e8f0;
        background: #fff;
    }
    .consumer-nav-list li a:hover,
    .consumer-nav-list li a:focus {
        background: #f1f5f9;
        border-color: #0d9488;
        color: #0d9488;
    }
    .consumer-nav-list li a:visited { color: #1a1a2e; }
    .consumer-nav-list li a.nav-signup {
        background: #0f766e;
        color: #fff;
        border-color: #0f766e;
    }
    .consumer-nav-list li a.nav-signup:hover {
        background: #0d9488;
    }
    .consumer-nav-list li a.nav-signup:visited { color: #fff; }

    .nav-hamburger { display: inline-flex; }
    .hero-arrow { display: none; }
}

@media (max-width: 700px) {
    .header-search { display: none; }
}
