/* ================================================================
   DUKA SOFTI — design tokens
   Palette: deep navy ink, electric blue accent, sky tint, white
   Type: Space Grotesk (display) / Inter (body) / Space Mono (codes)
   Signature: every product & payment moment is framed like an
   M-Pesa confirmation receipt / STK prompt, in blue instead of green.
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@500;600;700&family=Inter:wght@400;500;600;700&family=Space+Mono:wght@400;700&display=swap');

:root {
    --ink: #0A2540;
    --blue: #0F6FFF;
    --blue-deep: #0B4FCC;
    --sky: #EAF2FF;
    --sky-soft: #F5F9FF;
    --white: #FFFFFF;
    --line: #C9DBFF;
    --success: #1FA463;
    --danger: #E0473C;
    --shadow: 0 20px 40px -18px rgba(10, 37, 64, 0.25);
    --radius: 18px;
    --font-display: 'Space Grotesk', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-mono: 'Space Mono', monospace;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-body);
    background: var(--sky-soft);
    color: var(--ink);
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }

:focus-visible {
    outline: 3px solid var(--blue);
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------------------------------------------------------------
   NAVBAR
--------------------------------------------------------------- */
.navbar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}

.navbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    color: var(--ink);
}

.logo .dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 5px var(--sky);
}

.nav-links {
    display: flex;
    gap: 28px;
    font-weight: 600;
    font-size: 15px;
}

.nav-links a {
    color: var(--ink);
    opacity: 0.7;
    transition: opacity .2s;
}
.nav-links a:hover { opacity: 1; }

.cart-btn {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--ink);
    color: var(--white);
    border: none;
    padding: 11px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    transition: transform .15s, background .2s;
}
.cart-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }

.cart-badge {
    background: var(--blue);
    color: var(--white);
    font-family: var(--font-mono);
    font-size: 11px;
    min-width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ---------------------------------------------------------------
   HERO — the "STK prompt" thesis statement
--------------------------------------------------------------- */
.hero {
    position: relative;
    overflow: hidden;
    padding: 72px 0 60px;
    background:
        radial-gradient(circle at 85% 20%, rgba(15,111,255,0.14), transparent 55%),
        linear-gradient(180deg, #FFFFFF, #F5F9FF);
}

.hero-inner {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: 56px;
    align-items: center;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.06em;
    color: var(--blue-deep);
    background: var(--sky);
    border: 1px solid var(--line);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 22px;
}

.eyebrow .pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 0 rgba(31,164,99, .6);
    animation: pulse 2s infinite;
}
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(31,164,99, .5); }
    70% { box-shadow: 0 0 0 8px rgba(31,164,99, 0); }
    100% { box-shadow: 0 0 0 0 rgba(31,164,99, 0); }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(34px, 4.6vw, 54px);
    line-height: 1.08;
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}

.hero h1 span { color: var(--blue); }

.hero p.lede {
    font-size: 17px;
    line-height: 1.6;
    color: #33465C;
    max-width: 480px;
    margin-bottom: 28px;
}

.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 15px;
    border: none;
    transition: transform .15s ease, box-shadow .2s ease, background .2s;
}
.btn-primary {
    background: var(--blue);
    color: var(--white);
    box-shadow: 0 12px 24px -10px rgba(15,111,255,0.55);
}
.btn-primary:hover { transform: translateY(-2px); background: var(--blue-deep); }
.btn-ghost {
    background: var(--white);
    color: var(--ink);
    border: 1.5px solid var(--line);
}
.btn-ghost:hover { border-color: var(--blue); color: var(--blue-deep); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.hero-stats {
    display: flex;
    gap: 28px;
    margin-top: 36px;
}
.hero-stats div strong {
    display: block;
    font-family: var(--font-mono);
    font-size: 22px;
    color: var(--ink);
}
.hero-stats div span {
    font-size: 12px;
    color: #6B7C93;
}

/* --- The phone mockup: a stylised STK push prompt --- */
.phone {
    position: relative;
    margin-left: auto;
    width: 300px;
    background: var(--ink);
    border-radius: 40px;
    padding: 14px;
    box-shadow: var(--shadow);
    transform: rotate(2deg);
}
.phone-notch {
    width: 90px;
    height: 22px;
    background: var(--ink);
    border-radius: 0 0 14px 14px;
    margin: 0 auto;
    position: relative;
    top: 0;
}
.phone-screen {
    background: linear-gradient(180deg, #0F1D30, #0A2540);
    border-radius: 28px;
    padding: 22px 18px 26px;
    min-height: 420px;
    display: flex;
    flex-direction: column;
}
.phone-time {
    color: rgba(255,255,255,0.6);
    font-family: var(--font-mono);
    font-size: 12px;
    text-align: center;
    margin-bottom: 22px;
}
.stk-card {
    background: var(--white);
    border-radius: 16px;
    padding: 18px;
    margin-top: auto;
    animation: rise .6s ease;
}
@keyframes rise {
    from { opacity: 0; transform: translateY(16px); }
    to { opacity: 1; transform: translateY(0); }
}
.stk-card .stk-app {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--blue-deep);
    margin-bottom: 10px;
}
.stk-card .stk-app .sq {
    width: 16px; height: 16px; border-radius: 4px; background: var(--blue);
}
.stk-card p {
    font-size: 13px;
    line-height: 1.55;
    margin: 0 0 12px;
    color: var(--ink);
}
.stk-card .stk-amount {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--blue-deep);
}
.pin-dots {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 14px 0;
}
.pin-dots span {
    width: 12px; height: 12px; border-radius: 50%;
    background: var(--sky);
    border: 1.5px solid var(--line);
}
.pin-dots span.filled { background: var(--blue); border-color: var(--blue); }

/* ---------------------------------------------------------------
   SECTION HEADINGS
--------------------------------------------------------------- */
.section { padding: 64px 0; }
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 34px;
    gap: 20px;
    flex-wrap: wrap;
}
.section-head h2 {
    font-family: var(--font-display);
    font-size: 30px;
    margin: 0 0 6px;
}
.section-head p { margin: 0; color: #6B7C93; font-size: 15px; }

/* ---------------------------------------------------------------
   CATEGORY FILTER PILLS
--------------------------------------------------------------- */
.filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 34px;
}
.filter-pill {
    background: var(--white);
    border: 1.5px solid var(--line);
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--ink);
    transition: all .15s;
}
.filter-pill:hover { border-color: var(--blue); }
.filter-pill.active { background: var(--ink); color: var(--white); border-color: var(--ink); }

/* ---------------------------------------------------------------
   PRODUCT CARD — simple centered card (dukafresh-style)
--------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}

.product-card {
    background: var(--white);
    border-radius: 16px;
    border: 1px solid var(--line);
    padding: 24px 20px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: transform .2s ease, box-shadow .2s ease;
    position: relative;
}
.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.product-icon {
    font-size: 38px;
    line-height: 1;
    margin-bottom: 14px;
}

.badge {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--blue);
    color: var(--white);
    font-size: 10.5px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: 0.02em;
}

.product-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.product-body h3 {
    font-family: var(--font-display);
    font-size: 16.5px;
    margin: 0;
}
.product-body .short-desc {
    font-size: 13px;
    color: #6B7C93;
    line-height: 1.5;
    margin: 0 0 6px;
}

.price-row {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
    font-family: var(--font-mono);
}
.price-row .price { font-size: 19px; font-weight: 700; color: var(--blue-deep); }
.price-row .old-price { font-size: 13px; color: #A9B7C7; text-decoration: line-through; }

.add-btn {
    margin-top: 12px;
    width: 100%;
    background: var(--blue);
    color: var(--white);
    border: none;
    padding: 12px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 10px 20px -10px rgba(15,111,255,0.5);
    transition: background .2s, transform .15s;
}
.add-btn:hover { background: var(--blue-deep); transform: translateY(-1px); }
.add-btn.added { background: var(--success); box-shadow: none; }

/* ---------------------------------------------------------------
   TRUST STRIP
--------------------------------------------------------------- */
.trust-strip {
    background: var(--ink);
    color: var(--white);
    padding: 44px 0;
}
.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}
.trust-item { display: flex; gap: 14px; align-items: flex-start; }
.trust-item .ic { font-size: 24px; }
.trust-item h4 { margin: 0 0 4px; font-family: var(--font-display); font-size: 15px; }
.trust-item p { margin: 0; font-size: 13px; color: #A9C0DE; line-height: 1.5; }

/* ---------------------------------------------------------------
   CART DRAWER
--------------------------------------------------------------- */
.overlay {
    position: fixed; inset: 0;
    background: rgba(10,37,64,0.45);
    backdrop-filter: blur(2px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s;
}
.overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
    position: fixed;
    top: 0; right: 0;
    height: 100%;
    width: min(420px, 100%);
    background: var(--white);
    z-index: 100;
    box-shadow: -20px 0 50px rgba(10,37,64,0.2);
    transform: translateX(100%);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
    display: flex;
    flex-direction: column;
}
.drawer.open { transform: translateX(0); }

.drawer-head {
    padding: 22px 22px 16px;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.drawer-head h3 { font-family: var(--font-display); margin: 0; font-size: 19px; }
.close-btn {
    background: var(--sky);
    border: none;
    width: 34px; height: 34px;
    border-radius: 50%;
    font-size: 16px;
    color: var(--ink);
}

.drawer-items { flex: 1; overflow-y: auto; padding: 12px 22px; }

.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px dashed var(--line);
}
.cart-item .ic {
    width: 44px; height: 44px;
    background: var(--sky);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .info h5 { margin: 0 0 4px; font-size: 14px; }
.cart-item .info .unit { font-size: 12px; color: #6B7C93; font-family: var(--font-mono); }

.qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--sky-soft);
    border-radius: 999px;
    padding: 4px 6px;
}
.qty-control button {
    width: 22px; height: 22px;
    border-radius: 50%;
    border: none;
    background: var(--white);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    font-weight: 700;
    color: var(--ink);
}
.qty-control span { font-family: var(--font-mono); font-size: 13px; min-width: 14px; text-align: center; }

.empty-cart {
    text-align: center;
    padding: 60px 20px;
    color: #8FA3BC;
}
.empty-cart .big { font-size: 44px; margin-bottom: 12px; }

.drawer-foot {
    padding: 18px 22px 24px;
    border-top: 1px solid var(--line);
    background: var(--sky-soft);
}
.drawer-foot .total-row {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 15px;
    margin-bottom: 14px;
}
.drawer-foot .total-row strong { font-size: 20px; color: var(--blue-deep); }

/* ---------------------------------------------------------------
   CHECKOUT MODAL — the STK push moment
--------------------------------------------------------------- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(10,37,64,0.55);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
    background: var(--white);
    border-radius: 22px;
    width: 100%;
    max-width: 420px;
    padding: 30px 28px 28px;
    position: relative;
    box-shadow: 0 30px 70px rgba(10,37,64,0.4);
    animation: pop .25s ease;
}
@keyframes pop {
    from { opacity: 0; transform: scale(0.94); }
    to { opacity: 1; transform: scale(1); }
}

.modal h3 { font-family: var(--font-display); margin: 0 0 4px; font-size: 21px; }
.modal .sub { color: #6B7C93; font-size: 13.5px; margin: 0 0 20px; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; margin-bottom: 6px; color: var(--ink); }
.field input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    font-size: 14.5px;
    font-family: inherit;
    background: var(--sky-soft);
}
.field input:focus { border-color: var(--blue); background: var(--white); }
.field small { color: #8FA3BC; font-size: 11.5px; }

.modal-close {
    position: absolute; top: 18px; right: 18px;
    background: var(--sky); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 15px; color: var(--ink);
}

.form-error {
    background: #FDEDEC;
    color: var(--danger);
    font-size: 13px;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 14px;
    display: none;
}
.form-error.show { display: block; }

/* --- STK waiting state --- */
.stk-wait { text-align: center; padding: 10px 0 4px; }
.stk-wait .phone-anim {
    width: 74px; height: 74px;
    margin: 0 auto 20px;
    border-radius: 50%;
    background: var(--sky);
    display: flex; align-items: center; justify-content: center;
    font-size: 32px;
    position: relative;
}
.stk-wait .phone-anim::before {
    content: '';
    position: absolute; inset: -8px;
    border-radius: 50%;
    border: 3px solid var(--line);
    border-top-color: var(--blue);
    animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.stk-wait h4 { font-family: var(--font-display); margin: 0 0 8px; }
.stk-wait p { color: #6B7C93; font-size: 14px; line-height: 1.6; margin: 0 0 6px; }
.stk-wait .code { font-family: var(--font-mono); font-size: 13px; color: var(--blue-deep); background: var(--sky); display: inline-block; padding: 6px 12px; border-radius: 8px; margin-top: 10px;}
.stk-wait .timer { font-family: var(--font-mono); font-size: 12px; color: #8FA3BC; margin-top: 14px; }

/* --- Success / receipt state --- */
.receipt {
    text-align: center;
}
.receipt .check {
    width: 70px; height: 70px;
    background: var(--success);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: white; font-size: 32px;
    margin: 0 auto 18px;
    animation: pop .3s ease;
}
.receipt h4 { font-family: var(--font-display); margin: 0 0 6px; font-size: 20px; }
.receipt p { color: #6B7C93; font-size: 14px; margin: 0 0 18px; }

.receipt-slip {
    background: var(--sky-soft);
    border: 1.5px dashed var(--line);
    border-radius: 14px;
    padding: 16px 18px;
    text-align: left;
    font-family: var(--font-mono);
    font-size: 12.5px;
    margin-bottom: 18px;
}
.receipt-slip .r-row { display: flex; justify-content: space-between; padding: 5px 0; }
.receipt-slip .r-row.total { border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 10px; font-weight: 700; color: var(--blue-deep); }

/* --- Failure state --- */
.fail-icon {
    width: 70px; height: 70px;
    background: #FDEDEC;
    color: var(--danger);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 30px;
    margin: 0 auto 18px;
}

/* ---------------------------------------------------------------
   FOOTER
--------------------------------------------------------------- */
footer {
    background: var(--ink);
    color: #A9C0DE;
    padding: 50px 0 26px;
    margin-top: 40px;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr;
    gap: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-top .logo { color: var(--white); margin-bottom: 10px; }
.footer-top p { font-size: 13.5px; line-height: 1.6; max-width: 320px; }
.footer-top h5 { color: var(--white); font-size: 14px; margin: 0 0 12px; }
.footer-top ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.footer-bottom {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 20px; font-size: 12.5px; flex-wrap: wrap; gap: 10px;
}

/* ---------------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------------- */
@media (max-width: 880px) {
    .hero-inner { grid-template-columns: 1fr; }
    .phone { margin: 0 auto; transform: none; }
    .nav-links { display: none; }
    .footer-top { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}
