/* Reset and Base Styles */
.plugin-core-cart-page {
    direction: rtl;
    font-family: 'Vazir', 'Tahoma', sans-serif;
    background-color: #f8f9fa;
    min-height: 100vh;
    padding: 0;
    max-width: 1200px;
    margin: 0 auto;
}

.plugin-core-cart-page * {
    box-sizing: border-box;
}

/* Progress Section */
.progress-section {
    background: white;
    padding: 30px 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Progress Bar */
.progress-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 60px;
    max-width: 600px;
    margin: 0 auto;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    position: relative;
}

.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 25px;
    right: -30px;
    width: 60px;
    height: 2px;
    background-color: #e5e7eb;
}

.progress-step.active::after {
    background-color: #ef4444;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    background-color: #e5e7eb;
    color: #6b7280;
    transition: all 0.3s ease;
}

.progress-step.active .step-icon {
    background-color: #ef4444;
    color: white;
}

.step-text {
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    transition: color 0.3s ease;
}

.progress-step.active .step-text {
    color: #ef4444;
}

/* Main Content */
.cart-content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    padding: 0 20px;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.section-title {
    color: #1f2937;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.cart-badge {
    background-color: #ef4444;
    color: white;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
}

/* Cart Items */
.cart-items {
    margin-bottom: 30px;
}

.cart-item {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.cart-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.item-image {
    flex-shrink: 0;
}

.item-image img {
    width: 100px;
    height: 120px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item-name {
    font-size: 18px;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
    line-height: 1.4;
}

.item-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

/* Quantity Selector */
.quantity-selector {
    display: flex;
    align-items: center;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: white;
}

.qty-btn {
    background: #f9fafb;
    border: none;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #374151;
    transition: all 0.2s ease;
}

.qty-btn:hover {
    background: #e5e7eb;
    color: #1f2937;
}

.qty-input {
    width: 60px;
    height: 40px;
    border: none;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1f2937;
    background: white;
}

.qty-input:focus {
    outline: none;
    background: #f8fafc;
}

/* Item Pricing */
.item-pricing {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.original-price {
    color: #9ca3af;
    text-decoration: line-through;
    font-size: 16px;
}

.current-price {
    color: #1f2937;
    font-size: 20px;
    font-weight: bold;
}

.discount-badge {
    background-color: #ef4444;
    color: white;
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: bold;
}

/* Item Actions */
.item-actions {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-end;
}

.action-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 13px;
    color: #6b7280;
    transition: all 0.2s ease;
    border: 1px solid #e5e7eb;
}

.action-btn:hover {
    background: #f3f4f6;
    color: #374151;
    border-color: #d1d5db;
}

.action-icon {
    font-size: 16px;
}

.action-text {
    font-size: 12px;
}

.remove-btn {
    color: #ef4444;
    border-color: #fecaca;
}

.remove-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fca5a5;
}

/* Discount Section */
.discount-section {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.discount-input-group {
    display: flex;
    gap: 12px;
}

.discount-code-input {
    flex: 1;
    padding: 14px 18px;
    border: 2px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.discount-code-input:focus {
    outline: none;
    border-color: #3b82f6;
    background: white;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.apply-discount-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 14px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.apply-discount-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Cart Actions */
.cart-actions {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    padding: 20px 0;
    border-top: 1px solid #e5e7eb;
}

.update-cart-btn,
.clear-cart-btn,
.move-all-wishlist-btn {
    background: #ef4444;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.update-cart-btn:hover,
.clear-cart-btn:hover,
.move-all-wishlist-btn:hover {
    background: #dc2626;
    transform: translateY(-1px);
}

/* Order Summary Section */
.order-summary-section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.summary-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.summary-title {
    color: #1f2937;
    font-size: 20px;
    font-weight: bold;
    margin: 0;
}

.summary-card {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.summary-row:last-child {
    margin-bottom: 0;
}

.summary-label {
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

.summary-value {
    color: #1f2937;
    font-size: 18px;
    font-weight: 600;
}

.total-row {
    border-top: 2px solid #e5e7eb;
    padding-top: 20px;
    margin-top: 20px;
}

.total-row .summary-label,
.total-row .summary-value {
    font-size: 18px;
    font-weight: bold;
    color: #1f2937;
}

.checkout-btn {
    display: block;
    width: 100%;
    background: #3b82f6;
    color: white;
    text-decoration: none;
    text-align: center;
    padding: 18px 20px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.checkout-btn:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

/* Empty Cart */
.empty-cart {
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    padding: 40px 20px;
}

/* Error Message */
.error-message {
    text-align: center;
    color: #ef4444;
    font-size: 16px;
    padding: 40px 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    margin: 20px 0;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Messages */
.cart-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.cart-message.success {
    background: #10b981;
}

.cart-message.error {
    background: #ef4444;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-content {
        grid-template-columns: 1fr;
    }
    
    .progress-bar {
        gap: 20px;
    }
    
    .progress-step:not(:last-child)::after {
        width: 20px;
        right: -10px;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .item-controls {
        width: 100%;
        justify-content: space-between;
    }
    
    .item-actions {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
    }
    
    .cart-actions {
        flex-direction: column;
    }
    
    .cart-message {
        right: 10px;
        left: 10px;
        top: 10px;
    }
}
