/* Reset & Basic Setup */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }
body { background-color: #f4f7f6; color: #333; overflow-x: hidden; }

/* Navbar */
.navbar { display: flex; justify-content: space-between; align-items: center; background: #1a237e; color: white; padding: 15px 5%; position: sticky; top: 0; z-index: 100; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.2rem; }
.logo img { border-radius: 5px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { color: white; text-decoration: none; font-weight: 600; cursor: pointer; transition: 0.3s; }
.nav-links a:hover { color: #bbdefb; }
.cart-icon { position: relative; cursor: pointer; font-size: 1.1rem; }
.badge { position: absolute; top: -8px; right: -12px; background: #ff5252; color: white; border-radius: 50%; padding: 2px 6px; font-size: 12px; font-weight: bold; }

/* Search Bar */
.search-container { background: #1a237e; padding: 10px 5% 20px; text-align: center; }
.search-bar { background: white; max-width: 600px; margin: 0 auto; display: flex; align-items: center; padding: 10px 15px; border-radius: 25px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.search-bar i { color: #666; margin-right: 10px; }
.search-bar input { border: none; outline: none; width: 100%; font-size: 1rem; }

/* Home Section */
#homeSection { padding: 40px 5%; text-align: center; min-height: 70vh; }
.hero h1 { color: #1a237e; font-size: 2.5rem; margin-bottom: 10px; }
.about-card { background: white; padding: 30px; border-radius: 10px; max-width: 800px; margin: 30px auto; box-shadow: 0 4px 8px rgba(0,0,0,0.05); text-align: left; line-height: 1.6; }
.delivery-info { display: flex; justify-content: space-around; margin-top: 20px; font-weight: 600; color: #2e7d32; flex-wrap: wrap; gap: 10px; background: #e8f5e9; padding: 15px; border-radius: 8px;}
.cta-btn { background: #ff5252; color: white; padding: 15px 30px; font-size: 18px; border: none; border-radius: 30px; cursor: pointer; font-weight: bold; margin-top: 10px; transition: 0.3s; box-shadow: 0 4px 6px rgba(255,82,82,0.3); }
.cta-btn:hover { background: #d50000; transform: translateY(-2px); }

/* Filters */
.filter-section { display: flex; gap: 10px; overflow-x: auto; padding: 20px 5%; white-space: nowrap; scrollbar-width: none; }
.filter-section::-webkit-scrollbar { display: none; }
.filter-btn { background: white; border: 1px solid #ccc; padding: 8px 15px; border-radius: 20px; cursor: pointer; transition: 0.3s; font-weight: 600;}
.filter-btn.active, .filter-btn:hover { background: #1a237e; color: white; border-color: #1a237e; }

/* Product Grid */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; padding: 0 5% 50px; }
.product-card { background: white; padding: 15px; border-radius: 10px; text-align: center; box-shadow: 0 2px 5px rgba(0,0,0,0.05); display: flex; flex-direction: column; justify-content: space-between; transition: 0.3s; border: 1px solid #eee; }
.product-card:hover { box-shadow: 0 5px 15px rgba(0,0,0,0.1); transform: translateY(-3px); }
.product-card img { width: 100%; height: 130px; object-fit: contain; margin-bottom: 10px; background: #f9f9f9; padding: 5px; border-radius: 8px;}
.product-category { font-size: 12px; color: #888; margin-bottom: 5px; text-transform: uppercase; font-weight: bold;}
.product-title { font-size: 14px; color: #333; margin-bottom: 5px; min-height: 40px; font-weight: 600;}
.product-price { font-weight: bold; color: #2e7d32; font-size: 1.1rem; margin-bottom: 15px; }
.add-to-cart-btn { background: #1a237e; color: white; border: none; padding: 10px; border-radius: 5px; cursor: pointer; width: 100%; transition: 0.3s; font-weight: bold;}
.add-to-cart-btn:hover { background: #0d47a1; }

/* Cart Section */
#cartSection { padding: 30px 5%; max-width: 800px; margin: 0 auto; min-height: 70vh; }
.cart-item { display: flex; align-items: center; background: white; padding: 15px; border-radius: 8px; margin-bottom: 10px; box-shadow: 0 2px 4px rgba(0,0,0,0.05); border: 1px solid #eee;}
.cart-item img { width: 60px; height: 60px; object-fit: contain; margin-right: 15px; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 15px; margin-bottom: 5px; }
.cart-item-info p { color: #2e7d32; font-weight: bold; }
.cart-controls { display: flex; align-items: center; gap: 10px; }
.cart-qty-btn { background: #eee; border: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer; font-weight: bold; font-size: 16px;}
.remove-btn { background: none; border: none; color: #ff5252; cursor: pointer; font-size: 18px; margin-left: 5px;}

/* Checkout Form */
.checkout-form { background: white; padding: 25px; border-radius: 10px; margin-top: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.08); border: 1px solid #eee; }
.checkout-form h3 { margin-bottom: 15px; color: #1a237e; border-bottom: 2px solid #e8eaf6; padding-bottom: 10px;}
.checkout-form input[type="text"], .checkout-form textarea { width: 100%; padding: 12px; margin: 10px 0; border: 1px solid #ccc; border-radius: 5px; font-family: 'Inter', sans-serif;}
.map-btn { background: #1a237e; color: white; border: none; padding: 12px; width: 100%; border-radius: 5px; cursor: pointer; margin-bottom: 10px; font-weight: bold; font-size: 15px;}
.map-btn:hover { background: #0d47a1; }
.distance-text { font-size: 14px; color: #1a237e; font-weight: bold; margin-bottom: 20px; text-align: center; }

/* Bill Breakup */
.bill-breakup { background: #f5f5f5; padding: 15px; border-radius: 5px; margin-bottom: 20px; border: 1px dashed #ccc;}
.bill-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px;}
.bill-row.final { font-size: 1.3em; font-weight: bold; color: #2e7d32; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 5px; }

/* Payment & Verification Modules */
.payment-method { background: #e3f2fd; padding: 15px; border-radius: 8px; margin-bottom: 20px; border: 1px solid #90caf9; }
.pay-option { display: block; margin-bottom: 10px; cursor: pointer; font-size: 15px; font-weight: 600;}
.error-text { color: #d32f2f; font-size: 13px; margin-top: 5px; font-weight: bold;}

.verification-box { padding: 12px; border-radius: 5px; margin-bottom: 20px; border-left: 4px solid; }
.alert-red { background: #ffebee; border-color: #f44336; color: #c62828; font-size: 14px; font-weight: bold; }
.alert-orange { background: #fff3e0; border-color: #ff9800; color: #e65100; font-size: 14px; font-weight: bold; }
.verification-box input { margin-top: 10px; width: 100%; font-family: 'Inter', sans-serif;}

.order-btn { background: #25D366; color: white; border: none; padding: 15px; width: 100%; border-radius: 5px; font-size: 18px; font-weight: bold; cursor: pointer; transition: 0.3s; box-shadow: 0 4px 6px rgba(37, 211, 102, 0.3); }
.order-btn:hover { background: #128c7e; transform: translateY(-2px); }

/* AI Chatbot Widgets */
.ai-float-btn { position: fixed; bottom: 25px; right: 25px; background: #000; color: white; border: none; padding: 15px 25px; border-radius: 30px; font-size: 16px; font-weight: bold; cursor: pointer; box-shadow: 0 6px 15px rgba(0,0,0,0.3); z-index: 1000; transition: 0.3s; display: flex; gap: 8px; align-items: center;}
.ai-float-btn i { color: #25D366; font-size: 1.2rem;}
.ai-float-btn:hover { transform: scale(1.05); }

.ai-chat-window { position: fixed; bottom: 90px; right: 25px; width: 350px; background: white; border-radius: 12px; box-shadow: 0 8px 25px rgba(0,0,0,0.2); z-index: 1000; overflow: hidden; display: flex; flex-direction: column; border: 1px solid #ddd;}
.ai-chat-header { background: #000; color: white; padding: 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.ai-chat-header i { color: #25D366; margin-right: 5px;}
.ai-chat-header button { background: none; border: none; color: white; font-size: 18px; cursor: pointer; }
.ai-chat-body { padding: 15px; height: 320px; overflow-y: auto; background: #ece5dd; display: flex; flex-direction: column; gap: 12px; }
.chat-msg { padding: 10px 15px; border-radius: 15px; max-width: 85%; font-size: 14px; line-height: 1.5; word-wrap: break-word; box-shadow: 0 1px 2px rgba(0,0,0,0.1); }
.ai-msg { background: white; align-self: flex-start; border-bottom-left-radius: 2px;}
.user-msg { background: #dcf8c6; align-self: flex-end; border-bottom-right-radius: 2px;}
.ai-chat-footer { padding: 10px; background: #f0f0f0; display: flex; gap: 8px; align-items: center;}
.ai-chat-footer input { flex: 1; padding: 12px 15px; border: none; border-radius: 25px; outline: none; font-size: 14px;}
.ai-chat-footer button { background: #25D366; color: white; border: none; width: 45px; height: 45px; border-radius: 50%; cursor: pointer; display: flex; justify-content: center; align-items: center; font-size: 18px; transition: 0.2s;}
.ai-chat-footer button:hover { background: #128c7e;}

/* Utility */
.hidden { display: none !important; }

/* 📱 MOBILE UI FIXES (Fixes Screenshot 1 Overlap) */
@media (max-width: 768px) {
    /* Navbar fixed to not push items off screen */
    .navbar { flex-wrap: wrap; padding: 15px; }
    .nav-links { width: 100%; justify-content: space-between; padding-top: 15px; border-top: 1px solid rgba(255,255,255,0.2); margin-top: 10px; }
    
    .search-container { padding: 10px 5%; }
    .search-bar { width: 100%; }
    
    /* Grid adjusted for mobile */
    .product-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
    .product-card { padding: 10px; }
    .product-card img { height: 110px; }
    .product-title { font-size: 13px; min-height: 35px; }
    
    /* Home adjustments */
    .hero h1 { font-size: 1.8rem; }
    .delivery-info { flex-direction: column; text-align: center; }
    
    /* Chatbot widget sized for mobile screens */
    .ai-chat-window { right: 15px; left: 15px; width: auto; bottom: 85px; }
    .ai-float-btn { right: 15px; bottom: 15px; }
}

/* WTL Assignment 6 - AJAX Suggestion Box Styles */
.suggestions-box { position: absolute; top: 100%; left: 0; right: 0; background: white; border-radius: 0 0 10px 10px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); z-index: 1000; max-height: 250px; overflow-y: auto; text-align: left; border: 1px solid #ddd; border-top: none;}
.suggestion-item { padding: 12px 15px; cursor: pointer; border-bottom: 1px solid #eee; color: #333; font-weight: 500; display: flex; justify-content: space-between;}
.suggestion-item:hover { background: #e3f2fd; color: #1a237e; }
.suggestion-item:last-child { border-bottom: none; }