/* ==================== CATEGORY PAGE STYLES ==================== */
/* Universal styles for all category pages */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-green: #2e7d32;
    --primary-green-light: #4caf50;
    --primary-green-dark: #1b5e20;
    --secondary-orange: #ff9800;
    --accent-red: #e53935;
    --white: #ffffff;
    --off-white: #f5f5f5;
    --light-gray: #e0e0e0;
    --medium-gray: #9e9e9e;
    --dark-gray: #424242;
    --black: #212121;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.16);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --gradient-primary: linear-gradient(135deg, #2e7d32 0%, #66bb6a 100%);
    --gradient-secondary: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);

    --sidebar-width: 240px;
    --navbar-height: 60px;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--off-white);
    color: var(--black);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==================== TOP NAVBAR ==================== */
.category-navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: linear-gradient(135deg, #1b5e20, #2e7d32, #43a047);
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.back-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
    font-family: 'Poppins', sans-serif;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.back-btn:active {
    transform: scale(0.97);
}

.category-title-container {
    flex: 1;
    margin-left: 15px;
    color: var(--white);
    overflow: hidden;
}

.category-title {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin: 0;
}

.product-count {
    font-size: 0.75rem;
    opacity: 0.85;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.action-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--white);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.3s ease;
    position: relative;
    font-family: 'Poppins', sans-serif;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-1px);
}

.action-btn:active {
    transform: scale(0.97);
}

.filter-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: var(--accent-red);
    color: var(--white);
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-btn-nav {
    position: relative;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #ff9800, #ffb74d);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 152, 0, 0.2);
}

.cart-btn-nav:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(255, 152, 0, 0.3);
}

.cart-btn-nav:active {
    transform: scale(0.97);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 20px;
    height: 20px;
    background: var(--accent-red);
    color: var(--white);
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
}

/* ==================== SEARCH BAR ==================== */
.search-bar-container {
    position: fixed;
    top: var(--navbar-height);
    left: 0;
    right: 0;
    background: var(--white);
    padding: 10px 15px;
    box-shadow: var(--shadow-sm);
    z-index: 999;
    transform: translateY(-100%);
    opacity: 0;
    transition: var(--transition-normal);
}

.search-bar-container.show {
    transform: translateY(0);
    opacity: 1;
}

.search-bar {
    display: flex;
    align-items: center;
    background: var(--off-white);
    border: 2px solid #eee;
    border-radius: var(--radius-md);
    padding: 10px 15px;
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.search-bar i {
    color: var(--medium-gray);
    margin-right: 10px;
}

.search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
}

.clear-search {
    background: none;
    border: none;
    color: var(--medium-gray);
    cursor: pointer;
    padding: 5px;
    display: none;
    transition: all 0.2s ease;
    border-radius: var(--radius-full);
}

.clear-search:hover {
    color: var(--accent-red);
}

.clear-search.show {
    display: block;
}

/* ==================== FILTER POPUP ==================== */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    backdrop-filter: blur(5px);
}

.filter-overlay.show {
    opacity: 1;
    visibility: visible;
}

.filter-popup {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    z-index: 2000;
    transform: translateY(100%);
    transition: var(--transition-normal);
    max-height: 80vh;
    display: flex;
    flex-direction: column;
}

.filter-popup.show {
    transform: translateY(0);
}

.filter-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--light-gray);
}

.filter-popup-header h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.1rem;
    color: var(--primary-green);
    font-weight: 600;
}

.filter-popup-header h3 i {
    color: var(--primary-green);
}

.filter-close-btn {
    width: 34px;
    height: 34px;
    min-width: 34px;
    border: none;
    background: var(--off-white);
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: var(--dark-gray);
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
}

.filter-close-btn:hover {
    background: var(--accent-red);
    color: var(--white);
}

.filter-popup-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.filter-group {
    margin-bottom: 25px;
}

.filter-group h4 {
    font-size: 0.95rem;
    color: var(--dark-gray);
    margin-bottom: 12px;
    font-weight: 600;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 10px;
}

.price-inputs input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--light-gray);
    border-radius: var(--radius-md);
    font-size: 0.88rem;
    font-family: 'Poppins', sans-serif;
    outline: none;
    transition: all 0.2s ease;
}

.price-inputs input:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(46, 125, 50, 0.1);
}

.price-inputs span {
    color: var(--medium-gray);
    font-size: 0.85rem;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.filter-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dark-gray);
    padding: 8px 0;
}

.filter-checkbox input {
    display: none;
}

.checkmark-radio {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-gray);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkmark-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    background: var(--primary-green);
    border-radius: 50%;
    opacity: 0;
    transition: all 0.2s ease;
}

.filter-checkbox input:checked + .checkmark-radio {
    border-color: var(--primary-green);
}

.filter-checkbox input:checked + .checkmark-radio::after {
    opacity: 1;
}

.checkmark-box {
    width: 20px;
    height: 20px;
    border: 2px solid var(--light-gray);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.checkmark-box::after {
    content: '✓';
    font-size: 12px;
    color: var(--white);
    opacity: 0;
    transition: all 0.2s ease;
}

.filter-checkbox input:checked + .checkmark-box {
    background: var(--primary-green);
    border-color: var(--primary-green);
}

.filter-checkbox input:checked + .checkmark-box::after {
    opacity: 1;
}

.filter-popup-footer {
    display: flex;
    gap: 12px;
    padding: 20px;
    border-top: 1px solid var(--light-gray);
    background: var(--white);
}

.filter-clear-btn {
    flex: 1;
    padding: 13px 16px;
    border: 2px solid var(--primary-green);
    background: var(--white);
    color: var(--primary-green);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.filter-clear-btn:hover {
    background: var(--off-white);
    transform: translateY(-1px);
    border-color: var(--primary-green-dark);
}

.filter-clear-btn:active {
    transform: scale(0.97);
}

.filter-apply-btn {
    flex: 1;
    padding: 13px 16px;
    border: none;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}

.filter-apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.filter-apply-btn:active {
    transform: scale(0.97);
}

/* ==================== MAIN CONTAINER ==================== */
.category-container {
    display: flex;
    flex: 1;
    margin-top: var(--navbar-height);
}

/* ==================== SIDEBAR - SUB CATEGORIES ONLY ==================== */
.sidebar {
    width: var(--sidebar-width);
    background: var(--white);
    border-right: 1px solid var(--light-gray);
    position: sticky;
    top: var(--navbar-height);
    height: fit-content;
    max-height: calc(100vh - var(--navbar-height));
    overflow-y: auto;
    transition: var(--transition-normal);
}

.sidebar-title {
    padding: 20px 15px 15px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--medium-gray);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.subcategory-list {
    list-style: none;
    padding: 0 10px 20px;
}

.subcategory-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    margin-bottom: 4px;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--dark-gray);
    font-size: 0.9rem;
    font-family: 'Poppins', sans-serif;
}

.subcategory-item:hover {
    background: var(--off-white);
    transform: translateX(2px);
}

.subcategory-item.active {
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.subcategory-item i {
    width: 20px;
    text-align: center;
    font-size: 0.9rem;
}

.subcategory-item span:first-of-type {
    flex: 1;
}

.subcategory-count {
    font-size: 0.75rem;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.subcategory-item.active .subcategory-count {
    background: rgba(255, 255, 255, 0.3);
}

/* ==================== PRODUCTS AREA ==================== */
.products-area {
    flex: 1;
    padding: 15px;
    padding-bottom: 120px;
    display: flex;
    flex-direction: column;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

/* ==================== PRODUCT CARD ==================== */
.product-card {
    background: var(--white);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #eee;
    display: flex;
    flex-direction: column;
}

.product-card.hidden {
    display: none;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: rgba(46, 125, 50, 0.15);
}

.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 6px;
    background: var(--accent-red);
    color: var(--white);
    font-size: 0.6rem;
    font-weight: 700;
    border-radius: 50px;
    z-index: 2;
    letter-spacing: 0.3px;
}

/* ==================== PRODUCT IMAGE CONTAINER ==================== */
.product-image-container {
    position: relative;
    width: 100%;
    padding-top: 100%; /* 1:1 Aspect Ratio - Square Images */
    overflow: hidden;
    background: #f8f8f8;
    flex-shrink: 0;
}

.product-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-normal);
}

.product-card:hover .product-image {
    transform: scale(1.05);
}

.wishlist-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: var(--white);
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    z-index: 2;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.wishlist-btn:active {
    transform: scale(0.97);
}

.wishlist-btn.active {
    background: #ffebee;
}

.wishlist-btn i {
    font-size: 0.85rem;
    color: var(--medium-gray);
    transition: all 0.2s ease;
}

.wishlist-btn.active i {
    color: var(--accent-red);
}

/* ==================== PRODUCT INFO ==================== */
.product-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--black);
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    min-height: 2.2em;
}

.product-weight {
    font-size: 0.72rem;
    color: var(--medium-gray);
    margin-bottom: 8px;
    display: block;
}

/* ==================== WEIGHT SELECTOR DROPDOWN ==================== */
.weight-selector {
    margin-bottom: 8px;
    width: 100%;
}

.weight-dropdown {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.72rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 500;
    color: var(--dark-gray);
    background-color: var(--off-white);
    border: 1.5px solid var(--light-gray);
    border-radius: var(--radius-sm);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10'%3E%3Cpath fill='%23666' d='M5 7L1 3h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
    padding-right: 24px;
    transition: all 0.2s ease;
    line-height: 1.4;
}

.weight-dropdown:hover {
    border-color: var(--primary-green);
    background-color: var(--white);
}

.weight-dropdown:focus {
    outline: none;
    border-color: var(--primary-green);
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.1);
    background-color: var(--white);
}

.weight-dropdown option {
    padding: 8px;
    font-size: 0.75rem;
    background-color: var(--white);
}

/* Single weight display (no dropdown needed) */
.weight-selector .product-weight {
    margin-bottom: 0;
    font-size: 0.72rem;
    color: var(--medium-gray);
}

/* Price update animation */
.product-price.updating {
    animation: priceUpdate 0.3s ease;
}

@keyframes priceUpdate {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); color: var(--primary-green); }
    100% { transform: scale(1); }
}

/* Savings text in dropdown */
.weight-dropdown option {
    font-weight: 500;
}

/* ==================== PRODUCT PRICE ROW ==================== */
.product-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
}

.product-price {
    display: flex;
    flex-direction: column;
}

.current-price {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-green);
}

.original-price {
    font-size: 0.75rem;
    color: var(--medium-gray);
    text-decoration: line-through;
}

/* ==================== ADD TO CART BUTTON ==================== */
.add-to-cart-btn {
    padding: 8px 16px;
    background: var(--white);
    color: var(--primary-green);
    border: 2px solid var(--primary-green);
    border-radius: var(--radius-md);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-family: 'Poppins', sans-serif;
    flex-shrink: 0;
}

.add-to-cart-btn:hover {
    background: var(--primary-green);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.add-to-cart-btn:active {
    transform: scale(0.97);
}

/* ==================== QUANTITY CONTROLS ==================== */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--white);
    padding: 3px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    overflow: visible;
    flex-shrink: 0;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 7px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    font-size: 0.8rem;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
}

.qty-btn.minus,
.qty-btn.qty-minus,
.qty-btn:first-child {
    background: var(--light-gray);
    color: var(--dark-gray);
}

.qty-btn.plus,
.qty-btn.qty-plus,
.qty-btn:last-child {
    background: var(--primary-green);
    color: var(--white);
}

.qty-btn:hover:not(:disabled) {
    transform: scale(1.08);
}

.qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.qty-value {
    color: var(--black);
    font-weight: 700;
    min-width: 26px;
    text-align: center;
    font-size: 0.88rem;
}

/* Out of Stock */
.out-of-stock-btn {
    padding: 8px 12px;
    background: var(--light-gray);
    color: var(--medium-gray);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    cursor: not-allowed;
    font-family: 'Poppins', sans-serif;
}

/* ==================== EMPTY STATE ==================== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--medium-gray);
    grid-column: 1 / -1;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.3rem;
    color: var(--dark-gray);
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 0.85rem;
}

.reset-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 13px 16px;
    min-width: 130px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.reset-btn:active {
    transform: scale(0.97);
}

/* ==================== MOBILE CATEGORY BUTTON ==================== */
.mobile-category-btn {
    display: none;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    border: none;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
    z-index: 997;
    gap: 8px;
    align-items: center;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.mobile-category-btn:hover {
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 20px rgba(46, 125, 50, 0.4);
}

.mobile-category-btn:active {
    transform: translateX(-50%) scale(0.97);
}

.mobile-category-btn i {
    font-size: 1rem;
}

/* ==================== SIDEBAR OVERLAY ==================== */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 997;
    backdrop-filter: blur(5px);
}

.sidebar-overlay.show {
    display: block;
}

/* ==================== TOAST NOTIFICATION ==================== */
.toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--white);
    color: var(--dark-gray);
    padding: 12px 18px;
    border-radius: var(--radius-md);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 3000;
    max-width: 420px;
    width: 90%;
    border-left: 4px solid var(--primary-green);
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.error {
    border-left-color: var(--accent-red);
}

.toast.success {
    border-left-color: var(--primary-green);
}

.toast.warning {
    border-left-color: var(--secondary-orange);
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.toast-content i {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.toast-content span {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ==================== FLOATING CART ==================== */
.floating-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.12);
    z-index: 996;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.floating-cart.hidden {
    transform: translateY(100%);
}

.floating-cart-info {
    display: flex;
    flex-direction: column;
}

.floating-cart-count {
    font-size: 0.8rem;
    color: var(--medium-gray);
}

.floating-cart-total {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-green);
}

.floating-cart-btn {
    padding: 13px 16px;
    background: linear-gradient(135deg, #2e7d32, #66bb6a);
    color: var(--white);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.2);
}

.floating-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(46, 125, 50, 0.3);
}

.floating-cart-btn:active {
    transform: scale(0.97);
}

/* ==================== FOOTER ==================== */
.footer {
    background: var(--black);
    color: var(--white);
    padding: 24px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.footer-logo i {
    color: #4db6ac;
}

.footer-content p {
    color: var(--medium-gray);
    font-size: 0.82rem;
}

.footer-bottom {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--dark-gray);
    font-size: 0.78rem;
    color: var(--medium-gray);
}

/* ==================== UTILITY CLASSES ==================== */
.hidden {
    display: none !important;
}

/* ==================== SCROLLBAR STYLES ==================== */
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #c8e6c9;
    border-radius: 3px;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--off-white);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--light-gray);
    border-radius: 2px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--medium-gray);
}

.filter-popup-body::-webkit-scrollbar {
    width: 4px;
}

.filter-popup-body::-webkit-scrollbar-track {
    background: var(--off-white);
}

.filter-popup-body::-webkit-scrollbar-thumb {
    background: var(--light-gray);
    border-radius: 2px;
}

/* ==================== IMAGE ERROR STATE ==================== */
.product-image[src=""],
.product-image:not([src]) {
    background: linear-gradient(135deg, #e0e0e0 0%, #f5f5f5 100%);
}

/* ==================== RESPONSIVE STYLES ==================== */
@media (max-width: 1024px) {
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    :root {
        --sidebar-width: 220px;
    }
}

@media (max-width: 768px) {
    /* --- SIDEBAR DRAWER --- */
    .sidebar {
        position: fixed;
        left: -100%;
        width: 280px;
        top: 0;
        height: 100vh;
        z-index: 1001;
        padding-top: 60px;
        transition: left 0.3s ease;
    }

    .sidebar.show {
        left: 0;
    }

    .sidebar-title {
        padding-top: 15px;
    }

    .subcategory-item {
        padding: 10px 12px;
        font-size: 0.85rem;
    }

    /* --- PRODUCTS AREA --- */
    .products-area {
        margin-left: 0;
        padding: 12px;
        padding-bottom: 140px;
    }

    /* Show mobile category button */
    .mobile-category-btn {
        display: flex;
    }

    /* Products grid */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 12px;
    }

    /* --- PRODUCT CARD --- */
    .product-info {
        padding: 10px;
    }

    .product-name {
        font-size: 0.8rem;
    }

    .current-price {
        font-size: 0.95rem;
    }

    .add-to-cart-btn {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .quantity-controls {
        padding: 2px;
    }

    .qty-btn {
        width: 26px;
        height: 26px;
        font-size: 0.75rem;
    }

    .qty-value {
        min-width: 20px;
        font-size: 0.8rem;
    }

    /* Weight dropdown responsive */
    .weight-dropdown {
        padding: 5px 8px;
        font-size: 0.7rem;
        padding-right: 22px;
    }

    /* --- NAVBAR --- */
    .category-title {
        font-size: 1rem;
    }

    .product-count {
        font-size: 0.7rem;
    }

    /* --- TOAST --- */
    .toast {
        bottom: 130px;
        width: 94%;
    }

    /* --- FLOATING CART --- */
    .floating-cart {
        padding: 10px 15px;
    }

    .floating-cart-btn {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    .floating-cart-total {
        font-size: 1rem;
    }

    .floating-cart-count {
        font-size: 0.75rem;
    }

    /* --- FILTER --- */
    .filter-clear-btn,
    .filter-apply-btn {
        padding: 12px 14px;
        font-size: 0.82rem;
    }

    /* --- SEARCH BAR --- */
    .search-bar {
        padding: 8px 12px;
    }

    .search-bar input {
        font-size: 0.85rem;
    }

    /* --- FOOTER --- */
    .footer {
        padding: 20px 15px;
    }

    .footer-logo {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    /* --- NAVBAR --- */
    .category-navbar {
        padding: 0 10px;
    }

    .back-btn,
    .action-btn {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .cart-btn-nav {
        width: 36px;
        height: 36px;
        font-size: 0.9rem;
    }

    .cart-badge {
        min-width: 18px;
        height: 18px;
        font-size: 0.6rem;
        top: -4px;
        right: -4px;
    }

    .category-title-container {
        margin-left: 10px;
    }

    .category-title {
        font-size: 0.92rem;
    }

    .product-count {
        font-size: 0.68rem;
    }

    .nav-actions {
        gap: 5px;
    }

    /* --- PRODUCTS GRID --- */
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* --- PRODUCT CARD --- */
    .product-info {
        padding: 8px;
    }

    .product-name {
        font-size: 0.75rem;
        min-height: 2em;
        -webkit-line-clamp: 2;
        line-height: 1.3;
    }

    .product-weight {
        font-size: 0.68rem;
        margin-bottom: 6px;
    }

    /* Weight dropdown mobile */
    .weight-selector {
        margin-bottom: 6px;
    }

    .weight-dropdown {
        padding: 5px 8px;
        font-size: 0.65rem;
        padding-right: 20px;
        border-radius: 6px;
    }

    .product-price-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .current-price {
        font-size: 0.88rem;
    }

    .original-price {
        font-size: 0.68rem;
    }

    .add-to-cart-btn,
    .quantity-controls {
        width: 100%;
        justify-content: center;
    }

    .add-to-cart-btn {
        padding: 7px 8px;
        text-align: center;
        font-size: 0.72rem;
    }

    .out-of-stock-btn {
        width: 100%;
        text-align: center;
        padding: 7px 8px;
        font-size: 0.7rem;
    }

    .product-badge {
        top: 6px;
        left: 6px;
        padding: 2px 5px;
        font-size: 0.55rem;
    }

    .wishlist-btn {
        width: 28px;
        height: 28px;
        top: 6px;
        right: 6px;
    }

    .wishlist-btn i {
        font-size: 0.75rem;
    }

    /* --- FLOATING CART --- */
    .floating-cart {
        padding: 10px 12px;
    }

    .floating-cart-total {
        font-size: 0.95rem;
    }

    .floating-cart-count {
        font-size: 0.72rem;
    }

    .floating-cart-btn {
        padding: 10px 12px;
        font-size: 0.78rem;
        gap: 5px;
    }

    .mobile-category-btn {
        bottom: 75px;
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .toast {
        bottom: 125px;
        width: 92%;
    }

    .toast-content span {
        font-size: 0.8rem;
    }

    /* --- FILTER POPUP --- */
    .filter-popup-header {
        padding: 16px;
    }

    .filter-popup-header h3 {
        font-size: 1rem;
    }

    .filter-popup-body {
        padding: 16px;
    }

    .filter-group h4 {
        font-size: 0.88rem;
    }

    .filter-checkbox {
        font-size: 0.85rem;
        padding: 6px 0;
    }

    .price-inputs input {
        padding: 8px 12px;
        font-size: 0.82rem;
    }

    .filter-popup-footer {
        padding: 16px;
        gap: 10px;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        padding: 11px 12px;
        font-size: 0.8rem;
    }

    /* --- SIDEBAR DRAWER --- */
    .sidebar {
        width: 260px;
    }

    /* --- EMPTY STATE --- */
    .empty-state {
        padding: 40px 16px;
    }

    .empty-state i {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.1rem;
    }

    .empty-state p {
        font-size: 0.8rem;
    }

    .reset-btn {
        padding: 12px 14px;
        font-size: 0.82rem;
        min-width: unset;
    }

    /* --- SEARCH BAR --- */
    .search-bar {
        padding: 8px 10px;
    }

    .search-bar input {
        font-size: 0.82rem;
    }

    /* --- FOOTER --- */
    .footer {
        padding: 18px 12px;
    }

    .footer-logo {
        font-size: 0.95rem;
    }

    .footer-content p {
        font-size: 0.78rem;
    }

    .footer-bottom {
        font-size: 0.72rem;
        margin-top: 12px;
        padding-top: 12px;
    }
}

@media (max-width: 340px) {
    /* --- NAVBAR --- */
    .category-navbar {
        padding: 0 8px;
        height: 54px;
    }

    .back-btn,
    .action-btn {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .cart-btn-nav {
        width: 32px;
        height: 32px;
        font-size: 0.82rem;
    }

    .cart-badge {
        min-width: 16px;
        height: 16px;
        font-size: 0.55rem;
        padding: 0 3px;
    }

    .filter-badge {
        width: 16px;
        height: 16px;
        font-size: 0.55rem;
    }

    .category-title {
        font-size: 0.82rem;
    }

    .product-count {
        font-size: 0.62rem;
    }

    .category-title-container {
        margin-left: 8px;
    }

    .nav-actions {
        gap: 4px;
    }

    /* --- PRODUCTS GRID --- */
    .products-grid {
        gap: 6px;
    }

    /* --- PRODUCT CARD --- */
    .product-info {
        padding: 6px;
    }

    .product-name {
        font-size: 0.7rem;
        min-height: 1.8em;
    }

    .product-weight {
        font-size: 0.62rem;
        margin-bottom: 4px;
    }

    /* Weight dropdown extra small */
    .weight-selector {
        margin-bottom: 4px;
    }

    .weight-dropdown {
        padding: 4px 6px;
        font-size: 0.6rem;
        padding-right: 18px;
        border-radius: 5px;
    }

    .current-price {
        font-size: 0.82rem;
    }

    .original-price {
        font-size: 0.62rem;
    }

    .add-to-cart-btn {
        padding: 6px;
        font-size: 0.68rem;
    }

    .qty-btn {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
        border-radius: 6px;
    }

    .qty-value {
        min-width: 18px;
        font-size: 0.75rem;
    }

    .quantity-controls {
        padding: 2px;
        border-radius: 8px;
    }

    .out-of-stock-btn {
        padding: 6px;
        font-size: 0.65rem;
    }

    .product-badge {
        top: 4px;
        left: 4px;
        padding: 1px 4px;
        font-size: 0.5rem;
    }

    .wishlist-btn {
        width: 24px;
        height: 24px;
        top: 4px;
        right: 4px;
    }

    .wishlist-btn i {
        font-size: 0.65rem;
    }

    /* --- FLOATING CART --- */
    .floating-cart {
        padding: 8px 10px;
    }

    .floating-cart-total {
        font-size: 0.88rem;
    }

    .floating-cart-count {
        font-size: 0.68rem;
    }

    .floating-cart-btn {
        padding: 9px 10px;
        font-size: 0.72rem;
        gap: 4px;
        border-radius: 10px;
    }

    /* --- MOBILE CATEGORY BUTTON --- */
    .mobile-category-btn {
        bottom: 68px;
        padding: 8px 16px;
        font-size: 0.75rem;
        gap: 6px;
    }

    .mobile-category-btn i {
        font-size: 0.85rem;
    }

    /* --- TOAST --- */
    .toast {
        bottom: 115px;
        width: 92%;
        padding: 10px 14px;
    }

    .toast-content i {
        font-size: 0.95rem;
    }

    .toast-content span {
        font-size: 0.75rem;
    }

    /* --- FILTER POPUP --- */
    .filter-popup-header {
        padding: 14px;
    }

    .filter-popup-header h3 {
        font-size: 0.92rem;
        gap: 8px;
    }

    .filter-close-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
    }

    .filter-popup-body {
        padding: 14px;
    }

    .filter-group h4 {
        font-size: 0.82rem;
        margin-bottom: 10px;
    }

    .filter-checkbox {
        font-size: 0.8rem;
        gap: 10px;
    }

    .checkmark-radio,
    .checkmark-box {
        width: 18px;
        height: 18px;
    }

    .price-inputs input {
        padding: 8px 10px;
        font-size: 0.78rem;
    }

    .price-inputs span {
        font-size: 0.78rem;
    }

    .filter-popup-footer {
        padding: 14px;
        gap: 8px;
    }

    .filter-clear-btn,
    .filter-apply-btn {
        padding: 10px;
        font-size: 0.75rem;
    }

    /* --- SIDEBAR DRAWER --- */
    .sidebar {
        width: 240px;
        padding-top: 54px;
    }

    .sidebar-title {
        padding: 12px 12px 10px;
        font-size: 0.78rem;
    }

    .subcategory-item {
        padding: 8px 10px;
        font-size: 0.78rem;
        gap: 10px;
    }

    .subcategory-item i {
        width: 18px;
        font-size: 0.82rem;
    }

    .subcategory-count {
        font-size: 0.68rem;
        padding: 1px 6px;
    }

    /* --- SEARCH BAR --- */
    .search-bar {
        padding: 7px 8px;
    }

    .search-bar input {
        font-size: 0.78rem;
    }

    .search-bar i {
        font-size: 0.85rem;
        margin-right: 8px;
    }

    /* --- EMPTY STATE --- */
    .empty-state {
        padding: 30px 12px;
    }

    .empty-state i {
        font-size: 2.5rem;
        margin-bottom: 14px;
    }

    .empty-state h3 {
        font-size: 0.95rem;
    }

    .empty-state p {
        font-size: 0.75rem;
        margin-bottom: 16px;
    }

    .reset-btn {
        padding: 10px;
        font-size: 0.75rem;
        min-width: unset;
    }

    /* --- FOOTER --- */
    .footer {
        padding: 14px 10px;
    }

    .footer-logo {
        font-size: 0.85rem;
    }

    .footer-content p {
        font-size: 0.72rem;
    }

    .footer-bottom {
        font-size: 0.65rem;
        margin-top: 10px;
        padding-top: 10px;
    }
}

/* ==================== VARIANT PILLS — SWIGGY INSTAMART STYLE ==================== */
.variant-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 8px;
    width: 100%;
}

.variant-pill {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 5px 10px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: var(--white);
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Poppins', sans-serif;
    min-width: 0;
    flex: 0 0 auto;
    position: relative;
}

.variant-pill:hover {
    border-color: var(--primary-green-light);
    background: #f0f9f0;
}

.variant-pill.active {
    border-color: var(--primary-green);
    background: linear-gradient(135deg, #e8f5e9, #f1f8e9);
    box-shadow: 0 1px 4px rgba(46, 125, 50, 0.15);
}

.variant-pill.out-of-stock {
    opacity: 0.45;
    cursor: not-allowed;
    position: relative;
}

.variant-pill.out-of-stock::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    width: 80%;
    height: 1.5px;
    background: var(--accent-red);
    transform: rotate(-12deg);
}

.variant-pill .pill-weight {
    font-size: 0.68rem;
    font-weight: 700;
    color: var(--dark-gray);
    line-height: 1.2;
    white-space: nowrap;
}

.variant-pill.active .pill-weight {
    color: var(--primary-green-dark);
}

.variant-pill .pill-price {
    font-size: 0.62rem;
    font-weight: 600;
    color: var(--primary-green);
    line-height: 1.2;
    white-space: nowrap;
}

.variant-pill .pill-mrp {
    font-size: 0.55rem;
    color: var(--medium-gray);
    text-decoration: line-through;
    line-height: 1;
}

.variant-pill.active .pill-price {
    color: var(--primary-green-dark);
}

/* Single variant (no pills needed, just show weight text) */
.single-variant-label {
    font-size: 0.72rem;
    color: var(--medium-gray);
    margin-bottom: 8px;
    display: block;
}

/* ===== VARIANT PILLS RESPONSIVE ===== */
@media (max-width: 480px) {
    .variant-pills {
        gap: 4px;
        margin-bottom: 6px;
    }

    .variant-pill {
        padding: 4px 7px;
        border-radius: 6px;
    }

    .variant-pill .pill-weight {
        font-size: 0.62rem;
    }

    .variant-pill .pill-price {
        font-size: 0.58rem;
    }

    .variant-pill .pill-mrp {
        font-size: 0.5rem;
    }
}

@media (max-width: 340px) {
    .variant-pill {
        padding: 3px 5px;
        border-radius: 5px;
    }

    .variant-pill .pill-weight {
        font-size: 0.58rem;
    }

    .variant-pill .pill-price {
        font-size: 0.55rem;
    }
}