:root {
    --cart-primary: #e31837;
    --cart-primary-light: #ffe5ea;
    --cart-text-main: #111827;
    --cart-text-muted: #6b7280;
}

.products-card-btn-cart:hover,
.category_btn-cart:hover,
.shop_details_card-btn-cart:hover,
.pd_btn-cart:hover {
    background: #ffd6df !important;
    color: var(--cart-primary) !important;
    transform: scale(1.05);
    transition: all 0.2s;
    border-color: transparent !important;
}

.products-card-btn-cart:active,
.category_btn-cart:active,
.shop_details_card-btn-cart:active,
.pd_btn-cart:active {
    transform: scale(0.95);
}

/* Floating Cart Pill */
.floating-cart-container {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    z-index: 99990;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-cart-container.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.floating-cart-container.hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px) scale(0.9);
}

.floating-cart {
    background: var(--cart-primary);
    border-radius: 40px;
    padding: 0.6rem 0.6rem 0.6rem 1rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    color: white;
    box-shadow: 0 15px 30px rgba(227, 24, 55, 0.3);
    cursor: pointer;
    transition: transform 0.2s;
    min-width: 220px;
}

.floating-cart:hover {
    transform: scale(1.03);
    box-shadow: 0 18px 35px rgba(227, 24, 55, 0.4);
}

.cart-avatars {
    display: flex;
    align-items: center;
}

.cart-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid var(--cart-primary);
    background: white;
    margin-left: -14px; 
    object-fit: cover;
    position: relative;
    box-shadow: -2px 0 5px rgba(0,0,0,0.1);
}

.cart-avatar:first-child { margin-left: 0; }

.cart-info {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.cart-title {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.2;
}

.cart-count {
    font-size: 0.8rem;
    opacity: 0.8;
    font-weight: 500;
}

.cart-arrow {
    background: rgba(0, 0, 0, 0.15);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Expanded Cart Modal */
.cart-modal {
    position: fixed;
    bottom: 3rem;
    right: 3rem;
    width: 360px;
    background: var(--cart-primary);
    border-radius: 24px;
    padding: 1.5rem;
    color: white;
    box-shadow: 0 20px 40px rgba(227, 24, 55, 0.4);
    z-index: 100000;
    opacity: 0;
    visibility: hidden;
    transform: scale(0.9) translateY(20px);
    transform-origin: bottom right;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.cart-modal.open {
    opacity: 1;
    visibility: visible;
    transform: scale(1) translateY(0);
}

.cart-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.cart-modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 1.1rem;
}

.cart-modal-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.1rem 0.5rem;
    border-radius: 12px;
    font-size: 0.8rem;
}

.cart-modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}
.cart-modal-close:hover { background: rgba(255, 255, 255, 0.3); }

.cart-modal-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 250px;
    overflow-y: auto;
    margin-bottom: 1rem;
    padding-right: 0.5rem;
}

.cart-modal-items::-webkit-scrollbar { width: 4px; }
.cart-modal-items::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 10px; }

.modal-item {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 0.75rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.modal-item-img-wrap {
    background: white;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.3rem;
    flex-shrink: 0;
}

.modal-item-img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-item-info {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.modal-item-cat {
    font-size: 0.65rem;
    text-transform: uppercase;
    opacity: 0.8;
    margin-bottom: 0.1rem;
    letter-spacing: 0.5px;
}

.modal-item-title {
    font-weight: 600;
    font-size: 0.95rem;
}

.modal-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0,0,0,0.1);
    border-radius: 12px;
    padding: 0.1rem 0.4rem;
    width: fit-content;
    margin-top: 0.3rem;
}

.modal-qty-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.modal-qty-val {
    font-size: 0.8rem;
    font-weight: 600;
    min-width: 1rem;
    text-align: center;
    color: white;
}

.modal-item-price {
    font-weight: 700;
    font-size: 1rem;
    text-align: right;
}

.delivery-notice {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.cart-modal-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.cart-modal-checkout {
    background: white;
    color: var(--cart-primary);
    border: none;
    width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 16px;
    font-weight: 700;
    font-size: 0.95rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.cart-modal-checkout:hover {
    transform: translateY(-2px);
}

.checkout-price-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Overlay */
.cart-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(2px);
    z-index: 99990;
    opacity: 0; visibility: hidden;
    transition: all 0.3s;
}
.cart-overlay.show { opacity: 1; visibility: visible; }

/* Glowing Shadow Ball Animation */
.glowing-shadow-ball {
    position: fixed;
    z-index: 9999;
    width: 26px;
    height: 26px;
    background: linear-gradient(135deg, #ff758c 0%, #e31837 100%);
    border-radius: 50%;
    box-shadow: 0 0 25px 10px rgba(227, 24, 55, 0.6), inset 0 -4px 6px rgba(0,0,0,0.3);
    pointer-events: none;
    transform-origin: center center;
    opacity: 0;
}

/* Checkout Animation Overlay */
.checkout-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0; visibility: hidden;
    transition: all 0.4s ease;
}

.checkout-overlay.show {
    opacity: 1; visibility: visible;
}

.animation-container {
    position: relative;
    width: 80%;
    max-width: 500px;
    height: 120px;
    display: none;
}

.road {
    position: absolute;
    bottom: 20px;
    width: 100%;
    height: 8px;
    background: #cbd5e1;
    border-radius: 4px;
    overflow: hidden;
}

.road-lines {
    position: absolute;
    top: 3px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent 50%, #fff 50%);
    background-size: 40px 100%;
    animation: moveLines 0.4s linear infinite;
}

@keyframes moveLines {
    0% { background-position: 40px 0; }
    100% { background-position: 0 0; }
}

.truck {
    position: absolute;
    bottom: 28px;
    left: -80px;
    width: 70px;
    height: 45px;
    color: var(--cart-primary);
    filter: drop-shadow(0 5px 5px rgba(0,0,0,0.2));
}

.truck svg {
    width: 100%;
    height: 100%;
}

.truck.drive {
    animation: driveTruck 3s ease-in-out forwards;
}

@keyframes driveTruck {
    0% { left: -80px; transform: rotate(-2deg); }
    10% { transform: rotate(1deg) translateY(-2px); }
    20% { transform: rotate(-1deg) translateY(0); }
    30% { transform: rotate(2deg) translateY(-3px); }
    50% { transform: rotate(0deg) translateY(0); }
    70% { transform: rotate(-1deg) translateY(-2px); }
    90% { transform: rotate(1deg) translateY(0); }
    100% { left: calc(100% + 20px); transform: rotate(0); }
}

/* Success Popup */
.success-popup {
    background: white;
    padding: 3rem;
    border-radius: 24px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.15);
    text-align: center;
    transform: scale(0.8) translateY(30px);
    opacity: 0;
    display: none;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(0,0,0,0.05);
}

.success-popup.show {
    display: block;
}

.success-popup.animate-in {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.success-icon {
    width: 80px; height: 80px;
    background: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 10px 20px rgba(16, 185, 129, 0.3);
}

.success-icon svg {
    width: 40px; height: 40px;
}

.success-popup h2 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--cart-text-main);
    font-weight: 800;
}

.success-popup p {
    color: var(--cart-text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.success-btn {
    background: var(--cart-text-main);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 14px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.success-btn:hover { 
    background: black; 
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}
