.product-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
}

.product-list > li > a,
.category-list > li > a {
    text-decoration: none;
    color: #333; /* Modified to dark grey/black */
    display: block;
}

.product-card a {
    text-decoration: none;
    color: inherit;
    display: block; /* Increase clickable area */
}

.product-card h3,
.product-card p {
    color: #333;
    margin: 0.5rem 0;
    text-decoration: none; /* Force remove potential underlines */
}

.product-thumb {
    width: 100%;
    height: 150px;
    object-fit: contain;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Product detail page image styles */
.product-detail-image {
    max-width: 100%;
    max-height: 500px;
    height: auto;
    width: auto;
    display: block;
    margin: 1rem auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.product-image-container {
    width: 100%;
    height: 150px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.no-image {
    color: #999;
    font-size: 0.8rem;
}

.description {
    line-height: 1.6;
    color: #444;
    margin: 1.5rem 0;
    white-space: pre-wrap;
    text-align: left;
}

.back-link {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 4px;
}

.back-link:hover {
    background: #0056b3;
}

.product-detail-container {
    max-width: 800px;
    margin: 2rem auto;
    padding: 2rem;
    text-align: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.product-detail-container h2,
.product-detail-container p {
    color: #333;
}

.product-card {
    width: 250px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: box-shadow 0.3s;
}

.category-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    padding: 2rem;
    justify-content: center;
}

.category-card {
    width: 200px;
    height: 120px;
    border-radius: 8px;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    background: #f8f9fa;
    /* border-bottom: 2px solid #007bff; Removed original border, using external hr instead */
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
    color: #333;
}

.header-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

.breadcrumb {
    padding: 0.5rem 2rem;
    background: #eee;
    font-size: 0.9rem;
    color: #333;
}

.breadcrumb a {
    text-decoration: none;
    color: #007bff;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.cart-item input {
    width: 50px;
    padding: 2px;
}

.cart-total {
    margin-top: 1rem;
    font-weight: bold;
    text-align: right;
    border-top: 1px solid #eee;
    padding-top: 0.5rem;
    color: #333;
}

.checkout-btn {
    width: 100%;
    margin-top: 1rem;
    padding: 0.8rem;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.checkout-btn:hover {
    background: #218838;
}

.add-btn {
    margin-top: 0.5rem;
    padding: 0.5rem 1rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
}

.cart-item {
    display: grid;
    grid-template-columns: 1fr 50px 80px 30px; /* Fixed width allocation: name, quantity, price, delete button */
    align-items: center;
    gap: 0.5rem;
    margin: 0.8rem 0;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid #eee;
    text-align: left;
}

.cart-item span:nth-child(1) {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* Show ellipsis if name is too long */
}

.cart-item span:nth-child(3) {
    text-align: right; /* Align price to the right */
    font-family: monospace; /* Monospace font for better alignment of numbers */
}

.cart-item button {
    background: #ff4d4d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    padding: 2px 5px;
}

header nav a {
    text-decoration: none;
    color: #007bff;
}

header nav a:hover {
    text-decoration: underline;
}

.shopping-cart {
    position: relative;
    cursor: pointer;
    color: #333;
}

.cart-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background-color: white;
    border: 1px solid #ccc;
    padding: 1rem;
    min-width: 320px;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    border-radius: 8px;
    cursor: default;
}

.shopping-cart:hover .cart-dropdown,
.shopping-cart:focus-within .cart-dropdown {
    display: block;
}

.category-card.selected {
    background: #ddd;
}