/*============================================
            CART SIDEBAR OVERLAY STYLES                   
   ============================================*/

/* Alpine.js x-cloak directive - hide elements until Alpine loads */
[x-cloak] {
    display: none !important;
}

/* Cart Toggle Button Styles */
.cart-toggle-btn {
    position: relative;
    margin-right: 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #D7333C;
    transition: all 0.2s;
    padding: 0.5rem;
}

.cart-toggle-btn:hover {
    color: #FF4A56;
    transform: scale(1.05);
}

.cart-toggle-btn svg {
    display: block;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(180deg, #D7333C 0%, #711B1F 100%);
    color: #fff;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    animation: badge-pop 0.3s ease-out;
    box-shadow: 0 2px 8px rgba(215, 51, 60, 0.4);
}

@keyframes badge-pop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Cart Notification Styles */
#cart-notification {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    padding: 1rem 1.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    color: white;
    transform: translateX(100%);
    transition: transform 0.3s ease-out;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
    max-width: 350px;
}

#cart-notification.bg-green-500 {
    background-color: #10b981;
}

#cart-notification.bg-red-500 {
    background-color: #ef4444;
}

#cart-notification.bg-yellow-500 {
    background-color: #f59e0b;
}

#cart-notification.bg-blue-500 {
    background-color: #3b82f6;
}

/* Loading Spinner */
.loader-spinner {
    width: 48px;
    height: 48px;
    border: 5px solid #fff;
    border-bottom-color: transparent;
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

/* Cart Sidebar Scrollbar Styling */
.cart-sidebar-scroll::-webkit-scrollbar {
    width: 8px;
}

.cart-sidebar-scroll::-webkit-scrollbar-track {
    background: #1a1a1a;
}

.cart-sidebar-scroll::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

.cart-sidebar-scroll::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .cart-toggle-btn {
        margin-right: 0.5rem;
    }
    
    #cart-notification {
        right: 0.5rem;
        left: 0.5rem;
        max-width: none;
    }
}

/* Ensure cart sidebar is above everything */
.cart-sidebar-overlay {
    z-index: 10000 !important;
}

/* Smooth transitions for Alpine.js */
.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

.ease-out {
    transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
}

.ease-in {
    transition-timing-function: cubic-bezier(0.4, 0, 1, 1);
}

.duration-300 {
    transition-duration: 300ms;
}

.duration-200 {
    transition-duration: 200ms;
}

/* Backdrop blur effect */
.backdrop-blur {
    backdrop-filter: blur(4px);
}

/* Fixed positioning utilities */
.fixed {
    position: fixed;
}

.absolute {
    position: absolute;
}

.inset-0 {
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}

/* Z-index utilities */
.z-50 {
    z-index: 50;
}

.z-10 {
    z-index: 10;
}

/* Transform utilities */
.translate-x-full {
    transform: translateX(100%);
}

.translate-x-0 {
    transform: translateX(0);
}

/* Opacity utilities */
.opacity-85 {
    opacity: 0.85;
}

/* Flex utilities */
.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 0.75rem;
}

.gap-4 {
    gap: 1rem;
}

/* Spacing utilities */
.p-1 {
    padding: 0.25rem;
}

.p-4 {
    padding: 1rem;
}

.p-6 {
    padding: 1.5rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.ml-2 {
    margin-left: 0.5rem;
}

.mr-2 {
    margin-right: 0.5rem;
}

/* Text utilities */
.text-white {
    color: white;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-xs {
    font-size: 0.75rem;
    line-height: 1rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.text-lg {
    font-size: 1.125rem;
    line-height: 1.75rem;
}

.text-xl {
    font-size: 1.25rem;
    line-height: 1.75rem;
}

.text-2xl {
    font-size: 1.5rem;
    line-height: 2rem;
}

.font-medium {
    font-weight: 500;
}

.font-semibold {
    font-weight: 600;
}

.font-bold {
    font-weight: 700;
}

/* Border utilities */
.border-b {
    border-bottom-width: 1px;
}

.border-t {
    border-top-width: 1px;
}

.rounded-xl {
    border-radius: 0.75rem;
}

.rounded-lg {
    border-radius: 0.5rem;
}

.rounded-full {
    border-radius: 9999px;
}

/* Width/Height utilities */
.w-full {
    width: 100%;
}

.w-10 {
    width: 2.5rem;
}

.w-20 {
    width: 5rem;
}

.h-full {
    height: 100%;
}

.h-10 {
    height: 2.5rem;
}

.h-20 {
    height: 5rem;
}

.max-w-full {
    max-width: 100%;
}

/* Overflow utilities */
.overflow-y-auto {
    overflow-y: auto;
}

.overflow-hidden {
    overflow: hidden;
}

/* Flex grow/shrink */
.flex-1 {
    flex: 1 1 0%;
}

.flex-shrink-0 {
    flex-shrink: 0;
}

/* Shadow utilities */
.shadow-2xl {
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.shadow-lg {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Hover effects */
.hover\:opacity-75:hover {
    opacity: 0.75;
}

.hover\:text-white:hover {
    color: white;
}

.hover\:text-red-300:hover {
    color: #fca5a5;
}

.hover\:text-red-400:hover {
    color: #f87171;
}

.hover\:bg-\[\#333\]:hover {
    background-color: #333;
}

/* Transition utilities */
.transition-colors {
    transition-property: color, background-color, border-color, text-decoration-color, fill, stroke;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

.transition-all {
    transition-property: all;
    transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    transition-duration: 150ms;
}

/* Space utilities */
.space-y-4 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 1rem;
}

.space-y-3 > :not([hidden]) ~ :not([hidden]) {
    margin-top: 0.75rem;
}

/* Leading utilities */
.leading-tight {
    line-height: 1.25;
}

/* Min width utilities */
.min-w-0 {
    min-width: 0;
}

/* Text alignment */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

/* Cursor utilities */
.cursor-pointer {
    cursor: pointer;
}

/* Object fit */
.object-cover {
    object-fit: cover;
}

/* Custom Cart Theme Styles - Red/Grey */
.cart-customer-card {
    border: 1px solid rgba(215, 51, 60, 0.15);
}

.cart-customer-card:hover {
    background: rgba(215, 51, 60, 0.1);
}

.cart-customer-avatar {
    background: linear-gradient(180deg, #D7333C 0%, #711B1F 100%);
}

.cart-icon-red {
    color: #D7333C;
}

.cart-quantity-btn {
    color: #D7333C;
}

.cart-quantity-btn:hover {
    color: white;
    background: rgba(215, 51, 60, 0.2);
}

.cart-price-text {
    color: #D7333C;
}

.cart-total-text {
    color: #D7333C;
}

.cart-checkout-btn {
    background: linear-gradient(180deg, #D7333C 0%, #711B1F 100%);
    box-shadow: 0 4px 16px rgba(215, 51, 60, 0.4);
}

.cart-checkout-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(215, 51, 60, 0.5);
}

.cart-continue-btn {
    border: 1px solid rgba(215, 51, 60, 0.2);
}

.cart-continue-btn:hover {
    background: rgba(215, 51, 60, 0.1);
    border-color: rgba(215, 51, 60, 0.4);
}