/* =====================================================
   DUKA SMART MARKETPLACE — BASE CSS
   Clean Commerce Aesthetic · Poppins · Emerald & Navy
   ===================================================== */


/* ================= DESIGN TOKENS ================= */
:root {
    /* Brand Palette */
    --brand-green:        #16a34a;
    --brand-green-light:  #22c55e;
    --brand-green-dark:   #15803d;
    --brand-green-ghost:  #f0fdf4;

    --brand-navy:         #0f172a;
    --brand-navy-soft:    #1e293b;

    /* Surfaces */
    --surface-bg:         #f8fafc;
    --surface-card:       #ffffff;
    --surface-soft:       #f1f5f9;
    --surface-muted:      #e2e8f0;

    /* Typography */
    --text-primary:       #0f172a;
    --text-secondary:     #334155;
    --text-muted:         #64748b;
    --text-faint:         #94a3b8;

    /* Borders */
    --border:             #e2e8f0;
    --border-strong:      #cbd5e1;

    /* Shadows */
    --shadow-xs:  0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-sm:  0 1px 4px rgba(0, 0, 0, 0.07), 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.08), 0 2px 4px rgba(0, 0, 0, 0.04);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.10), 0 4px 8px rgba(0, 0, 0, 0.06);
    --shadow-xl:  0 20px 60px rgba(0, 0, 0, 0.14);

    /* Radius */
    --radius-xs:  6px;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-xl:  24px;
    --radius-full: 999px;

    /* Layout */
    --max-width:  1380px;
    --header-h:   68px;
    --stripe-h:   34px;

    /* Transitions */
    --ease:       cubic-bezier(0.4, 0, 0.2, 1);
    --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}


/* ================= RESET ================= */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    background: var(--surface-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    max-width: 100%;
    display: block;
}

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

ul {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}


/* ================= ACCENT STRIPE ================= */
.header-stripe {
    height: var(--stripe-h);
    background: var(--brand-navy);
    color: rgba(255, 255, 255, 0.80);
    font-size: 0.72rem;
    font-weight: 400;
    letter-spacing: 0.01em;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
    padding: 0 16px;
}

.header-stripe span {
    display: flex;
    align-items: center;
    gap: 6px;
}


/* ================= HEADER ================= */
.market-header {
    position: sticky;
    top: 0;
    z-index: 900;

    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(20px) saturate(1.8);
    -webkit-backdrop-filter: blur(20px) saturate(1.8);

    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-sm);

    transition: box-shadow 0.2s var(--ease);
}

.market-header.scrolled {
    box-shadow: var(--shadow-md);
}

.header-inner {
    max-width: var(--max-width);
    height: var(--header-h);
    margin: 0 auto;
    padding: 0 28px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}


/* ——— BRAND ——— */
.header-brand {
    display: flex;
    align-items: center;
    gap: 11px;
    flex-shrink: 0;
    text-decoration: none;
    transition: opacity 0.15s var(--ease);
}

.header-brand:hover {
    opacity: 0.82;
}

.header-logo {
    width: 38px;
    height: 38px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.brand-name {
    font-size: 1.0rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.brand-badge {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--brand-green);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}


/* ——— CENTER TAGLINE ——— */
.header-center {
    flex: 1;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.header-tagline {
    font-size: 0.78rem;
    font-weight: 400;
    color: var(--text-muted);
    font-style: italic;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* ——— NAV (DESKTOP) ——— */
.header-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 7px 14px;
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: background 0.18s var(--ease);
    position: relative;
}

.nav-item:hover {
    background: var(--surface-soft);
}

.nav-item.active {
    background: var(--brand-green-ghost);
}

.nav-item.active .nav-label {
    color: var(--brand-green-dark);
}

.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 18px;
    height: 2px;
    border-radius: var(--radius-full);
    background: var(--brand-green);
}

.nav-label {
    font-size: 0.80rem;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.2;
}

.nav-sub {
    font-size: 0.60rem;
    color: var(--text-faint);
    font-weight: 400;
    line-height: 1;
}

/* ——— CTA BUTTON ——— */
.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 10px 20px;
    border-radius: var(--radius-full);

    background: var(--brand-green);
    color: #ffffff;

    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    text-decoration: none;
    white-space: nowrap;

    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.28);
    transition: background 0.2s var(--ease), transform 0.2s var(--ease-bounce), box-shadow 0.2s var(--ease);
}

.nav-cta:hover {
    background: var(--brand-green-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(22, 163, 74, 0.38);
}

.nav-cta:active {
    transform: translateY(0);
}

.nav-cta svg {
    transition: transform 0.2s var(--ease-bounce);
}

.nav-cta:hover svg {
    transform: translateX(3px);
}


/* ——— HAMBURGER (MOBILE) ——— */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: none;
    border: 1px solid var(--border);
    flex-shrink: 0;
    transition: background 0.15s var(--ease), border-color 0.15s var(--ease);
}

.hamburger:hover {
    background: var(--surface-soft);
    border-color: var(--border-strong);
}

.hamburger span {
    display: block;
    width: 18px;
    height: 2px;
    border-radius: 2px;
    background: var(--text-secondary);
    transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
    transform-origin: center;
}

/* Hamburger → X animation */
.hamburger.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.hamburger.is-open span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.hamburger.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}


/* ——— MOBILE DRAWER ——— */
.mobile-drawer {
    display: none;
    flex-direction: column;
    gap: 4px;

    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 800;

    background: #ffffff;
    border-bottom: 2px solid var(--border);
    padding: 12px 20px 18px;

    box-shadow: var(--shadow-lg);

    /* Slide-in animation */
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 0.22s var(--ease), transform 0.22s var(--ease);
    pointer-events: none;
}

.market-header.drawer-open .mobile-drawer {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-md);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: background 0.15s var(--ease), color 0.15s var(--ease);
}

.mobile-nav-item:hover {
    background: var(--surface-soft);
    color: var(--text-primary);
}

.mobile-nav-icon {
    font-size: 1.1rem;
    width: 24px;
    text-align: center;
}

.mobile-drawer-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 0;
}

.mobile-cta {
    display: block;
    margin-top: 4px;
    padding: 12px 20px;
    border-radius: var(--radius-full);
    background: var(--brand-green);
    color: #ffffff;
    font-size: 0.88rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    transition: background 0.18s var(--ease);
}

.mobile-cta:hover {
    background: var(--brand-green-dark);
}

/* Backdrop */
.drawer-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 700;
    background: rgba(15, 23, 42, 0.25);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.22s var(--ease);
    pointer-events: none;
}

.drawer-backdrop.is-visible {
    opacity: 1;
    pointer-events: auto;
}


/* ================= MAIN ================= */
.market-main {
    min-height: calc(100vh - var(--header-h) - var(--stripe-h) - 140px);
    padding-top: 28px;
}

.market-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 24px 56px;
}


/* ================= FOOTER ================= */
.market-footer {
    background: var(--brand-navy);
    color: rgba(255, 255, 255, 0.72);
    margin-top: 60px;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 44px 28px 28px;

    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 40px;
    flex-wrap: wrap;
}

/* Brand column */
.footer-brand-col {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-brand-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: var(--radius-xs);
    opacity: 0.9;
    filter: brightness(0) invert(1);
}

.footer-brand-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.02em;
}

.footer-tagline {
    font-size: 0.76rem;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.45);
    font-style: italic;
    margin-left: 42px;
}

/* Links column */
.footer-links-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links-heading {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(255, 255, 255, 0.40);
}

.footer-links-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-link {
    font-size: 0.82rem;
    font-weight: 400;
    color: rgba(255, 255, 255, 0.62);
    text-decoration: none;
    transition: color 0.15s var(--ease);
    width: fit-content;
    position: relative;
}

.footer-link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--brand-green-light);
    transition: width 0.2s var(--ease);
}

.footer-link:hover {
    color: #ffffff;
}

.footer-link:hover::after {
    width: 100%;
}

/* Bottom bar */
.footer-bottom {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 16px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);

    font-size: 0.70rem;
    color: rgba(255, 255, 255, 0.30);
    font-weight: 400;
    text-align: center;
}


/* ================= SHARED CARD UTILITY ================= */
.card {
    background: var(--surface-card);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    padding: 20px;
    box-shadow: var(--shadow-xs);
    transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease);
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}


/* ================= SCROLLBAR ================= */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--brand-green);
    border-radius: var(--radius-full);
    opacity: 0.6;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--brand-green-dark);
}


/* ================= SCROLL SHADOW (JS hook) ================= */
.market-header.scrolled {
    box-shadow: 0 2px 20px rgba(15, 23, 42, 0.10);
}


/* ================= RESPONSIVE ================= */

/* Tablet */
@media (max-width: 1024px) {
    .header-inner {
        padding: 0 20px;
    }

    .header-tagline {
        font-size: 0.72rem;
    }

    .market-container {
        padding: 0 20px 40px;
    }

    .footer-inner {
        padding: 36px 20px 24px;
    }
}

/* Mobile */
@media (max-width: 768px) {

    /* Show hamburger, hide desktop nav */
    .hamburger {
        display: flex;
    }

    .header-nav {
        display: none;
    }

    .header-center {
        display: none;
    }

    /* Show mobile drawer */
    .mobile-drawer {
        display: flex;
    }

    .drawer-backdrop {
        display: block;
    }

    /* Tighter header */
    .header-inner {
        padding: 0 16px;
        height: 60px;
    }

    .header-logo {
        width: 32px;
        height: 32px;
    }

    .brand-name {
        font-size: 0.88rem;
    }

    /* Main content */
    .market-main {
        padding-top: 20px;
    }

    .market-container {
        padding: 0 14px 36px;
    }

    /* Footer */
    .market-footer {
        margin-top: 40px;
    }

    .footer-inner {
        padding: 32px 16px 20px;
        flex-direction: column;
        gap: 28px;
    }

    .footer-tagline {
        margin-left: 0;
    }

    .footer-bottom {
        padding: 14px 16px;
        text-align: center;
    }
}

/* Small mobile */
@media (max-width: 400px) {
    .brand-badge {
        display: none;
    }
}