:root {
    --primary-color: #43a047;
    /* Organic Green */
    --secondary-color: #ffb300;
    /* Warm Yellow */
    --hover-green: #2e7d32;
    --bg-light: #F8F9FA;
    --bg-white: #FFFFFF;
    --border-color: #e0e0e0;
    --text-main: #212121;
    --text-muted: #757575;
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.08);
}

body {
    background-color: var(--bg-light);
    font-family: 'Poppins', sans-serif;
    color: var(--text-main);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
}

/* Main Header Redesign */
.header-top {
    background-color: var(--bg-white);
    padding: 10px 0;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-muted);
}

.header-main {
    padding: 15px 0;
    transition: all 0.3s ease;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary-color);
    text-decoration: none;
    letter-spacing: -0.5px;
}

.logo-text span {
    color: var(--text-main);
}

.search-bar-rounded {
    border: 1px solid var(--border-color);
    border-radius: 50px;
    overflow: hidden;
    display: flex;
    background: #f1f3f4;
    transition: all 0.3s ease;
}

.search-bar-rounded:focus-within {
    background: white;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(67, 160, 71, 0.1);
}

.search-bar-rounded input {
    border: none;
    padding: 12px 25px;
    flex-grow: 1;
    background: transparent;
    font-size: 0.95rem;
}

.search-bar-rounded input:focus {
    outline: none;
}

.clear-search-icon {
    display: flex;
    align-items: center;
    padding-right: 15px;
    color: var(--text-muted);
    cursor: pointer;
    transition: color 0.2s;
}

.clear-search-icon:hover {
    color: #e53935;
}

.search-bar-rounded button {
    background: var(--primary-color);
    border: none;
    color: white;
    padding: 0 25px;
    font-weight: 600;
    transition: background 0.2s;
}

.search-bar-rounded button:hover {
    background: var(--hover-green);
}

/* Sidebar Category (Vertical Menu) */
.sidebar-category {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    background: var(--primary-color);
    color: white;
    padding: 15px 20px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.sidebar-content .list-group-item {
    border: none;
    border-bottom: 1px solid #f5f5f5;
    padding: 12px 20px;
    font-size: 0.9rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-content .list-group-item:last-child {
    border-bottom: none;
}

.sidebar-content .list-group-item:hover {
    background-color: #f9f9f9;
    color: var(--primary-color);
    padding-left: 25px;
}

.sidebar-content .list-group-item.active {
    background-color: #e8f5e9;
    color: var(--primary-color);
    font-weight: 600;
}

/* Product Cards Grocable Aesthetic */
.product-card-v2 {
    border: 1px solid var(--border-color);
    border-radius: 16px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    position: relative;
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card-v2:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.image-container {
    aspect-ratio: 1/1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbfbfb;
    border-radius: 12px;
    margin-bottom: 12px;
    overflow: hidden;
    position: relative;
}

.product-card-v2 img {
    max-height: 85%;
    max-width: 85%;
    object-fit: contain;
    transition: transform 0.5s ease;
}

.product-card-v2:hover img {
    transform: scale(1.1);
}

.product-card-v2 .category-label {
    font-size: 0.75rem;
    color: var(--primary-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
}

.product-card-v2 .product-title {
    font-size: 1rem;
    font-weight: 600;
    margin-top: 4px;
    margin-bottom: 8px;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    min-height: 3rem;
    line-height: 1.4;
}

.product-card-v2 .price-v2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-main);
}

.product-card-v2 .price-v2.text-danger {
    color: #d32f2f !important;
}

.product-card-v2 .old-price {
    text-decoration: line-through;
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-left: 5px;
}

.btn-add-cart-v2 {
    background: #f0f7f0;
    border: 1px solid transparent;
    color: var(--primary-color);
    border-radius: 12px;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    width: 100%;
    margin-top: 12px;
}

.btn-add-cart-v2:hover {
    background: var(--primary-color);
    color: white;
}

/* Modal Custom Styles */
.modal-content {
    animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bg-soft-success {
    background-color: rgba(67, 160, 71, 0.1);
}

#modalProductImage {
    transition: transform 0.3s ease;
}

#modalProductImage:hover {
    transform: scale(1.05);
}

/* Circular Categories */
.category-circle-item {
    text-align: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.category-circle-item:hover {
    transform: scale(1.05);
}

.category-circle-icon {
    width: 80px;
    height: 80px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #f0f0f0;
    font-size: 2rem;
    color: var(--primary-color);
}

.category-circle-item.active .category-circle-icon {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .product-grid {
        display: grid;
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    .product-item {
        width: 100% !important;
    }

    .bottom-nav {
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        background: white;
        display: flex;
        justify-content: space-around;
        padding: 5px 0 10px;
        box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        border-top: 1px solid #eee;
    }

    .bottom-nav-item {
        color: var(--text-muted);
        text-decoration: none;
        display: flex;
        flex-direction: column;
        align-items: center;
        font-size: 0.65rem;
        font-weight: 500;
    }

    .bottom-nav-item i {
        font-size: 1.4rem;
        margin-bottom: 2px;
    }

    .bottom-nav-item.active {
        color: var(--primary-color);
    }

    body {
        padding-bottom: 70px;
        /* Spacer for bottom-nav */
    }

    .header-main {
        padding: 10px 0;
    }

    .logo-text {
        font-size: 1.4rem;
    }
}

/* Micro-interactions: Loading Bar */
.progress-container {
    height: 3px;
    width: 100%;
    background: #f0f0f0;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9999;
}

.progress-bar {
    height: 100%;
    background: var(--primary-color);
    width: 0;
    transition: width 0.4s ease;
}

/* Labels */
.badge-sale {
    position: absolute;
    top: 15px;
    left: 15px;
    background: linear-gradient(45deg, #ffb300, #ff8f00);
    color: white;
    font-weight: 700;
    font-size: 0.65rem;
    padding: 5px 12px;
    border-radius: 50px;
    z-index: 5;
    box-shadow: 0 4px 10px rgba(255, 179, 0, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.price-v2.text-danger {
    color: #e53935 !important;
    text-shadow: 0 0 10px rgba(229, 57, 53, 0.1);
}

/* WhatsApp Floating Button */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #25d366;
    color: #FFF !important;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1.1rem;
    font-weight: 600;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 25px rgba(37, 211, 102, 0.3) !important;
}

.whatsapp-float:hover {
    transform: scale(1.08) translateY(-5px);
    background-color: #128c7e;
    color: #fff;
    box-shadow: 0 15px 30px rgba(37, 211, 102, 0.4) !important;
}

.whatsapp-float i {
    font-size: 1.5rem;
}

.btn-whatsapp-outline {
    background: #e8f5e9;
    border: 2px solid #25d366;
    color: #128c7e;
    transition: all 0.3s ease;
}

.btn-whatsapp-outline:hover {
    background: #25d366;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(37, 211, 102, 0.2);
}

@media (max-width: 768px) {
    .whatsapp-float {
        bottom: 90px;
        /* Above mobile bottom nav (bottom-nav is usually ~70px) */
        right: 20px;
        padding: 10px 15px;
        font-size: 1.3rem;
        border-radius: 50%;
        /* Make it more compact on mobile if preferred, or keep as pill */
    }

    .whatsapp-float span {
        display: none;
    }
}

/* Pagination Styles */
.custom-pagination .page-link {
    border: none;
    margin: 0 5px;
    border-radius: 8px !important;
    color: var(--text-main);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 10px 18px;
}

.custom-pagination .page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 5px 15px rgba(67, 160, 71, 0.3);
}

.custom-pagination .page-link:hover:not(.disabled) {
    background-color: #e8f5e9;
    color: var(--primary-color);
    transform: translateY(-2px);
}

.custom-pagination .page-item.disabled .page-link {
    background-color: transparent;
    color: #ccc;
}

/* Toolbar Controls */
.form-select-sm {
    border-radius: 10px;
    padding-left: 10px;
    border-color: #eee;
    background-color: #f9f9f9;
    cursor: pointer;
}

.form-select-sm:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 160, 71, 0.1);
}

/* Search Suggestions */
.search-suggestions-container {
    position: absolute;
    top: 100%;
    left: 1.5rem;
    right: 1.5rem;
    background: white;
    z-index: 1050;
    border-radius: 0 0 15px 15px;
    margin-top: -10px;
    padding-top: 15px;
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-top: none;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: var(--text-main);
    transition: background 0.2s;
    border-bottom: 1px solid #f8f9fa;
}

.suggestion-item:last-child {
    border-bottom: none;
    border-radius: 0 0 15px 15px;
}

.suggestion-item:hover {
    background-color: #f1f8f1;
    color: var(--primary-color);
}

.suggestion-img {
    width: 45px;
    height: 45px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 12px;
    background: #f8f9fa;
}

.suggestion-info {
    flex-grow: 1;
}

.suggestion-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.suggestion-price {
    font-size: 0.8rem;
    color: var(--primary-color);
    font-weight: 700;
}

.search-suggestions-container::-webkit-scrollbar {
    width: 6px;
}

.search-suggestions-container::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 10px;
}

/* Password Visibility Toggle */
.password-toggle-input-group .form-control {
    border-right: none;
}

.password-toggle-input-group .input-group-text {
    background-color: transparent;
    cursor: pointer;
    border-left: none;
    color: var(--text-muted);
    transition: color 0.2s;
}

.password-toggle-input-group .input-group-text:hover {
    color: var(--primary-color);
}