:root {
    --primary-color: #008ecc;
    --secondary-color: #f7f7f7;
    --text-color: #333;
    --white: #fff;
    --red: #d32f2f;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--secondary-color);
    padding-bottom: 60px; /* Space for footer */
}

/* Header */
header {
    background-color: var(--primary-color);
    padding: 10px 15px;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.search-bar {
    flex-grow: 1;
    margin: 0 15px;
    position: relative;
    max-width: 600px;
}

.search-bar input {
    width: 100%;
    padding: 10px 15px;
    border-radius: 4px;
    border: none;
    outline: none;
}

.cart-icon {
    color: var(--white);
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
}

.cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: var(--red);
    color: var(--white);
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.75rem;
    font-weight: bold;
}

/* Offer Banner */
.offer-banner {
    background-color: #e8f3ff;
    padding: 10px;
    text-align: center;
    color: var(--primary-color);
    font-weight: bold;
    border-bottom: 1px solid #d0e4ff;
    animation: fadeIn 1s;
}

/* Product Grid */
.container {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 15px;
}

.section-title {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--text-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.product-card {
    background: var(--white);
    border-radius: 8px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
}

.product-name {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 5px;
    line-height: 1.3;
    height: 38px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.price-container {
    margin-top: auto;
}

.price {
    font-weight: bold;
    font-size: 1.1rem;
    color: var(--text-color);
}

.mrp {
    text-decoration: line-through;
    color: #888;
    font-size: 0.85rem;
    margin-left: 5px;
}

.discount {
    color: var(--green, #2e7d32);
    font-size: 0.8rem;
    font-weight: bold;
    margin-left: 5px;
}

.add-btn {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    width: 100%;
    padding: 8px;
    margin-top: 10px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.2s;
}

.add-btn:hover {
    background-color: #007bb5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    margin: auto;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    position: relative;
    animation: slideDown 0.3s;
}

.close-modal {
    position: absolute;
    top: 10px;
    right: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover {
    color: #000;
}

.modal h2 {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.modal p {
    margin-bottom: 20px;
    color: #555;
}

.enable-btn {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    width: 100%;
}

/* Footer (Mobile Nav) */
.mobile-nav {
    display: flex;
    justify-content: space-around;
    position: fixed;
    bottom: 0;
    width: 100%;
    background: white;
    padding: 10px 0;
    border-top: 1px solid #ddd;
    box-shadow: 0 -2px 5px rgba(0,0,0,0.05);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #666;
    text-decoration: none;
    font-size: 0.8rem;
}

.nav-item.active {
    color: var(--primary-color);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
