:root {
    --cream: #faf6f0;
    --warm-white: #fff9f2;
    --parchment: #f0e8d8;
    --tan: #d4b896;
    --terracotta: #c4704a;
    --terracotta-dark: #a85a38;
    --bark: #6b4c35;
    --espresso: #2c1a0e;
    --sage: #7a8c6e;
    --sage-light: #b5c4a8;
    --charcoal: #3a3028;
    --muted: #8a7a6a;
    --border: #e4d8c8;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'DM Sans', sans-serif;
    background: var(--cream);
    color: var(--espresso);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ─── Noise texture overlay ─────────────────────── */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* ─── Header ─────────────────────────────────────── */
header {
    background: var(--espresso);
    padding: 0 2.5rem;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(212, 184, 150, 0.2);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background: var(--terracotta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.logo-text {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--warm-white);
    letter-spacing: 0.02em;
}

.logo-text span {
    color: var(--tan);
    font-style: italic;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.greeting {
    font-size: 0.85rem;
    color: var(--tan);
    font-weight: 300;
    letter-spacing: 0.03em;
}

.greeting strong {
    color: var(--warm-white);
    font-weight: 500;
}

.logout-btn {
    background: transparent;
    color: var(--tan);
    border: 1px solid rgba(212, 184, 150, 0.35);
    padding: 0.45rem 1.1rem;
    border-radius: 30px;
    font-size: 0.82rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    letter-spacing: 0.04em;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.logout-btn:hover {
    background: rgba(212, 184, 150, 0.12);
    color: var(--warm-white);
    border-color: rgba(212, 184, 150, 0.6);
}

/* ─── Hero Banner ────────────────────────────────── */
.hero {
    background: var(--espresso);
    padding: 3.5rem 2.5rem 4rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 100%, rgba(196, 112, 74, 0.18) 0%, transparent 70%);
    pointer-events: none;
}

.hero-eyebrow {
    font-size: 0.72rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--terracotta);
    font-weight: 500;
    margin-bottom: 1rem;
}

.hero-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: clamp(2.8rem, 6vw, 4.5rem);
    font-weight: 300;
    color: var(--warm-white);
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.01em;
}

.hero-title em {
    font-style: italic;
    color: var(--tan);
}

.hero-sub {
    font-size: 0.92rem;
    color: rgba(255, 249, 242, 0.5);
    font-weight: 300;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ─── Decorative divider ─────────────────────────── */
.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0 2.5rem;
    padding: 1.8rem 0 1.2rem;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: var(--border);
}

.divider-ornament {
    color: var(--terracotta);
    font-size: 0.75rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    font-weight: 500;
    white-space: nowrap;
}

/* ─── Main Content ───────────────────────────────── */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2.5rem 5rem;
    position: relative;
    z-index: 1;
}

/* ─── Section Header ─────────────────────────────── */
.section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 2rem;
}

.section-title {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--espresso);
    letter-spacing: -0.01em;
}

.menu-count {
    font-size: 0.8rem;
    color: var(--muted);
    letter-spacing: 0.06em;
    font-weight: 400;
}

/* ─── Menu Grid ──────────────────────────────────── */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 1.25rem;
}

/* ─── Menu Card ──────────────────────────────────── */
.menu-card {
    background: var(--warm-white);
    border-radius: 14px;
    border: 1px solid var(--border);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(44, 26, 14, 0.04);
    animation: cardIn 0.5s ease both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-card:nth-child(1) {
    animation-delay: 0.05s;
}

.menu-card:nth-child(2) {
    animation-delay: 0.12s;
}

.menu-card:nth-child(3) {
    animation-delay: 0.19s;
}

.menu-card:nth-child(4) {
    animation-delay: 0.26s;
}

.menu-card:nth-child(5) {
    animation-delay: 0.33s;
}

.menu-card:nth-child(6) {
    animation-delay: 0.40s;
}

.menu-card:hover {
    transform: translateY(-6px) scale(1.01);
    box-shadow: 0 16px 40px rgba(44, 26, 14, 0.12);
}

/* Top color bar that cycles per card */
.menu-card:nth-child(3n+1) .card-accent {
    background: var(--terracotta);
}

.menu-card:nth-child(3n+2) .card-accent {
    background: var(--bark);
}

.menu-card:nth-child(3n+3) .card-accent {
    background: var(--sage);
}

.card-accent {
    height: 4px;
    width: 100%;
}

.card-body {
    padding: 1.5rem 1.6rem 1.6rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.menu-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--parchment);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    border: 1px solid var(--border);
    overflow: hidden;
    color: var(--bark);
    font-size: 0.72rem;
    font-weight: 600;
}

.menu-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.active-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: #e8f3e4;
    color: #4a7c3f;
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    text-transform: uppercase;
}

.active-badge::before {
    content: '';
    width: 5px;
    height: 5px;
    background: #5a9e50;
    border-radius: 50%;
    animation: pulse 2s ease infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

.menu-name {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--espresso);
    line-height: 1.25;
    margin-bottom: 0.5rem;
    letter-spacing: -0.01em;
}

.menu-code {
    font-family: 'DM Mono', 'Courier New', monospace;
    color: var(--muted);
    font-size: 0.75rem;
    background: var(--parchment);
    padding: 0.22rem 0.6rem;
    border-radius: 5px;
    display: inline-block;
    border: 1px solid var(--border);
    letter-spacing: 0.05em;
}

.card-footer {
    margin-top: auto;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.view-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--terracotta);
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: uppercase;
}

.arrow-icon {
    width: 22px;
    height: 22px;
    background: var(--terracotta);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.7rem;
    transition: transform 0.25s ease, background 0.25s ease;
}

.menu-card:hover .arrow-icon {
    transform: translateX(3px);
    background: var(--terracotta-dark);
}

/* ─── Empty State ────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    background: var(--warm-white);
    border-radius: 16px;
    border: 1px dashed var(--tan);
    animation: cardIn 0.4s ease both;
}

.empty-icon {
    width: 72px;
    height: 72px;
    background: var(--parchment);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    border: 1px solid var(--border);
}

.empty-state h3 {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 400;
    color: var(--espresso);
    margin-bottom: 0.5rem;
}

.empty-state p {
    font-size: 0.9rem;
    color: var(--muted);
    font-weight: 300;
    line-height: 1.7;
}

/* ─── Footer ─────────────────────────────────────── */
footer {
    text-align: center;
    padding: 1.5rem;
    font-size: 0.75rem;
    color: var(--muted);
    border-top: 1px solid var(--border);
    letter-spacing: 0.04em;
}

/* ─── Responsive ─────────────────────────────────── */
/* ─── Header Utility Classes (replacing inline styles) ─── */
.store-logo-icon {
    background: transparent;
    overflow: hidden;
    padding: 0;
}

.store-logo-img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 50%;
}

.logo-text-wrapper {
    display: flex;
    flex-direction: column;
}

.store-address {
    font-size: 0.75rem;
    color: var(--tan);
    margin-top: 2px;
}

.wallet-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.wallet-btn {
    margin-right: 0;
    cursor: pointer;
    color: var(--tan);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    transition: background 0.2s;
}

.orders-btn-icon {
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* ─── Responsive ─────────────────────────────────── */
@media (max-width: 1024px) {
    header {
        padding: 0 1.5rem;
    }

    main {
        padding: 0 1.5rem 4rem;
    }

    .hero {
        padding: 3rem 1.5rem 3.5rem;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .divider {
        margin: 0 1.5rem;
    }
}

@media (max-width: 768px) {
    header {
        height: auto;
        padding: 0.75rem 1.25rem;
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
        border-bottom: 1px solid rgba(212, 184, 150, 0.2);
    }
    .logout-btn-text{
        display: none;
    }

    .logo-area {
        justify-content: center;
    }

    .nav-right {
        justify-content: center;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .greeting {
        display: none;
    }

    .hero-title {
        font-size: 2.8rem;
    }

    .menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
        gap: 1rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.25rem;
        align-items: flex-start;
    }

    .logout-btn {
        padding: 0.4rem 0.9rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    header {
        padding: 0.6rem 1rem;
    }

    .logo-text {
        font-size: 1.25rem;
    }

    .nav-right {
        gap: 0.5rem;
    }

    .hero {
        padding: 2.5rem 1rem 3rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    main {
        padding: 0 1rem 3rem;
    }

    .divider {
        margin: 0 1rem;
        padding: 1.2rem 0 0.8rem;
    }

    .menu-grid {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 1.6rem;
    }
}