feat: refactor cart item and cart components for improved layout and styling

This commit is contained in:
2026-07-02 08:42:35 -03:00
parent 06d29be056
commit 8471505e6f
4 changed files with 187 additions and 272 deletions

View File

@@ -1,15 +1,15 @@
<section class="cart" [style.background-color]="backgroundColor()">
<header class="cart__header">
<h2 class="cart__title">{{ title() }}</h2>
<section class="d-flex flex-column h-100 overflow-hidden text-secondary" [style.background-color]="backgroundColor()">
<header class="d-flex align-items-center justify-content-between bg-transparent cart-header">
<h2 class="m-0 text-uppercase fw-bold cart-title">{{ title() }}</h2>
@if (showClose()) {
<button class="cart__close" type="button" aria-label="Cerrar carrito" (click)="closed.emit()">
<button class="btn btn-link p-0 border-0 d-inline-flex align-items-center justify-content-center cart-close-btn" type="button" aria-label="Cerrar carrito" (click)="closed.emit()">
<i class="fa-solid fa-xmark"></i>
</button>
}
</header>
<div class="cart__items">
<div class="d-grid gap-2 flex-grow-1 overflow-y-auto cart-items-container">
@for (item of items(); track item.product + item.discountedPrice) {
<app-cart-item
[imageUrl]="item.imageUrl"
@@ -23,20 +23,22 @@
}
</div>
<footer class="cart__summary">
<div class="cart__summary-row">
<span class="cart__summary-label">Subtotal:</span>
<span class="cart__summary-value">{{ formattedSubtotal() }}</span>
<footer class="d-grid gap-1 bg-transparent cart-footer">
<div class="d-flex align-items-baseline justify-content-between gap-3">
<span class="cart-summary-text-muted">Subtotal:</span>
<span class="cart-summary-text-muted-bold">{{ formattedSubtotal() }}</span>
</div>
<div class="cart__summary-row">
<span class="cart__summary-label">Descuento:</span>
<span class="cart__summary-value">{{ formattedDiscount() }}</span>
<div class="d-flex align-items-baseline justify-content-between gap-3">
<span class="cart-summary-text-muted">Descuento:</span>
<span class="cart-summary-text-muted-bold">{{ formattedDiscount() }}</span>
</div>
<div class="cart__summary-row cart__summary-row--total">
<span class="cart__summary-label">TOTAL:</span>
<span class="cart__summary-value">{{ formattedTotal() }}</span>
<div class="d-flex align-items-baseline justify-content-between gap-3 mt-1">
<span class="cart-total-text">TOTAL:</span>
<span class="cart-total-text">{{ formattedTotal() }}</span>
</div>
</footer>
</section>