/**
 * D&D Auto Recycling - Cart Styles
 */

/* ---- Floating Cart Icon ---- */
#dd-cart-icon {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999999;
    width: 56px;
    height: 56px;
    background: #00C853;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0,200,83,0.35);
    transition: all 0.25s ease;
    border: none;
}
#dd-cart-icon:hover {
    transform: scale(1.08);
    box-shadow: 0 6px 24px rgba(0,200,83,0.45);
}
#dd-cart-icon svg { width: 24px; height: 24px; color: #1A1A1A; }
#dd-cart-icon.dd-cart-has-items { animation: ddCartPulse 2s ease infinite; }

#dd-cart-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 22px;
    height: 22px;
    background: #F44336;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}

@keyframes ddCartPulse {
    0%, 100% { box-shadow: 0 4px 16px rgba(0,200,83,0.35); }
    50% { box-shadow: 0 4px 24px rgba(0,200,83,0.55); }
}

/* ---- Overlay ---- */
#dd-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}
#dd-cart-overlay.dd-cart-overlay-visible {
    opacity: 1;
    visibility: visible;
}

/* ---- Drawer ---- */
#dd-cart-drawer {
    position: fixed;
    top: 0 !important;
    right: -420px;
    width: 400px;
    max-width: 90vw;
    height: 100vh;
    height: 100dvh;
    background: #1E1E1E;
    z-index: 999999999;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0,0,0,0.5);
}
#dd-cart-drawer.dd-cart-open { right: 0; }

/* Drawer Header */
.dd-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #333;
    flex-shrink: 0;
}
.dd-cart-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
}
.dd-cart-close {
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}
.dd-cart-close:hover { color: #fff; }

/* Drawer Items */
#dd-cart-items {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 20px;
}
#dd-cart-items::-webkit-scrollbar { width: 4px; }
#dd-cart-items::-webkit-scrollbar-track { background: #1E1E1E; }
#dd-cart-items::-webkit-scrollbar-thumb { background: #444; border-radius: 2px; }

.dd-cart-empty {
    text-align: center;
    padding: 48px 20px;
    color: #888;
}
.dd-cart-empty p { margin: 8px 0; }

.dd-cart-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 0;
    border-bottom: 1px solid #2A2A2A;
    gap: 12px;
}
.dd-cart-item-info { flex: 1; }
.dd-cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: #F5F5F5;
    margin-bottom: 2px;
}
.dd-cart-item-vehicle {
    font-size: 12px;
    color: #888;
}
.dd-cart-item-stock {
    font-size: 11px;
    color: #666;
    font-family: monospace;
}
.dd-cart-item-price {
    font-size: 16px;
    font-weight: 700;
    color: #00C853;
    margin-top: 4px;
}
.dd-cart-item-quote {
    font-size: 12px;
    color: #FF9800;
    font-weight: 600;
    margin-top: 4px;
}
.dd-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Remove Button */
.dd-cart-remove-btn {
    background: transparent !important;
    border: 1px solid #444 !important;
    border-radius: 6px !important;
    color: #888 !important;
    font-size: 12px !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    padding: 6px 10px !important;
    margin: 0 !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
    min-width: auto !important;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif !important;
    white-space: nowrap;
    transition: all 0.2s;
}
.dd-cart-remove-btn:hover { border-color: #F44336 !important; color: #F44336 !important; }
.dd-cart-remove-btn svg { flex-shrink: 0; }

/* Drawer Footer */
#dd-cart-footer {
    border-top: 1px solid #333;
    padding: 16px 20px;
    flex-shrink: 0;
}
.dd-cart-totals { margin-bottom: 12px; }
.dd-cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #B0B0B0;
    padding: 4px 0;
}
.dd-cart-surcharge { font-size: 12px; color: #FF9800; }
.dd-cart-grand-total {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #fff !important;
    border-top: 1px solid #333;
    padding-top: 8px !important;
    margin-top: 4px;
}
.dd-cart-checkout-btn {
    display: block;
    width: 100%;
    background: #00C853;
    color: #1A1A1A !important;
    text-align: center;
    padding: 14px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none !important;
    transition: background 0.2s;
}
.dd-cart-checkout-btn:hover { background: #00A844; color: #1A1A1A !important; text-decoration: none !important; }

/* ---- Notification Toast ---- */
.dd-cart-notification {
    position: fixed;
    bottom: 90px;
    right: 24px;
    background: #2A2A2A;
    color: #00C853;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif;
    box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    z-index: 999999999;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #333;
}
.dd-cart-notification.dd-cart-notif-visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Add to Cart Button (injected into results) ---- */
.dd-add-to-cart-btn {
    background: #00C853 !important;
    color: #1A1A1A !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 4px 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
}
.dd-add-to-cart-btn:hover {
    background: #00A844 !important;
    box-shadow: 0 2px 8px rgba(0,200,83,0.3) !important;
}
.dd-add-to-cart-btn.dd-added {
    background: #333 !important;
    color: #00C853 !important;
    border: 1px solid #00C853 !important;
}

.dd-quote-btn {
    background: #FF9800 !important;
    color: #1A1A1A !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 8px 16px !important;
    font-weight: 700 !important;
    font-size: 13px !important;
    cursor: pointer !important;
    font-family: 'Segoe UI', Roboto, Arial, sans-serif !important;
    transition: all 0.2s !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    margin: 4px 0 !important;
    box-shadow: none !important;
    min-height: auto !important;
}
.dd-quote-btn:hover { background: #F57C00 !important; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    #dd-cart-drawer { width: 100%; max-width: 100%; right: -100%; }
    #dd-cart-icon { bottom: 16px; right: 16px; width: 48px; height: 48px; }
    .dd-cart-notification { right: 16px; bottom: 74px; left: 16px; }
}
