@import '/style.css';

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* User Header */
header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 0 2rem;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: var(--shadow-sm);
}

.brand {
    font-size: 1.75rem;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.04em;
    font-family: 'Inter', sans-serif; /* Could swap for a serif if desired */
}

.user-nav {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Main Layout */
#app-container {
    display: flex;
    flex-direction: column;
    gap: 2.5rem;
    max-width: 1400px;
    margin: 3rem auto;
    padding: 0 1.5rem;
    width: 100%;
}

@media (min-width: 1024px) {
    #app-container {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* Product Grid */
#products-container {
    flex: 1;
}

#products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2.5rem;
}

.product {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: none;
    overflow: hidden;
    transition: all var(--transition-smooth);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.product-info {
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info h3 {
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    color: var(--text-main);
}

.product-info p {
    color: var(--text-muted);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.add-to-cart-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    width: 100%;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

.add-to-cart-btn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.add-to-cart-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    color: var(--text-muted);
    transform: none;
}

/* Cart Sidebar/Panel */
#cart-container {
    width: 100%;
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: 2rem;
    border: none;
}

@media (min-width: 1024px) {
    #cart-container {
        width: 400px;
        position: sticky;
        top: 110px;
    }
}

#cart-container h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
}

#cart-items {
    max-height: 50vh;
    overflow-y: auto;
    padding-right: 0.75rem;
}

/* Custom Scrollbar */
#cart-items::-webkit-scrollbar {
    width: 6px;
}
#cart-items::-webkit-scrollbar-track {
    background: transparent;
}
#cart-items::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 20px;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease-out;
}

.cart-item-info .item-name {
    font-weight: 600;
    font-size: 1rem;
    display: block;
    color: var(--text-main);
    margin-bottom: 0.25rem;
}

.cart-item-info span:not(.item-name) {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: var(--background-color);
    padding: 0.35rem;
    border-radius: var(--radius-full);
}

.cart-item-controls button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: white;
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    font-weight: bold;
    color: var(--primary-color);
    transition: all var(--transition-fast);
}
.cart-item-controls button:hover {
    background-color: var(--primary-color);
    color: white;
}

.cart-total {
    margin-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-main);
    border-top: 2px solid var(--border-color);
    padding-top: 1.5rem;
}

#place-order-btn {
    width: 100%;
    margin-top: 1.5rem;
    padding: 1rem;
    font-size: 1rem;
    background-color: var(--warning-color);
    color: white;
    border: none;
    border-radius: var(--radius-full);
    cursor: pointer;
    font-weight: 700;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: var(--shadow-md);
}

#place-order-btn:hover {
    filter: brightness(110%);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

/* Order History */
#orders-container {
    flex: 1;
}

#orders-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.order-card {
    background-color: var(--surface-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    border: 1px solid var(--border-color);
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.order-id {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary-color);
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
}

.order-status.pending {
    background-color: #fff3cd;
    color: #856404;
}

.order-status.completed, .order-status.delivered {
    background-color: #d4edda;
    color: #155724;
}

.order-status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
}

.order-details p {
    margin-bottom: 0.5rem;
    color: var(--text-main);
}

.order-items-list {
    list-style: disc;
    margin-left: 1.5rem;
    margin-top: 0.75rem;
    color: var(--text-muted);
}
