/* =========================================================
   KANOMART
   CUSTOMER CATEGORIES / PRODUCT LISTING
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {

    box-sizing: border-box;

    margin: 0;

    padding: 0;

}


html {

    scroll-behavior: smooth;

}


body {

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #f7f9f8;

    color: #172033;

    min-height: 100vh;

    padding-bottom: 85px;

}


button,
input {

    font: inherit;

}


button {

    cursor: pointer;

}


/* =========================================================
   COLORS
========================================================= */

:root {

    --green: #0b7a3b;

    --green-dark: #075d2e;

    --green-light: #eaf7ef;

    --green-soft: #f0f8f3;

    --text: #172033;

    --muted: #7c8388;

    --border: #e2e7e4;

    --white: #ffffff;

    --danger: #e53935;

}


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

.categories-header {

    background: var(--white);

    position: sticky;

    top: 0;

    z-index: 100;

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

    padding:
        14px
        16px
        16px;

}


.header-top {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 12px;

}


.back-btn {

    width: 44px;

    height: 44px;

    border: 0;

    border-radius: 14px;

    background: var(--green-soft);

    color: var(--green);

    font-size: 27px;

    display: flex;

    align-items: center;

    justify-content: center;

}


.header-title {

    flex: 1;

    display: flex;

    align-items: center;

    gap: 10px;

}


.header-logo {

    width: 42px;

    height: 42px;

    border-radius: 12px;

    background: var(--green);

    color: white;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 23px;

    font-weight: 800;

}


.header-title h1 {

    font-size: 19px;

    font-weight: 800;

}


.header-title p {

    margin-top: 2px;

    color: var(--muted);

    font-size: 12px;

}


.header-cart-btn {

    width: 46px;

    height: 46px;

    border: 0;

    border-radius: 50%;

    background: var(--green-soft);

    font-size: 23px;

    position: relative;

}


.cart-count {

    position: absolute;

    top: -4px;

    right: -2px;

    min-width: 21px;

    height: 21px;

    padding: 0 5px;

    border-radius: 20px;

    background: var(--danger);

    color: white;

    font-size: 11px;

    font-weight: 800;

    display: flex;

    align-items: center;

    justify-content: center;

}


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

.categories-search {

    margin-top: 15px;

    height: 52px;

    background: #f4f6f5;

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

    border-radius: 17px;

    display: flex;

    align-items: center;

    padding-left: 14px;

    overflow: hidden;

}


.search-icon {

    font-size: 20px;

    margin-right: 9px;

}


.categories-search input {

    flex: 1;

    height: 100%;

    border: 0;

    outline: none;

    background: transparent;

    color: var(--text);

    font-size: 14px;

    min-width: 0;

}


.categories-search input::placeholder {

    color: #969d9e;

}


.search-btn {

    width: 50px;

    height: 100%;

    border: 0;

    background: var(--green);

    color: white;

    font-size: 18px;

}


/* =========================================================
   MAIN
========================================================= */

.categories-main {

    max-width: 1100px;

    margin: auto;

    padding:
        22px
        16px
        35px;

}


/* =========================================================
   INTRO
========================================================= */

.page-intro {

    margin-bottom: 25px;

}


.intro-label {

    display: inline-block;

    background: var(--green-light);

    color: var(--green);

    border-radius: 20px;

    padding:
        7px
        11px;

    font-size: 10px;

    font-weight: 800;

    letter-spacing: .6px;

}


.page-intro h2 {

    margin-top: 11px;

    font-size: 28px;

    line-height: 1.15;

}


.page-intro p {

    margin-top: 7px;

    color: var(--muted);

    font-size: 14px;

    line-height: 1.5;

}


/* =========================================================
   SECTION HEADING
========================================================= */

.section-heading,
.products-heading {

    display: flex;

    align-items: center;

    justify-content: space-between;

    gap: 10px;

    margin-bottom: 15px;

}


.section-heading h3,
.products-heading h3 {

    font-size: 21px;

    font-weight: 800;

}


.section-heading p,
.products-heading p {

    margin-top: 5px;

    color: var(--muted);

    font-size: 13px;

}


/* =========================================================
   CATEGORY GRID
========================================================= */

.categories-grid {

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    gap: 11px;

    margin-bottom: 34px;

}


.category-card {

    background: white;

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

    border-radius: 17px;

    min-height: 130px;

    padding: 12px 7px;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    text-align: center;

    transition: .2s ease;

}


.category-card:active {

    transform: scale(.96);

}


.category-card.active {

    border: 2px solid var(--green);

    background: var(--green-soft);

}


.category-icon {

    width: 58px;

    height: 58px;

    border-radius: 17px;

    background: #edf7f1;

    display: flex;

    align-items: center;

    justify-content: center;

    font-size: 29px;

    margin-bottom: 9px;

}


.category-card.active .category-icon {

    background: white;

}


.category-name {

    font-size: 13px;

    font-weight: 800;

    color: #26302f;

}


.category-number {

    margin-top: 4px;

    color: var(--muted);

    font-size: 11px;

}


/* =========================================================
   PRODUCT SECTION
========================================================= */

.products-section {

    margin-top: 5px;

}


.selected-category-label {

    display: inline-block;

    color: var(--green);

    font-size: 11px;

    font-weight: 800;

    text-transform: uppercase;

    letter-spacing: .5px;

    margin-bottom: 4px;

}


.clear-filter-btn {

    border: 0;

    background: var(--green-light);

    color: var(--green);

    padding:
        9px
        14px;

    border-radius: 20px;

    font-weight: 800;

    font-size: 12px;

}


/* =========================================================
   PRODUCT COUNT
========================================================= */

.product-count-row {

    color: var(--muted);

    font-size: 12px;

    margin-bottom: 12px;

}


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

.products-grid {

    display: grid;

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

    gap: 13px;

}


/* =========================================================
   PRODUCT CARD
========================================================= */

.customer-category-product-card {

    background: white;

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

    border-radius: 17px;

    overflow: hidden;

    min-width: 0;

    box-shadow:
        0 3px 12px
        rgba(0,0,0,.035);

}


.product-image-wrapper {

    width: 100%;

    height: 170px;

    background: #eef2f0;

    position: relative;

    overflow: hidden;

}


.product-image {

    width: 100%;

    height: 100%;

    object-fit: cover;

    display: block;

}


.product-badge {

    position: absolute;

    top: 9px;

    left: 9px;

    background: var(--green);

    color: white;

    border-radius: 20px;

    padding:
        5px
        8px;

    font-size: 9px;

    font-weight: 800;

}


.product-info {

    padding: 12px;

}


.product-category {

    color: var(--muted);

    font-size: 10px;

    font-weight: 600;

    text-transform: capitalize;

}


.product-name {

    margin-top: 5px;

    font-size: 15px;

    line-height: 1.25;

    font-weight: 800;

    min-height: 38px;

    color: #202a3b;

}


.product-price {

    display: block;

    margin-top: 8px;

    color: var(--green);

    font-size: 17px;

    font-weight: 900;

}


.product-seller {

    display: block;

    margin-top: 5px;

    color: var(--muted);

    font-size: 10px;

    white-space: nowrap;

    overflow: hidden;

    text-overflow: ellipsis;

}


.product-actions {

    display: flex;

    gap: 7px;

    margin-top: 11px;

}


.view-product-btn {

    flex: 1;

    min-width: 0;

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

    background: white;

    color: var(--green);

    border-radius: 10px;

    padding: 9px 5px;

    font-size: 11px;

    font-weight: 800;

}


.add-cart-btn {

    flex: 1;

    min-width: 0;

    border: 0;

    background: var(--green);

    color: white;

    border-radius: 10px;

    padding: 9px 5px;

    font-size: 11px;

    font-weight: 800;

}


.add-cart-btn:active,
.view-product-btn:active {

    transform: scale(.96);

}


/* =========================================================
   EMPTY
========================================================= */

.products-empty {

    background: white;

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

    border-radius: 20px;

    text-align: center;

    padding:
        45px
        20px;

}


.empty-icon {

    font-size: 45px;

}


.products-empty h3 {

    margin-top: 12px;

    font-size: 19px;

}


.products-empty p {

    margin-top: 6px;

    color: var(--muted);

    font-size: 13px;

    line-height: 1.5;

}


.show-all-btn {

    margin-top: 18px;

    border: 0;

    background: var(--green);

    color: white;

    border-radius: 12px;

    padding:
        12px
        18px;

    font-weight: 800;

}


/* =========================================================
   LOADING
========================================================= */

.category-loading,
.products-loading {

    grid-column: 1 / -1;

    min-height: 120px;

    display: flex;

    align-items: center;

    justify-content: center;

    gap: 10px;

    color: var(--muted);

    font-size: 13px;

}


.products-loading {

    min-height: 220px;

    flex-direction: column;

}


.loading-spinner {

    width: 25px;

    height: 25px;

    border-radius: 50%;

    border:
        3px solid #dfe8e3;

    border-top-color: var(--green);

    animation:
        spin .8s linear infinite;

}


@keyframes spin {

    to {

        transform: rotate(360deg);

    }

}


/* =========================================================
   ERROR
========================================================= */

.category-error,
.products-error {

    grid-column: 1 / -1;

    background: #fff5f5;

    border: 1px solid #ffd6d6;

    color: #b42318;

    border-radius: 15px;

    padding: 18px;

    text-align: center;

    font-size: 13px;

}


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

.bottom-nav {

    position: fixed;

    left: 0;

    right: 0;

    bottom: 0;

    height: 74px;

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

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

    display: grid;

    grid-template-columns:
        repeat(4, 1fr);

    z-index: 200;

}


.bottom-nav-item {

    border: 0;

    background: transparent;

    color: #818786;

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 3px;

    font-size: 11px;

    font-weight: 700;

}


.bottom-nav-item .nav-icon {

    font-size: 22px;

    line-height: 1;

}


.bottom-nav-item.active {

    color: var(--green);

}


/* =========================================================
   TABLET
========================================================= */

@media (min-width: 600px) {

    .categories-main {

        padding:
            30px
            25px
            50px;

    }


    .categories-grid {

        grid-template-columns:
            repeat(6, 1fr);

    }


    .products-grid {

        grid-template-columns:
            repeat(3, 1fr);

    }


    .product-image-wrapper {

        height: 200px;

    }

}


/* =========================================================
   DESKTOP
========================================================= */

@media (min-width: 900px) {

    body {

        padding-bottom: 20px;

    }


    .categories-header {

        position: relative;

    }


    .bottom-nav {

        display: none;

    }


    .categories-main {

        padding:
            40px
            30px
            60px;

    }


    .categories-grid {

        grid-template-columns:
            repeat(8, 1fr);

    }


    .products-grid {

        grid-template-columns:
            repeat(4, 1fr);

    }


    .product-image-wrapper {

        height: 220px;

    }


    .page-intro h2 {

        font-size: 34px;

    }

}
/* =========================================================
   KanoMart Customer Categories
   Product / Food Action Buttons
   ========================================================= */

.customer-category-product-card .product-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    width: 100%;
}


/* ---------------------------------------------------------
   VIEW BUTTON
   --------------------------------------------------------- */

.customer-category-product-card .view-product-btn,
.customer-category-product-card .view-food-btn {

    flex: 1;

    min-height: 42px;

    padding: 9px 12px;

    border: 1px solid #008f4c;

    border-radius: 10px;

    background: #ffffff;

    color: #008f4c;

    font-size: 15px;

    font-weight: 700;

    font-family: inherit;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;

}


/* ---------------------------------------------------------
   VIEW BUTTON HOVER / ACTIVE
   --------------------------------------------------------- */

.customer-category-product-card .view-product-btn:hover,
.customer-category-product-card .view-food-btn:hover {

    background: #008f4c;

    color: #ffffff;

}


.customer-category-product-card .view-product-btn:active,
.customer-category-product-card .view-food-btn:active {

    transform: scale(0.97);

}


/* ---------------------------------------------------------
   ADD TO CART BUTTON
   --------------------------------------------------------- */

.customer-category-product-card .add-cart-btn,
.customer-category-product-card .add-food-cart-btn {

    flex: 1;

    min-height: 42px;

    padding: 9px 12px;

    border: 1px solid #008f4c;

    border-radius: 10px;

    background: #008f4c;

    color: #ffffff;

    font-size: 15px;

    font-weight: 700;

    font-family: inherit;

    cursor: pointer;

    display: inline-flex;

    align-items: center;

    justify-content: center;

    transition:
        background 0.2s ease,
        transform 0.2s ease;

}


/* ---------------------------------------------------------
   ADD TO CART HOVER / ACTIVE
   --------------------------------------------------------- */

.customer-category-product-card .add-cart-btn:hover,
.customer-category-product-card .add-food-cart-btn:hover {

    background: #007a40;

}


.customer-category-product-card .add-cart-btn:active,
.customer-category-product-card .add-food-cart-btn:active {

    transform: scale(0.97);

}


/* ---------------------------------------------------------
   MOBILE
   --------------------------------------------------------- */

@media (max-width: 480px) {

    .customer-category-product-card .product-actions {

        gap: 7px;

        margin-top: 10px;

    }


    .customer-category-product-card .view-product-btn,
    .customer-category-product-card .view-food-btn,
    .customer-category-product-card .add-cart-btn,
    .customer-category-product-card .add-food-cart-btn {

        min-height: 40px;

        padding: 8px 8px;

        font-size: 14px;

        border-radius: 9px;

    }

}