| 1 |
<!DOCTYPE html> |
| 2 |
<html lang="en" xmlns:th="http://www.thymeleaf.org"> |
| 3 |
<head> |
| 4 |
<meta charset="UTF-8"> |
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> |
| 6 |
<title>Shopping Cart - Payment Link Service</title> |
| 7 |
<link rel="stylesheet" th:href="@{/css/styles.css}"> |
| 8 |
<style> |
| 9 |
.cart-container { |
| 10 |
max-width: 900px; |
| 11 |
margin: 2rem auto; |
| 12 |
padding: 0 1.5rem; |
| 13 |
} |
| 14 |
.cart-header { |
| 15 |
margin-bottom: 1.5rem; |
| 16 |
} |
| 17 |
.cart-header h2 { |
| 18 |
font-size: 1.5rem; |
| 19 |
font-weight: 500; |
| 20 |
color: var(--text-color); |
| 21 |
margin: 0; |
| 22 |
letter-spacing: -0.01em; |
| 23 |
} |
| 24 |
.cart-items { |
| 25 |
background: transparent; |
| 26 |
padding: 0; |
| 27 |
} |
| 28 |
.cart-item { |
| 29 |
display: flex; |
| 30 |
align-items: flex-start; |
| 31 |
padding: 1.25rem 0; |
| 32 |
border-bottom: 1px solid var(--border-color); |
| 33 |
background: transparent; |
| 34 |
transition: opacity 0.2s ease; |
| 35 |
} |
| 36 |
.cart-item:last-child { |
| 37 |
border-bottom: none; |
| 38 |
} |
| 39 |
.cart-item-image { |
| 40 |
width: 80px; |
| 41 |
height: 80px; |
| 42 |
object-fit: cover; |
| 43 |
border-radius: 4px; |
| 44 |
margin-right: 1.25rem; |
| 45 |
background: #f8f8f8; |
| 46 |
display: flex; |
| 47 |
align-items: center; |
| 48 |
justify-content: center; |
| 49 |
font-size: 0.65rem; |
| 50 |
color: #bbb; |
| 51 |
flex-shrink: 0; |
| 52 |
} |
| 53 |
.cart-item-image img { |
| 54 |
width: 100%; |
| 55 |
height: 100%; |
| 56 |
object-fit: cover; |
| 57 |
border-radius: 4px; |
| 58 |
} |
| 59 |
.cart-item-info { |
| 60 |
flex: 1; |
| 61 |
min-width: 0; |
| 62 |
padding-right: 1rem; |
| 63 |
} |
| 64 |
.cart-item-name { |
| 65 |
font-size: 1rem; |
| 66 |
font-weight: 500; |
| 67 |
margin-bottom: 0.25rem; |
| 68 |
color: var(--text-color); |
| 69 |
line-height: 1.3; |
| 70 |
} |
| 71 |
.cart-item-price { |
| 72 |
color: var(--text-light); |
| 73 |
font-weight: 400; |
| 74 |
font-size: 0.875rem; |
| 75 |
margin-bottom: 0.75rem; |
| 76 |
} |
| 77 |
.cart-item-quantity { |
| 78 |
display: flex; |
| 79 |
align-items: center; |
| 80 |
gap: 0.75rem; |
| 81 |
flex-wrap: wrap; |
| 82 |
} |
| 83 |
.cart-item-quantity label { |
| 84 |
font-size: 0.8125rem; |
| 85 |
font-weight: 400; |
| 86 |
color: var(--text-light); |
| 87 |
} |
| 88 |
.quantity-input { |
| 89 |
width: 70px; |
| 90 |
padding: 0.5rem; |
| 91 |
border: 1px solid var(--border-color); |
| 92 |
border-radius: 4px; |
| 93 |
text-align: center; |
| 94 |
font-size: 0.875rem; |
| 95 |
font-weight: 400; |
| 96 |
background: var(--card-bg); |
| 97 |
transition: border-color 0.2s ease; |
| 98 |
} |
| 99 |
.quantity-input:focus { |
| 100 |
outline: none; |
| 101 |
border-color: var(--text-color); |
| 102 |
} |
| 103 |
.cart-item-quantity .btn { |
| 104 |
padding: 0.35rem 0.75rem; |
| 105 |
font-size: 0.75rem; |
| 106 |
background: #f5f5f5; |
| 107 |
color: var(--text-color); |
| 108 |
border: 1px solid var(--border-color); |
| 109 |
border-radius: 4px; |
| 110 |
font-weight: 400; |
| 111 |
text-decoration: none; |
| 112 |
cursor: pointer; |
| 113 |
transition: all 0.2s ease; |
| 114 |
} |
| 115 |
.cart-item-quantity .btn:hover { |
| 116 |
background: #eeeeee; |
| 117 |
border-color: var(--text-color); |
| 118 |
} |
| 119 |
.cart-item-total { |
| 120 |
font-size: 1rem; |
| 121 |
font-weight: 500; |
| 122 |
min-width: 100px; |
| 123 |
text-align: right; |
| 124 |
color: var(--text-color); |
| 125 |
padding-left: 1rem; |
| 126 |
white-space: nowrap; |
| 127 |
} |
| 128 |
.cart-summary { |
| 129 |
background: transparent; |
| 130 |
padding: 0; |
| 131 |
margin-top: 2rem; |
| 132 |
width: 100%; |
| 133 |
} |
| 134 |
.cart-summary h3 { |
| 135 |
font-size: 0.75rem; |
| 136 |
font-weight: 500; |
| 137 |
margin-bottom: 1.25rem; |
| 138 |
color: var(--text-color); |
| 139 |
text-transform: uppercase; |
| 140 |
letter-spacing: 0.1em; |
| 141 |
} |
| 142 |
.summary-row { |
| 143 |
display: flex; |
| 144 |
justify-content: space-between; |
| 145 |
align-items: center; |
| 146 |
margin-bottom: 0.75rem; |
| 147 |
padding-bottom: 0.75rem; |
| 148 |
border-bottom: 1px solid var(--border-color); |
| 149 |
font-size: 0.875rem; |
| 150 |
} |
| 151 |
.summary-row:last-of-type { |
| 152 |
border-bottom: none; |
| 153 |
margin-bottom: 0; |
| 154 |
} |
| 155 |
.summary-row span:first-child { |
| 156 |
color: var(--text-light); |
| 157 |
font-weight: 400; |
| 158 |
} |
| 159 |
.summary-row span:last-child { |
| 160 |
font-weight: 500; |
| 161 |
color: var(--text-color); |
| 162 |
} |
| 163 |
.summary-row.total { |
| 164 |
font-size: 1rem; |
| 165 |
font-weight: 600; |
| 166 |
border-bottom: none; |
| 167 |
padding-top: 0.75rem; |
| 168 |
margin-top: 0.75rem; |
| 169 |
border-top: 2px solid var(--border-color); |
| 170 |
} |
| 171 |
.summary-row.total span:first-child { |
| 172 |
color: var(--text-color); |
| 173 |
font-weight: 600; |
| 174 |
} |
| 175 |
.summary-row.total span:last-child { |
| 176 |
color: var(--text-color); |
| 177 |
font-size: 1.125rem; |
| 178 |
} |
| 179 |
.cart-summary .btn { |
| 180 |
width: 100%; |
| 181 |
margin-top: 1rem; |
| 182 |
text-align: center; |
| 183 |
padding: 0.875rem; |
| 184 |
font-size: 0.875rem; |
| 185 |
font-weight: 500; |
| 186 |
border-radius: 4px; |
| 187 |
transition: all 0.2s ease; |
| 188 |
text-decoration: none; |
| 189 |
display: block; |
| 190 |
} |
| 191 |
.cart-summary .btn-success { |
| 192 |
background: var(--text-color); |
| 193 |
color: white; |
| 194 |
border: none; |
| 195 |
} |
| 196 |
.cart-summary .btn-success:hover { |
| 197 |
background: var(--text-color); |
| 198 |
opacity: 0.85; |
| 199 |
} |
| 200 |
.cart-summary .btn:not(.btn-success) { |
| 201 |
background: transparent; |
| 202 |
border: 1px solid var(--border-color); |
| 203 |
color: var(--text-color); |
| 204 |
} |
| 205 |
.cart-summary .btn:not(.btn-success):hover { |
| 206 |
background: var(--bg-color); |
| 207 |
border-color: var(--text-color); |
| 208 |
} |
| 209 |
.empty-cart { |
| 210 |
text-align: center; |
| 211 |
padding: 4rem 2rem; |
| 212 |
background: transparent; |
| 213 |
} |
| 214 |
.empty-cart-icon { |
| 215 |
font-size: 3rem; |
| 216 |
margin-bottom: 1rem; |
| 217 |
opacity: 0.15; |
| 218 |
} |
| 219 |
.empty-cart h3 { |
| 220 |
font-size: 1.25rem; |
| 221 |
font-weight: 500; |
| 222 |
margin-bottom: 0.5rem; |
| 223 |
color: var(--text-color); |
| 224 |
} |
| 225 |
.empty-cart p { |
| 226 |
color: var(--text-light); |
| 227 |
margin-bottom: 1.5rem; |
| 228 |
font-size: 0.875rem; |
| 229 |
} |
| 230 |
.empty-cart .btn { |
| 231 |
padding: 0.875rem 1.5rem; |
| 232 |
font-size: 0.875rem; |
| 233 |
} |
| 234 |
@media (max-width: 968px) { |
| 235 |
.cart-container { |
| 236 |
margin: 1.5rem auto; |
| 237 |
padding: 0 1rem; |
| 238 |
} |
| 239 |
.cart-summary { |
| 240 |
margin-top: 1.5rem; |
| 241 |
} |
| 242 |
.cart-item { |
| 243 |
flex-wrap: wrap; |
| 244 |
padding: 1rem 0; |
| 245 |
} |
| 246 |
.cart-item-image { |
| 247 |
width: 70px; |
| 248 |
height: 70px; |
| 249 |
margin-right: 1rem; |
| 250 |
} |
| 251 |
.cart-item-total { |
| 252 |
width: 100%; |
| 253 |
text-align: left; |
| 254 |
margin-top: 0.75rem; |
| 255 |
padding-top: 0.75rem; |
| 256 |
padding-left: 0; |
| 257 |
border-top: 1px solid var(--border-color); |
| 258 |
min-width: auto; |
| 259 |
} |
| 260 |
.cart-item-quantity { |
| 261 |
width: 100%; |
| 262 |
} |
| 263 |
} |
| 264 |
@media (max-width: 640px) { |
| 265 |
.cart-container { |
| 266 |
margin: 1rem auto; |
| 267 |
padding: 0 1rem; |
| 268 |
} |
| 269 |
.cart-item { |
| 270 |
padding: 0.875rem 0; |
| 271 |
} |
| 272 |
.cart-item-image { |
| 273 |
width: 60px; |
| 274 |
height: 60px; |
| 275 |
margin-right: 0.875rem; |
| 276 |
} |
| 277 |
.cart-item-name { |
| 278 |
font-size: 0.9375rem; |
| 279 |
} |
| 280 |
.cart-item-total { |
| 281 |
font-size: 0.9375rem; |
| 282 |
} |
| 283 |
} |
| 284 |
</style> |
| 285 |
</head> |
| 286 |
<body> |
| 287 |
<header> |
| 288 |
<nav class="navbar container"> |
| 289 |
<a th:href="@{/}" class="navbar-brand"> |
| 290 |
<h1>Webshop</h1> |
| 291 |
</a> |
| 292 |
<div class="navbar-actions"> |
| 293 |
<a th:href="@{/cart}" class="cart-button" aria-label="Cart"> |
| 294 |
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="9" cy="21" r="1"></circle><circle cx="20" cy="21" r="1"></circle><path d="M1 1h4l2.68 13.39a2 2 0 0 0 2 1.61h9.72a2 2 0 0 0 2-1.61L23 6H6"></path></svg> |
| 295 |
<span id="cartCount" class="cart-badge" style="display: none;">0</span> |
| 296 |
</a> |
| 297 |
</div> |
| 298 |
</nav> |
| 299 |
</header> |
| 300 |
|
| 301 |
<main class="container"> |
| 302 |
<div class="cart-container"> |
| 303 |
<div class="cart-header"> |
| 304 |
<h2>Shopping Cart</h2> |
| 305 |
</div> |
| 306 |
<div id="cartContent"> |
| 307 |
<div class="loading">Loading cart...</div> |
| 308 |
</div> |
| 309 |
</div> |
| 310 |
</main> |
| 311 |
|
| 312 |
|
| 313 |
<div id="notificationContainer" class="notification-container"></div> |
| 314 |
|
| 315 |
<script th:src="@{/js/notifications.js}"></script> |
| 316 |
<script th:src="@{/js/csrf.js}"></script> |
| 317 |
<script th:src="@{/js/cart.js}"></script> |
| 318 |
</body> |
| 319 |
</html> |
| 320 |
|