/* --- General Body & Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #333;
}
.main-container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
}

/* --- Navbar & Header --- */
.navbar {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 0 20px;
}
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    height: 70px;
    position: relative;
}
.nav-logo { font-size: 1.8em; font-weight: bold; color: #533692; text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 20px; }
.nav-menu { list-style: none; display: flex; margin: 0; padding: 0; gap: 20px; align-items: center; }
.nav-link { color: #555; font-weight: 500; text-decoration: none; }
.nav-icons { display: flex; align-items: center; gap: 20px; }
.nav-icon-link { color: #333; font-size: 1.3em; text-decoration: none; position: relative; }
.cart-link .cart-count {
    position: absolute;
    top: -8px;
    right: -10px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    padding: 2px 6px;
    font-size: 0.6em;
}
.hamburger-menu { display: none; }

/* --- Search Page Styles (with fix) --- */
.search-page-container { text-align: center; }
.search-header { margin-bottom: 30px; }
.search-input-wrapper {
    position: relative;
    max-width: 600px;
    margin: 10px auto 0;
}
.search-input-wrapper i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}
#mainSearchInput {
    width: 100%;
    padding: 15px 20px 15px 50px;
    font-size: 1.1em; /* Slightly smaller font on mobile */
    border-radius: 30px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    box-sizing: border-box; /* THIS IS THE FIX */
}
.search-placeholder { color: #777; }
#searchResultsGrid {
    text-align: left;
}

/* --- Homepage Sections --- */
.hero-section {
    text-align: center;
    padding: 40px 20px;
    background-color: #e9ecef;
    border-radius: 8px;
    margin-bottom: 30px;
}
.prescription-upload-section {
    text-align: center;
    margin-bottom: 30px;
}
.prescription-upload-section .card {
    max-width: 600px;
    margin: 0 auto;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.top-selling-container {
    margin-top: 30px;
}
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    margin-bottom: 25px;
}
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}
.product-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: center;
    padding: 20px;
}
.product-card img {
    max-width: 100%;
    height: 150px;
    object-fit: contain;
}

/* --- Product Details Page --- */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    background: #fff;
    padding: 30px;
    border-radius: 8px;
}
.product-detail-image img {
    max-width: 100%;
    border-radius: 8px;
}
.composition-string {
    font-size: 1em;
    font-weight: 500;
    color: #555;
    margin-top: -10px;
    margin-bottom: 15px;
}
.marketer-name {
    color: #6c757d;
    margin-top: -10px;
}
.price-container {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}
.price-container .price, .price-container .discounted-price {
    font-size: 1.8em;
    font-weight: bold;
}
.original-price {
    color: #7f8c8d;
    text-decoration: line-through;
}
.discount-badge {
    background-color: #e74c3c;
    color: white;
    padding: 4px 8px;
    font-size: 0.8em;
    font-weight: bold;
    border-radius: 4px;
}
.substitutes-container.card {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 30px;
}
.substitutes-container h2 {
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px;
}

/* --- Cart & Checkout --- */
.cart-container table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.cart-container th, .cart-container td {
    padding: 15px;
    border-bottom: 1px solid #ddd;
    text-align: left;
}
.cart-summary {
    text-align: right;
    margin-top: 20px;
}
.wallet-notice {
    color: #28a745;
    font-weight: 500;
}
.checkout-container {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 30px;
    align-items: start;
}
.order-summary-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}
.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}
.total-row {
    font-weight: bold;
    font-size: 1.2em;
}
.wallet-apply-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* --- My Account Page --- */
.account-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}
.account-section {
    background: #fff;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.wallet-balance {
    font-size: 1.5em;
    margin-bottom: 20px;
}
.wallet-balance span {
    font-weight: bold;
    color: #28a745;
}
.transaction-history td.cashback {
    color: #28a745;
    font-weight: bold;
}
.transaction-history td.spent {
    color: #e74c3c;
    font-weight: bold;
}

/* --- Footer --- */
footer {
    background: #343a40;
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: auto;
}

/* --- Responsive Design --- */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 70px;
        right: 0;
        width: 250px;
        background-color: #fff;
        box-shadow: 0 4px 8px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 10px 0;
        z-index: 1000;
    }
    .nav-menu.active {
        display: flex;
    }
    .nav-item {
        width: 100%;
        text-align: center;
        padding: 10px 0;
    }
    .hamburger-menu {
        display: block;
        cursor: pointer;
        background: none;
        border: none;
    }
    .hamburger-menu span {
        display: block;
        width: 25px;
        height: 3px;
        background-color: #333;
        margin: 5px 0;
    }
    #search-box.active {
        width: 180px;
    }
    .product-detail-container, .checkout-container, .account-container {
        grid-template-columns: 1fr;
    }
    .order-summary-card {
        grid-row: 1;
    }
}
/* --- Modern Rounded Card Footer --- */
footer {
    background-color: #ffffff; /* Light background to contrast with the card */
    padding: 40px 20px 20px 20px;
    margin-top: 40px;
}
.footer-card {
    max-width: 1200px;
    margin: 0 auto;
    background: #000000;
    border-radius: 16px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    padding-bottom: 30px;
}
.footer-column h4 {
    font-size: 1.2em;
    color: #ffffff;
    margin-bottom: 15px;
}
.footer-column p {
    color: #ffffff;
    line-height: 1.7;
}
.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}
.footer-column ul li {
    margin-bottom: 10px;
}
.footer-column ul a {
    color: #ffffff;
    text-decoration: none;
}
.footer-column ul a:hover {
    color: #533692; /* Theme color */
}
.footer-column ul i {
    margin-right: 10px;
    color: #533692; /* Theme color */
}
.social-icons {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}
.social-icons a {
    color: #fff48b;
    font-size: 1.2em;
}
.footer-bottom {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    text-align: center;
    font-size: 0.9em;
    color: #ffffff;
}






/* --- General Body & Typography --- */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: #f8f9fa;
    color: #333;
}
.main-container { padding: 20px; max-width: 1200px; margin: 0 auto; width: 100%; box-sizing: border-box; }

/* --- NEW FLOATING HEADER --- */
.site-header { padding: 20px; }
.navbar {
    max-width: 1200px; margin: 0 auto; background-color: #ffffff;
    border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    padding: 15px 30px; display: flex; justify-content: space-between; align-items: center;
    position: relative;
}
.nav-logo { font-size: 1.8em; font-weight: bold; color: #533692; text-decoration: none; }
.nav-menu { list-style: none; display: flex; margin: 0; padding: 0; gap: 30px; }
.nav-link { color: #555; font-weight: 500; text-decoration: none; }
.nav-actions { display: flex; align-items: center; gap: 25px; }
.nav-icon-link { color: #333; font-size: 1.2em; text-decoration: none; }
.nav-cart-button {
    background-color: #1A202C; color: #fff; padding: 10px 20px;
    border-radius: 20px; text-decoration: none; display: flex;
    align-items: center; gap: 8px; font-weight: 500;
}
.cart-count { background: #533692; border-radius: 50%; font-size: 0.8em; min-width: 20px; height: 20px; line-height: 20px; text-align: center; }
.hamburger-menu { display: none; }

/* --- Other Sections --- */
/* ... (All your other existing styles for product cards, forms, etc.) ... */

/* --- RESPONSIVE DESIGN FOR NEW HEADER --- */
@media (max-width: 992px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 85px; /* Adjust position to be below the header card */
        right: 20px;
        width: 250px;
        background-color: #fff;
        box-shadow: 0 4px 12px rgba(0,0,0,0.1);
        flex-direction: column;
        padding: 10px 0;
        border-radius: 12px;
        z-index: 1000;
    }
    .nav-menu.active { display: flex; }
    .nav-item { width: 100%; text-align: left; padding: 10px 20px; }
    
    .hamburger-menu {
        display: block; cursor: pointer; background: none; border: none; z-index: 1001;
        padding: 0; margin-left: -10px; /* Adjust spacing */
    }
    .hamburger-menu span { display: block; width: 25px; height: 3px; background-color: #333; margin: 5px 0; }
}
@media (max-width: 600px) {
    .site-header { padding: 10px; }
    .navbar { padding: 10px 20px; }
    .nav-menu { gap: 0; }
    .nav-actions { gap: 15px; }
}