|
6 | 6 | <img :src="item.image" :alt="item.title" class="cart-item-image" />
|
7 | 7 | <div class="cart-item-details">
|
8 | 8 | <h2>{{ item.title }}</h2>
|
9 |
| - <p class="price">{{ item.price | currency }}</p> |
| 9 | + <p class="price">Price: {{ item.price | currency }} USD</p> |
10 | 10 | <div class="quantity-controls">
|
11 | 11 | <button @click="updateCartQuantity({ product: item, quantity: item.quantity - 1 })">-</button>
|
12 | 12 | <span>{{ item.quantity }}</span>
|
@@ -59,14 +59,12 @@ body {
|
59 | 59 | box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
|
60 | 60 | font-family: 'Courier New', Courier, monospace;
|
61 | 61 | background-color: beige;
|
62 |
| -
|
63 | 62 | }
|
64 | 63 |
|
65 | 64 | h1 {
|
66 | 65 | font-size: 2rem;
|
67 | 66 | margin-bottom: 20px;
|
68 | 67 | text-align: center;
|
69 |
| - font-family: 'Courier New', Courier, monospace; |
70 | 68 | }
|
71 | 69 |
|
72 | 70 | .cart-content {
|
|
77 | 75 |
|
78 | 76 | .cart-item {
|
79 | 77 | display: flex;
|
| 78 | + flex-direction: row; |
80 | 79 | align-items: center;
|
81 | 80 | padding: 10px;
|
82 | 81 | border-bottom: 1px dashed #ddd;
|
@@ -143,11 +142,6 @@ h1 {
|
143 | 142 | }
|
144 | 143 |
|
145 | 144 | .cart-summary h2 {
|
146 |
| - display: flex; |
147 |
| - flex-direction: column; |
148 |
| - justify-content: center; |
149 |
| - align-items: center; |
150 |
| - width: 400px; |
151 | 145 | font-size: 1.5rem;
|
152 | 146 | margin-bottom: 10px;
|
153 | 147 | }
|
@@ -184,5 +178,55 @@ h1 {
|
184 | 178 | justify-content: center;
|
185 | 179 | align-items: center;
|
186 | 180 | }
|
187 |
| -</style> |
188 | 181 |
|
| 182 | +/* Responsive styles */ |
| 183 | +@media (max-width: 768px) { |
| 184 | + .cart { |
| 185 | + padding: 20px; |
| 186 | + max-width: 100%; |
| 187 | + margin: 10px; |
| 188 | + } |
| 189 | +
|
| 190 | + .cart-item { |
| 191 | + flex-direction: column; |
| 192 | + align-items: flex-start; |
| 193 | + } |
| 194 | +
|
| 195 | + .cart-item-image { |
| 196 | + width: 100%; |
| 197 | + margin: 0 0 10px 0; |
| 198 | + } |
| 199 | +
|
| 200 | + .quantity-controls { |
| 201 | + margin-top: 10px; |
| 202 | + } |
| 203 | +
|
| 204 | + .checkout-button { |
| 205 | + font-size: 0.9rem; |
| 206 | + padding: 8px 16px; |
| 207 | + } |
| 208 | +} |
| 209 | +
|
| 210 | +@media (max-width: 480px) { |
| 211 | + .cart { |
| 212 | + padding: 10px; |
| 213 | + } |
| 214 | +
|
| 215 | + h1 { |
| 216 | + font-size: 1.5rem; |
| 217 | + } |
| 218 | +
|
| 219 | + .cart-item-details h2 { |
| 220 | + font-size: 1rem; |
| 221 | + } |
| 222 | +
|
| 223 | + .cart-summary h2 { |
| 224 | + font-size: 1.2rem; |
| 225 | + } |
| 226 | +
|
| 227 | + .checkout-button { |
| 228 | + font-size: 0.8rem; |
| 229 | + padding: 6px 12px; |
| 230 | + } |
| 231 | +} |
| 232 | +</style> |
0 commit comments