* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f4f4f4;
}

a {
    text-decoration: none;
    color: #333;
}

header, nav, main, footer {
    display: block;
    width: 100%;
}

nav a, #nav-categories a {
    color: #fff;
    margin-right: 15px;
}

#nav-categories {
    display: inline-flex;
    gap: 15px;
}

header {
    background: #333;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 70px;
}

nav {
    margin: 0 30px;
    flex: 1;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
    padding: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 25px;
    flex-shrink: 0;
}

.user-status-bar {
    position: relative;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
}

.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 150px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1001;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.user-status-bar:hover .user-dropdown {
    display: block;
}

.user-dropdown a, .user-dropdown button {
    display: block;
    width: 100%;
    padding: 10px 15px;
    color: #333;
    text-align: left;
    background: none;
    border: none;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.2s;
}

.user-dropdown a:last-child, .user-dropdown button:last-child {
    border-bottom: none;
}

.user-dropdown a:hover, .user-dropdown button:hover {
    background: #f4f4f4;
    color: #007bff;
}

.username-trigger {
    color: #ffd700;
    font-weight: bold;
    cursor: pointer;
    padding: 8px 0;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.username-trigger::after {
    content: ' ▼';
    font-size: 0.7rem;
}

.user-status-bar > a {
    color: #fff;
    background: #555;
    padding: 5px 12px;
    border-radius: 4px;
}

.shopping-cart {
    position: relative;
    background: #444;
    padding: 8px 15px;
    cursor: pointer;
    border-radius: 5px;
    white-space: nowrap;
    transition: background 0.2s;
}

.shopping-cart:hover {
    background: #555;
}

.cart-summary {
    font-weight: bold;
    color: white;
}

.cart-dropdown {
    display: none; 
    position: absolute;
    top: 100%;
    right: 0;
    width: 280px;
    background: white;
    color: #333;
    border: 1px solid #ddd;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    z-index: 1000; 
    padding: 15px;
    border-radius: 4px;
    margin-top: 5px;
}

.shopping-cart:hover .cart-dropdown {
    display: block;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 8px 0;
    font-size: 0.9rem;
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item .item-info {
    flex-grow: 1;
}

.cart-item .item-price {
    font-weight: bold;
    margin-left: 10px;
}

hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 10px 0;
}

.checkout-btn {
    display: block;
    width: 100%;
    background: #28a745;
    color: white;
    text-align: center;
    padding: 8px;
    margin-top: 10px;
    border: none;
    cursor: pointer;
}

.breadcrumbs {
    padding: 1rem 2rem;
    background: #e9ecef;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: #007bff;
}

main {
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    margin-bottom: 1rem;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
}

.product-list {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: flex-start;
}

.product-item {
    background: white;
    border: 1px solid #ddd;
    padding: 15px;
    width: 250px; 
    flex-grow: 1; 
    flex-basis: 200px; 
    text-align: center;
    transition: transform 0.2s;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.product-thumb {
    width: 100%;
    height: 150px;
    background-color: #eee; 
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
    color: #888;
}

.add-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    margin-top: 10px;
}

.product-detail {
    display: flex;
    gap: 30px;
    background: white;
    padding: 20px;
    flex-wrap: wrap;
}

.large-image {
    flex: 1;
    min-width: 300px;
    height: 400px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #888;
}

.product-info {
    flex: 1;
    min-width: 300px;
}

footer {
    text-align: center;
    padding: 2rem;
    background: #333;
    color: white;
    margin-top: 2rem;
}

aside {
    margin-bottom: 20px;
}

.price {
    font-size: 1.5rem;
    color: #d9534f;
    margin: 10px 0;
}

.product-info .add-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
}