/* ARB Elite Protocol Styles - Colorful Glassmorphism Edition */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;800&family=Inter:wght@400;500;600;700&display=swap');

:root {
    --arb-gold: #b09462;
    --arb-gold-deep: #8c7447;
    --arb-dark: #0a0a0a;
    --arb-glass-bg: rgba(236, 226, 200, 0.95);
    --arb-glass-border: rgba(255, 255, 255, 0.5);
    
    /* Category Colors for Identification */
    --cat-dairy: #3498db;   /* Blue */
    --cat-honey: #f39c12;   /* Amber */
    --cat-seeds: #2ecc71;   /* Green */
    --cat-pickles: #e74c3c; /* Red */
    --cat-grain: #f1c40f;   /* Yellow */
    --cat-gurr: #9b59b6;    /* Purple */
}

/* Base Styles */
#arb-cart-floating-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    height: 65px;
    background: #25d366; /* WhatsApp Green for high visibility */
    border-radius: 40px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    cursor: pointer;
    z-index: 9999;
    box-shadow: 0 10px 40px rgba(37, 211, 102, 0.3);
    padding: 0 12px;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    width: 65px;
    white-space: nowrap;
    overflow: hidden;
    border: none;
}

#arb-cart-floating-btn.expanded { width: auto; padding-right: 25px; }

.arb-btn-label {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
    text-transform: uppercase;
    font-size: 14px;
    letter-spacing: 1px;
    margin-left: 10px;
}

.arb-cart-count {
    position: absolute;
    top: 5px;
    left: 45px;
    background: #ff3e3e;
    color: white;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 7px;
    border-radius: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

/* Sidebar Styling */
#arb-cart-sidebar {
    position: fixed;
    top: 10px;
    bottom: 10px;
    left: -450px;
    width: 420px;
    background: var(--arb-glass-bg);
    backdrop-filter: blur(40px) saturate(150%);
    -webkit-backdrop-filter: blur(40px) saturate(150%);
    z-index: 10000;
    transition: all 0.6s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    padding: 30px;
    border: 1px solid var(--arb-glass-border);
    border-radius: 0 30px 30px 0;
    box-shadow: 25px 0 50px rgba(0,0,0,0.6);
}

#arb-cart-sidebar.active { left: 0; }

#arb-close-cart {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #b09462, #8c7447); /* Updated the close button to match the theme */
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: 800;
    line-height: 0;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 4px 12px rgba(176, 148, 98, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

#arb-close-cart:hover {
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 6px 18px rgba(176, 148, 98, 0.6);
    filter: brightness(1.1);
}

.arb-cart-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    font-family: 'Outfit';
    color: #222;
    text-transform: uppercase;
}

/* Colorful Category Badges */
.badge-dairy { background: var(--cat-dairy); color: #fff; }
.badge-honey { background: var(--cat-honey); color: #fff; }
.badge-seeds { background: var(--cat-seeds); color: #fff; }
.badge-pickles { background: var(--cat-pickles); color: #fff; }
.badge-grain { background: var(--cat-grain); color: #000; }
.badge-gurr { background: var(--cat-gurr); color: #fff; }

/* In-Cart Item Cards with Color Glow */
.arb-cart-item {
    background: rgba(255, 255, 255, 0.6);
    padding: 20px;
    border-radius: 22px;
    margin-bottom: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid rgba(255, 255, 255, 0.5);
    position: relative;
    overflow: hidden;
    transition: 0.3s;
    color: #333;
}

/* Side highlight for quick identification */
.arb-cart-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 6px;
}

/* Custom Scrollbar for Glass UI - Enhanced for Easy Navigation */
#arb-cart-items::-webkit-scrollbar { 
    width: 6px; 
}

#arb-cart-items::-webkit-scrollbar-track { 
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

#arb-cart-items::-webkit-scrollbar-thumb { 
    background: linear-gradient(to bottom, var(--arb-gold), var(--arb-gold-deep));
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.3);
}

#arb-cart-items::-webkit-scrollbar-thumb:hover {
    background: var(--arb-gold-light);
}

.item-dairy::before { background: var(--cat-dairy); }
.item-honey::before { background: var(--cat-honey); }
.item-seeds::before { background: var(--cat-seeds); }
.item-pickles::before { background: var(--cat-pickles); }
.item-grain::before { background: var(--cat-grain); }
.item-gurr::before { background: var(--cat-gurr); }

.item-info .item-name {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 3px;
    display: block;
}

.item-info .item-sku {
    font-size: 10px;
    font-weight: 800;
    padding: 2px 6px;
    border-radius: 5px;
    background: rgba(0,0,0,0.1);
    color: #555;
}

/* Selection Search Component */
.search-result-card {
    padding: 15px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    cursor: pointer;
    transition: 0.2s;
    color: #333;
}

.search-result-card:hover { background: rgba(0,0,0,0.05); }

.card-icon {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-right: 12px;
}

/* Summary Panel with Clean Logic display */
.arb-summary-details {
    background: rgba(255,255,255,0.6);
    padding: 15px;
    border-radius: 15px;
    margin-bottom: 15px;
    color: #333;
    border: 1px solid rgba(255,255,255,0.5);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.summary-row.total-label {
    font-size: 28px;
    font-weight: 900;
    color: #111;
    margin-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 10px;
}

.total-label span { color: #25d366; }

/* Inputs */
.arb-input {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.7);
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 12px;
    color: #333;
    margin-bottom: 15px;
    font-family: inherit;
}

.arb-input:focus {
    border-color: #25d366;
    background: #ffffff;
    outline: none;
}

/* Search results dropdown positioning */
.arb-search-results {
    position: absolute;
    top: 60px;
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 15px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 99999;
}

#arb-cart-items {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-top: 10px;
    padding-right: 15px; /* Space for thicker scrollbar */
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* Momentum scroll for iOS */
}

/* Tour Tooltip Styles */
.arb-tour-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 10005;
}

.arb-tour-tooltip {
    position: absolute;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border: 1px solid var(--arb-gold);
    border-radius: 12px;
    padding: 15px;
    width: 250px;
    z-index: 10006;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    color: #333;
    animation: fadeIn 0.3s ease-out;
}

.arb-tour-tooltip h4 { margin: 0 0 5px 0; color: var(--arb-gold-deep); font-family: 'Outfit'; font-size: 16px; font-weight: 800;}
.arb-tour-tooltip p { margin: 0 0 10px 0; font-size: 13px; font-family: 'Inter'; line-height: 1.4;}
.arb-tour-actions { display: flex; justify-content: space-between; align-items: center; }
.arb-tour-btn { background: var(--arb-gold); color: #fff; border: none; padding: 5px 12px; border-radius: 6px; cursor: pointer; font-size: 12px; font-weight: bold;}
.arb-tour-skip { color: #888; font-size: 11px; cursor: pointer; text-decoration: underline;}

.arb-tour-highlight {
    position: relative;
    z-index: 10007 !important;
    box-shadow: 0 0 0 4px var(--arb-gold) !important;
    background: rgba(255,255,255,1) !important;
    border-radius: inherit;
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* Responsiveness */
@media (max-width: 500px) {
    #arb-cart-sidebar {
        width: 100%;
        left: -100%;
        top: 0;
        bottom: 0;
        border-radius: 0;
    }
    
    /* Smart Mobile Adjustment for Floating Button */
    #arb-cart-floating-btn {
        bottom: 110px; /* Further elevated to ensure a clear gap from bottom nav */
        left: 20px;
        height: 55px;
        box-shadow: 0 5px 25px rgba(37, 211, 102, 0.4);
    }
    
    .arb-btn-label {
        font-size: 12px;
        letter-spacing: 0.5px;
    }
    
    .arb-cart-count {
        top: 2px;
        left: 38px;
    }
}
