/**
 * SmartPaw Bundle Styles
 * Delivery Basket System
 */

/* Variables */
:root {
    --sp-primary: #005a87;
    --sp-primary-dark: #004165;
    --sp-success: #059669;
    --sp-warning: #f59e0b;
    --sp-danger: #dc2626;
    --sp-gray-50: #f9fafb;
    --sp-gray-100: #f3f4f6;
    --sp-gray-200: #e5e7eb;
    --sp-gray-300: #d1d5db;
    --sp-gray-500: #6b7280;
    --sp-gray-700: #374151;
    --sp-gray-900: #111827;
}

/* Wrapper */
.sp-bundle-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* Notifications */
.sp-notification {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sp-notification-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.sp-notification-warning {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.sp-notification-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #f87171;
}

/* Header */
.sp-bundle-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--sp-gray-100);
}

.sp-bundle-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: var(--sp-gray-900);
}

.sp-shop-link {
    background: var(--sp-primary);
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.sp-shop-link:hover {
    background: var(--sp-primary-dark);
}

/* Empty State */
.sp-empty-state {
    text-align: center;
    padding: 60px 20px;
    background: var(--sp-gray-50);
    border: 2px dashed var(--sp-gray-200);
    border-radius: 16px;
}

.sp-empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.sp-empty-state h3 {
    margin: 0 0 8px;
    font-size: 20px;
    color: var(--sp-gray-700);
}

.sp-empty-state p {
    margin: 0 0 24px;
    color: var(--sp-gray-500);
}

.sp-btn-primary {
    display: inline-block;
    background: var(--sp-primary);
    color: #fff !important;
    padding: 14px 32px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 600;
}

/* Baskets Grid */
.sp-baskets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

/* Basket Card */
.sp-basket-card {
    background: #fff;
    border: 2px solid var(--sp-gray-200);
    border-radius: 16px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sp-basket-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.sp-basket-card.status-paid {
    border-color: var(--sp-success);
}

.sp-basket-card.status-overdue {
    border-color: var(--sp-danger);
}

.sp-basket-card.status-due-soon {
    border-color: var(--sp-warning);
}

/* Basket Header */
.sp-basket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--sp-gray-50);
    border-bottom: 1px solid var(--sp-gray-100);
}

.sp-basket-date {
    display: flex;
    flex-direction: column;
}

.sp-date-day {
    font-size: 32px;
    font-weight: 800;
    color: var(--sp-primary);
    line-height: 1;
}

.sp-date-month {
    font-size: 14px;
    color: var(--sp-gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sp-basket-status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-pending .sp-basket-status {
    background: var(--sp-gray-100);
    color: var(--sp-gray-500);
}

.status-paid .sp-basket-status {
    background: #d1fae5;
    color: var(--sp-success);
}

.status-overdue .sp-basket-status {
    background: #fee2e2;
    color: var(--sp-danger);
}

.status-due-soon .sp-basket-status {
    background: #fef3c7;
    color: #b45309;
}

/* Basket Items */
.sp-basket-items {
    padding: 16px;
    max-height: 300px;
    overflow-y: auto;
}

.sp-basket-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--sp-gray-500);
}

.sp-basket-empty a {
    color: var(--sp-primary);
    text-decoration: none;
    font-weight: 600;
}

/* Item Row */
.sp-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--sp-gray-50);
    border-radius: 10px;
    margin-bottom: 10px;
}

.sp-item:last-child {
    margin-bottom: 0;
}

.sp-item.item-paid {
    opacity: 0.7;
}

.sp-item-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--sp-gray-200);
}

.sp-item-info {
    flex: 1;
    min-width: 0;
}

.sp-item-name {
    font-weight: 600;
    color: var(--sp-gray-900);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 14px;
}

.sp-item-price {
    font-size: 12px;
    color: var(--sp-gray-500);
}

/* Quantity Controls */
.sp-item-qty {
    display: flex;
    align-items: center;
    gap: 4px;
}

.sp-qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--sp-gray-200);
    background: #fff;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-qty-btn:hover {
    background: var(--sp-primary);
    color: #fff;
    border-color: var(--sp-primary);
}

.sp-qty-val {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
}

.sp-item-total {
    font-weight: 700;
    color: var(--sp-gray-900);
    min-width: 70px;
    text-align: right;
    font-size: 14px;
}

.sp-item-remove {
    width: 28px;
    height: 28px;
    border: none;
    background: var(--sp-gray-100);
    color: var(--sp-gray-500);
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sp-item-remove:hover {
    background: var(--sp-danger);
    color: #fff;
}

.sp-paid-badge {
    color: var(--sp-success);
    font-weight: 600;
}

/* Basket Footer */
.sp-basket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--sp-gray-50);
    border-top: 1px solid var(--sp-gray-100);
}

.sp-basket-summary {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sp-basket-summary span:first-child {
    font-size: 12px;
    color: var(--sp-gray-500);
}

.sp-basket-total {
    font-size: 20px;
    font-weight: 700;
    color: var(--sp-gray-900);
}

.sp-pay-btn {
    background: linear-gradient(135deg, var(--sp-success) 0%, #047857 100%);
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sp-pay-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.3);
}

.sp-paid-label {
    color: var(--sp-success);
    font-weight: 600;
    font-size: 15px;
}

/* Toast */
.sp-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--sp-gray-900);
    color: #fff;
    padding: 16px 24px;
    border-radius: 12px;
    z-index: 100000;
    opacity: 0;
    transition: all 0.3s ease;
}

.sp-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
    .sp-bundle-wrapper {
        padding: 12px;
    }
    
    .sp-bundle-header {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
    
    .sp-baskets-grid {
        grid-template-columns: 1fr;
    }
    
    .sp-item {
        flex-wrap: wrap;
    }
    
    .sp-item-info {
        flex: 1 1 calc(100% - 70px);
    }
    
    .sp-item-qty,
    .sp-item-total,
    .sp-item-remove {
        margin-left: auto;
    }
}