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

body {
    font-family: Arial, Helvetica, sans-serif;
    background: #f7f7f7;
    color: #222;
}


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

.top-header {
    height: 70px;
    background: #ffffff;
    border-bottom: 1px solid #e8e8e8;

    display: flex;
    align-items: center;

    padding: 10px 4%;

    gap: 30px;

    position: sticky;
    top: 0;
    z-index: 100;
}

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

    min-width: 190px;
}

.brand-icon {
    width: 42px;
    height: 42px;

    background: #00a651;
    color: white;

    border-radius: 10px;

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

    font-size: 22px;
    font-weight: bold;
}

.brand h1 {
    font-size: 19px;
}

.brand span {
    display: block;

    font-size: 11px;
    color: #777;

    margin-top: 3px;
}


.header-search {
    flex: 1;

    max-width: 650px;

    height: 44px;

    background: #f4f4f4;

    border-radius: 10px;

    display: flex;
    align-items: center;

    padding: 0 15px;

    gap: 10px;
}

.header-search input {
    border: none;
    outline: none;

    background: transparent;

    width: 100%;

    font-size: 14px;
}


.notification-button {
    margin-left: auto;

    width: 45px;
    height: 45px;

    border: none;

    background: #f4f4f4;

    color: #333;

    border-radius: 10px;

    font-size: 20px;

    cursor: pointer;

    position: relative;

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

.notification-button:hover {
    background: #e9e9e9;
}

.notification-count {
    position: absolute;

    right: -5px;
    top: -5px;

    min-width: 19px;
    height: 19px;

    padding: 0 4px;

    background: #ff3b30;

    color: white;

    border-radius: 50%;

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

    display: none;

    align-items: center;
    justify-content: center;
}
.cart-button {
    margin-left: auto;

    width: 45px;
    height: 45px;

    border: none;

    background: #00a651;

    color: white;

    border-radius: 10px;

    font-size: 20px;

    cursor: pointer;

    position: relative;
}

.cart-count {
    position: absolute;

    right: -5px;
    top: -5px;

    width: 19px;
    height: 19px;

    background: #ff3b30;

    border-radius: 50%;

    font-size: 11px;

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


/* =========================
   HORIZONTAL MENU
========================= */

.main-menu {
    background: white;

    border-bottom: 1px solid #e5e5e5;

    height: 58px;

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

    gap: 45px;

    position: sticky;
    top: 70px;

    z-index: 90;
}

.menu-item {
    height: 58px;

    display: flex;
    align-items: center;

    gap: 7px;

    text-decoration: none;

    color: #666;

    font-size: 14px;

    border-bottom: 3px solid transparent;

    transition: 0.2s;
}

.menu-item span {
    font-size: 17px;
}

.menu-item:hover,
.menu-item.active {
    color: #00a651;

    border-bottom-color: #00a651;
}


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

.app-container {
    max-width: 1250px;

    margin: auto;

    padding: 20px 20px 60px;
}


/* =========================
   MARKET
========================= */

.market-selector {
    background: white;

    padding: 15px 18px;

    border-radius: 12px;

    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-bottom: 20px;

    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.market-selector small {
    display: block;

    color: #999;

    font-size: 10px;

    margin-bottom: 3px;
}

.market-selector strong {
    font-size: 14px;
}

.market-selector select {
    border: 1px solid #ddd;

    border-radius: 8px;

    padding: 9px 12px;

    background: white;

    outline: none;
}


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

.hero-banner {
    min-height: 220px;

    border-radius: 18px;

    overflow: hidden;

    background: linear-gradient(
        120deg,
        #00a651,
        #008f45
    );

    color: white;

    display: flex;

    align-items: center;

    padding: 35px;

    margin-bottom: 30px;
}

.hero-content small {
    font-size: 11px;

    letter-spacing: 1px;

    opacity: 0.9;
}

.hero-content h2 {
    font-size: 32px;

    line-height: 1.2;

    margin: 10px 0;
}

.hero-content p {
    font-size: 14px;

    max-width: 500px;

    opacity: 0.9;
}


/* =========================
   SECTIONS
========================= */

.categories-section,
.products-section {
    margin-bottom: 35px;
}

.section-heading {
    display: flex;

    justify-content: space-between;

    align-items: center;

    margin-bottom: 15px;
}

.section-heading h2 {
    font-size: 20px;
}

.section-heading a,
.section-heading span {
    font-size: 13px;

    color: #00a651;

    text-decoration: none;
}


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

.category-list {
    display: flex;

    gap: 15px;

    overflow-x: auto;

    padding-bottom: 5px;
}

.category-card {
    min-width: 130px;

    height: 115px;

    background: white;

    border: none;

    border-radius: 13px;

    cursor: pointer;

    box-shadow: 0 2px 8px rgba(0,0,0,0.04);

    display: flex;

    flex-direction: column;

    align-items: center;

    justify-content: center;

    gap: 10px;
}

.category-icon {
    width: 55px;
    height: 55px;

    background: #f2fff7;

    border-radius: 50%;

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

    font-size: 28px;
}

.category-card span {
    font-size: 13px;

    font-weight: 600;
}


/* =========================
   PRODUCTS
========================= */

.products-grid {
    display: grid;

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

    gap: 15px;
}

.product-card {
    background: white;

    border-radius: 14px;

    padding: 12px;

    min-height: 260px;

    box-shadow: 0 2px 8px rgba(0,0,0,0.04);

    display: flex;

    flex-direction: column;
}

.product-image {
    height: 145px;

    border-radius: 10px;

    background: #f5f5f5;

    display: flex;

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

    overflow: hidden;

    margin-bottom: 10px;
}

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

    object-fit: contain;
}

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

    font-weight: 600;

    line-height: 1.3;

    margin-bottom: 5px;
}

.product-unit {
    font-size: 11px;

    color: #888;

    margin-bottom: auto;
}

.product-bottom {
    display: flex;

    align-items: center;

    justify-content: space-between;

    margin-top: 12px;
}

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

    font-weight: bold;
}

.add-button {
    border: 1px solid #00a651;

    background: white;

    color: #00a651;

    padding: 7px 15px;

    border-radius: 7px;

    font-size: 12px;

    font-weight: bold;

    cursor: pointer;
}

.add-button:hover {
    background: #00a651;

    color: white;
}

.loading-products {
    grid-column: 1 / -1;

    text-align: center;

    padding: 50px;

    color: #777;

    background: white;

    border-radius: 12px;
}


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

.mobile-cart-bar {
    display: none;
}


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

@media (max-width: 900px) {

    .products-grid {
        grid-template-columns:
            repeat(3, minmax(0, 1fr));
    }

    .top-header {
        padding: 10px 15px;
        gap: 10px;
    }

    .header-search {
        max-width: none;
    }

    .brand {
        min-width: auto;
    }

    .brand h1 {
        font-size: 16px;
    }

    .brand p {
        display: none;
    }

    .main-menu {
        gap: 25px;
    }

}


@media (max-width: 600px) {

    .top-header {
        height: 62px;

        padding: 8px 12px;
    }

    .brand-icon {
        width: 38px;
        height: 38px;
    }

    .brand h1 {
        font-size: 15px;
    }

    .header-search {
        position: absolute;

        top: 70px;

        left: 12px;
        right: 12px;

        width: auto;

        height: 42px;
    }

    .notification-button {
    margin-left: auto;

    width: 45px;
    height: 45px;

    border: none;

    background: #f4f4f4;

    color: #333;

    border-radius: 10px;

    font-size: 20px;

    cursor: pointer;

    position: relative;

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

.notification-button:hover {
    background: #e9e9e9;
}

.notification-count {
    position: absolute;

    right: -5px;
    top: -5px;

    min-width: 19px;
    height: 19px;

    padding: 0 4px;

    background: #ff3b30;

    color: white;

    border-radius: 50%;

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

    display: none;

    align-items: center;
    justify-content: center;
}
.cart-button {
        width: 40px;
        height: 40px;
    }

    .main-menu {
        top: 62px;

        height: 55px;

        justify-content: space-around;

        gap: 0;
    }

    .menu-item {
        height: 55px;

        flex-direction: column;

        justify-content: center;

        gap: 2px;

        font-size: 10px;
    }

    .menu-item span {
        font-size: 17px;
    }

    .app-container {
        padding: 70px 12px 90px;
    }

    .market-selector {
        margin-top: 5px;
    }

    .hero-banner {
        min-height: 180px;

        padding: 25px;
    }

    .hero-content h2 {
        font-size: 25px;
    }

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

        gap: 10px;
    }

    .product-card {
        min-height: 245px;

        padding: 9px;
    }

    .product-image {
        height: 125px;
    }

    .category-card {
        min-width: 105px;

        height: 100px;
    }

    .mobile-cart-bar {
        position: fixed;

        bottom: 10px;

        left: 10px;
        right: 10px;

        background: #00a651;

        color: white;

        padding: 13px 15px;

        border-radius: 12px;

        display: flex;

        align-items: center;

        justify-content: space-between;

        z-index: 200;

        box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    }

    .mobile-cart-bar button {
        border: none;

        background: white;

        color: #00a651;

        padding: 8px 13px;

        border-radius: 7px;

        font-weight: bold;
    }

}


/* LOGIN BAR */
.login-bar{
    display:flex;
    align-items:center;
    gap:10px;
    padding:10px 15px;
    background:#ffffff;
    border-bottom:1px solid #eeeeee;
    overflow-x:auto;
    white-space:nowrap;
    scrollbar-width:none;
}

.login-bar::-webkit-scrollbar{
    display:none;
}

.login-option{
    flex:0 0 auto;
    text-decoration:none;
    padding:9px 14px;
    border-radius:20px;
    font-size:13px;
    font-weight:600;
    color:#222;
    background:#f5f5f5;
    border:1px solid #e5e5e5;
}

.login-option:hover{
    background:#eeeeee;
}

.customer-login{
    background:#111111;
    color:#ffffff;
}

@media(max-width:600px){

    .login-bar{
        padding:8px 10px;
        gap:8px;
    }

    .login-option{
        font-size:12px;
        padding:8px 12px;
    }

}


/* MOBILE LOGIN BAR POSITION FIX */
@media(max-width:600px){

    .login-bar{
        position:relative;
        margin-top:55px;
        width:100%;
        box-sizing:border-box;
        min-height:45px;
        padding:7px 10px;
        display:flex;
        align-items:center;
        gap:8px;
        background:#ffffff;
        border-bottom:1px solid #e5e5e5;
        overflow-x:auto;
        white-space:nowrap;
        z-index:95;
    }

    .login-option{
        flex:0 0 auto;
        display:inline-flex;
        align-items:center;
        justify-content:center;
        min-height:32px;
        box-sizing:border-box;
    }

    .main-menu{
        position:sticky;
        top:117px;
        z-index:90;
    }

}


/* LOGIN & MORE MENU */
.login-menu-wrapper{
    position:relative;
    background:#ffffff;
    border-bottom:1px solid #e5e5e5;
    z-index:95;
}

.login-menu-toggle{
    display:none;
}

.login-bar{
    display:flex;
    align-items:center;
    gap:10px;
    padding:8px 15px;
    background:#ffffff;
    overflow-x:auto;
    white-space:nowrap;
    scrollbar-width:none;
}

.login-bar::-webkit-scrollbar{
    display:none;
}

.login-option{
    flex:0 0 auto;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    text-decoration:none;
    padding:8px 14px;
    border-radius:20px;
    font-size:13px;
    font-weight:600;
    color:#222;
    background:#f5f5f5;
    border:1px solid #e5e5e5;
}

.login-option:hover{
    background:#eeeeee;
}

.customer-login{
    background:#111111;
    color:#ffffff;
}

.contact-option{
    background:#eaf8ef;
}


/* MOBILE */
@media(max-width:600px){

    .login-menu-wrapper{
        margin-top:55px;
        width:100%;
        box-sizing:border-box;
    }

    .login-menu-toggle{
        width:100%;
        height:42px;
        display:flex;
        align-items:center;
        justify-content:center;
        gap:8px;
        border:0;
        background:#ffffff;
        color:#222222;
        font-size:13px;
        font-weight:600;
        cursor:pointer;
    }

    .hamburger-icon{
        font-size:20px;
        line-height:1;
    }

    .login-bar{
        display:none;
        flex-direction:column;
        align-items:stretch;
        gap:6px;
        padding:8px 10px;
        border-top:1px solid #eeeeee;
        overflow:visible;
        white-space:normal;
    }

    .login-bar.login-open{
        display:flex;
    }

    .login-option{
        width:100%;
        min-height:38px;
        box-sizing:border-box;
        border-radius:8px;
        font-size:13px;
    }

    .main-menu{
        top:117px;
    }

}

/* ================================
   SHOP SELECTION
================================ */

.shops-section {
    margin-top: 24px;
    margin-bottom: 24px;
}

.shops-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.shop-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.10);
}

.shop-card-icon {
    font-size: 34px;
    margin-bottom: 8px;
}

.shop-card-name {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

.shop-card-products {
    color: #666;
    font-size: 14px;
    margin-bottom: 14px;
}

.shop-card-button {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 10px 14px;
    font-weight: 700;
    cursor: pointer;
}

.products-section.shop-products-active {
    margin-top: 28px;
}

@media (max-width: 600px) {

    .shops-grid {
        grid-template-columns: 1fr;
    }

    .shop-card {
        padding: 16px;
    }

}

/* ================================
   BACK TO SHOPS
================================ */

.back-to-shops-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: none;
    background: transparent;
    padding: 6px 0;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
}

.back-to-shops-button:hover {
    text-decoration: underline;
}

/* =========================================
   MOHALLA MART - MOBILE HOMEPAGE FIX
   ========================================= */

@media (max-width: 768px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    body {
        margin: 0;
        padding: 0;
    }

    /* Main page containers */
    main,
    .main-content,
    .container {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Header */
    header,
    .header,
    .top-header {
        width: 100%;
        box-sizing: border-box;
    }

    /* Search area */
    .search-container,
    .search-box,
    .search-wrapper {
        width: calc(100% - 24px);
        max-width: none;
        box-sizing: border-box;
        margin-left: 12px;
        margin-right: 12px;
    }

    #searchInput {
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Login / hamburger menu */
    .login-menu-wrapper {
        width: 100%;
        box-sizing: border-box;
    }

    .login-menu-toggle {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    .login-bar {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    .login-option {
        width: 100%;
        box-sizing: border-box;
    }

    /* Market selector */
    .market-selector {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    .market-selector select {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Categories */
    .categories-section {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    /* Shops */
    .shops-section {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    .shops-grid {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .shop-card {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    /* Products */
    .products-section {
        width: calc(100% - 24px);
        margin-left: 12px;
        margin-right: 12px;
        box-sizing: border-box;
    }

    .products-grid {
        width: 100%;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .product-card {
        min-width: 0;
        width: 100%;
        box-sizing: border-box;
    }

    .product-card img {
        max-width: 100%;
        height: auto;
    }

    /* Section headings */
    .section-heading {
        width: 100%;
        box-sizing: border-box;
        gap: 8px;
    }

    .section-heading h2 {
        min-width: 0;
        font-size: 18px;
    }

    .section-heading span {
        white-space: nowrap;
        font-size: 13px;
    }

    /* Back to shops */
    .back-to-shops-button {
        max-width: 100%;
        box-sizing: border-box;
    }

    /* Bottom navigation */
    .bottom-nav,
    .mobile-bottom-nav,
    .main-menu {
        max-width: 100%;
        box-sizing: border-box;
    }

    .menu-item {
        min-width: 0;
        box-sizing: border-box;
    }

}


/* Smaller phones */
@media (max-width: 480px) {

    .products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .product-card {
        padding: 8px;
    }

    .shop-card {
        padding: 14px;
        border-radius: 14px;
    }

    .shop-card-name {
        font-size: 16px;
    }

    .shop-card-products {
        font-size: 13px;
    }

    .shop-card-button {
        padding: 9px 10px;
        font-size: 13px;
    }

    .section-heading h2 {
        font-size: 17px;
    }

}


/* Very small phones */
@media (max-width: 360px) {

    .products-grid {
        gap: 6px;
    }

    .product-card {
        padding: 6px;
    }

    .section-heading {
        flex-wrap: wrap;
    }

}
