/* style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f7f6;
    color: #333;
    line-height: 1.6;
    font-size: 12px; /* Base font size for better mobile readability */
}

.container {
    max-width: 1200px;
    margin: 15px auto; /* Slightly reduced margin for mobile */
    padding: 0 15px; /* Adjusted padding for smaller screens */
}

header {
    background-color: #4CAF50; /* Hijau */
    color: white;
    padding: 12px 0; /* Reduced padding */
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
}

header h1 {
    margin: 0;
    font-size: 2em; /* Adjusted for mobile */
    font-weight: 700;
}

header p {
    font-size: 0.9em; /* Smaller subtitle */
}

/* Search Bar and Cart Icon Container (NEW) */
.search-and-cart-container {
    background-color: #fefefe;
    padding: 8px 0; /* Reduced padding */
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    margin-bottom: 10px; /* Space below this section */
}

.search-and-cart-inner {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Space out search and cart */
    gap: 10px; /* Gap between search form and cart icon */
    padding: 0 15px; /* Ensure padding inside container */
}

.search-form {
    flex-grow: 1; /* Allow search form to take available space */
    display: flex;
    gap: 8px;
    align-items: center;
}

.search-form input[type="text"] {
    flex-grow: 1;
    padding: 6px 10px; /* Slightly smaller padding */
    border: 1px solid #ddd;
    border-radius: 20px; /* More rounded */
    font-size: 0.85em; /* Smaller font */
    outline: none;
    transition: border-color 0.3s ease;
}

.search-form input[type="text"]:focus {
    border-color: #4CAF50;
}

.search-form .btn-search {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 6px 12px; /* Smaller button */
    border-radius: 20px; /* Rounded button */
    cursor: pointer;
    font-size: 0.85em; /* Smaller font */
    transition: background-color 0.3s ease;
}

.search-form .btn-search:hover {
    background-color: #45a049;
}

.cart-icon-container {
    position: relative; /* For badge positioning */
    flex-shrink: 0; /* Prevent shrinking */
}

.cart-link {
    color: #333; /* Darker color for visibility */
    font-size: 1.5em; /* Larger icon */
    text-decoration: none;
    position: relative;
    padding: 5px;
    display: inline-block; /* To make padding work */
}

.cart-count {
    position: absolute;
    top: -5px; /* Adjust as needed */
    right: -5px; /* Adjust as needed */
    background-color: #FF0000; /* Red badge */
    color: white;
    font-size: 0.6em; /* Smaller font for count */
    border-radius: 50%;
    padding: 3px 6px;
    min-width: 18px; /* Ensure it's a circle even with 1 digit */
    text-align: center;
    line-height: 1.2;
    transform: translate(25%, -25%); /* Adjust position precisely */
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}


/* Main Navigation Bar (for customers/vendors) */
nav.main-nav, nav.admin-nav {
    background-color: #388E3C; /* Default green for main nav */
    padding: 4px 0;
    text-align: center;
    border-radius: 8px;
    margin-top: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}
nav.admin-nav {
    background-color: #2C3E50; /* Darker blue/grey for admin */
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Use flex for horizontal layout */
    flex-wrap: wrap; /* Allow wrapping on small screens */
    justify-content: center; /* Center align items */
    gap: 5px; /* Reduced gap between main nav items */
}

.nav-list li {
    position: relative; /* For dropdown positioning */
    flex-shrink: 0; /* Prevent items from shrinking too much */
}

.nav-list li a:not(.dropbtn) {
    display: block; /* Make entire link clickable */
    color: white;
    text-decoration: none;
    padding: 6px 10px; /* Adjusted padding */
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-size: 0.85em; /* Adjusted font size */
    white-space: nowrap; /* Prevent text wrapping */
}

.nav-list li a:not(.dropbtn):hover {
    background-color: #2E7D32; /* Darker green on hover */
}

/* Dropdown Button */
.nav-list .dropbtn {
    background-color: transparent;
    color: black; /* Changed to black */
    padding: 6px 10px;
    font-size: 0.85em;
    border: none;
    cursor: pointer;
    display: inline-flex; /* Align text and icon */
    align-items: center;
    gap: 5px;
    transition: background-color 0.3s ease;
}

.nav-list .dropbtn:hover, .nav-list .dropbtn:focus {
    background-color: #2E7D32; /* Darker green on hover */
    color: white; /* Keep white on hover for better contrast on dark background */
}
nav.admin-nav .dropbtn:hover, nav.admin-nav .dropbtn:focus {
    background-color: #34495E; /* Darker blue on hover */
    color: white; /* Keep white on hover for better contrast on dark background */
}


/* Dropdown Content (Hidden by Default) */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #0c853e; /* Dark background for dropdown */
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 100; /* Ensure it's above other content */
    border-radius: 8px;
    overflow: hidden; /* For rounded corners */
}

.dropdown-content a {
    color: white; /* Make text visible on dark background */
    padding: 8px 12px;
    text-decoration: none;
    display: block;
    text-align: left;
    font-size: 0.85em;
    transition: background-color 0.2s ease;
}

.dropdown-content a:hover {
    background-color: #0d420d; /* Darker green on hover */
}
/* Divider for dropdown content */
.dropdown-divider {
    height: 1px;
    margin: 6px 0;
    overflow: hidden;
    background-color: #7bf357;
}


/* Show the dropdown menu on hover */
.dropdown:hover .dropdown-content {
    display: block;
}

/* For mobile: hide dropdown content by default and use JS to toggle */
@media (max-width: 768px) {
    .nav-list {
        flex-direction: column; /* Stack menu items vertically */
        align-items: flex-start; /* Align to the left */
        gap: 0; /* Remove gap when stacked */
        padding: 5px 0; /* Add some padding */
    }
    .nav-list li {
        width: 100%; /* Full width for stacked items */
        text-align: left;
    }
    .nav-list li a:not(.dropbtn) {
        width: calc(100% - 20px); /* Adjust for padding */
        padding: 8px 10px;
        font-size: 0.9em;
    }
    .nav-list .dropbtn {
        width: calc(100% - 20px);
        padding: 8px 10px;
        font-size: 0.9em;
        justify-content: space-between; /* Push caret to the right */
    }
    .dropdown-content {
        position: static; /* Stack dropdown content below parent on mobile */
        box-shadow: none;
        border-radius: 0;
        min-width: unset;
        background-color: #365032; /* Lighter background for nested items */
        width: 100%;
        padding-left: 15px; /* Indent nested items */
    }
    .dropdown-content a {
        color: #ffffff; /* Ensure text is visible on mobile dropdown */
        padding: 8px 15px;
        font-size: 0.85em;
    }
    /* Initially hide dropdown content on mobile, JS will toggle */
    .dropdown .dropdown-content {
        display: none;
    }
}


.section-title {
    text-align: center;
    margin: 30px 0 15px; /* Adjusted margin */
    color: #4CAF50;
    font-size: 1.8em; /* Adjusted for mobile */
    font-weight: 600;
}
/* Smaller titles for homepage sections */
.homepage-section .section-title {
    font-size: 1.5em; /* Slightly smaller for internal sections */
    margin-top: 10px;
    margin-bottom: 10px;
}


/* Category Thumbnails Section (Reverted to original, but not displayed in index.php anymore) */
.category-thumbnails {
    display: flex;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 10px 0;
    gap: 15px;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
    justify-content: flex-start;
    padding-left: 15px;
    padding-right: 15px;
}

.category-thumbnails::-webkit-scrollbar {
    height: 6px;
}

.category-thumbnails::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.category-thumbnails::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

.category-item {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    font-size: 0.85em;
    text-align: center;
    padding: 8px;
    border-radius: 8px;
    transition: background-color 0.3s ease;
    margin-bottom: 0;
}

.category-item:hover {
    background-color: #e8f5e9;
}

.category-item img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0;
    border: 2px solid #4CAF50;
}

.category-item span {
    display: none; /* Hide the text */
}


/* Product Grid (Standard - for main product display and search results) */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); /* DIUBAH: Adjusted min-width for 240x240 thumbnails */
    gap: 10px; /* Reduced gap */
    padding: 10px 0;
}

.product-card {
    background-color: white;
    border-radius: 10px; /* Slightly smaller radius */
    box-shadow: 0 3px 6px rgba(0,0,0,0.1); /* Slightly lighter shadow */
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-2px); /* Slightly less transform */
    box-shadow: 0 4px 8px rgba(0,0,0,0.12); /* Slightly less shadow */
}

.product-card img {
    width: 100%;
    height: 180px; /* DIUBAH: Adjusted height for 240x240 thumbnail aspect */
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}

.product-card-content {
    padding: 8px; /* Reduced padding */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-card h3 {
    margin-top: 0;
    margin-bottom: 4px; /* DIUBAH: Reduced margin */
    color: #333;
    font-size: 1.1em; /* Adjusted font size */
    min-height: 1.1em; /* Ensure consistent height for 2 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Limit to 2 lines */
    -webkit-box-orient: vertical;
}

.product-card p {
    font-size: 0.8em; /* Adjusted font size */
    color: #666;
    margin-bottom: 4px; /* DIUBAH: Reduced margin */
    flex-grow: 1;
    min-height: 1.2em; /* Ensure consistent height for 3 lines */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Limit to 3 lines */
    -webkit-box-orient: vertical;
}

.product-card .price {
    font-size: 1em; /* Adjusted font size */
    font-weight: 500;
    color: #E67E22;
    margin-bottom: 8px; /* DIUBAH: Reduced margin */
}

.product-card .vendor-name {
    font-size: 0.75em; /* Adjusted font size */
    color: #777;
    margin-top: 2px; /* DIUBAH: Reduced margin */
}

.btn {
    display: inline-block;
    background-color: #007BFF; /* Biru */
    color: white;
    padding: 8px 15px; /* Reduced padding */
    border-radius: 6px; /* Slightly smaller border radius */
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    cursor: pointer;
    border: none;
    font-size: 0.9em; /* Adjusted font size */
    font-weight: 500;
}

.btn-primary {
    background-color: #4CAF50; /* Hijau */
}

.btn-primary:hover {
    background-color: #45a049;
    transform: translateY(-1px); /* Slightly less transform */
}

.btn-secondary {
    background-color: #007BFF; /* Biru */
}

.btn-secondary:hover {
    background-color: #0056b3;
    transform: translateY(-1px);
}

.btn-danger {
    background-color: #DC3545; /* Merah */
}

.btn-danger:hover {
    background-color: #c82333;
    transform: translateY(-1px);
}

.btn-small {
    padding: 4px 8px; /* Smaller padding for small buttons */
    font-size: 0.7em; /* Smaller font for small buttons */
    display: inline-flex; /* Align icon and text */
    align-items: center;
    gap: 4px; /* Reduced space between text and text */
}

/* Product Grid for horizontal scroll (for popular/new products) */
.product-grid.horizontal-scroll {
    display: flex;
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 8px 0; /* Reduced vertical padding */
    gap: 6px; /* Reduced gap between product cards */
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding-left: 5px; /* Padding for scrollable content */
    padding-right: 5px;
    margin-bottom: 5px; /* Reduced space below the section */
}

.product-grid.horizontal-scroll::-webkit-scrollbar {
    height: 5px; /* Smaller scrollbar */
}

.product-grid.horizontal-scroll::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.product-grid.horizontal-scroll::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

.product-card-small { /* Style for small product cards in horizontal scroll */
    flex: 0 0 calc(25% - 4.5px); /* Approx 4 items per row, accounting for gap */
    min-width: 70px; /* Minimum width to ensure readability */
    max-width: 100px; /* Max width for consistency */
    background-color: white;
    border-radius: 8px; /* Slightly smaller radius */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); /* Lighter shadow */
    overflow: hidden;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 6px; /* Reduced padding */
}

.product-card-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.product-card-small img {
    width: 100%;
    height: 60px; /* Smaller image height */
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.product-card-content-small {
    padding: 5px; /* Reduced padding */
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%; /* Ensure content takes full width of card */
}

.product-card-content-small h3 {
    margin-top: 0;
    margin-bottom: 2px; /* Reduced margin */
    color: #333;
    font-size: 0.75em; /* Smaller font size for product name */
    white-space: nowrap; /* Prevent text wrap */
    overflow: hidden; /* Hide overflow text */
    text-overflow: ellipsis; /* Add ellipsis for overflow */
}

.product-card-content-small .price {
    font-size: 0.65em; /* Smaller font size for price */
    font-weight: 600;
    color: #E67E22;
    margin-bottom: 5px; /* Reduced margin */
}

.product-card-content-small .btn {
    padding: 3px 6px; /* Smaller button for small card */
    font-size: 0.6em; /* Even smaller font for button */
    width: 100%; /* Full width button */
}

/* Related Product Card specific styling */
.related-product-card .btn-primary,
.related-product-card .btn-secondary {
    padding: 3px 5px; /* Slightly smaller buttons for related products */
    font-size: 0.6em; /* Smaller font */
    margin-bottom: 0; /* Remove default margin */
}

.related-product-card .product-card-content-small {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center; /* Center align content */
}
.related-product-card .product-card-content-small h3 {
    text-align: center;
    margin-bottom: 2px;
}
.related-product-card .product-card-content-small .price {
    text-align: center;
    margin-bottom: 6px;
}
.related-product-card .product-card-content-small .btn {
    margin-bottom: 3px; /* Space between buttons */
}


/* Product Detail Page */
.product-detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 10px; /* Reduced padding */
    margin-top: 10px; /* Reduced margin */
}

.product-detail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 12px; /* Reduced margin */
}

.product-detail h2 {
    color: #4CAF50;
    margin-bottom: 6px; /* Reduced margin */
    font-size: 1.5em; /* Adjusted for mobile */
}

.product-detail .vendor-info {
    font-size: 0.85em; /* Adjusted font size */
    color: #141313;
    margin-bottom: 8px; /* Reduced margin */
}

.product-detail .price {
    font-size: 1.1em; /* Adjusted font size */
    font-weight: 500;
    color: #E67E22;
    margin-bottom: 10px; /* Reduced margin */
}

.product-detail p {
    text-align: center;
    max-width: 600px;
    margin-bottom: 12px; /* Reduced margin */
    color: #555;
    font-size: 0.85em; /* Adjusted font size */
}

.product-detail form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px; /* Reduced gap */
}

/* Quantity control buttons */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px; /* Space below quantity control */
}

.quantity-control input[type="number"] {
    width: 50px; /* Adjust width */
    text-align: center;
    -moz-appearance: textfield; /* Hide Firefox arrows */
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9em;
}

.quantity-control input[type="number"]::-webkit-outer-spin-button,
.quantity-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Hide Chrome/Safari arrows */
    margin: 0;
}

.quantity-btn {
    background-color: #007BFF; /* Blue, matching btn-secondary */
    color: white;
    border: none;
    padding: 6px 10px; /* Sufficient padding for touch */
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em; /* Larger font for +/- */
    transition: background-color 0.3s ease;
}

.quantity-btn:hover {
    background-color: #0056b3;
}

/* Notes textarea */
.add-to-cart-section textarea#item_notes {
    width: calc(100% - 16px); /* Match input width */
    max-width: 235px; /* Max width for inputs */
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.9em;
    min-height: 50px; /* Set a minimum height for visibility */
    resize: vertical; /* Allow vertical resizing */
    margin-bottom: 10px; /* Space below textarea */
}

/* Cart Page */
.cart-items {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px; /* Reduced padding */
    margin-top: 25px; /* Reduced margin */
}

.cart-item {
    display: flex;
    align-items: center;
    margin-bottom: 12px; /* Reduced margin */
    padding-bottom: 12px; /* Reduced padding */
    border-bottom: 1px solid #eee;
    flex-wrap: wrap; /* Allow items to wrap on smaller screens */
}

.cart-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.cart-item img {
    width: 70px; /* Smaller image */
    height: 70px; /* Smaller image */
    object-fit: cover;
    border-radius: 8px;
    margin-right: 10px; /* Reduced margin */
    flex-shrink: 0; /* Prevent shrinking */
}

.cart-item-details {
    flex-grow: 1;
    margin-right: 10px; /* Space before actions */
    min-width: 150px; /* Ensure details don't get too squished */
}

.cart-item-details h4 {
    margin: 0 0 4px 0; /* Reduced margin */
    color: #333;
    font-size: 1em; /* Adjusted font size */
}

.cart-item-details p {
    margin: 0;
    color: #666;
    font-size: 0.8em; /* Adjusted font size */
}

.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px; /* Reduced gap */
    margin-top: 10px; /* Add margin on top for wrapping */
    width: 100%; /* Take full width when wrapped */
    justify-content: flex-end; /* Align actions to the right when wrapped */
}

.cart-item-actions input[type="number"] {
    width: 50px; /* Smaller input */
    padding: 4px; /* Reduced padding */
    border: 1px solid #ccc;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em; /* Adjusted font size */
}

.cart-summary {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px; /* Reduced padding */
    margin-top: 15px; /* Reduced margin */
    text-align: right;
}

.cart-summary p {
    font-size: 1.1em; /* Adjusted font size */
    font-weight: 600;
    margin-bottom: 12px; /* Reduced margin */
}

.cart-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px; /* Reduced gap */
    margin-top: 15px; /* Reduced margin */
}

/* Checkout Form */
.checkout-form {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 25px; /* Reduced padding */
    margin-top: 25px; /* Reduced margin */
    max-width: 500px; /* Reduced max width */
    margin-left: auto;
    margin-right: auto;
}

.checkout-form label {
    display: block;
    margin-bottom: 6px; /* Reduced margin */
    font-weight: 500;
    color: #555;
    font-size: 0.9em; /* Adjusted font size */
}

.checkout-form input[type="text"],
.checkout-form input[type="tel"],
.checkout-form textarea,
.checkout-form select,
.checkout-form input[type="file"] { /* Added file input styling */
    width: calc(100% - 16px); /* Adjust width for padding */
    padding: 8px; /* Reduced padding */
    margin-bottom: 15px; /* Reduced margin */
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9em; /* Adjusted font size */
}

.checkout-form textarea {
    resize: vertical;
    min-height: 70px; /* Reduced min height */
}

.checkout-form .form-group {
    margin-bottom: 15px; /* Reduced margin */
}

/* Order Confirmation */
.order-confirmation {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 30px; /* Reduced padding */
    margin-top: 40px; /* Reduced margin */
    text-align: center;
}

.order-confirmation h2 {
    color: #4CAF50;
    margin-bottom: 15px; /* Reduced margin */
    font-size: 2em; /* Adjusted font size */
}

.order-confirmation p {
    font-size: 1em; /* Adjusted font size */
    color: #555;
    margin-bottom: 20px; /* Reduced margin */
}

.order-confirmation ul {
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
    text-align: left; /* Align list items to left */
}

.order-confirmation ul li {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.order-confirmation h3 {
    font-size: 1.5em;
    margin-top: 25px;
    margin-bottom: 15px;
    color: #4CAF50;
}

.order-confirmation .btn {
    padding: 10px 20px;
    font-size: 1em;
}

/* Vendor Login & Customer Login */
.login-form {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 25px; /* Reduced padding */
    margin-top: 40px; /* Reduced margin */
    max-width: 350px; /* Reduced max width */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.login-form h2 {
    color: #4CAF50;
    margin-bottom: 20px; /* Reduced margin */
    font-size: 1.8em; /* Adjusted font size */
}

.login-form input[type="email"],
.login-form input[type="password"],
.login-form input[type="tel"] { /* Added tel input for customer/vendor login */
    width: calc(100% - 16px); /* Adjust width for padding */
    padding: 10px; /* Reduced padding */
    margin-bottom: 15px; /* Reduced margin */
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 0.9em; /* Adjusted font size */
}

.login-form button {
    width: 100%;
    padding: 10px; /* Reduced padding */
    font-size: 1em; /* Adjusted font size */
}

.error-message {
    color: #DC3545;
    margin-top: 8px; /* Reduced margin */
    font-weight: 500;
    font-size: 0.85em; /* Adjusted font size */
}

.success-message { /* New style for success messages */
    color: #28A745;
    margin-top: 8px;
    font-weight: 500;
    font-size: 0.85em;
}

/* Vendor Dashboard & Customer Dashboard */
.homepage-section { /* Container for sections like popular, new, shops */
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 10px;
    margin-top: 10px; /* Space between sections */
}

.dashboard-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 20px; /* Reduced padding */
    margin-top: 25px; /* Reduced margin */
}

.dashboard-section h2 {
    color: #4CAF50;
    margin-bottom: 15px; /* Reduced margin */
    font-size: 1.8em; /* Adjusted font size */
}

.order-list {
    list-style: none;
    padding: 0;
}

.order-item-dashboard {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px; /* Reduced padding */
    margin-bottom: 12px; /* Reduced margin */
}

.order-item-dashboard strong {
    color: #333;
}

.order-item-dashboard p {
    margin: 4px 0; /* Reduced margin */
    font-size: 0.9em; /* Adjusted font size */
    color: #666;
}

.order-item-dashboard ul {
    list-style: none;
    padding-left: 0;
    margin-top: 8px; /* Reduced margin */
    border-top: 1px dashed #ddd;
    padding-top: 8px; /* Reduced padding */
}

.order-item-dashboard ul li {
    margin-bottom: 4px; /* Reduced margin */
    font-size: 0.85em; /* Adjusted font size */
    color: #444;
}

.order-status-form {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping */
    gap: 8px; /* Reduced gap */
    margin-top: 15px; /* Reduced margin */
    align-items: center;
}

.order-status-form select {
    padding: 6px; /* Reduced padding */
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 0.85em; /* Adjusted font size */
    flex-grow: 1; /* Allow select to grow */
    min-width: 120px; /* Minimum width for select */
}

.order-status-form button {
    padding: 6px 12px; /* Reduced padding */
    font-size: 0.85em; /* Adjusted font size */
    flex-shrink: 0; /* Prevent button from shrinking */
}

/* Recent Orders List on Index Page */
.recent-orders-list {
    padding: 15px;
    margin-bottom: 30px;
    background-color: #e8f5e9; /* Light green background */
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.recent-orders-list ul {
    list-style: none;
    padding: 0;
}

.recent-orders-list li {
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #c8e6c9; /* Lighter dashed border */
    font-size: 0.9em;
    color: #388E3C; /* Darker green text */
}

.recent-orders-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Footer */
footer {
    text-align: center;
    padding: 10px 0; /* Reduced padding */
    margin-top: 15px; /* Reduced margin */
    background-color: #61ca46;
    color: white;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    font-size: 0.85em; /* Adjusted font size */
}

/* Policy and Guide Pages */
.policy-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 25px;
    margin-top: 25px;
}
.policy-section h3 {
    color: #388E3C;
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 1.2em;
}
.policy-section ul {
    list-style: disc;
    padding-left: 20px;
    margin-bottom: 15px;
}
.policy-section ol {
    list-style: decimal;
    padding-left: 20px;
    margin-bottom: 15px;
}
.policy-section li {
    margin-bottom: 5px;
}


/* Profile Section in Customer Dashboard */
.profile-section {
    padding: 20px;
    text-align: center;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.profile-section img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #4CAF50;
    margin-bottom: 10px;
}

.profile-section h3 {
    font-size: 1.5em;
    color: #333;
    margin-bottom: 5px;
}

.profile-section p {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

/* Product List Management in Vendor Dashboard */
.product-list-management {
    display: grid;
    grid-template-columns: 1fr; /* Stack on mobile */
    gap: 15px;
    margin-top: 20px;
}

.product-item-management {
    background-color: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap; /* Allow wrapping */
}

.product-item-management img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.product-item-management .product-info {
    flex-grow: 1;
    min-width: 150px; /* Ensure info doesn't get too squished */
}

.product-item-management .product-info h4 {
    margin: 0 0 5px 0;
    font-size: 1em;
    color: #333;
    margin-top: 2px;
}

.product-item-management .product-info p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
    margin-top: 2px;
}

.product-item-management .product-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
    margin-top: 5px; /* Margin when wrapped */
    width: 100%; /* Take full width when wrapped */
    justify-content: flex-end;
}

/* Shop List Grid */
.shop-list-grid {
    display: flex; /* Use flex for horizontal scroll */
    overflow-x: auto; /* Enable horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    padding: 10px 0; /* Reduced vertical padding */
    gap: 8px; /* Reduced gap between shop cards */
    background-color: #e0f2f1; /* Light teal background */
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    padding-left: 10px; /* Padding for scrollable content */
    padding-right: 10px;
}

.shop-list-grid::-webkit-scrollbar {
    height: 6px;
}

.shop-list-grid::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

.shop-list-grid::-webkit-scrollbar-track {
    background-color: #f1f1f1;
    border-radius: 10px;
}

.shop-card-small { /* New style for small shop cards */
    flex: 0 0 calc(25% - 6px); /* Approx 4 items per row, accounting for gap */
    min-width: 80px; /* Minimum width to ensure readability */
    max-width: 110px; /* Max width for consistency */
    background-color: white;
    border-radius: 8px; /* Slightly smaller radius */
    box-shadow: 0 2px 5px rgba(0,0,0,0.1); /* Lighter shadow */
    overflow: hidden;
    transition: transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 8px; /* Reduced padding */
    text-decoration: none; /* Remove underline from link */
    color: inherit; /* Inherit text color */
}

.shop-card-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 3px 7px rgba(0,0,0,0.15);
}

.shop-card-small img {
    width: 60px; /* Thumbnail size */
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 5px;
    border: 2px solid #4CAF50; /* Green border */
}

.shop-card-small h3 {
    margin-top: 0;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 3px;
}

.shop-card-small p {
    font-size: 0.85em;
    color: #666;
    margin-bottom: 5px;
}

.shop-card-small .shop-location {
    font-size: 0.75em;
    color: #666;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


/* Admin Dashboard Styles */
.admin-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); /* 2-3 columns on mobile, more on desktop */
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 30px;
}

.admin-stats-grid .stat-card {
    background-color: #e8f5e9; /* Light green background */
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

.admin-stats-grid .stat-card h3 {
    font-size: 1em; /* Smaller title for stat cards */
    color: #388E3C; /* Darker green */
    margin-top: 0;
    margin-bottom: 5px;
}

.admin-stats-grid .stat-card p {
    font-size: 1.5em; /* Larger number */
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 10px;
}

.admin-stats-grid .stat-card .btn {
    width: 100%;
    padding: 6px 10px;
    font-size: 0.8em;
}

.admin-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.admin-actions-grid .btn {
    width: 100%;
    padding: 10px;
    font-size: 0.9em;
}

.admin-table-container {
    overflow-x: auto; /* Enable horizontal scroll for tables on small screens */
    -webkit-overflow-scrolling: touch;
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.85em;
}

.admin-table th, .admin-table td {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
    white-space: nowrap; /* Prevent text wrapping in table cells */
}

.admin-table th {
    background-color: #4CAF50;
    color: white;
    font-weight: 600;
}

.admin-table tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

.admin-table tbody tr:hover {
    background-color: #e8f5e9;
}

.admin-table .status-pending { color: #FFC107; font-weight: bold; }
.admin-table .status-processing { color: #007BFF; font-weight: bold; }
.admin-table .status-completed { color: #28A745; font-weight: bold; }
.admin-table .status-cancelled { color: #DC3545; font-weight: bold; }

.admin-detail-section {
    background-color: white;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    padding: 15px;
    margin-top: 20px;
}

.admin-detail-section h3 {
    color: #388E3C;
    font-size: 1.2em;
    margin-bottom: 15px;
}

.admin-detail-section p {
    margin-bottom: 8px;
    font-size: 0.8em;
}

.admin-detail-section h4 {
    color: #4CAF50;
    font-size: 0.8em;
    margin-top: 20px;
    margin-bottom: 10px;
}

.admin-detail-section ul {
    list-style: none;
    padding-left: 0;
    margin-bottom: 15px;
}

.admin-detail-section ul li {
    margin-bottom: 5px;
    font-size: 0.9em;
}

.admin-detail-section .order-status-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.admin-detail-section .order-status-form label {
    margin-bottom: 0;
    font-weight: normal;
    font-size: 0.9em;
}

.admin-detail-section .order-status-form select {
    flex-grow: 1;
    max-width: 150px;
}

.admin-detail-section .whatsapp-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.admin-detail-section .whatsapp-actions .btn {
    flex-grow: 1;
    min-width: 120px;
}

/* Responsive adjustments */
@media (min-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); /* Adjust for larger screens */
    }
}

@media (max-width: 768px) {
    .container {
        margin: 10px auto;
        padding: 0 10px;
    }
    header h1 {
        font-size: 1.2em;
    }
    nav.main-nav a {
        font-size: 0.75em;
        padding: 4px 6px;
    }
    .section-title {
        font-size: 1.6em;
        margin: 25px 0 12px;
    }
    .homepage-section .section-title {
        font-size: 1.1em;
    }
    .product-grid.horizontal-scroll .product-card-small {
        flex: 0 0 calc(33.33% - 6.66px); /* 3 items per row on smaller tablets */
        min-width: 90px;
    }
    .shop-list-grid .shop-card-small {
        flex: 0 0 calc(33.33% - 6.66px); /* 3 items per row on smaller tablets */
        min-width: 90px;
    }
    .admin-stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    .admin-stats-grid .stat-card h3 {
        font-size: 0.9em;
    }
    
