Files
projet_gestion_commande/frontend-prep/src/pages/User/Cart.css
T
2026-03-31 19:50:44 +02:00

504 lines
9.4 KiB
CSS

/* ============================================
Cart.css — style app mobile
============================================ */
.cart-container {
width: 100%;
min-height: 100vh;
padding-top: 60px;
max-width: 640px;
margin: 0 auto;
padding-bottom: 140px;
background: var(--bg);
}
/* ============================================
HEADER
============================================ */
.cart-header {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem 1.25rem;
border-bottom: 1px solid var(--border);
}
.cart-header-left {
display: flex;
flex-direction: column;
gap: 0.1rem;
}
.cart-title {
color: var(--text);
font-size: 1.4rem;
font-weight: 700;
margin: 0;
}
.cart-header-count {
color: var(--text-muted);
font-size: 0.85rem;
font-weight: 400;
}
.clear-all-button {
background: none;
border: none;
color: #ef4444;
font-size: 0.9rem;
font-weight: 500;
cursor: pointer;
padding: 0.25rem 0;
transition: opacity 0.2s;
}
.clear-all-button:hover:not(:disabled) {
opacity: 0.75;
}
.clear-all-button:disabled {
opacity: 0.4;
cursor: not-allowed;
}
/* ============================================
LISTE DES ARTICLES
============================================ */
.cart-items-list {
padding: 0.75rem 1rem;
}
.cart-row {
display: flex;
align-items: center;
gap: 0.875rem;
background: var(--surface);
border: 1px solid var(--border);
border-radius: 12px;
padding: 0.875rem;
margin-bottom: 0.625rem;
transition: border-color 0.15s;
}
.cart-row:hover {
border-color: rgba(124, 58, 237, 0.35);
}
/* Vignette */
.cart-row-thumb {
position: relative;
flex-shrink: 0;
}
.cart-row-img {
width: 68px;
height: 68px;
border-radius: 8px;
object-fit: cover;
background: var(--surface-2);
display: block;
}
.cart-row-img-placeholder {
width: 68px;
height: 68px;
border-radius: 8px;
background: var(--surface-2);
display: flex;
align-items: center;
justify-content: center;
color: var(--text-muted);
font-size: 1.4rem;
}
.cart-row-video-badge {
position: absolute;
bottom: 4px;
right: 4px;
background: rgba(124, 58, 237, 0.9);
color: #fff;
border: none;
border-radius: 5px;
width: 24px;
height: 24px;
display: flex;
align-items: center;
justify-content: center;
font-size: 0.65rem;
cursor: pointer;
transition: background 0.15s;
}
.cart-row-video-badge:hover {
background: rgba(124, 58, 237, 1);
}
/* Infos */
.cart-row-info {
flex: 1;
min-width: 0;
}
.cart-row-name {
color: var(--text);
font-size: 0.95rem;
font-weight: 600;
margin: 0 0 0.2rem 0;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.cart-row-qty {
color: var(--text-muted);
font-size: 0.82rem;
margin: 0 0 0.25rem 0;
}
.cart-row-price {
color: #10b981;
font-size: 0.95rem;
font-weight: 700;
margin: 0;
}
/* Bouton supprimer */
.cart-row-remove {
background: none;
border: none;
color: #ef4444;
cursor: pointer;
padding: 0.5rem;
border-radius: 8px;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.7;
transition: opacity 0.15s, background 0.15s;
flex-shrink: 0;
}
.cart-row-remove:hover:not(:disabled) {
opacity: 1;
background: rgba(239, 68, 68, 0.1);
}
.cart-row-remove:disabled {
opacity: 0.3;
cursor: not-allowed;
}
/* ============================================
FOOTER FIXE
============================================ */
.cart-footer {
position: fixed;
bottom: 0;
left: 50%;
transform: translateX(-50%);
width: 100%;
max-width: 640px;
background: var(--surface);
border-top: 1px solid var(--border);
padding: 1rem 1.25rem 1.25rem;
z-index: 100;
}
.cart-footer-total {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 0.875rem;
}
.cart-footer-total-label {
color: var(--text-muted);
font-size: 1rem;
}
.cart-footer-total-value {
color: #10b981;
font-size: 1.4rem;
font-weight: 700;
}
.checkout-button {
width: 100%;
background: linear-gradient(to right, #7c3aed, #6d28d9);
color: white;
border: none;
border-radius: 10px;
padding: 0.9rem;
font-size: 1rem;
font-weight: 700;
cursor: pointer;
transition: opacity 0.2s, transform 0.15s;
letter-spacing: 0.3px;
}
.checkout-button:hover:not(:disabled) {
opacity: 0.92;
transform: translateY(-1px);
}
.checkout-button:active:not(:disabled) {
transform: translateY(0);
}
.checkout-button:disabled {
opacity: 0.55;
cursor: not-allowed;
}
/* ============================================
EMPTY STATE
============================================ */
.empty-cart {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
text-align: center;
padding: 5rem 2rem;
min-height: calc(100vh - 60px);
}
.empty-cart-icon {
color: var(--text-muted);
opacity: 0.35;
margin-bottom: 1.25rem;
}
.empty-cart h2 {
color: var(--text);
font-size: 1.4rem;
font-weight: 700;
margin: 0 0 0.4rem 0;
}
.empty-cart p {
color: var(--text-muted);
font-size: 0.95rem;
margin: 0 0 1.75rem 0;
}
.continue-shopping {
background: linear-gradient(to right, #7c3aed, #6d28d9);
color: white;
border: none;
border-radius: 8px;
padding: 0.75rem 1.75rem;
font-size: 0.95rem;
font-weight: 600;
cursor: pointer;
transition: opacity 0.2s, transform 0.15s;
}
.continue-shopping:hover {
opacity: 0.9;
transform: translateY(-1px);
}
/* ============================================
LOADING
============================================ */
.loading-cart {
text-align: center;
padding: 3rem 2rem;
}
.loading-cart p {
color: var(--text-muted);
font-size: 0.95rem;
animation: pulse 1.5s ease-in-out infinite;
}
@keyframes pulse {
0%, 100% { opacity: 0.5; }
50% { opacity: 1; }
}
/* ============================================
MODAL CONFIRMATION
============================================ */
.modal-overlay {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.65);
backdrop-filter: blur(6px);
display: flex;
align-items: center;
justify-content: center;
padding: 1rem;
z-index: 1000;
animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.modal-content2 {
background: var(--surface);
border: 1px solid var(--border);
border-radius: 16px;
padding: 1.75rem;
max-width: 360px;
width: 100%;
animation: slideUp 0.25s ease;
}
@keyframes slideUp {
from { opacity: 0; transform: translateY(16px); }
to { opacity: 1; transform: translateY(0); }
}
.modal-icon-container {
display: flex;
justify-content: center;
margin-bottom: 1rem;
}
.modal-icon {
color: #ef4444;
}
.modal-title {
color: var(--text);
font-size: 1.1rem;
font-weight: 700;
text-align: center;
margin: 0 0 0.5rem 0;
}
.modal-message {
color: var(--text-muted);
font-size: 0.9rem;
text-align: center;
margin: 0 0 1.25rem 0;
line-height: 1.5;
}
.modal-actions {
display: flex;
gap: 0.75rem;
}
.modal-button {
flex: 1;
padding: 0.75rem;
border-radius: 8px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
border: none;
display: flex;
align-items: center;
justify-content: center;
gap: 0.4rem;
transition: opacity 0.15s, transform 0.15s;
}
.modal-button:hover:not(:disabled) {
opacity: 0.85;
transform: translateY(-1px);
}
.modal-cancel {
background: transparent;
color: var(--text-muted);
border: 1px solid var(--border);
}
.modal-confirm {
background: linear-gradient(135deg, #ef4444, #dc2626);
color: white;
}
.modal-confirm:disabled {
opacity: 0.5;
cursor: not-allowed;
}
/* ============================================
MODAL VIDÉO
============================================ */
.video-modal {
position: fixed;
inset: 0;
background: rgba(0, 0, 0, 0.92);
backdrop-filter: blur(6px);
display: flex;
align-items: center;
justify-content: center;
z-index: 10000;
padding: 1.5rem;
animation: fadeIn 0.2s ease;
}
.video-modal-content {
position: relative;
width: 100%;
max-width: 860px;
background: var(--surface);
border-radius: 12px;
overflow: hidden;
}
.video-close-btn {
position: absolute;
top: 0.75rem;
right: 0.75rem;
background: rgba(239, 68, 68, 0.9);
color: white;
border: none;
border-radius: 50%;
width: 36px;
height: 36px;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
z-index: 10;
font-size: 1.1rem;
transition: background 0.2s, transform 0.2s;
}
.video-close-btn:hover {
background: #ef4444;
transform: scale(1.1) rotate(90deg);
}
.video-player {
width: 100%;
height: auto;
max-height: 80vh;
display: block;
background: #000;
}
/* ============================================
RESPONSIVE
============================================ */
@media (max-width: 480px) {
.cart-row-img,
.cart-row-img-placeholder {
width: 58px;
height: 58px;
}
.cart-footer {
padding: 0.875rem 1rem 1rem;
}
}