Files
santeh-ray/static/css/cart.css
Azimkin 52cbc1c2b3
All checks were successful
Build and Push Docker Image / build (push) Successful in 42s
feat: implement shopping cart feature with user authentication support
- Added `Cart` and `CartItem` models with migrations for managing user-specific carts and items
- Developed services for cart-related operations: adding, removing, and updating cart items
- Built specialized templates (`cart.html`) and styled them with new CSS assets (`cart.css`)
- Enabled real-time UI updates via AJAX in shopping cart interactions (`cart.js`)
- Modified header to dynamically display cart link with user authentication awareness
- Added Leaflet-based interactive map to the contacts page and integrated CSS/JS dependencies
- Expanded tests for cart functionality, item detail page cart integration, and contacts page maps
2026-05-15 23:18:16 +02:00

269 lines
4.4 KiB
CSS

.cart-page {
margin-bottom: 88px;
}
.cart-hero {
padding: 28px 0 34px;
}
.cart-kicker {
color: #63768d;
font-size: 16px;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.cart-hero__row {
margin-top: 12px;
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 24px;
}
.cart-title {
font-size: 44px;
line-height: 1.04;
}
.cart-description {
margin-top: 12px;
max-width: 620px;
color: #554971;
font-size: 18px;
line-height: 1.4;
}
.cart-summary-card {
min-width: 220px;
padding: 18px 22px;
border: 1px solid rgba(54, 33, 62, 0.12);
background: rgba(99, 118, 141, 0.06);
}
.cart-summary-card__value {
display: block;
font-size: 34px;
font-weight: 700;
}
.cart-summary-card__label {
display: block;
margin-top: 6px;
color: #554971;
}
.cart-content {
display: grid;
grid-template-columns: minmax(0, 1fr) 280px;
gap: 28px;
align-items: start;
}
.cart-content--guest {
min-height: 280px;
}
.cart-items {
display: flex;
flex-direction: column;
gap: 18px;
}
.cart-item {
display: grid;
grid-template-columns: 180px minmax(0, 1fr);
gap: 22px;
padding: 22px;
border: 1px solid rgba(54, 33, 62, 0.12);
background: #ffffff;
}
.cart-item__media {
display: block;
aspect-ratio: 4 / 3;
background: rgba(99, 118, 141, 0.08);
overflow: hidden;
}
.cart-item__media img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
}
.cart-item__placeholder {
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
color: #63768d;
}
.cart-item__body {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 18px;
min-width: 0;
}
.cart-item__category {
color: #63768d;
font-size: 15px;
}
.cart-item__title {
display: inline-block;
margin-top: 8px;
font-family: 'BerlinType', serif;
font-size: 28px;
line-height: 1.1;
}
.cart-item__price {
margin-top: 10px;
color: #554971;
font-size: 18px;
}
.cart-item__controls {
display: flex;
align-items: flex-end;
justify-content: space-between;
gap: 18px;
}
.cart-quantity {
display: inline-flex;
align-items: center;
gap: 10px;
}
.cart-quantity form {
margin: 0;
}
.cart-quantity__button {
width: 38px;
height: 38px;
border: 1px solid #63768d;
background: transparent;
color: #36213e;
font-size: 24px;
line-height: 1;
cursor: pointer;
}
.cart-quantity__value {
min-width: 24px;
text-align: center;
font-size: 18px;
}
.cart-item__aside {
display: flex;
flex-direction: column;
align-items: flex-end;
gap: 12px;
}
.cart-item__subtotal {
font-size: 17px;
color: #36213e;
}
.cart-item__remove {
border: 0;
background: transparent;
color: #a14b4b;
cursor: pointer;
text-decoration: underline;
}
.cart-totals {
position: sticky;
top: 120px;
padding: 24px;
border: 1px solid rgba(54, 33, 62, 0.12);
background: rgba(99, 118, 141, 0.06);
}
.cart-totals__label {
color: #554971;
font-size: 16px;
text-transform: uppercase;
letter-spacing: 0.08em;
}
.cart-totals__value {
margin-top: 10px;
font-family: 'BerlinType', serif;
font-size: 36px;
line-height: 1.1;
}
.cart-totals__meta {
margin-top: 12px;
color: #554971;
font-size: 16px;
line-height: 1.4;
}
.cart-empty {
padding: 32px;
border: 1px solid rgba(54, 33, 62, 0.12);
color: #554971;
font-size: 18px;
line-height: 1.4;
}
.cart-item__summary-line {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin-top: 10px;
color: #554971;
font-size: 16px;
}
@media (max-width: 900px) {
.cart-page {
padding-left: 24px;
padding-right: 24px;
}
.cart-hero__row,
.cart-content {
grid-template-columns: 1fr;
display: grid;
}
.cart-summary-card,
.cart-totals {
min-width: 0;
position: static;
}
}
@media (max-width: 680px) {
.cart-item {
grid-template-columns: 1fr;
}
.cart-item__controls {
align-items: flex-start;
flex-direction: column;
}
.cart-item__aside {
align-items: flex-start;
}
.cart-title {
font-size: 34px;
}
}