/**
 * Modern Side Cart Styles - Ultra Modern Design
 * 
 * Features:
 * - Glassmorphism effects
 * - Smooth animations
 * - Modern gradients
 * - Better shadows
 * - Micro-interactions
 * 
 * @package Grabit
 * @version 2.0
 */

/* ============================================
   Overlay - Modern Backdrop Blur
   ============================================ */
.gi-side-cart-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: pointer;
}

.gi-side-cart-overlay.gi-side-cart-overlay-active {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   Side Cart Container - Modern Design
   ============================================ */
.gi-side-cart {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 420px;
    background: linear-gradient(to bottom, #ffffff, #f9fafb);
    box-shadow: 
        -10px 0 40px rgba(0, 0, 0, 0.1),
        -20px 0 80px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

/* Open State */
.gi-side-cart:not(.translate-x-full) {
    transform: translateX(0);
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .gi-side-cart {
        width: 100%;
    }
}

/* ============================================
   Header - Gradient & Modern
   ============================================ */
.gi-cart-header {
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    color: white;
    padding: 1.25rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Decorative Background Pattern */
.gi-cart-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Close Button Hover */
.gi-cart-close {
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-cart-close:hover {
    transform: rotate(90deg) scale(1.1);
}

/* Free Shipping Progress */
.gi-cart-header .bg-white\/20 {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ============================================
   Empty Cart - Modern & Engaging
   ============================================ */
.gi-cart-empty-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.gi-cart-empty-icon {
    width: 8rem;
    height: 8rem;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { 
        transform: translateY(0) scale(1); 
    }
    50% { 
        transform: translateY(-10px) scale(1.05); 
    }
}

.gi-cart-empty-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 600;
    box-shadow: 0 4px 6px rgba(92, 175, 144, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-cart-empty-cta:hover {
    box-shadow: 0 8px 12px rgba(92, 175, 144, 0.4);
    transform: scale(1.05) translateY(-2px);
}

/* ============================================
   Product Cards - Ultra Modern
   ============================================ */
.gi-cart-product-card {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #f3f4f6;
    padding: 1rem;
    position: relative;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.gi-cart-product-card:hover {
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
    border-color: rgba(92, 175, 144, 0.3);
    transform: translateY(-2px);
}

/* Product Image - Modern Rounded */
.gi-cart-product-img {
    width: 6rem;
    height: 6rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.gi-cart-product-img:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: scale(1.05);
}

.gi-cart-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gi-cart-product-card:hover .gi-cart-product-img img {
    transform: scale(1.1);
}

/* Sale Badge - Modern Floating */
.gi-cart-sale-badge {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.5rem;
    border-radius: 9999px;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1); 
        box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    }
    50% { 
        transform: scale(1.05); 
        box-shadow: 0 4px 12px rgba(239, 68, 68, 0.6);
    }
}

/* Remove Button - Floating Modern */
.gi-cart-remove-btn {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    width: 2rem;
    height: 2rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    cursor: pointer;
    z-index: 10;
}

.gi-cart-product-card:hover .gi-cart-remove-btn {
    opacity: 1;
    transform: scale(1);
}

.gi-cart-remove-btn:hover {
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 6px 16px rgba(239, 68, 68, 0.6);
}

/* Stock Badge - Modern Pills */
.gi-cart-stock-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: 9999px;
    font-weight: 500;
}

.gi-cart-stock-badge.in-stock {
    color: #16a34a;
    background-color: #f0fdf4;
}

.gi-cart-stock-badge.out-of-stock {
    color: #dc2626;
    background-color: #fef2f2;
}

/* Quantity Controls - Modern Rounded */
.gi-cart-qty-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f9fafb;
    border-radius: 0.5rem;
    padding: 0.25rem;
}

.gi-cart-qty-btn {
    width: 1.75rem;
    height: 1.75rem;
    display: flex;
    align-items: center;
    justify-center;
    color: #6b7280;
    background: transparent;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.gi-cart-qty-btn:hover:not(:disabled) {
    color: white;
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    transform: scale(1.1);
}

.gi-cart-qty-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.gi-cart-qty-display {
    width: 2rem;
    text-align: center;
    font-weight: 700;
    color: #1f2937;
    font-size: 0.875rem;
}

/* Price Display - Bold & Modern */
.gi-cart-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #5caf90;
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.gi-cart-price-original {
    font-size: 0.75rem;
    color: #9ca3af;
    text-decoration: line-through;
}

/* ============================================
   Cart Footer - Modern Totals
   ============================================ */
.gi-cart-footer {
    border-top: 2px solid #f3f4f6;
    background: white;
    padding: 1.25rem;
}

.gi-cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
}

.gi-cart-total-row.main {
    padding-top: 0.75rem;
    border-top: 2px solid #f3f4f6;
    margin-top: 0.5rem;
}

.gi-cart-total-label {
    color: #6b7280;
    font-size: 0.875rem;
}

.gi-cart-total-value {
    font-weight: 600;
    color: #1f2937;
}

.gi-cart-total-main {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Action Buttons - Modern Gradients */
.gi-cart-btn-primary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: linear-gradient(135deg, #5caf90 0%, #4b9b7f 100%);
    color: white;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 4px 12px rgba(92, 175, 144, 0.3);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.gi-cart-btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gi-cart-btn-primary:hover::before {
    opacity: 1;
}

.gi-cart-btn-primary:hover {
    box-shadow: 0 8px 20px rgba(92, 175, 144, 0.4);
    transform: scale(1.02) translateY(-2px);
}

.gi-cart-btn-primary i {
    transition: transform 0.3s ease;
}

.gi-cart-btn-primary:hover i {
    animation: bounce 0.5s ease;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

.gi-cart-btn-secondary {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.5rem;
    background-color: #f3f4f6;
    color: #374151;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.gi-cart-btn-secondary:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
}

/* Trust Badges - Subtle & Professional */
.gi-cart-trust-badges {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding-top: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.gi-cart-trust-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.gi-cart-trust-badge i {
    font-size: 0.875rem;
}

/* ============================================
   Scrollbar - Modern Thin
   ============================================ */
.gi-side-cart::-webkit-scrollbar {
    width: 6px;
}

.gi-side-cart::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.gi-side-cart::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #5caf90, #4b9b7f);
    border-radius: 10px;
}

.gi-side-cart::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #4b9b7f, #5caf90);
}

/* ============================================
   Loading States
   ============================================ */
.gi-cart-loading {
    pointer-events: none;
    opacity: 0.6;
}

.gi-cart-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

/* ============================================
   Accessibility
   ============================================ */
.gi-side-cart[aria-hidden="true"] {
    pointer-events: none;
}

.gi-side-cart[aria-hidden="false"] {
    pointer-events: all;
}

/* Focus Visible */
.gi-cart-close:focus-visible,
.gi-cart-qty-btn:focus-visible,
.gi-cart-btn-primary:focus-visible,
.gi-cart-btn-secondary:focus-visible {
    outline: 2px solid #5caf90;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
@media (prefers-color-scheme: dark) {
    .gi-side-cart {
        background: linear-gradient(to bottom, #1f2937, #111827);
    }
    
    .gi-cart-product-card {
        background: #374151;
        border-color: #4b5563;
    }
    
    .gi-cart-footer {
        background: #1f2937;
        border-color: #374151;
    }
}


