345 lines
No EOL
5.6 KiB
CSS
345 lines
No EOL
5.6 KiB
CSS
* {
|
|
margin: 0;
|
|
padding: 0;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
body {
|
|
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
|
|
line-height: 1.6;
|
|
color: #333;
|
|
background-color: #f4f4f4;
|
|
}
|
|
|
|
/* Screen reader only content */
|
|
.sr-only {
|
|
position: absolute;
|
|
width: 1px;
|
|
height: 1px;
|
|
padding: 0;
|
|
margin: -1px;
|
|
overflow: hidden;
|
|
clip: rect(0, 0, 0, 0);
|
|
white-space: nowrap;
|
|
border: 0;
|
|
}
|
|
|
|
/* Focus styles for accessibility */
|
|
button:focus,
|
|
a:focus,
|
|
[tabindex]:focus {
|
|
outline: 2px solid #007bff;
|
|
outline-offset: 2px;
|
|
}
|
|
|
|
/* Loading state */
|
|
.loading {
|
|
text-align: center;
|
|
padding: 2rem;
|
|
font-size: 1.1rem;
|
|
color: #666;
|
|
}
|
|
|
|
/* Improved button styles for different types */
|
|
.btn-primary {
|
|
background-color: #007bff;
|
|
border-color: #007bff;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background-color: #0056b3;
|
|
border-color: #0056b3;
|
|
}
|
|
|
|
.btn-danger {
|
|
background-color: #dc3545;
|
|
border-color: #dc3545;
|
|
}
|
|
|
|
.btn-danger:hover {
|
|
background-color: #c82333;
|
|
border-color: #bd2130;
|
|
}
|
|
|
|
.btn-remove {
|
|
background-color: #6c757d;
|
|
border-color: #6c757d;
|
|
}
|
|
|
|
.btn-remove:hover {
|
|
background-color: #545b62;
|
|
border-color: #4e555b;
|
|
}
|
|
|
|
.navbar {
|
|
background: #2c3e50;
|
|
color: white;
|
|
padding: 1rem 2rem;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.logo {
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.nav-links {
|
|
display: flex;
|
|
list-style: none;
|
|
gap: 2rem;
|
|
}
|
|
|
|
.nav-links a {
|
|
color: white;
|
|
text-decoration: none;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 4px;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.nav-links a:hover {
|
|
background-color: rgba(255,255,255,0.1);
|
|
}
|
|
|
|
.cart-link {
|
|
background-color: #e74c3c;
|
|
border-radius: 20px;
|
|
}
|
|
|
|
#app {
|
|
max-width: 1200px;
|
|
margin: 2rem auto;
|
|
padding: 0 1rem;
|
|
}
|
|
|
|
.page {
|
|
display: none;
|
|
}
|
|
|
|
.page.active {
|
|
display: block;
|
|
}
|
|
|
|
.products-grid {
|
|
display: grid;
|
|
grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
|
|
gap: 2rem;
|
|
margin-top: 2rem;
|
|
}
|
|
|
|
.product-card {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
transition: transform 0.3s, box-shadow 0.3s;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.product-card:hover {
|
|
transform: translateY(-5px);
|
|
box-shadow: 0 5px 20px rgba(0,0,0,0.15);
|
|
}
|
|
|
|
.product-image {
|
|
width: 100%;
|
|
height: 200px;
|
|
background-color: #ecf0f1;
|
|
border-radius: 4px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
margin-bottom: 1rem;
|
|
font-size: 3rem;
|
|
color: #95a5a6;
|
|
}
|
|
|
|
.product-name {
|
|
font-size: 1.2rem;
|
|
font-weight: bold;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.product-price {
|
|
font-size: 1.1rem;
|
|
color: #e74c3c;
|
|
font-weight: bold;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.product-description {
|
|
color: #666;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.btn {
|
|
background-color: #3498db;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.75rem 1.5rem;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
font-size: 1rem;
|
|
transition: background-color 0.3s;
|
|
}
|
|
|
|
.btn:hover {
|
|
background-color: #2980b9;
|
|
}
|
|
|
|
.btn-success {
|
|
background-color: #27ae60;
|
|
}
|
|
|
|
.btn-success:hover {
|
|
background-color: #219a52;
|
|
}
|
|
|
|
.back-btn {
|
|
background-color: #95a5a6;
|
|
color: white;
|
|
border: none;
|
|
padding: 0.5rem 1rem;
|
|
border-radius: 4px;
|
|
cursor: pointer;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.back-btn:hover {
|
|
background-color: #7f8c8d;
|
|
}
|
|
|
|
.product-detail {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 2rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.product-detail .product-image {
|
|
height: 300px;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.product-detail .product-name {
|
|
font-size: 2rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.product-detail .product-price {
|
|
font-size: 1.5rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.product-detail .product-description {
|
|
font-size: 1.1rem;
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.cart-items {
|
|
margin-bottom: 2rem;
|
|
}
|
|
|
|
.cart-item {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 1.5rem;
|
|
margin-bottom: 1rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.cart-item-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.cart-item-name {
|
|
font-weight: bold;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.cart-item-price {
|
|
color: #e74c3c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.cart-item-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.quantity-controls {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.quantity-btn {
|
|
background-color: #ecf0f1;
|
|
border: none;
|
|
width: 30px;
|
|
height: 30px;
|
|
border-radius: 50%;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
}
|
|
|
|
.quantity-btn:hover {
|
|
background-color: #d5dbdb;
|
|
}
|
|
|
|
.cart-total {
|
|
background: white;
|
|
border-radius: 8px;
|
|
padding: 2rem;
|
|
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
|
|
text-align: right;
|
|
}
|
|
|
|
.total-amount {
|
|
font-size: 1.5rem;
|
|
font-weight: bold;
|
|
color: #e74c3c;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
.empty-cart {
|
|
text-align: center;
|
|
padding: 3rem;
|
|
color: #666;
|
|
}
|
|
|
|
@media (max-width: 768px) {
|
|
.navbar {
|
|
padding: 1rem;
|
|
flex-direction: column;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.nav-links {
|
|
gap: 1rem;
|
|
}
|
|
|
|
.products-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.cart-item {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.cart-item-controls {
|
|
width: 100%;
|
|
justify-content: space-between;
|
|
}
|
|
} |