:root {
    --primary: #00b14f;
    --primary-dark: #008f40;
    --primary-soft: #e9fff2;
    --secondary: #111827;
    --bg: #f6f8fb;
    --surface: #ffffff;
    --surface-2: #f9fafb;
    --text: #111827;
    --text-soft: #667085;
    --muted: #98a2b3;
    --border: #eaecf0;
    --danger: #ef4444;
    --success: #12b76a;
    --warning: #f79009;

    --shadow-sm: 0 2px 8px rgba(16, 24, 40, .05);
    --shadow: 0 8px 30px rgba(16, 24, 40, .07);
    --shadow-lg: 0 18px 50px rgba(16, 24, 40, .11);

    --radius: 18px;
    --radius-sm: 12px;
    --radius-lg: 24px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family:
        Inter,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    background:
        radial-gradient(
            circle at top left,
            rgba(0, 177, 79, .07),
            transparent 30%
        ),
        var(--bg);

    color: var(--text);
    line-height: 1.5;
    padding-bottom: 92px;
    -webkit-font-smoothing: antialiased;
}

/* =========================
   HEADER
========================= */

.header {
    position: sticky;
    top: 0;
    z-index: 1000;

    background: rgba(255, 255, 255, .86);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);

    border-bottom: 1px solid rgba(234, 236, 240, .8);
}

.header-content {
    max-width: 1180px;
    margin: auto;

    height: 68px;
    padding: 0 20px;

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

.logo {
    font-size: 23px;
    font-weight: 850;
    letter-spacing: -.8px;
    color: var(--text);
}

.logo span {
    color: var(--primary);
}

.btn-admin {
    width: 42px;
    height: 42px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--surface);
    color: var(--text);

    border: 1px solid var(--border);
    border-radius: 50%;

    text-decoration: none;
    font-size: 17px;

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

    transition: .25s ease;
}

.btn-admin:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    color: var(--primary);
}

/* =========================
   HERO
========================= */

.hero {
    position: relative;
    overflow: hidden;

    max-width: 1180px;
    margin: 18px auto 0;

    padding: 42px 28px;

    border-radius: var(--radius-lg);

    background:
        radial-gradient(
            circle at 85% 20%,
            rgba(255,255,255,.18),
            transparent 25%
        ),
        linear-gradient(
            135deg,
            #00a943 0%,
            #00c853 55%,
            #08d66b 100%
        );

    color: white;

    box-shadow:
        0 20px 50px rgba(0, 177, 79, .18);
}

.hero::before {
    content: "";
    position: absolute;

    width: 180px;
    height: 180px;

    right: -60px;
    top: -80px;

    border-radius: 50%;

    background: rgba(255,255,255,.10);
}

.hero::after {
    content: "";
    position: absolute;

    width: 100px;
    height: 100px;

    left: 35%;
    bottom: -60px;

    border-radius: 50%;

    background: rgba(255,255,255,.08);
}

.hero h1,
.hero p {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 850;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.hero p {
    font-size: 15px;
    opacity: .9;
}

/* =========================
   CONTAINER
========================= */

.container {
    width: 100%;
    max-width: 1180px;

    margin: auto;
    padding: 0 20px;
}

/* =========================
   SEARCH
========================= */

.search-container {
    position: relative;
    z-index: 10;

    margin: -27px auto 18px;

    max-width: 760px;
}

.search-container form {
    position: relative;
}

.search-input {
    width: 100%;
    height: 58px;

    padding: 0 22px 0 52px;

    background: rgba(255,255,255,.97);

    border: 1px solid rgba(255,255,255,.8);
    border-radius: 18px;

    font-size: 15px;
    color: var(--text);

    outline: none;

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

    transition: .25s ease;
}

.search-input::placeholder {
    color: var(--muted);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow:
        0 0 0 4px rgba(0,177,79,.10),
        var(--shadow-lg);
}

/* =========================
   CATEGORIES
========================= */

.categories {
    display: flex;
    gap: 9px;

    overflow-x: auto;

    padding: 4px 1px 18px;

    scrollbar-width: none;
}

.categories::-webkit-scrollbar {
    display: none;
}

.category-pill {
    flex: 0 0 auto;

    padding: 9px 15px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: 999px;

    color: var(--text-soft);

    font-size: 13px;
    font-weight: 650;

    text-decoration: none;

    transition: .2s ease;
}

.category-pill:hover {
    border-color: rgba(0,177,79,.4);
    color: var(--primary);
    transform: translateY(-1px);
}

.category-pill.active {
    background: var(--primary);
    border-color: var(--primary);

    color: white;

    box-shadow:
        0 5px 15px rgba(0,177,79,.22);
}

/* =========================
   PRODUCT GRID
========================= */

.product-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fill, minmax(175px, 1fr));

    gap: 15px;

    padding-bottom: 20px;
}

.product-card {
    position: relative;

    overflow: hidden;

    display: block;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius);

    color: var(--text);
    text-decoration: none;

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

    transition:
        transform .25s ease,
        box-shadow .25s ease,
        border-color .25s ease;
}

.product-card:hover {
    transform: translateY(-5px);

    border-color: rgba(0,177,79,.25);

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

/* =========================
   PRODUCT IMAGE
========================= */

.product-image {
    position: relative;

    width: 100%;
    height: 165px;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(
            135deg,
            #f2f4f7,
            #eaecf0
        );

    font-size: 46px;
}

.product-image img {
    width: 100%;
    height: 100%;

    object-fit: cover;

    transition: transform .45s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.06);
}

/* =========================
   BADGE
========================= */

.product-badge {
    position: absolute;

    top: 10px;
    right: 10px;

    min-width: 30px;
    height: 30px;

    padding: 0 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 999px;

    font-size: 11px;
    font-weight: 750;

    backdrop-filter: blur(10px);
}

.badge-available {
    background: rgba(18,183,106,.12);
    color: #067647;

    border: 1px solid rgba(18,183,106,.2);
}

.badge-unavailable {
    background: rgba(239,68,68,.10);
    color: #b42318;

    border: 1px solid rgba(239,68,68,.18);
}

/* =========================
   PRODUCT INFO
========================= */

.product-info {
    padding: 14px;
}

.product-name {
    font-size: 14px;
    font-weight: 750;

    line-height: 1.35;

    margin-bottom: 5px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    min-height: 18px;

    color: var(--text-soft);

    font-size: 11.5px;

    margin-bottom: 8px;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    color: var(--primary);

    font-size: 16px;
    font-weight: 850;

    letter-spacing: -.3px;
}

.product-stock {
    margin-top: 4px;

    color: var(--muted);

    font-size: 10.5px;
}

/* =========================
   BOTTOM NAV
========================= */

.bottom-nav {
    position: fixed;

    left: 50%;
    bottom: 14px;

    transform: translateX(-50%);

    width: min(430px, calc(100% - 24px));

    height: 66px;

    padding: 7px;

    display: flex;
    align-items: center;
    justify-content: space-around;

    background: rgba(255,255,255,.88);

    border: 1px solid rgba(234,236,240,.9);
    border-radius: 22px;

    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);

    box-shadow:
        0 15px 45px rgba(16,24,40,.15);

    z-index: 9999;
}

.bottom-nav a {
    position: relative;

    min-width: 75px;
    height: 52px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 1px;

    color: var(--text-soft);

    text-decoration: none;

    border-radius: 16px;

    transition: .2s ease;
}

.bottom-nav a.active {
    color: var(--primary);
    background: var(--primary-soft);
}

.bottom-nav a:hover {
    color: var(--primary);
}

.bottom-nav a .nav-icon {
    font-size: 20px;
    line-height: 22px;
}

.bottom-nav a span:last-child {
    font-size: 10px;
    font-weight: 700;
}

/* =========================
   FORMS
========================= */

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;

    margin-bottom: 7px;

    color: var(--text);

    font-size: 13px;
    font-weight: 700;
}

.form-input {
    width: 100%;
    height: 48px;

    padding: 0 14px;

    background: var(--surface);

    border: 1px solid var(--border);
    border-radius: var(--radius-sm);

    color: var(--text);

    font-size: 14px;

    outline: none;

    transition: .2s ease;
}

.form-input:focus {
    border-color: var(--primary);

    box-shadow:
        0 0 0 4px rgba(0,177,79,.08);
}

.btn-primary {
    width: 100%;

    min-height: 50px;

    border: none;
    border-radius: var(--radius-sm);

    background:
        linear-gradient(
            135deg,
            var(--primary),
            #00c853
        );

    color: white;

    font-size: 14px;
    font-weight: 750;

    cursor: pointer;

    box-shadow:
        0 8px 20px rgba(0,177,79,.18);

    transition: .25s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);

    box-shadow:
        0 12px 25px rgba(0,177,79,.25);
}

.btn-primary:disabled {
    background: #d0d5dd;
    box-shadow: none;
    cursor: not-allowed;
}

/* =========================
   INVOICE
========================= */

.invoice-container {
    max-width: 600px;

    margin: 40px auto;

    padding: 30px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius-lg);

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

    text-align: center;
}

.invoice-title {
    color: var(--primary);

    font-size: 25px;
    font-weight: 850;
}

.invoice-code {
    margin: 18px 0;

    padding: 15px;

    background: var(--primary-soft);

    border: 1px dashed rgba(0,177,79,.3);

    border-radius: var(--radius-sm);

    color: var(--primary);

    font-weight: 800;
}

.success-icon {
    width: 76px;
    height: 76px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--success);

    border-radius: 50%;

    color: white;

    font-size: 35px;

    box-shadow:
        0 12px 30px rgba(18,183,106,.2);
}

/* =========================
   ADMIN
========================= */

.admin-header {
    min-height: 68px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #101828;
    color: white;
}

.admin-content {
    max-width: 1200px;

    margin: auto;

    padding: 24px 20px;
}

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(auto-fit, minmax(200px, 1fr));

    gap: 16px;

    margin-bottom: 24px;
}

.stat-card {
    padding: 20px;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}

.stat-value {
    color: var(--primary);

    font-size: 28px;
    font-weight: 850;
}

.stat-label {
    color: var(--text-soft);

    font-size: 13px;
}

.table-container {
    overflow-x: auto;

    background: var(--surface);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow-sm);
}

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

th,
td {
    padding: 13px 16px;

    text-align: left;

    border-bottom: 1px solid var(--border);
}

th {
    background: var(--surface-2);

    color: var(--text-soft);

    font-size: 12px;
    font-weight: 750;
}

/* =========================
   MOBILE
========================= */

@media (max-width: 700px) {

    body {
        padding-bottom: 96px;
    }

    .header-content {
        height: 62px;
        padding: 0 16px;
    }

    .logo {
        font-size: 21px;
    }

    .hero {
        margin: 10px 12px 0;

        padding: 32px 20px;

        border-radius: 22px;
    }

    .hero h1 {
        font-size: 26px;
    }

    .hero p {
        font-size: 13px;
    }

    .container {
        padding: 0 12px;
    }

    .search-container {
        margin-top: -22px;
    }

    .search-input {
        height: 54px;
        border-radius: 17px;
    }

    .categories {
        margin-left: 0;
        margin-right: 0;
        padding-bottom: 15px;
    }

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

        gap: 10px;
    }

    .product-image {
        height: 135px;
    }

    .product-info {
        padding: 11px;
    }

    .product-name {
        font-size: 13px;
    }

    .product-price {
        font-size: 15px;
    }

    .bottom-nav {
        bottom: 10px;
    }
}

/* =========================
   VERY SMALL SCREEN
========================= */

@media (max-width: 360px) {

    .product-grid {
        gap: 8px;
    }

    .product-image {
        height: 120px;
    }

    .product-info {
        padding: 9px;
    }

    .product-name {
        font-size: 12px;
    }

    .product-price {
        font-size: 14px;
    }

    .bottom-nav a {
        min-width: 65px;
    }
}

/* =========================
   REDUCED MOTION
========================= */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}