:root {
    --primary: #1E40AF;
    --accent: #3B82F6;
    --bg: #F8FAFC;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #64748B;
    --border: #E2E8F0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --radius: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg);
    color: var(--text-main);
    line-height: 1.5;
    padding-bottom: 80px;
}


/* =========================
   HEADER
========================= */

.app-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    object-fit: cover;
}

.search-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    background: #F1F5F9;
    border: 1px solid transparent;
    padding: 10px 40px 10px 36px;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.2s;
    outline: none;
}

.search-input:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.search-icon {
    position: absolute;
    left: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.mic-btn {
    position: absolute;
    right: 12px;
    color: var(--primary);
    cursor: pointer;
    padding: 4px;
}

.mic-active {
    animation: pulse-red 1.5s infinite;
    color: #ef4444;
}

@keyframes pulse-red {

    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}


/* =========================
   SECTION LABEL
========================= */

.section-label {
    padding: 20px 16px 10px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
}


/* =========================
   CATEGORIES
========================= */

.categories-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    padding: 0 16px 20px;
}

.category-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 8px;
    text-align: center;
    text-decoration: none;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.cat-icon-wrapper {
    width: 44px;
    height: 44px;
    background: #EFF6FF;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 18px;
}

.category-card span {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-main);
}


/* =========================
   MORE CATEGORY BAR
========================= */

.more-categories-wrapper {
    padding: 0 16px 20px;
}

.more-categories-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: var(--shadow-sm);
}

.more-categories-btn:active {
    transform: scale(0.98);
}

.more-categories-btn:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-md);
    background: linear-gradient(to right, #ffffff, #f8faff);
}

.more-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 10px;
}

.more-icon {
    color: var(--primary);
    font-size: 16px;
    transition: transform 0.3s ease;
}

.more-categories-btn:hover .more-icon {
    transform: translateX(5px);
}


/* =========================
   DIVIDER
========================= */

.divider {
    height: 1px;
    background: var(--border);
    margin: 0 16px 20px;
}


/* =========================
   PRODUCTS
========================= */

.products-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    padding: 0 16px;
}

.product-node {
    background: var(--surface);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-sm);
}

.product-thumb {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    background: #f8f8f8;
}

.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-price {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 800;
    font-size: 15px;
    color: var(--text-main);
    margin-bottom: 4px;
}

.product-name {
    font-size: 13px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 12px;
}

.action-btn {
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    text-decoration: none;
    font-size: 12px;
    font-weight: 600;
    transition: 0.2s;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: #1e3a8a;
}

.btn-outline {
    border: 1px solid var(--primary);
    color: var(--primary);
}


/* =========================
   BOTTOM NAVIGATION
========================= */

.bottom-bar {
    position: fixed;
    bottom: 0;
    width: 100%;
    height: 65px;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    align-items: center;
    border-top: 1px solid var(--border);
    z-index: 1001;
}

.nav-link {
    text-decoration: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 500;
}

.nav-link i {
    font-size: 18px;
}

.nav-link.active {
    color: var(--primary);
}

.sell-fab {
    background: var(--primary);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff !important;
    margin-top: -35px;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
    border: 4px solid var(--bg);
}


/* =========================
   DESKTOP RESPONSIVE
========================= */

@media (min-width: 768px) {

    .products-layout {
        grid-template-columns: repeat(4, 1fr);
    }

    .categories-container {
        grid-template-columns: repeat(8, 1fr);
    }

    .app-header {
        padding: 15px 10%;
    }

    .categories-container,
    .products-layout,
    .section-label,
    .divider {
        padding-left: 10%;
        padding-right: 10%;
    }

    .more-categories-wrapper {
        padding-left: 10%;
        padding-right: 10%;
    }
}