:root {
    --bg: #fdf7f2;
    --surface: #ffffff;
    --surface-2: #fef0e4;
    --ink: #2c1a0e;
    --ink-soft: #7a4f35;
    --brand: #ea580c;
    --brand-2: #f97316;
    --danger: #c2410c;
    --border: #f0d9c8;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Trebuchet MS", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at 15% 0%, rgba(234, 88, 12, 0.13), transparent 32%),
        radial-gradient(circle at 85% 0%, rgba(249, 115, 22, 0.10), transparent 28%),
        var(--bg);
}

a {
    color: inherit;
    text-decoration: none;
}

.container {
    width: min(1100px, 92vw);
    margin: 0 auto;
}

.site-header {
    background: linear-gradient(135deg, #f7bcc8 0%, #f2a7b8 55%, #e48ea3 100%);
    color: #4a1f2b;
    position: sticky;
    top: 0;
    z-index: 30;
    border-bottom: 1px solid #d9879d;
}

.nav-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.4px;
}

.brand img {
    width: 70px;
    height: 70px;
    object-fit: contain;
    display: block;
}

.main-nav {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.main-nav a {
    color: #4a1f2b;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
}

.main-nav a:hover {
    background: rgba(255, 255, 255, 0.45);
}

.main-nav .lang-link {
    border: 1px solid rgba(74, 31, 43, 0.25);
    padding-inline: 0.55rem;
}

.main-nav .lang-link.active {
    background: rgba(255, 255, 255, 0.7);
    font-weight: 700;
}

.page-content {
    padding: 1.5rem 0 3rem;
    min-height: 75vh;
    background: #ffffff;
}

.hero {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1.2rem;
    background: linear-gradient(125deg, #7c2d12, #c2410c 45%, #ea580c);
    color: #fff7ed;
    border-radius: 18px;
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.hero h1 {
    margin: 0.4rem 0 0.8rem;
    font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.eyebrow {
    letter-spacing: 1px;
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.78rem;
    opacity: 0.9;
}

.hero-search {
    display: flex;
    gap: 0.6rem;
    margin-top: 1rem;
}

input,
select,
textarea,
button {
    font: inherit;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: #fff;
    border-radius: 10px;
    padding: 0.62rem 0.72rem;
}

button,
.btn {
    border: 0;
    border-radius: 10px;
    padding: 0.6rem 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    background: linear-gradient(135deg, #f7bcc8 0%, #f2a7b8 55%, #e48ea3 100%);
    color: #4a1f2b;
}

.btn-primary {
    background: linear-gradient(135deg, #f7bcc8 0%, #f2a7b8 55%, #e48ea3 100%);
    color: #4a1f2b;
}

.btn-secondary {
    background: linear-gradient(135deg, #f7bcc8 0%, #f2a7b8 55%, #e48ea3 100%);
    color: #4a1f2b;
}

.btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: #fff;
}

button:hover,
.btn:hover {
    filter: brightness(0.97);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.coupon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 0.95rem;
}

.coupon-card,
.stat-card,
.card-form,
.detail-card,
.table-wrap,
.filter-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.05);
}

.coupon-card {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.badge {
    align-self: flex-start;
    font-size: 0.72rem;
    letter-spacing: 0.45px;
    border-radius: 999px;
    background: #fff7ed;
    color: #c2410c;
    padding: 0.2rem 0.55rem;
    font-weight: 700;
}

.meta {
    color: var(--ink-soft);
    font-size: 0.9rem;
}

.coupon-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.6rem;
}

.coupon-bottom.stacked {
    flex-direction: column;
    align-items: flex-start;
}

.filter-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.6rem;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    gap: 0.4rem;
    margin-top: 1rem;
}

.pagination a {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    min-width: 34px;
    text-align: center;
    padding: 0.35rem;
}

.pagination a.active {
    background: var(--brand);
    color: #fff;
}

.auth-wrap {
    max-width: 560px;
    margin: 0 auto;
}

.auth-wrap.wide {
    max-width: 780px;
}

.card-form {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
}

.row-two {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.65rem;
}

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.stat-card p {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
}

.table-wrap {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    text-align: left;
    border-bottom: 1px solid var(--border);
    padding: 0.65rem;
    font-size: 0.93rem;
}

.action-row {
    display: flex;
    gap: 0.55rem;
    align-items: center;
    flex-wrap: wrap;
}

.detail-wrap {
    display: grid;
    place-items: center;
}

.detail-card {
    width: min(760px, 100%);
}

.detail-image,
.thumb {
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 0.6rem 0;
}

.detail-list {
    display: grid;
    gap: 0.4rem;
    padding: 0;
    list-style: none;
}

.pill {
    border-radius: 999px;
    padding: 0.25rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 700;
}

.pill.claimed {
    background: #fff7ed;
    color: #c2410c;
}

.pill.disabled {
    background: #fff1e6;
    color: #9a3412;
}

.alert {
    border-radius: 10px;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.7rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #fff7ed;
    color: #9a3412;
}

.alert-error {
    background: #ffedd5;
    color: #9a3412;
}

.alert-info {
    background: #fff3e0;
    color: #9a3412;
}

.empty-note,
.empty-state {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 1rem;
}

.category-section {
    margin-bottom: 2.4rem;
}

.card-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 10px;
    border: 1px solid var(--border);
}

.site-footer {
    background: #ffffff;
    color: var(--ink);
    padding: 1.5rem 0;
    border-top: 1px solid var(--border);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.8rem;
}

.footer-grid a {
    display: block;
    margin: 0.4rem 0;
    color: var(--ink-soft);
}

.lz-hero {
    display: grid;
    grid-template-columns: 2.3fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.lz-hero-main {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 42%, #c2410c 100%);
    color: #fff7ed;
    border-radius: 16px;
    padding: 1.4rem;
    box-shadow: 0 15px 35px rgba(194, 65, 12, 0.24);
}

.lz-label {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 700;
    font-size: 0.75rem;
    opacity: 0.95;
}

.lz-hero-main h1 {
    margin: 0.45rem 0 0.6rem;
    font-size: clamp(1.7rem, 3.8vw, 2.4rem);
}

.lz-hero-main p {
    margin: 0;
}

.lz-search {
    display: flex;
    gap: 0.55rem;
    margin-top: 1rem;
}

.lz-search input {
    border-color: rgba(255, 255, 255, 0.35);
}

.lz-hero-actions {
    display: flex;
    gap: 0.55rem;
    margin-top: 0.7rem;
}

.lz-hero-side {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1rem;
}

.lz-hero-side h3 {
    margin: 0 0 0.55rem;
}

.lz-hero-side ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: grid;
    gap: 0.45rem;
}

.lz-hero-side a {
    display: block;
    padding: 0.45rem 0.55rem;
    border-radius: 9px;
    background: #fff7ed;
    color: #9a3412;
    font-weight: 600;
}

.lz-shortcuts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.65rem;
    margin-bottom: 1.15rem;
}

.lz-shortcut-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.75rem;
    text-align: center;
    color: #9a3412;
    font-weight: 700;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lz-shortcut-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 9px 18px rgba(194, 65, 12, 0.12);
}

.lz-section {
    margin-bottom: 1.35rem;
}

.lz-flash-grid,
.lz-category-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.85rem;
}

.lz-flash-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 8px 24px rgba(17, 24, 39, 0.05);
}

.lz-flash-card h3 {
    margin: 0;
    font-size: 1rem;
}

.lz-flash-card .btn {
    margin-top: auto;
}

.home-canva {
    display: grid;
    gap: 1.4rem;
}

.cv-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    background: linear-gradient(140deg, #fff7ed 0%, #ffedd5 100%);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 1.2rem;
    overflow: hidden;
}

.cv-hero-copy h1 {
    margin: 0.5rem 0 0.6rem;
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    line-height: 1.1;
}

.cv-hero-copy p {
    margin: 0;
    color: #6b3b1e;
}

.cv-tag {
    display: inline-flex;
    padding: 0.3rem 0.62rem;
    border-radius: 999px;
    background: #ffffff;
    color: #9a3412;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.cv-hero-search {
    margin-top: 1rem;
    display: flex;
    gap: 0.55rem;
}

.cv-hero-actions {
    margin-top: 0.65rem;
    display: flex;
    gap: 0.55rem;
}

.cv-hero-preview {
    min-height: 280px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 0.65rem;
}

.cv-preview-card {
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow: 0 10px 20px rgba(194, 65, 12, 0.15);
}

.cv-preview-a {
    background: linear-gradient(145deg, #fb923c 0%, #ea580c 100%);
    grid-row: span 2;
}

.cv-preview-b {
    background: linear-gradient(145deg, #fdba74 0%, #fb923c 100%);
}

.cv-preview-c {
    background: linear-gradient(145deg, #ffedd5 0%, #fed7aa 100%);
}

.cv-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.cv-chip {
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: #fff;
    color: #9a3412;
    font-weight: 700;
    font-size: 0.85rem;
}

.cv-chip:hover {
    background: #fff7ed;
}

.cv-section {
    display: grid;
    gap: 0.8rem;
}

.cv-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
}

.cv-gallery-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.8rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.06);
}

.cv-gallery-card.tall {
    transform: translateY(-4px);
}

.cv-gallery-image {
    height: 160px;
}

.cv-gallery-card .btn {
    margin-top: auto;
}

.cv-collection-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
}

.cv-collection-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    box-shadow: 0 8px 25px rgba(17, 24, 39, 0.05);
}

@media (max-width: 900px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .lz-hero {
        grid-template-columns: 1fr;
    }

    .lz-shortcuts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .lz-flash-grid,
    .lz-category-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .cv-hero {
        grid-template-columns: 1fr;
    }

    .cv-gallery-grid,
    .cv-collection-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .row-two {
        grid-template-columns: 1fr;
    }

    .hero-search {
        flex-direction: column;
    }

    .main-nav {
        gap: 0.5rem;
    }

    .lz-search,
    .lz-hero-actions {
        flex-direction: column;
    }

    .lz-shortcuts,
    .lz-flash-grid,
    .lz-category-grid {
        grid-template-columns: 1fr;
    }

    .cv-hero-search,
    .cv-hero-actions {
        flex-direction: column;
    }

    .cv-gallery-grid,
    .cv-collection-grid {
        grid-template-columns: 1fr;
    }
}

/* =============================================
   Status Pills — extra variant
   ============================================= */
.pill.redeemed {
    background: #d1fae5;
    color: #065f46;
}

/* =============================================
   Redeem Modal — Customer UI
   ============================================= */
.redeem-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.redeem-overlay.hidden { display: none; }

.redeem-modal {
    background: #fff;
    border-radius: 20px;
    padding: 1.6rem 1.4rem;
    width: min(400px, 100%);
    text-align: center;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    max-height: 94dvh;
    overflow-y: auto;
}

.redeem-modal-close {
    position: absolute;
    top: 0.75rem;
    right: 0.9rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    cursor: pointer;
    color: #999;
    padding: 0.1rem 0.4rem;
    line-height: 1;
    border-radius: 50%;
}
.redeem-modal-close:hover { background: #f3f4f6; }

.redeem-coupon-summary { margin-bottom: 1.1rem; }
.redeem-coupon-summary h3 { margin: 0 0 0.25rem; font-size: 1.05rem; color: #2c1a0e; }
.redeem-coupon-summary small { color: #7a4f35; font-size: 0.85rem; }

.redeem-state { display: none; }
.redeem-state.active { display: block; }

#state-active {
    width: 100%;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

#qr-canvas-wrap {
    width: 220px;
    height: 220px;
    margin: 0 auto 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}
#qr-canvas-wrap canvas,
#qr-canvas-wrap img {
    width: 220px !important;
    height: 220px !important;
    border-radius: 10px;
    border: 3px solid #f7bcc8;
    padding: 6px;
    background: #fff;
}

.redeem-short-code {
    font-family: 'Courier New', monospace;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: 0.25em;
    color: #2c1a0e;
    background: #fdf3f6;
    border: 2px dashed #e48ea3;
    border-radius: 10px;
    padding: 0.45rem 1.1rem;
    margin: 0 auto 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.redeem-hint {
    color: #7a4f35;
    font-size: 0.9rem;
    margin: 0 0 0.65rem;
}

.redeem-timer {
    font-size: 1rem;
    font-weight: 600;
    color: #4a1f2b;
    margin-bottom: 0.4rem;
}
.redeem-timer span {
    display: inline-block;
    min-width: 3ch;
    text-align: center;
    background: #f7bcc8;
    border-radius: 6px;
    padding: 1px 8px;
    transition: background 0.25s, color 0.25s;
}
.redeem-timer span.urgent {
    background: #e53e3e;
    color: #fff;
}

.redeem-spinner {
    width: 46px;
    height: 46px;
    border: 5px solid #f7bcc8;
    border-top-color: #e48ea3;
    border-radius: 50%;
    animation: redeem-spin 0.7s linear infinite;
    margin: 1.4rem auto 1rem;
}
@keyframes redeem-spin { to { transform: rotate(360deg); } }

/* =============================================
   Merchant Redeem Page
   ============================================= */
.merchant-redeem-wrap { max-width: 520px; margin: 0 auto; }

.redeem-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.2rem;
}

.redeem-tab-btn {
    flex: 1;
    padding: 0.7rem;
    border-radius: 10px;
    border: 2px solid #e48ea3;
    background: #fff;
    color: #4a1f2b;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.redeem-tab-btn.active {
    background: linear-gradient(135deg, #f7bcc8 0%, #e48ea3 100%);
}

.redeem-tab-panel { display: none; }
.redeem-tab-panel.active { display: block; }

#qr-scanner-video {
    width: 100%;
    border-radius: 12px;
    border: 3px solid #f7bcc8;
    display: block;
    max-height: 320px;
    object-fit: cover;
    background: #111;
}

.scanner-status {
    text-align: center;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: #7a4f35;
    min-height: 2rem;
}

.merchant-result-box {
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-top: 1rem;
    display: none;
    text-align: center;
}
.merchant-result-box.success {
    display: block;
    background: #f0fdf4;
    border: 2px solid #22c55e;
    color: #15803d;
}
.merchant-result-box.error {
    display: block;
    background: #fff1f2;
    border: 2px solid #f43f5e;
    color: #be123c;
}
.merchant-result-box .result-icon { font-size: 2.4rem; margin-bottom: 0.4rem; }
.merchant-result-box h3 { margin: 0 0 0.3rem; font-size: 1.05rem; }
.merchant-result-box p  { margin: 0; font-size: 0.88rem; opacity: 0.85; }

.text-muted { color: #888; font-size: 0.85em; }
