Files

125 lines
2.6 KiB
CSS
Raw Permalink Normal View History

/* ==========================================================================
CommerceKit Floating Cart
========================================================================== */
/* Container fixed to bottom-right, above most theme layers */
#cgkit-floating-cart {
position: fixed;
bottom: 28px;
right: 28px;
z-index: 99998; /* below most modals/overlays but above normal content */
}
/* The circle button */
.cgkit-floating-cart__btn {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 56px;
height: 56px;
padding: 0;
border: none;
border-radius: 50%;
background-color: #2c2c2c;
color: #ffffff;
cursor: pointer;
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
transition: transform 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
/* Prevent tap-highlight on mobile */
-webkit-tap-highlight-color: transparent;
}
.cgkit-floating-cart__btn:hover,
.cgkit-floating-cart__btn:focus-visible {
background-color: #444444;
transform: scale(1.08);
box-shadow: 0 6px 22px rgba(0, 0, 0, 0.3);
outline: none;
}
.cgkit-floating-cart__btn:active {
transform: scale(0.96);
}
/* Cart icon SVG */
.cgkit-floating-cart__icon {
display: block;
width: 22px;
height: 22px;
pointer-events: none;
}
/* Item-count badge */
.cgkit-floating-cart__count {
position: absolute;
top: -4px;
right: -4px;
min-width: 20px;
height: 20px;
padding: 0 4px;
border-radius: 10px;
background-color: #e84040;
color: #ffffff;
font-size: 11px;
font-weight: 700;
line-height: 20px;
text-align: center;
pointer-events: none;
transition: transform 0.15s ease;
}
/* Hide badge when cart is empty */
.cgkit-floating-cart__count--hidden {
display: none;
}
/* "Bump" animation when count changes */
.cgkit-floating-cart__count--bump {
animation: cgkit-fc-bump 0.3s ease;
}
@keyframes cgkit-fc-bump {
0% { transform: scale(1); }
50% { transform: scale(1.4); }
100% { transform: scale(1); }
}
/* "Pulse" ring that briefly appears after add-to-cart */
.cgkit-floating-cart__btn::after {
content: '';
position: absolute;
inset: 0;
border-radius: 50%;
border: 2px solid #2c2c2c;
opacity: 0;
transform: scale(1);
}
.cgkit-floating-cart__btn.cgkit-fc--pulse::after {
animation: cgkit-fc-pulse 0.5s ease-out forwards;
}
@keyframes cgkit-fc-pulse {
0% { opacity: 0.6; transform: scale(1); }
100% { opacity: 0; transform: scale(1.6); }
}
/* Responsive: shrink slightly on small screens */
@media (max-width: 480px) {
#cgkit-floating-cart {
bottom: 18px;
right: 18px;
}
.cgkit-floating-cart__btn {
width: 50px;
height: 50px;
}
.cgkit-floating-cart__icon {
width: 20px;
height: 20px;
}
}